]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/forbid-break-engraver.cc
Merge branch 'master' of ssh://jomand@git.sv.gnu.org/srv/git/lilypond
[lilypond.git] / lily / forbid-break-engraver.cc
index 474188706081d40ea990535a156416fd0c5d1109..f44d7bc27fca8656b43df95a881f0fe298a1cb90 100644 (file)
@@ -5,22 +5,26 @@
 
   (c) 2002--_2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
 */
-#include "rhythmic-head.hh"
+#include "context.hh"
+#include "duration.hh"
+#include "engraver.hh"
 #include "grob.hh"
-#include "score-engraver.hh"
 #include "input.hh"
 #include "pitch.hh"
-#include "duration.hh"
-#include "moment.hh"
+#include "rhythmic-head.hh"
+
+#include "translator.icc"
 
 class Forbid_line_break_engraver : public Engraver
 {
 public:
   TRANSLATOR_DECLARATIONS (Forbid_line_break_engraver);
-  virtual void start_translation_timestep ();
+  void start_translation_timestep ();
 };
 
-Forbid_line_break_engraver::Forbid_line_break_engraver (){}
+Forbid_line_break_engraver::Forbid_line_break_engraver ()
+{
+}
 
 void
 Forbid_line_break_engraver::start_translation_timestep ()
@@ -37,18 +41,23 @@ Forbid_line_break_engraver::start_translation_timestep ()
   while (scm_is_pair (busy))
     {
       Grob *g = unsmob_grob (scm_cdar (busy));
-      if (Rhythmic_head::has_interface (g))
-       {
-         get_score_engraver ()->forbid_breaks ();
-       }
+      if (g->internal_has_interface (ly_symbol2scm ("rhythmic-grob-interface")))
+        context ()->get_score_context ()->set_property ("forbidBreak", SCM_BOOL_T);
       busy = scm_cdr (busy);
     }
 }
 
 ADD_TRANSLATOR (Forbid_line_break_engraver,
-               /* descr */ "Forbid line breaks when note heads are still playing at some point.",
-               /* creats*/ "",
-               /* accepts */ "",
-               /* acks  */ "",
-               /* reads */ "busyGrobs",
-               /* write */ "");
+               /* doc */
+               "Forbid line breaks when note heads are still playing at some"
+               " point.",
+
+               /* create */
+               "",
+
+               /* read */
+               "busyGrobs ",
+
+               /* write */
+               "forbidBreak "
+               );