X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fcommand-request.cc;h=f37c73825c450744dc96df79faed03f528d7e94d;hb=d79efa6efaa15be34beda70e5b24731a1d372f0e;hp=92143f8a5554482515790b60b4a088bb21ad7870;hpb=305fb79f24233b261b5372168f76520f84d2ea87;p=lilypond.git diff --git a/lily/command-request.cc b/lily/command-request.cc index 92143f8a55..f37c73825c 100644 --- a/lily/command-request.cc +++ b/lily/command-request.cc @@ -11,26 +11,6 @@ #include "musical-request.hh" -bool -Bar_req::do_equal_b (Request const *r) const -{ - Bar_req const* b = dynamic_cast (r); - return b && type_str_ == b->type_str_; -} - -void -Bar_req::do_print () const -{ -#ifndef NPRINT - DEBUG_OUT << type_str_; -#endif -} - -Bar_req::Bar_req (String s) -{ - type_str_ = s; -} - bool Barcheck_req::do_equal_b (Request const *r) const { @@ -38,56 +18,14 @@ Barcheck_req::do_equal_b (Request const *r) const return b; } -void -Clef_change_req::do_print () const -{ -#ifndef NPRINT - DEBUG_OUT << clef_str_ ; -#endif -} - -Clef_change_req::Clef_change_req (String s) -{ - clef_str_ = s; -} - -void -Time_signature_change_req::do_print () const -{ -#ifndef NPRINT - DEBUG_OUT << beats_i_ << "/" << one_beat_i_; -#endif -} - -bool -Time_signature_change_req::do_equal_b (Request const *r) const -{ - Time_signature_change_req const* m - = dynamic_cast (r); - - return m && m->beats_i_ == beats_i_ - && one_beat_i_ == m->one_beat_i_; -} - -Time_signature_change_req::Time_signature_change_req () -{ - beats_i_ = 0; - one_beat_i_ =0; -} Tempo_req::Tempo_req () { - metronome_i_ = 60; - dur_. durlog_i_ = 2; + set_mus_property ("duration", Duration(2,0).smobbed_copy ()); } -void -Tempo_req::do_print () const -{ - DEBUG_OUT << dur_.str () << " = " << metronome_i_; -} bool @@ -95,7 +33,8 @@ Tempo_req::do_equal_b (Request const *r) const { Tempo_req const *t = dynamic_cast (r); - return t&& t->dur_.length_mom ()== dur_.length_mom () && metronome_i_ == t->metronome_i_; + return t; // && t->dur_.length_mom ()== dur_.length_mom (); + // && metronome_i_ == t->metronome_i_; } @@ -105,43 +44,45 @@ bool Key_change_req::do_equal_b (Request const * req) const { Key_change_req const * k = dynamic_cast (req); - return k && scm_equal_p (pitch_alist_, k->pitch_alist_); + return k && scm_equal_p (get_mus_property ("pitch-alist"), k->get_mus_property ("pitch-alist")) == SCM_BOOL_T; } - void -Key_change_req::transpose (Musical_pitch p) +Key_change_req::transpose (Pitch p) { SCM newlist = SCM_EOL; - for (SCM s = pitch_alist_; gh_pair_p (s); s = gh_cdr (s)) + SCM pa = get_mus_property ("pitch-alist"); + for (SCM s = pa; gh_pair_p (s); s = gh_cdr (s)) { - SCM k = gh_caar (s); - - if (gh_pair_p (k)) + SCM key = gh_caar (s); + SCM alter = gh_cdar (s); + if (gh_pair_p (key)) { - Musical_pitch orig (gh_list (gh_car (k), gh_cdr (k), gh_cdr (s), SCM_UNDEFINED)); + Pitch orig (gh_scm2int (gh_car (key)), + gh_scm2int (gh_cdr (key)), + gh_scm2int (alter)); orig.transpose (p); - SCM key = gh_cons (gh_int2scm (orig.octave_i_), + SCM key = gh_cons (gh_int2scm (orig.octave_i () ), gh_int2scm (orig.notename_i_)); - newlist = gh_cons (gh_cons (key, gh_int2scm (orig.accidental_i_)), + newlist = gh_cons (gh_cons (key, gh_int2scm (orig.alteration_i_)), newlist); } - else if (gh_number_p (k)) + else if (gh_number_p (key)) { - Musical_pitch orig (gh_list (gh_int2scm (0), k, gh_cdar (s), SCM_UNDEFINED)); + Pitch orig (0, gh_scm2int (key), gh_scm2int (alter)); orig.transpose (p); - SCM key =gh_int2scm (orig.notename_i_); - newlist = gh_cons (gh_cons (key, gh_int2scm (orig.accidental_i_)), - newlist); + key =gh_int2scm (orig.notename_i_); + alter = gh_int2scm (orig.alteration_i_); + newlist = gh_cons (gh_cons (key, alter), newlist); } } - pitch_alist_ = newlist; + set_mus_property ("pitch-alist", newlist); } Break_req::Break_req () @@ -149,10 +90,10 @@ Break_req::Break_req () } - bool Mark_req::do_equal_b (Request const * r) const { Mark_req const * other = dynamic_cast (r); - return other && scm_equal_p (other->mark_label_, mark_label_); + return other && scm_equal_p (other->get_mus_property ("mark-label"), + get_mus_property ("mark-label")) == SCM_BOOL_T; }