2 score.cc -- implement Score
4 source file of the GNU LilyPond music typesetter
6 (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
9 #include "tex-stream.hh"
11 #include "score-column.hh"
14 #include "paper-def.hh"
17 #include "source-file.hh"
18 #include "midi-output.hh"
19 #include "midi-def.hh"
21 #include "music-iterator.hh"
23 #include "global-translator.hh"
25 extern String default_out_fn;
35 Score::Score(Score const &s)
38 music_p_ = s.music_p_->clone();
39 midi_p_ = new Midi_def(*s.midi_p_);
40 paper_p_ = new Paper_def(*s.paper_p_);
52 Score::run_translator(Global_translator * trans_l)
54 trans_l->set_score (this);
55 Music_iterator * iter = Music_iterator::static_get_iterator_p(music_p_,
57 iter->construct_children();
60 while ( iter->ok() || trans_l->moments_left_i() ) {
63 w = iter->next_moment();
66 trans_l->modify_next( w );
70 iter->process_and_next( w );
90 *mlog << "\nCreating MIDI elements ..." << flush;
92 Global_translator* score_trans= midi_p_->get_global_translator_p();
93 run_translator( score_trans );
97 // should we? hampers debugging.
98 warning( "Errors found, /*not processing score*/" );
111 *mlog << "\nCreating elements ..." << flush;
112 pscore_p_ = new PScore(paper_p_);
114 Global_translator * score_trans= paper_p_->get_global_translator_p();
115 run_translator( score_trans );
119 // should we? hampers debugging.
120 warning("Errors found, /*not processing score*/");
128 pscore_p_->process();
136 Score::set(Paper_def *pap_p)
143 Score::set(Midi_def* midi_p)
165 Score::paper_output()
167 if (paper_p_->outfile_str_=="")
168 paper_p_->outfile_str_ = default_out_fn + ".out";
170 if ( errorlevel_i_ ) {
171 *mlog << "lilypond: warning: no output to: " << paper_p_->outfile_str_
172 << " (errorlevel=" << errorlevel_i_ << ")" << endl;
176 *mlog << "TeX output to " << paper_p_->outfile_str_ << " ...\n";
178 Tex_stream the_output(paper_p_->outfile_str_);
180 the_output << "% outputting Score, defined at: " <<
181 location_str() << "\n";
182 pscore_p_->output(the_output);
193 if (midi_p_->outfile_str_ == "")
194 midi_p_->outfile_str_ = default_out_fn + ".midi";
196 *mlog << "midi output to " << midi_p_->outfile_str_ << " ...\n";
197 Midi_output(this, midi_p_);