- Score_systems sc;
- sc.systems_ = systems;
- sc.header_ = scores_[i]->header_;
- sc.texts_ = scores_[i]->texts_;
- paper_book->score_systems_.push (sc);
+ 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))
+ {
+ SCM systems = pscore->get_paper_systems ();
+ if (ly_is_module (score->header_))
+ paper_book->add_score (score->header_);
+ paper_book->add_score (systems);
+ }
+
+ outputs = scm_cdr (outputs);
+ }