]> git.donarmstrong.com Git - lilypond.git/commitdiff
* lily/include/paper-book.hh (PAGE_LAYOUT): Define as "ps"; make
authorJan Nieuwenhuizen <janneke@gnu.org>
Tue, 9 Mar 2004 20:56:18 +0000 (20:56 +0000)
committerJan Nieuwenhuizen <janneke@gnu.org>
Tue, 9 Mar 2004 20:56:18 +0000 (20:56 +0000)
switch runtime.

ChangeLog
lily/include/paper-book.hh
lily/input-file-results.cc
lily/paper-outputter.cc
lily/parser.yy
lily/score.cc
lily/system.cc

index 05b08bc7e1ce9827930de5f260e7e10f78b122a6..7fe6375e3aff25665e7db412a8f941d1bb0243de 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2004-03-09  Jan Nieuwenhuizen  <janneke@gnu.org>
 
+       * lily/include/paper-book.hh (PAGE_LAYOUT): Define as "ps"; make
+       switch runtime.
+
        * lily/include/music-output.hh (process): Change signature to
        return SCM.
 
index 3c2dd05f6739918ebae305b92ac6a3974c173e69..0a18454979cf902d3512506db329aa849adedc9d 100644 (file)
@@ -9,12 +9,12 @@
 #ifndef PAPER_BOOK_HH
 #define PAPER_BOOK_HH
 
-// #define PAGE_LAYOUT 1
-
 #include "lily-guile.hh"
 #include "parray.hh"
 #include "protected-scm.hh"
 
+#define PAGE_LAYOUT "ps"
+
 class Paper_book
 {
 public:
index 6c446f881d21f4882c8848a17f25dae59477413b..17a67cba57f16716a7a0602960dc4aea41f1aa3d 100644 (file)
@@ -233,7 +233,6 @@ do_one_file (char const *file)
   Paper_book book;
   paper_book = &book;
   Input_file_results inp_file (init, in_file, out_file);
-#ifdef PAGE_LAYOUT
-  book.output (out_file);
-#endif
+  if (output_format_global == PAGE_LAYOUT)
+    book.output (out_file);
 }
index dead824a55e38a301c5df9d3593a10f08d567d84..4ec59b228fd29c9805f21fdfed9b6e00187c6ae3 100644 (file)
@@ -24,8 +24,7 @@
 #include "paper-def.hh"
 #include "input-file-results.hh"
 #include "ly-module.hh"
-
-
+#include "paper-book.hh"
 #include "input-smob.hh"  // output_expr
 
 
@@ -108,13 +107,13 @@ Paper_outputter::output_line (SCM line, bool is_last)
     {
       Stencil *stil = unsmob_stencil (ly_cdar (s));
       SCM head = ly_caar (s);
-#ifndef PAGE_LAYOUT
+      
       if (head == ly_symbol2scm ("between-system-string"))
        {
          between = stil->get_expr ();
          continue;
        }
-#endif      
+  
       output_expr (stil->get_expr (), ly_scm2offset (head));
     }
 
@@ -123,7 +122,7 @@ Paper_outputter::output_line (SCM line, bool is_last)
   else
     {
       output_scheme (scm_list_1 (ly_symbol2scm ("stop-system")));
-      if (between != SCM_EOL)
+      if (output_format_global != PAGE_LAYOUT && between != SCM_EOL)
        output_scheme (between);
     }
 }
index 80ba7a4fe491659926c09a369ebab6c2f1e05004..fed1f4469c3fd894d448e93067bc9e94f8972f08 100644 (file)
@@ -453,14 +453,12 @@ toplevel_expression:
                   id = id ? id->clone () : new Paper_def;
        
                   default_rendering (sc->music_, id->self_scm (), head, outname);
-                                               
-#ifndef PAGE_LAYOUT
-                  scm_gc_unprotect_object (id->self_scm ());
-#endif
+
+                  if (output_format_global != PAGE_LAYOUT)
+                        scm_gc_unprotect_object (id->self_scm ());
                }
-#ifndef PAGE_LAYOUT
-               scm_gc_unprotect_object (sc->self_scm ());
-#endif
+                  if (output_format_global != PAGE_LAYOUT)
+                       scm_gc_unprotect_object (sc->self_scm ());
        }
        | output_def {
                SCM id = SCM_EOL;
index ae9c81f64775c96c1a9cf125aac58e0c8ec4e98d..a83573b7b21e229761a172a21fe71d556f9c2ccd 100644 (file)
@@ -178,9 +178,8 @@ default_rendering (SCM music, SCM outdef, SCM header, SCM outname)
          paper_book->headers_.push (header);
          Paper_score *ps = dynamic_cast<Paper_score*> (output);
          paper_book->papers_.push (ps->paper_);
-#ifndef PAGE_LAYOUT
-         paper_book->classic_output (ly_scm2string (outname));
-#endif
+         if (output_format_global != PAGE_LAYOUT)
+           paper_book->classic_output (ly_scm2string (outname));
        }
       delete output;
     }
index ac6fc06702291d508a9462ed36897aaeb778e877..393d2abf5b50a11c15c4aa630e48d4c3be6034f2 100644 (file)
@@ -424,18 +424,19 @@ System::get_line ()
                                   stil->smobbed_copy ()), line);
       }
 
-#ifndef PAGE_LAYOUT
-  SCM lastcol = ly_car (get_property ("columns"));
-  Grob *g = unsmob_grob (lastcol);
-  
-  SCM between = ly_symbol2scm ("between-system-string");
-  SCM inter = g->internal_get_property (between);
-  if (gh_string_p (inter))
+  if (output_format_global != PAGE_LAYOUT)
     {
-      Stencil *stil = new Stencil (Box (), scm_list_2 (between, inter));
-      line = scm_cons (scm_cons (between, stil->smobbed_copy ()), line);
+      SCM lastcol = ly_car (get_property ("columns"));
+      Grob *g = unsmob_grob (lastcol);
+      
+      SCM between = ly_symbol2scm ("between-system-string");
+      SCM inter = g->internal_get_property (between);
+      if (gh_string_p (inter))
+       {
+         Stencil *stil = new Stencil (Box (), scm_list_2 (between, inter));
+         line = scm_cons (scm_cons (between, stil->smobbed_copy ()), line);
+       }
     }
-#endif
 
   Interval x (extent (this, X_AXIS));
   Interval y (extent (this, Y_AXIS));