]> git.donarmstrong.com Git - lilypond.git/commitdiff
* lily/paper-book.cc (classic_output): Reinstate header_0_ hack.
authorJan Nieuwenhuizen <janneke@gnu.org>
Wed, 9 Mar 2005 08:14:39 +0000 (08:14 +0000)
committerJan Nieuwenhuizen <janneke@gnu.org>
Wed, 9 Mar 2005 08:14:39 +0000 (08:14 +0000)
* lily/book.cc (process): Oops, add score_.header_.

* lily/paper-book.cc: Fold hearders, score and texts into scores_.

* scm/backend-library.scm (ly:system): Typo.

ChangeLog
input/regression/score-text.ly
lily/book.cc
lily/include/paper-book.hh
lily/paper-book.cc
scm/backend-library.scm

index 96300d92fda8bd065199213cace5dc130d095069..befd3d7fbc47be6808cc83bc7353c7cf232e4146 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,9 @@
 2005-03-09  Jan Nieuwenhuizen  <janneke@gnu.org>
 
-       * lily/book.cc:
+       * lily/paper-book.cc (classic_output): Reinstate header_0_ hack.
+
+       * lily/book.cc (process): Oops, add score_.header_.
+
        * lily/paper-book.cc: Fold hearders, score and texts into scores_.
 
        * lily/parser.yy: Handle toplevel and book texts as score.
index 2cf43d56219191de271fb9cb2613b8c7df8255ca..0347f19f8201771c694b70397a652c8edbda3d94 100644 (file)
@@ -9,20 +9,25 @@
 \paper {
     linewidth = #110
 }
-\markup {
-    \fill-line { "High up above" }
-}
-<<
-    \relative {
-       \clef bass
-       d,2 d c4 bes a2 \break
-       c2 c d4 f g2
+
+%% using Book and Score to get text in lilypond-book 
+\book {
+    \markup {
+       \fill-line { "High up above" }
     }
-    \addlyrics {
-       My first Li -- ly song,
-       Not much can go wrong!
+    \score {
+       <<
+           \relative {
+               \clef bass
+               d,2 d c4 bes a2 \break
+               c2 c d4 f g2
+           }
+           \addlyrics {
+               My first Li -- ly song,
+               Not much can go wrong!
+           }
+       >>
     }
->>
     \markup {
        %%TODO: make \verse markup.
        \fill-line {
@@ -46,3 +51,4 @@
            }
        }
     }
+}
\ No newline at end of file
index 0ba3fdf7f85d99062f0e1e2499593254834f3071..4d764f3be35865d6e4971366b8111d0613f44032 100644 (file)
@@ -106,8 +106,8 @@ Book::process (String outname, Output_def *default_def)
             titling? */
          if (scm_is_vector (systems))
            {
-             if (ly_c_module_p (header_))
-               paper_book->add_score (header_);
+             if (ly_c_module_p (score->header_))
+               paper_book->add_score (score->header_);
              paper_book->add_score (systems);
            }
        }
index a95ed8e3f64b4e553e4bc61ed5696503b17a5075..1b783fd5fa6d049b2aaa534ade4a1414de471d86 100644 (file)
@@ -28,6 +28,7 @@ class Paper_book
 
 public:
   SCM header_;
+  SCM header_0_;
   SCM scores_;
   Output_def *paper_;
   
index d3a7e8512f62a8352ac62c6ea6a8440d0a107936..0ad8a14be7dae14d570941756ff13dcb51845ca3 100644 (file)
@@ -20,6 +20,7 @@
 Paper_book::Paper_book ()
 {
   header_ = SCM_EOL;
+  header_0_ = SCM_EOL;
   pages_ = SCM_BOOL_F;
   scores_ = SCM_EOL;
   systems_ = SCM_BOOL_F;
@@ -43,6 +44,7 @@ Paper_book::mark_smob (SCM smob)
   if (b->paper_)
     scm_gc_mark (b->paper_->self_scm ());
   scm_gc_mark (b->header_);
+  scm_gc_mark (b->header_0_);
   scm_gc_mark (b->pages_);
   scm_gc_mark (b->scores_);
   return b->systems_;
@@ -124,16 +126,12 @@ Paper_book::classic_output (String outname)
   /* Generate all stencils to trigger font loads.  */
   systems ();
 
-  // ugh code dup
   SCM scopes = SCM_EOL;
   if (ly_c_module_p (header_))
     scopes = scm_cons (header_, scopes);
 
-#if 0
-  if (ly_c_module_p (scores_[0].header_))
-    scopes = scm_cons (scores_[0].header_, scopes);
-#endif  
-  //end ugh
+  if (ly_c_module_p (header_0_))
+    scopes = scm_cons (header_0_, scopes);
 
   String format = output_backend_global;
   String mod_nm = "scm framework-" + format;
@@ -251,10 +249,16 @@ Paper_book::systems ()
   for (SCM s = scm_reverse (scores_); s != SCM_EOL; s = scm_cdr (s))
     {
       if (ly_c_module_p (scm_car (s)))
-       header = scm_car (s);
+       {
+         header = scm_car (s);
+         if (header_0_ == SCM_EOL)
+           header_0_ = header;
+       }
       else if (scm_is_vector (scm_car (s)))
        {
          Stencil title = score_title (header);
+         if (title.is_empty ())
+           title = score_title (header_);
          if (!title.is_empty ())
            {
              Paper_system *ps = new Paper_system (title, true);
index 431c7b48a616423188beb1d196fbc1800f211727..cb4ac82b0d36974748cb7b6fdf42c9e40faa61c1 100644 (file)
@@ -84,4 +84,3 @@
    '("tex" "dvi" "ps" "pdf" "png"))
 
   new-fmts)
-