- Music_output * output = trans_p->get_output_p();
- delete trans_p;
- *mlog << endl << _f ("time: %.2f seconds", timer.read ()) << flush;
+/*
+ Format score, return list of Music_output objects.
+
+ LAYOUTBOOK should be scaled already.
+*/
+SCM
+Score::book_rendering (Output_def *layoutbook,
+ Output_def *default_def)
+{
+ if (error_found_)
+ return SCM_EOL;
+
+ SCM scaled_bookdef = SCM_EOL;
+ Real scale = 1.0;
+
+ if (layoutbook && layoutbook->c_variable ("is-paper") == SCM_BOOL_T)
+ scale = scm_to_double (layoutbook->c_variable ("output-scale"));
+
+ SCM outputs = SCM_EOL;
+ SCM *tail = &outputs;
+
+ int outdef_count = defs_.size ();
+
+ for (int i = 0; !i || i < outdef_count; i++)
+ {
+ Output_def *def = outdef_count ? defs_[i] : default_def;
+ SCM scaled = SCM_EOL;
+
+ if (def->c_variable ("is-layout") == SCM_BOOL_T)
+ {
+ def = scale_output_def (def, scale);
+ def->parent_ = layoutbook;
+
+ scaled = def->unprotect ();
+ }
+
+ /* TODO: fix or junk --no-layout. */
+ SCM context = ly_run_translator (music_, def->self_scm ());
+ if (dynamic_cast<Global_context *> (unsmob_context (context)))
+ {
+ SCM s = ly_format_output (context);