X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fmusical-request.cc;h=147fce3fa2cbce1143d66df4cda8d34a3a8bc1ae;hb=6b89a99dbfb2e208c42ba1510be9e638d21be4a9;hp=ef2b193979a3c3b9017526b9445aa9dcc417783b;hpb=4975901229a1b074f6c93d812e15d653aa8e2952;p=lilypond.git diff --git a/lily/musical-request.cc b/lily/musical-request.cc index ef2b193979..147fce3fa2 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" @@ -16,23 +16,6 @@ Tremolo_req::Tremolo_req () { } - -void -Melodic_req::transpose (Pitch delta) -{ - Pitch p = *unsmob_pitch (get_mus_property ("pitch")); - - p.transpose (delta); - - if (abs (p.alteration_i_) > 2) - { - warning (_f ("Transposition by %s makes accidental larger than two", - delta.str ())); - } - - set_mus_property ("pitch", p.smobbed_copy ()); -} - bool Melodic_req::do_equal_b (Request const* r) const { @@ -48,21 +31,24 @@ Rhythmic_req::do_equal_b (Request const* r) const return rh; // ; && !compare (*this, *rh); } - - Moment Rhythmic_req::length_mom () const { - return unsmob_duration ( get_mus_property( "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 *d = unsmob_duration (get_mus_property( "duration")); - - set_mus_property ("duration", d ->compressed (m).smobbed_copy()); + Duration *d = unsmob_duration (get_mus_property ("duration")); + if (d) + set_mus_property ("duration", d ->compressed (m.main_part_).smobbed_copy ()); } bool @@ -78,9 +64,6 @@ Note_req::Note_req () } - - - bool Span_req::do_equal_b (Request const*r) const { @@ -101,13 +84,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 (); } +