+
+void
+Paper_def::reset_default_count()
+{
+ default_count_i_ = 0;
+}
+
+extern char const* lily_version_number_sz ();
+
+Paper_outputter*
+Paper_def::paper_outputter_p (Paper_stream* os_p, Header* header_l, String origin_str) const
+{
+ Paper_outputter* p = new Paper_outputter (os_p);
+
+ // for now; breaks -fscm output
+ p->output_comment (_ ("outputting Score, defined at: "));
+ p->output_comment (origin_str);
+
+ p->output_version();
+ if (header_global_p)
+ p->output_scope (header_global_p, "mudela");
+ if (header_l)
+ p->output_scope (header_l, "mudela");
+ if (scope_p_)
+ p->output_scope (scope_p_, "mudelapaper");
+
+ if (output_global_ch == String("tex"))
+ {
+ *p->outstream_l_ << *scope_p_->elem ("texsetting")->access_content_String (false);
+ }
+
+
+ SCM scm = gh_list (ly_symbol ("experimental-on"), SCM_UNDEFINED);
+ p->output_scheme (scm);
+ scm = gh_list (ly_symbol ("header-end"), SCM_UNDEFINED);
+ p->output_scheme (scm);
+
+ return p;
+}
+
+Paper_stream*
+Paper_def::paper_stream_p () const
+{
+ String outname = base_output_str ();
+
+ if (outname != "-")
+ outname += String (".") + output_global_ch;
+ *mlog << _f ("Paper output to %s...",
+ outname == "-" ? String ("<stdout>") : outname) << endl;
+
+ target_str_global_array.push (outname);
+ return new Paper_stream (outname);
+}
+
+
+String
+Paper_def::base_output_str () const
+{
+ String str = get_default_output ();
+
+ if (str.empty_b ())
+ {
+ str = default_outname_base_global;
+ int def = get_next_default_count ();
+ if (def)
+ str += "-" + to_str (def);
+ }
+ return str;
+}
+