From: fred Date: Tue, 26 Mar 2002 23:54:55 +0000 (+0000) Subject: lilypond-1.3.79 X-Git-Tag: release/1.5.59~1353 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=4970dd3936419a1ac095eb0d65b1a3389aa1604b;p=lilypond.git lilypond-1.3.79 --- diff --git a/input/bugs/almost.ly b/input/bugs/almost.ly new file mode 100644 index 0000000000..7276562718 --- /dev/null +++ b/input/bugs/almost.ly @@ -0,0 +1,18 @@ +\score{ + \context Staff < + \context Voice=one { \skip 1; } + \context Voice=two { \skip 1; } + + \context Voice=one \partcombine Voice + \context Thread=one \notes\relative c'' { + a4 c4.()g8 a4 + } + \context Thread=two \notes\relative c'' { + g4 e4.()d8 c4 + } + > + \paper{ + linewidth=60.\mm; + } +} + diff --git a/input/test/hymn.ly b/input/test/hymn.ly new file mode 100644 index 0000000000..8003c4dbd4 --- /dev/null +++ b/input/test/hymn.ly @@ -0,0 +1,32 @@ +\score{ + \context Staff < + \context Voice=one { \skip 1; } + \context Voice=two { \skip 1; } + + \context Voice=one \partcombine Voice + \context Thread=one \notes\relative c'' { + %a4 c4.()g8 a4 | + g4 e' g()f | + b, a c2 + } + \context Thread=two \notes\relative c'' { + %g4 e4.()d8 c4 | + g4 c, e()f | + d2 a + } + > + \paper{ + linewidth=140.\mm; + \translator { + \VoiceContext + soloADue = ##f + %\remove Slur_engraver; + \consists Slur_engraver; + } +% \translator { +% \ThreadContext +% \consists Slur_engraver; +% } + } +} + diff --git a/input/test/part-combine.ly b/input/test/part-combine.ly index 074498488e..40fe3fc007 100644 --- a/input/test/part-combine.ly +++ b/input/test/part-combine.ly @@ -1,22 +1,27 @@ \score{ - \context Staff = first < - \context Voice=first { \skip 1; } - \context Voice=second { \skip 1; } + \context Staff = one < + \context Voice=one { \skip 1; } + \context Voice=two { \skip 1; } - \context Voice=first \partcombine Voice - \context Thread=first \notes\relative c'' + \context Voice=one \partcombine Voice + \context Thread=one \notes\relative c'' { c4 d e f b,4 d c d r2 e4 f c4 d e f + c d e f } - \context Thread=second \notes\relative c'' + \context Thread=two \notes\relative c'' { - a b c d + g b d f r2 c4 d a c c d a4. b8 c4 d + c d e f } > + \paper{ + linewidth = 100.\mm; + } } diff --git a/input/test/short-part-combine.ly b/input/test/short-part-combine.ly new file mode 100644 index 0000000000..89e907cf04 --- /dev/null +++ b/input/test/short-part-combine.ly @@ -0,0 +1,16 @@ +\score{ + \context Staff = one < + \context Voice=one { \skip 1; } + \context Voice=two { \skip 1; } + + \context Voice=one \partcombine Voice + \context Thread=one \notes\relative c'' + { + d e f + } + \context Thread=two \notes\relative c'' + { + d d d + } + > +} diff --git a/input/test/solo-a2.ly b/input/test/solo-a2.ly new file mode 100644 index 0000000000..e3054214df --- /dev/null +++ b/input/test/solo-a2.ly @@ -0,0 +1,19 @@ +\score{ + \context Staff = one < + \context Voice=one { \skip 1; } + \context Voice=two { \skip 1; } + + \context Voice=one \partcombine Voice + \context Thread=one \notes\relative c'' + { + e \property Voice.soloADue = ##f e + } + \context Thread=two \notes\relative c'' + { + e \property Voice.soloADue = ##f e + } + > + \paper{ + linewidth = 100.\mm; + } +} diff --git a/lily/a2-devnull-engraver.cc b/lily/a2-devnull-engraver.cc index 680dedb5a3..30638451d8 100644 --- a/lily/a2-devnull-engraver.cc +++ b/lily/a2-devnull-engraver.cc @@ -17,25 +17,16 @@ public: VIRTUAL_COPY_CONS (Translator); protected: - virtual bool do_try_music (Music*); + virtual void acknowledge_element (Score_element_info); }; ADD_THIS_TRANSLATOR (A2_devnull_engraver); -bool -A2_devnull_engraver::do_try_music (Music *m) +void +A2_devnull_engraver::acknowledge_element (Score_element_info i) { - if (Note_req * n = dynamic_cast (m)) - { - SCM a2 = get_property ("a2"); - // should be able to read id_str_, no? - SCM second = get_property ("second"); - - if (a2 == SCM_BOOL_T && second == SCM_BOOL_T) - { - return true; - } - } - return false; + if (daddy_trans_l_->id_str_ == "two" + && to_boolean (get_property ("unison")) + && to_boolean (get_property ("soloADue"))) + i.elem_l_->suicide (); } - diff --git a/lily/a2-engraver.cc b/lily/a2-engraver.cc index 65a239e030..796056eb4d 100644 --- a/lily/a2-engraver.cc +++ b/lily/a2-engraver.cc @@ -23,12 +23,12 @@ public: protected: virtual void do_process_music (); virtual void acknowledge_element (Score_element_info); - //virtual void process_acknowledged (); virtual void do_pre_move_processing (); private: Item* text_p_; + enum State { NORMAL, SOLO, SPLIT_INTERVAL, UNISON } state_; }; ADD_THIS_TRANSLATOR (A2_engraver); @@ -36,6 +36,7 @@ ADD_THIS_TRANSLATOR (A2_engraver); A2_engraver::A2_engraver () { text_p_ = 0; + state_ = NORMAL; } void @@ -43,39 +44,50 @@ A2_engraver::do_process_music () { if (!text_p_) { - SCM a2 = get_property ("a2"); + SCM unison = get_property ("unison"); + SCM unirhythm = get_property ("unirhythm"); SCM solo = get_property ("solo"); - SCM solo2 = get_property ("solo2"); + SCM split_interval = get_property ("split-interval"); + SCM solo_adue = get_property ("soloADue"); - if (solo == SCM_BOOL_T || a2 == SCM_BOOL_T || solo2 == SCM_BOOL_T) + if (solo_adue == SCM_BOOL_T + && ((solo == SCM_BOOL_T && state_ != SOLO) + || (unison == SCM_BOOL_T && state_ != UNISON + && daddy_trans_l_->id_str_ == "one"))) { text_p_ = new Item (get_property ("basicTextScriptProperties")); Side_position::set_axis (text_p_, Y_AXIS); announce_element (text_p_, 0); - /* - Urg, read prop - */ - SCM text; Direction dir = UP; + SCM text; if (solo == SCM_BOOL_T) { - text = ly_str02scm ("Solo"); - } - else if (solo2 == SCM_BOOL_T) - { - text = ly_str02scm ("Solo II"); - dir = DOWN; + state_ = SOLO; + if (daddy_trans_l_->id_str_ == "one") + { + text = get_property ("soloText"); + } + else + { + text = get_property ("soloIIText"); + dir = DOWN; + } } - else if (a2 == SCM_BOOL_T) + else if (unison == SCM_BOOL_T) { - text = ly_str02scm ("\\`a 2"); + state_ = UNISON; + if (daddy_trans_l_->id_str_ == "one") + text = get_property ("aDueText"); } - + Side_position::set_direction (text_p_, dir); text_p_->set_elt_property ("text", text); - } + else if (unison == SCM_BOOL_T) + state_ = UNISON; + else if (unirhythm == SCM_BOOL_T && split_interval == SCM_BOOL_T) + state_ = SPLIT_INTERVAL; } } @@ -95,26 +107,31 @@ A2_engraver::acknowledge_element (Score_element_info i) if (Stem::has_interface (i.elem_l_)) { Side_position::add_support (text_p_, i.elem_l_); + } + } + - SCM a2 = get_property ("a2"); - SCM solo = get_property ("solo"); - SCM solo2 = get_property ("solo2"); + if (Stem::has_interface (i.elem_l_)) + { + Item *stem_l = dynamic_cast (i.elem_l_); - SCM first = get_property ("first"); - SCM second = get_property ("second"); + SCM unison = get_property ("unison"); + SCM unirhythm = get_property ("unirhythm"); + SCM solo = get_property ("solo"); + SCM split_interval = get_property ("split-interval"); + SCM solo_adue = get_property ("soloADue"); - if (solo != SCM_BOOL_T - && solo2 != SCM_BOOL_T - && a2 != SCM_BOOL_T) + if ((unirhythm != SCM_BOOL_T && solo != SCM_BOOL_T) + || (unirhythm == SCM_BOOL_T && split_interval == SCM_BOOL_T + && (unison != SCM_BOOL_T || solo_adue != SCM_BOOL_T))) + { + if (daddy_trans_l_->id_str_ == "one") { - if (first == SCM_BOOL_T) - { - Directional_element_interface (i.elem_l_).set (UP); - } - else if (second == SCM_BOOL_T) - { - Directional_element_interface (i.elem_l_).set (DOWN); - } + stem_l->set_elt_property ("direction", gh_int2scm (1)); + } + else if (daddy_trans_l_->id_str_ == "two") + { + stem_l->set_elt_property ("direction", gh_int2scm (-1)); } } } @@ -129,9 +146,5 @@ A2_engraver::do_pre_move_processing () typeset_element (text_p_); text_p_ = 0; } - // burp: reset properties - daddy_trans_l_->set_property ("a2", SCM_BOOL_F); - daddy_trans_l_->set_property ("solo", SCM_BOOL_F); - daddy_trans_l_->set_property ("solo2", SCM_BOOL_F); }