lilypond-devel
[Top][All Lists]
Advanced

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

Re: [patch] top level page breaking directives


From: Joe Neeman
Subject: Re: [patch] top level page breaking directives
Date: Sun, 6 May 2007 09:50:25 +1000
User-agent: KMail/1.9.5

On Sunday 06 May 2007 03:10, Nicolas Sceaux wrote:
> Han-Wen, Joe,
>
> Here is a patch which implements top-level page breaking directives, for
> instance:

Great! I think this has been a needed feature for some time. I just have one 
comment with the implementation, though.

+void
+set_page_permissions (SCM sys, SCM page_break_permission, SCM 
page_turn_permission)
+{
+  if (Paper_score *ps = dynamic_cast<Paper_score*> (unsmob_music_output 
(sys)))
+    {
+      vector<Grob*> cols = ps->get_columns ();
+      if (cols.size ())
+       {
+         Paper_column *col = dynamic_cast<Paper_column*> (cols.back ());
+         col->set_property ("page-break-permission", page_break_permission);
+         col->find_prebroken_piece (LEFT)->set_property 
("page-break-permission",
+                                                         
page_break_permission);
+         col->set_property ("page-turn-permission", page_turn_permission);
+         col->find_prebroken_piece (LEFT)->set_property 
("page-turn-permission",
+                                                         
page_turn_permission);
+       }

It would be nice if this generalised to having \forcePageTurn and 
\forbidPageTurn commands. The problem is that you always set 
page-break-permission and page-turn-permission together. That means that 
something like \forbidPageTurn \forcePageBreak will never work because 
\forcePageBreak will set page-turn-permission, overriding everything that 
\forbidPageTurn does.

Maybe a solution is to define Page_marker to have

SCM symbol_;
SCM permission_;

where symbol_ is either 'page-turn-permission or 'page-break-permission and 
permission_ is the actual permission (and set_page_permissions would be 
modified to take a symbol and a permission instead of 2 permissions). Then 
you can set only one without affecting the other.

Joe




reply via email to

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