#include "book.hh"
#include "global-context.hh"
#include "ly-module.hh"
-#include "input-file-results.hh"
#include "main.hh"
#include "music-iterator.hh"
#include "music-output-def.hh"
#include "music-output.hh"
#include "music.hh"
+#include "page.hh"
#include "paper-book.hh"
#include "paper-def.hh"
#include "score.hh"
: Input ()
{
header_ = SCM_EOL;
+ assert (!scores_.size ());
smobify_self ();
}
-#if 0
-Book::Book (Book const &src)
- : Input (src)
-{
- header_ = SCM_EOL;
- smobify_self ();
-
- int score_count = src.scores_.size ();
- for (int i = 0; i < score_count; i++)
- scores_.push (src.scores_[i]->clone ());
-
-#if 0
- header_ = ly_make_anonymous_module ();
- if (is_module (src.header_))
- ly_import_module (header_, src.header_);
-#endif
-}
-#endif
-
Book::~Book ()
{
}
{
if (paper)
paper_book->papers_.push (paper);
+
paper_book->scores_.push (systems);
- paper_book->global_headers_.push (global_input_file->header_);
+
+ // fixme.
+ //paper_book->global_headers_.push (global_input_file->header_);
//paper_book->headers_.push (scores_[i]->header_);
paper_book->headers_.push (header);
}
paper_book->output (outname);
scm_gc_unprotect_object (paper_book->self_scm ());
}
+
+/* FIXME: WIP, this is a hack. Return first page as stencil. */
+SCM
+Book::to_stencil (Music_output_def *default_def, SCM header)
+{
+ Paper_book *paper_book = new Paper_book ();
+ int score_count = scores_.size ();
+ for (int i = 0; i < score_count; i++)
+ {
+ Paper_def *paper = 0;
+ SCM systems = scores_[i]->book_rendering ("<markup>", default_def,
+ &paper);
+ if (systems != SCM_UNDEFINED)
+ {
+ if (paper)
+ paper_book->papers_.push (paper);
+ paper_book->scores_.push (systems);
+ paper_book->headers_.push (header);
+ }
+ }
+
+ SCM pages = paper_book->pages ();
+ paper_book = 0;
+ if (pages != SCM_EOL)
+ {
+ progress_indication (_f ("paper output to `%s'...", "<markup>"));
+ return (unsmob_page (ly_car (pages)))->to_stencil ();
+ }
+ return SCM_EOL;
+}