]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/paper-book.cc
Scons stuff
[lilypond.git] / lily / paper-book.cc
index cd9f4cbc45b1d60d7c78f75abce335a607be96c9..a424b66cf4602ab960155d1981cf9a992173774a 100644 (file)
@@ -219,6 +219,21 @@ set_system_penalty (Paper_system *ps, SCM header)
     }
 }
 
+void
+Paper_book::add_score_title (SCM header)
+{
+  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);
+      systems_ = scm_cons (ps->self_scm (), systems_);
+      scm_gc_unprotect_object (ps->self_scm ());
+      set_system_penalty (ps, header);
+    }
+}
+
 SCM
 Paper_book::systems ()
 {
@@ -250,20 +265,34 @@ Paper_book::systems ()
          if (header_0_ == SCM_EOL)
            header_0_ = header;
        }
-      else if (scm_is_vector (scm_car (s)))
+      else if (Music_output *mop = unsmob_music_output (scm_car (s)))
+       
        {
-         Stencil title = score_title (header);
-         if (title.is_empty ())
-           title = score_title (header_);
-         if (!title.is_empty ())
+         if (Paper_score *pscore = dynamic_cast<Paper_score *> (mop))
+           {
+             add_score_title (header);
+         
+             header = SCM_EOL;
+         
+             SCM system_list = scm_vector_to_list (pscore->get_paper_systems ());
+             system_list = scm_reverse (system_list);
+             systems_ = scm_append (scm_list_2 (system_list, systems_));
+           }
+         else
            {
-             Paper_system *ps = new Paper_system (title, true);
-             systems_ = scm_cons (ps->self_scm (), systems_);
-             scm_gc_unprotect_object (ps->self_scm ());
-             set_system_penalty (ps, header);
+             /*
+               Ignore MIDI
+             */
            }
+       }
+      else if (scm_is_vector (scm_car (s)))
+       {
+         /*
+           UGH. code dup.  
+         */
+         add_score_title (header);
          header = SCM_EOL;
-
+         
          SCM system_list = scm_vector_to_list (scm_car (s));
          system_list = scm_reverse (system_list);
          systems_ = scm_append (scm_list_2 (system_list, systems_));