]> git.donarmstrong.com Git - lilypond.git/commitdiff
* lily/voice-devnull-engraver.cc (acknowledge_grob): Use proper
authorJan Nieuwenhuizen <janneke@gnu.org>
Sun, 14 Jul 2002 13:10:03 +0000 (13:10 +0000)
committerJan Nieuwenhuizen <janneke@gnu.org>
Sun, 14 Jul 2002 13:10:03 +0000 (13:10 +0000)
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.

ChangeLog
lily/a2-engraver.cc
lily/part-combine-music-iterator.cc
lily/thread-devnull-engraver.cc
lily/voice-devnull-engraver.cc

index 39be48aaa8bd1c8bb085a5f2d56b7cd836825a74..ca6d9c69a6f8d667b8b0f28805f083504168d6f2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2002-07-14  Jan Nieuwenhuizen  <janneke@gnu.org>
+
+       * 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  <hanwen@cs.uu.nl>
 
        * lily/beam.cc (calc_stem_y): fix beams on quarter notes.
index 4d7b440def81689df6f04077654180c56b7503ff..fdbd361a1ed1ec30d7d2b8075f85e53eba892dd3 100644 (file)
@@ -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)
     {
index 3e0fccef6e5e559ac7d274ba85ff1ee8931c3938..82ca27ad39a28750ee75cdd377ee73b1c0a2455f 100644 (file)
@@ -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<Part_combine_music const* > (music_l ());
+  Part_combine_music const *p =
+    dynamic_cast<Part_combine_music const* > (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);
   
index b019d3801fc5109562693d3fdbf67bd2a4dbe76e..96e397f69f09aecfb0d20b46fdf700984a09497e 100644 (file)
@@ -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 ();
     }
 }
index b457f4535df4bc20c7b4dd94c0945bcca4529e6a..786e7a07aabdd6e5ca8ac00af92bbd599b0b86b9 100644 (file)
@@ -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;
        }