2 request.cc -- implement all musical requests.
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
9 #include "musical-request.hh"
12 #include "music-list.hh"
15 Tremolo_req::Tremolo_req ()
20 Melodic_req::do_equal_b (Request const* r) const
22 Melodic_req const* m= dynamic_cast <Melodic_req const*> (r);
23 return m; // && !compare (*m, *this);
27 Rhythmic_req::do_equal_b (Request const* r) const
29 Rhythmic_req const* rh = dynamic_cast <Rhythmic_req const*> (r);
31 return rh; // ; && !compare (*this, *rh);
35 Rhythmic_req::length_mom () const
37 Duration *d = unsmob_duration (get_mus_property ("duration"));
40 programming_error("Rhythmic_req has no duration");
43 return d->length_mom ();
47 Rhythmic_req::compress (Moment m)
49 Duration *d = unsmob_duration (get_mus_property ("duration"));
51 set_mus_property ("duration", d ->compressed (m.main_part_).smobbed_copy ());
55 Note_req::do_equal_b (Request const* r) const
57 Note_req const* n = dynamic_cast<Note_req const*> (r);
58 return n&& Rhythmic_req::do_equal_b (n) && Melodic_req::do_equal_b (n);
68 Span_req::do_equal_b (Request const*r) const
70 Span_req const* s = dynamic_cast <Span_req const*> (r);
71 return s && get_span_dir () == s->get_span_dir ();
80 Text_script_req::do_equal_b (Request const* r) const
82 Text_script_req const* t = dynamic_cast<Text_script_req const*> (r);
83 return t && gh_equal_p (get_mus_property ("text"),
84 t->get_mus_property ("text"));
88 Articulation_req::do_equal_b (Request const* r) const
90 Articulation_req const* a = dynamic_cast<Articulation_req const*> (r);
92 return a && gh_equal_p (get_mus_property ("articulation-type"),
93 r->get_mus_property ("articulation-type"))
94 && get_direction () == a->get_direction ();