]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/voice-devnull-engraver.cc
huh
[lilypond.git] / lily / voice-devnull-engraver.cc
index 7a8d460f99c933b672028507c5e23e1c414faa7f..eb47ba180b62ece70bbacdf1d97c2a6fa4f7de51 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
   
-  (c) 2000--2001 Jan Nieuwenhuizen <janneke@gnu.org>
+  (c) 2000--2002 Jan Nieuwenhuizen <janneke@gnu.org>
 */
 
 #include "engraver.hh"
 class Voice_devnull_engraver : public Engraver
 {
 public:
-  VIRTUAL_COPY_CONS (Translator);
+  TRANSLATOR_DECLARATIONS(Voice_devnull_engraver);
   
 protected:
   virtual bool try_music (Music *m);
   virtual void acknowledge_grob (Grob_info);
 };
 
-ADD_THIS_TRANSLATOR (Voice_devnull_engraver);
+
 
 static char const *eat_spanners[] = {
   "beam",
   "crescendo",
   "decrescendo",
+  "rest",
   "slur",
   0
 };
@@ -35,15 +36,16 @@ bool
 Voice_devnull_engraver::try_music (Music *m)
 {
   SCM s = get_property ("devNullVoice");
+
 #if 0
   /* No need */
   if (gh_equal_p (s, ly_symbol2scm ("never")))
     return;
 #endif
 
-  if (gh_equal_p (s, ly_symbol2scm ("allways"))
+  if (gh_equal_p (s, ly_symbol2scm ("always"))
       || (s == SCM_EOL
-         && daddy_trans_l_->id_str_.left_str (3) == "two"
+         && daddy_trans_->id_string_.left_string (3) == "two"
          && (to_boolean (get_property ("unison"))
              || to_boolean (get_property ("unisilence")))))
     {
@@ -89,25 +91,38 @@ 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"
+         && daddy_trans_->id_string_.left_string (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_->id_string_.left_string (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.elem_l_->has_interface (ly_symbol2scm (*p)))
+      if (i.grob_->internal_has_interface (ly_symbol2scm (*p)))
        {
-#if 0
-         /* Ugh: virtual mmrest::suicide () ? */
-         if (i.elem_l_->has_interface (ly_symbol2scm ("multi-measure-rest-interface")))
-           i.elem_l_->set_grob_property ("skip-timestep", SCM_BOOL_T);
-         else
-           ;
-#endif   
-         /* Ugh, we can suicide them, but they remain living */
-         i.elem_l_->suicide ();
+         i.grob_->suicide ();
          return;
        }
 }
  
+Voice_devnull_engraver::Voice_devnull_engraver(){}
   
+ENTER_DESCRIPTION(Voice_devnull_engraver,
+/* descr */       "Kill off certain items and spanners if we're Voice `two' and unison or unisilence is set.",
+/* creats*/       "",
+/* acks  */       "grob-interface",
+/* reads */       "",
+/* write */       "");