- scm = gh_list (ly_symbol2scm ("end-output"), SCM_UNDEFINED);
- outputter_l_->output_scheme (scm);
+ SCM scopes = SCM_EOL;
+ if (header_)
+ scopes = scm_cons (header_, scopes);
+ if (global_input_file->header_ && global_input_file->header_ != header_)
+ scopes = scm_cons (global_input_file->header_, scopes);
+
+ outputter_->output_metadata (scopes, paper_);
+
+#ifdef PAGE_LAYOUT
+ SCM make_title = scm_primitive_eval (ly_symbol2scm ("make-title"));
+ SCM b = ly_modules_lookup (scopes, ly_symbol2scm ("bookTitle"));
+ if (b != SCM_UNDEFINED && scm_variable_bound_p (b) == SCM_BOOL_T)
+ book_title_
+ = unsmob_stencil (gh_call2 (make_title, paper_->self_scm (),
+ scm_variable_ref (b)));
+
+ SCM s = ly_modules_lookup (scopes, ly_symbol2scm ("scoreTitle"));
+ if (s != SCM_UNDEFINED && scm_variable_bound_p (s) == SCM_BOOL_T)
+ score_title_
+ = unsmob_stencil (gh_call2 (make_title, paper_->self_scm (),
+ scm_variable_ref (s)));
+
+#if 0
+ // FIXME:
+ delete system_;
+ system_ = 0;
+#endif
+
+ /* Ugh: caller (Score) should do this, but does not know our flavor
+ (paper or midi). */
+ paper_book->paper_scores_.push (this);
+#else
+ output ();
+#endif
+}