lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bar-line-engraver and breakpoints


From: Joe Neeman
Subject: Re: bar-line-engraver and breakpoints
Date: Tue, 28 Feb 2006 16:29:09 +1100
User-agent: Mozilla Thunderbird 1.0.7 (X11/20051121)

Han-Wen Nienhuys wrote:

Joe Neeman wrote:

OK, how about this one? It basically uses the original method, but the engravers communicate by setting/reading properties in the Score context (inspired by the "guh. Use properties!" comment).


it's probably wonderful, but can I see the patch first? ;)

oops :P (a proper patch would modify other engravers too, of course. This is just to get the idea....)
Index: lily/bar-engraver.cc
===================================================================
RCS file: /sources/lilypond/lilypond/lily/bar-engraver.cc,v
retrieving revision 1.86
diff -u -r1.86 bar-engraver.cc
--- lily/bar-engraver.cc        11 Feb 2006 11:35:18 -0000      1.86
+++ lily/bar-engraver.cc        28 Feb 2006 00:34:31 -0000
@@ -8,6 +8,8 @@
 */
 
 #include "bar-line.hh"
+#include "context.hh"
+#include "score-context.hh"
 #include "score-engraver.hh"
 #include "warn.hh"
 #include "item.hh"
@@ -89,8 +91,9 @@
 Bar_engraver::stop_translation_timestep ()
 {
   if (!bar_)
+    context ()->get_score_context ()->set_property ("forbidBreak", SCM_BOOL_T);
     /* guh. Use properties! */
-    get_score_engraver ()->forbid_breaks ();
+    //get_score_engraver ()->forbid_breaks ();
   else
     typeset_bar ();
 }
@@ -101,4 +104,4 @@
                /* create */ "BarLine",
                /* accept */ "",
                /* read */ "whichBar",
-               /* write */ "");
+               /* write */ "forbidBreak");
Index: lily/paper-column-engraver.cc
===================================================================
RCS file: /sources/lilypond/lilypond/lily/paper-column-engraver.cc,v
retrieving revision 1.12
diff -u -r1.12 paper-column-engraver.cc
--- lily/paper-column-engraver.cc       31 Jan 2006 00:30:43 -0000      1.12
+++ lily/paper-column-engraver.cc       28 Feb 2006 00:34:32 -0000
@@ -14,6 +14,7 @@
 #include "note-spacing.hh"
 #include "pointer-group-interface.hh"
 #include "context.hh"
+#include "score-context.hh"
 #include "axis-group-interface.hh"
 #include "warn.hh"
 
@@ -108,8 +109,8 @@
 void
 Paper_column_engraver::forbid_breaks ()
 {
-  if (command_column_ && !first_)
-    command_column_->set_property ("breakable", SCM_EOL);
+  /*if (command_column_ && !first_)
+    command_column_->set_property ("breakable", SCM_EOL);*/
 }
 
 bool
@@ -180,8 +181,11 @@
     }
   items_.clear ();
 
-  if (to_boolean (command_column_->get_property ("breakable")))
+  if (to_boolean (get_property ("forbidBreak")))
+    command_column_->set_property ("breakable", SCM_BOOL_F);
+  else
     {
+      command_column_->set_property ("breakable", SCM_BOOL_T);
       breaks_++;
       if (! (breaks_%8))
        progress_indication ("[" + to_string (breaks_) + "]");
@@ -197,6 +201,7 @@
   /*
     TODO: don't make columns when skipTypesetting is true.
   */
+  context ()->get_score_context ()->set_property ("forbidBreak", SCM_BOOL_F);
   if (!first_)
     make_columns ();
 }
@@ -220,7 +225,8 @@
                "NonMusicalPaperColumn",
                
                /* accept */ "break-event",
-               /* read */ "",
+               /* read */ "forbidBreak",
                /* write */
+                "forbidBreak "
                "currentCommandColumn "
                "currentMusicalColumn");

reply via email to

[Prev in Thread] Current Thread [Next in Thread]