+ int first_page_number
+ = robust_scm2int (paper_->c_variable ("first-page-number"), 1);
+ int first_performance_number = 0;
+
+ /* FIXME: We need a line-width for ps output (framework-ps.scm:92).
+ If we don't have any, we take the paper-width unless we know
+ better which line-width to choose (e.g. if there are \bookparts
+ with different line-widths) and why we need it at all.
+ */
+
+ if (paper_->c_variable ("line-width") == SCM_UNDEFINED)
+ paper_->set_variable (ly_symbol2scm ("line-width"),
+ paper_->c_variable ("paper-width"));
+
+ if (!output_aux (output_channel,
+ true,
+ &first_page_number,
+ &first_performance_number))
+ return;
+
+ SCM scopes = SCM_EOL;
+ if (ly_is_module (header_))
+ scopes = scm_cons (header_, scopes);
+
+ string mod_nm = "scm framework-" + get_output_backend_name ();
+
+ SCM mod = scm_c_resolve_module (mod_nm.c_str ());
+
+ if (get_program_option ("print-pages"))
+ {
+ SCM framework = ly_module_lookup (mod,
+ ly_symbol2scm ("output-framework"));
+
+ if (framework != SCM_BOOL_F)
+ {
+ SCM func = scm_variable_ref (framework);
+ scm_apply_0 (func, scm_list_n (output_channel,
+ self_scm (),
+ scopes,
+ dump_fields (),
+ SCM_UNDEFINED));
+ }
+ else
+ warning (_f ("program option -dprint-pages not supported by backend `%s'",
+ get_output_backend_name ()));
+ }
+
+ if (get_program_option ("preview"))
+ {
+ SCM framework
+ = ly_module_lookup (mod, ly_symbol2scm ("output-preview-framework"));
+
+ if (framework != SCM_BOOL_F)
+ {
+ SCM func = scm_variable_ref (framework);
+ scm_apply_0 (func, scm_list_n (output_channel,
+ self_scm (),
+ scopes,
+ dump_fields (),
+ SCM_UNDEFINED));
+ }
+ else
+ warning (_f ("program option -dpreview not supported by backend `%s'",
+ get_output_backend_name ()));
+ }
+}
+
+void
+Paper_book::classic_output_aux (SCM output,
+ int *first_performance_number)
+{
+ if (scm_is_pair (performances_))
+ {
+ SCM proc = ly_lily_module_constant ("write-performances-midis");
+ scm_call_3 (proc,
+ performances (),
+ output,
+ scm_long2num (*first_performance_number));
+ *first_performance_number += scm_ilength (performances_);
+ }
+