- if (paper)
- paper_book->papers_.push (paper);
- paper_book->scores_.push (systems);
-
- // fixme.
- //paper_book->global_headers_.push (global_input_file->header_);
- //paper_book->headers_.push (scores_[i]->header_);
- paper_book->headers_.push (header);
+ SCM outputs = score
+ ->book_rendering (paper_book->paper_, default_layout, key);
+
+ while (scm_is_pair (outputs))
+ {
+ Music_output *output = unsmob_music_output (scm_car (outputs));
+
+ if (Performance *perf = dynamic_cast<Performance *> (output))
+ paper_book->add_performance (perf->self_scm ());
+ else if (Paper_score *pscore = dynamic_cast<Paper_score *> (output))
+ {
+ if (ly_is_module (score->header_))
+ paper_book->add_score (score->header_);
+ paper_book->add_score (pscore->self_scm ());
+ }
+
+ outputs = scm_cdr (outputs);
+ }