]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/voice-devnull-engraver.cc
release commit
[lilypond.git] / lily / voice-devnull-engraver.cc
index b457f4535df4bc20c7b4dd94c0945bcca4529e6a..d7027086bf570d4c52d025aea7b325d7074323d2 100644 (file)
@@ -3,12 +3,12 @@
 
   source file of the GNU LilyPond music typesetter
   
-  (c) 2000--2002 Jan Nieuwenhuizen <janneke@gnu.org>
+  (c) 2000--2003 Jan Nieuwenhuizen <janneke@gnu.org>
 */
 
 #include "engraver.hh"
 #include "item.hh"
-#include "musical-request.hh"
+#include "event.hh"
 #include "translator-group.hh"
 
 class Voice_devnull_engraver : public Engraver
@@ -22,7 +22,14 @@ protected:
 };
 
 
+/*
+
+ARGH .
+
 
+This really sucks.
+
+ */
 static char const *eat_spanners[] = {
   "beam",
   "crescendo",
@@ -45,22 +52,22 @@ Voice_devnull_engraver::try_music (Music *m)
 
   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")))))
     {
-      if (Span_req *s = dynamic_cast <Span_req *> (m))
+      if (m->is_mus_type ("span-event"))
        {
-         SCM t = s->get_mus_property ("span-type");
+         SCM t = m->get_mus_property ("span-type");
         
          for (char const **p = eat_spanners; *p; p++)
            {
-             if (t == ly_str02scm (*p))
+             if (t == scm_makfrom0str (*p))
                return true;
            }
        }
-      /* Ugh.  Should eat other requests, script etc. too. */  
-      else if (dynamic_cast<Tie_req*> (m))
+      /* Ugh.  Should eat other events, script etc. too. */  
+      else if (m->is_mus_type ("tie-event"))
        return true;
     }
   return false;
@@ -91,16 +98,29 @@ 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.grob_l_->internal_has_interface (ly_symbol2scm (*p)))
+      if (i.grob_->internal_has_interface (ly_symbol2scm (*p)))
        {
-         /* Ugh, we can suicide them, but they remain living */
-         i.grob_l_->suicide ();
+         i.grob_->suicide ();
          return;
        }
 }
@@ -110,6 +130,7 @@ 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",
+/* accepts */     "general-music", /*UGH.*/
+/* acks  */      "grob-interface",
 /* reads */       "",
 /* write */       "");