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"
20 #include "audio-score.hh"
22 #include "music-iterator.hh"
24 #include "global-translator.hh"
26 extern String default_out_fn;
37 Score::Score(Score const &s)
40 music_p_ = s.music_p_->clone();
41 midi_p_ = new Midi_def(*s.midi_p_);
42 paper_p_ = new Paper_def(*s.paper_p_);
49 delete audio_score_p_;
55 Score::run_translator(Global_translator * trans_l)
57 trans_l->set_score (this);
58 Music_iterator * iter = Music_iterator::static_get_iterator_p(music_p_,
60 iter->construct_children();
63 while ( iter->ok() || trans_l->moments_left_i() ) {
64 Moment w = infinity_mom;
66 w = iter->next_moment();
69 trans_l->modify_next( w );
73 iter->process_and_next( w );
94 *mlog << "\nCreating MIDI elements ..." << flush;
95 audio_score_p_ = new Audio_score( midi_p_ );
97 Global_translator* score_trans= midi_p_->get_global_translator_p();
98 run_translator( score_trans );
102 // should we? hampers debugging.
103 warning( "Errors found, /*not processing score*/" );
115 *mlog << "\nCreating elements ..." << flush;
116 pscore_p_ = new PScore(paper_p_);
118 Global_translator * score_trans= paper_p_->get_global_translator_p();
119 run_translator( score_trans );
123 // should we? hampers debugging.
124 warning("Errors found, /*not processing score*/");
130 pscore_p_->process();
138 Score::set(Paper_def *pap_p)
145 Score::set(Midi_def* midi_p)
167 Score::paper_output()
169 if (paper_p_->outfile_str_=="")
170 paper_p_->outfile_str_ = default_out_fn + ".out";
172 if ( errorlevel_i_ ) {
173 *mlog << "lilypond: warning: no output to: " << paper_p_->outfile_str_
174 << " (errorlevel=" << errorlevel_i_ << ")" << endl;
178 *mlog << "TeX output to " << paper_p_->outfile_str_ << " ...\n";
180 Tex_stream the_output(paper_p_->outfile_str_);
182 the_output << "% outputting Score, defined at: " <<
183 location_str() << "\n";
184 pscore_p_->output(the_output);
195 if (midi_p_->outfile_str_ == "")
196 midi_p_->outfile_str_ = default_out_fn + ".midi";
198 *mlog << "midi output to " << midi_p_->outfile_str_ << " ...\n";
199 Midi_output(this, midi_p_);