10 #include "sourcefile.hh"
15 *mlog << "\nProcessing music ... ";
18 if (last() == Moment(0)) {
19 warning("Need to have music in a score.", defined_ch_c_l_);
21 // distribute commands to disciples
22 pscore_p_ = new PScore(paper_p_);
23 for (iter_top(staffs_,i); i.ok(); i++) {
24 i->truncate_cols(last());
25 i->set_output(pscore_p_);
29 // do this after processing, staffs first have to generate PCols.
30 find_col(last(), false)->set_breakable();
45 for (iter_top(staffs_,i); i.ok(); i++)
48 for (iter_top(cols_,c); c.ok(); ) {
49 if (!c->pcol_l_->used()) {
58 this sux. We should have Score_column create the appropriate PCol.
59 Unfortunately, PCols don't know about their position.
61 PCursor<Score_column*>
62 Score::create_cols(Moment w)
64 Score_column* c1 = new Score_column(w);
65 Score_column* c2 = new Score_column(w);
73 assert(i->when() != w);
79 cols_.bottom().add(c1);
80 cols_.bottom().add(c2);
91 PCursor<Score_column*>
92 Score::find_col(Moment w,bool mus)
96 if (i->when() == w && i->musical_ == mus)
111 for (; i.ok(); i++) {
112 pscore_p_->add(i->pcol_l_);
114 clean_cols(); // can't move clean_cols() farther up.
120 for (iter_top(staffs_,i); i.ok(); i++) {
130 for (iter_top(staffs_,i); i.ok(); i++) {
132 assert(i->score_l_ == this);
136 for (iter_top(cols_,cc); cc.ok() && (cc+1).ok(); cc++) {
137 assert(cc->when() <= (cc+1)->when());
148 for (iter_top(staffs_,i); i.ok(); i++) {
151 for (iter_top(cols_,i); i.ok(); i++) {
161 Score::Score(Paperdef*p)
164 paper_p_ = p; // ?? safe?
176 Score::output(String s)
179 if (paper_p_->outfile=="")
180 paper_p_->outfile = s;
182 if ( errorlevel_i_ ) {
183 *mlog << "lilypond: warning: no output to: " << paper_p_->outfile
184 << " (errorlevel=" << errorlevel_i_ << ")" << endl;
188 *mlog << "output to " << paper_p_->outfile << "...\n";
190 Tex_stream the_output(paper_p_->outfile);
192 the_output << "% outputting Score, defined at: " <<
194 sourcefile_l (defined_ch_c_l_)->file_line_no_str(defined_ch_c_l_) << "\n";
195 pscore_p_->output(the_output);
204 staffs_.bottom().add(s);
208 Score::add_marks(Array<String> s_arr, Array<Moment> m_arr)
210 for (int i=0; i < s_arr.size(); i++) {
211 String mark_str (s_arr[i]);
212 if (markers_assoc_.elt_query(mark_str) &&
213 m_arr[i] != markers_assoc_[mark_str])
215 error("Conflicting marker: `" + s_arr[i]+ "\'");
217 markers_assoc_[s_arr[i]] = m_arr[i];