X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fmusical-request.cc;h=4beca66cf72369515a58567f2bdcddd5eeda7b61;hb=b9d041b950695f3681fabd6558e0680ecc5734a6;hp=43b238f8772f1bbc95776db833aeaa6c551a0f78;hpb=7776d4901caa57e1d0f3ab7cf01348b930a6dbee;p=lilypond.git diff --git a/lily/musical-request.cc b/lily/musical-request.cc index 43b238f877..4beca66cf7 100644 --- a/lily/musical-request.cc +++ b/lily/musical-request.cc @@ -3,7 +3,7 @@ source file of the GNU LilyPond music typesetter - (c) 1997--2000 Han-Wen Nienhuys + (c) 1997--2002 Han-Wen Nienhuys */ #include "musical-request.hh" @@ -14,45 +14,13 @@ Tremolo_req::Tremolo_req () { - type_i_ = 0; } - -void -Melodic_req::transpose (Musical_pitch delta) -{ - pitch_.transpose (delta); - - if (abs (pitch_.accidental_i_) > 2) - { - warning (_f ("Transposition by %s makes accidental larger than two", - delta.str ())); - } -} - - - bool Melodic_req::do_equal_b (Request const* r) const { Melodic_req const* m= dynamic_cast (r); - return m&& !compare (*m, *this); -} - -int -Melodic_req::compare (Melodic_req const &m1 , Melodic_req const&m2) -{ - return Musical_pitch::compare (m1.pitch_, m2.pitch_); -} - - - - - -int -Rhythmic_req::compare (Rhythmic_req const &r1, Rhythmic_req const &r2) -{ - return (r1.length_mom () - r2.length_mom ()); + return m; // && !compare (*m, *this); } bool @@ -60,25 +28,30 @@ Rhythmic_req::do_equal_b (Request const* r) const { Rhythmic_req const* rh = dynamic_cast (r); - return rh && !compare (*this, *rh); + return rh; // ; && !compare (*this, *rh); } - - Moment Rhythmic_req::length_mom () const { - return duration_.length_mom (); + Duration *d = unsmob_duration (get_mus_property ("duration")); + if (!d) + { + Moment m ; + programming_error("Rhythmic_req has no duration"); + return m; + } + return d->length_mom (); } void Rhythmic_req::compress (Moment m) { - duration_.compress (m); + Duration *d = unsmob_duration (get_mus_property ("duration")); + if (d) + set_mus_property ("duration", d ->compressed (m.main_part_).smobbed_copy ()); } - - bool Note_req::do_equal_b (Request const* r) const { @@ -89,24 +62,18 @@ Note_req::do_equal_b (Request const* r) const Note_req::Note_req () { - cautionary_b_ = false; - forceacc_b_ = false; } - - - bool Span_req::do_equal_b (Request const*r) const { Span_req const* s = dynamic_cast (r); - return s && span_dir_ == s->span_dir_; + return s && get_span_dir () == s->get_span_dir (); } Span_req::Span_req () { - span_dir_ = CENTER; } @@ -118,13 +85,15 @@ Text_script_req::do_equal_b (Request const* r) const t->get_mus_property ("text")); } - bool Articulation_req::do_equal_b (Request const* r) const { Articulation_req const* a = dynamic_cast (r); - return a && articulation_str_ == a->articulation_str_; + return a && gh_equal_p (get_mus_property ("articulation-type"), + r->get_mus_property ("articulation-type")) + && get_direction () == a->get_direction (); } +