From: Jan Nieuwenhuizen Date: Sun, 14 Jul 2002 13:10:03 +0000 (+0000) Subject: * lily/voice-devnull-engraver.cc (acknowledge_grob): Use proper X-Git-Tag: release/1.5.68~13 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=80fefb01fd8016e791824d36fe1ca1f21267d519;p=lilypond.git * lily/voice-devnull-engraver.cc (acknowledge_grob): Use proper spelling for always. In solo a due mode, kill spanners when the other thread has solo. * lily/thread-devnull-engraver.cc (acknowledge_grob): In solo a due mode, kill everything when the other thread has solo. * lily/a2-engraver.cc (acknowledge_grob): In solo a due mode, do not set directions when we have solo. * lily/part-combine-music-iterator.cc (process): Set property "othersolo" if the other thread has solo. --- diff --git a/ChangeLog b/ChangeLog index 39be48aaa8..ca6d9c69a6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2002-07-14 Jan Nieuwenhuizen + + * lily/voice-devnull-engraver.cc (acknowledge_grob): Use proper + spelling for always. In solo a due mode, kill spanners when the + other thread has solo. + + * lily/thread-devnull-engraver.cc (acknowledge_grob): In solo a + due mode, kill everything when the other thread has solo. + + * lily/a2-engraver.cc (acknowledge_grob): In solo a due mode, do + not set directions when we have solo. + + * lily/part-combine-music-iterator.cc (process): Set property + "othersolo" if the other thread has solo. + 2002-07-13 Han-Wen * lily/beam.cc (calc_stem_y): fix beams on quarter notes. diff --git a/lily/a2-engraver.cc b/lily/a2-engraver.cc index 4d7b440def..fdbd361a1e 100644 --- a/lily/a2-engraver.cc +++ b/lily/a2-engraver.cc @@ -137,45 +137,50 @@ A2_engraver::acknowledge_grob (Grob_info i) d = DOWN; /* Must only set direction for VoiceCombines, not for StaffCombines: - we can't detect that here, so, ugh, yet another property */ + we can't detect that here, so we use yet another property */ if (!to_boolean (get_property ("noDirection")) && (Stem::has_interface (i.grob_l_) || Slur::has_interface (i.grob_l_) || Tie::has_interface (i.grob_l_) - /* - Usually, dynamics are removed by *_devnull_engravers for the - second voice. On the one hand, we don't want all dynamics for - the first voice to be placed above the staff. On the other - hand, colliding of scripts may be worse. - So, we don't set directions for these when we're playing solo. - */ - || (i.grob_l_->internal_has_interface (ly_symbol2scm ("dynamic-interface")) + /* Usually, dynamics are removed by *_devnull_engravers for + the second voice. On the one hand, we don't want all + dynamics for the first voice to be placed above the + staff. On the other hand, colliding of scripts may be + worse. So, we don't set directions for these when we're + playing solo. */ + || (i.grob_l_->internal_has_interface (ly_symbol2scm + ("dynamic-interface")) && state_ != SOLO) - || (i.grob_l_->internal_has_interface (ly_symbol2scm ("text-interface")) + || (i.grob_l_->internal_has_interface (ly_symbol2scm + ("text-interface")) && state_ != SOLO) )) { - /* - Hmm. We must set dir when solo, in order to get - the rests collided to the right position - */ - if ((unirhythm != SCM_BOOL_T) || (solo == SCM_BOOL_T) - || ((unisilence == SCM_BOOL_T && previous_state != UNISON)) - || (unirhythm == SCM_BOOL_T && split_interval == SCM_BOOL_T - && (unison != SCM_BOOL_T || solo_adue != SCM_BOOL_T))) + /* When in solo a due mode, and we have solo, every grob in + other thread gets annihilated, so we don't set dir. + + Maybe that should be optional? */ + if ((solo != SCM_BOOL_T && solo_adue == SCM_BOOL_T) + + /* When not same rhythm, we set dir */ + && (unirhythm != SCM_BOOL_T + /* When both have rests, but previously played something + different, we set dir */ + || ((unisilence == SCM_BOOL_T && previous_state != UNISON)) + /* When same rhythm, and split stems, but not same pitch + or not solo a du mode, we set dir */ + || (unirhythm == SCM_BOOL_T && split_interval == SCM_BOOL_T + && (unison != SCM_BOOL_T || solo_adue != SCM_BOOL_T)))) { - /* - Blunt axe method: every grob gets a propertysetting. - */ + /* Blunt axe method: every grob gets a propertysetting. */ i.grob_l_->set_grob_property ("direction", gh_int2scm (d)); } } - /* - todo: should we have separate state variable for being "rest while - other has solo?" */ - if ( Multi_measure_rest::has_interface (i.grob_l_) && d ) + /* Should we have separate state variable for being "rest + while other has solo?" */ + if (Multi_measure_rest::has_interface (i.grob_l_) && d) if (state_ == UNIRHYTHM && unisilence != SCM_BOOL_T) { diff --git a/lily/part-combine-music-iterator.cc b/lily/part-combine-music-iterator.cc index 3e0fccef6e..82ca27ad39 100644 --- a/lily/part-combine-music-iterator.cc +++ b/lily/part-combine-music-iterator.cc @@ -337,7 +337,8 @@ Part_combine_music_iterator::process (Moment m) */ if (suffix_.empty_b ()) - suffix_ = first_iter_p_->report_to_l ()->daddy_trans_l_->id_str_.cut_str (3, INT_MAX); + suffix_ = first_iter_p_->report_to_l () + ->daddy_trans_l_->id_str_.cut_str (3, INT_MAX); int state = get_state (m); if (state) @@ -345,7 +346,8 @@ Part_combine_music_iterator::process (Moment m) else state = state_; - Part_combine_music const *p = dynamic_cast (music_l ()); + Part_combine_music const *p = + dynamic_cast (music_l ()); bool previously_combined_b = first_iter_p_->report_to_l ()->daddy_trans_l_ @@ -413,6 +415,10 @@ Part_combine_music_iterator::process (Moment m) first_translator->set_property ("solo", b1); second_translator->set_property ("solo", b2); + /* Can't these be computed? */ + first_translator->set_property ("othersolo", b2); + second_translator->set_property ("othersolo", b1); + if (first_iter_p_->ok ()) first_iter_p_->process (m); diff --git a/lily/thread-devnull-engraver.cc b/lily/thread-devnull-engraver.cc index b019d3801f..96e397f69f 100644 --- a/lily/thread-devnull-engraver.cc +++ b/lily/thread-devnull-engraver.cc @@ -35,12 +35,14 @@ Thread_devnull_engraver::acknowledge_grob (Grob_info i) if (s == ly_symbol2scm ("always") || (s == SCM_EOL - && daddy_trans_l_->id_str_.left_str (3) == "two" - && (to_boolean (get_property ("unison")) - || to_boolean (get_property ("unisilence"))) - && to_boolean (get_property ("soloADue")))) + && to_boolean (get_property ("soloADue")) + && ((daddy_trans_l_->id_str_.left_str (3) == "two" + && (to_boolean (get_property ("unison")) + || to_boolean (get_property ("unisilence")))) + + /* Maybe this should be optional? */ + || to_boolean (get_property ("othersolo"))))) { - /* Ugh, we can suicide them, but they remain living */ i.grob_l_->suicide (); } } diff --git a/lily/voice-devnull-engraver.cc b/lily/voice-devnull-engraver.cc index b457f4535d..786e7a07aa 100644 --- a/lily/voice-devnull-engraver.cc +++ b/lily/voice-devnull-engraver.cc @@ -91,15 +91,28 @@ Voice_devnull_engraver::acknowledge_grob (Grob_info i) return; #endif - if (s == ly_symbol2scm ("allways") +#if 0 /* We used to have have this until 1.5.68. Not sure about + soloADue requirement */ + if (s == ly_symbol2scm ("always") || (s == SCM_EOL && daddy_trans_l_->id_str_.left_str (3) == "two" && (to_boolean (get_property ("unison")) || to_boolean (get_property ("unisilence"))))) +#else + if (s == ly_symbol2scm ("always") + || (s == SCM_EOL + && to_boolean (get_property ("soloADue")) + && ((daddy_trans_l_->id_str_.left_str (3) == "two" + && (to_boolean (get_property ("unison")) + || to_boolean (get_property ("unisilence")))) + + /* Maybe this should be optional? */ + || to_boolean (get_property ("othersolo"))))) +#endif + for (char const **p = junk_interfaces; *p; p++) if (i.grob_l_->internal_has_interface (ly_symbol2scm (*p))) { - /* Ugh, we can suicide them, but they remain living */ i.grob_l_->suicide (); return; }