10 #include "sourcefile.hh"
15 *mlog << "\nProcessing music" << endl;
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();
44 for (iter_top(staffs_,i); i.ok(); i++)
47 for (iter_top(cols_,c); c.ok(); ) {
48 if (!c->pcol_l_->used()) {
57 this sux. We should have Score_column create the appropriate PCol.
58 Unfortunately, PCols don't know about their position.
60 PCursor<Score_column*>
61 Score::create_cols(Moment w)
63 Score_column* c1 = new Score_column(w);
64 Score_column* c2 = new Score_column(w);
72 assert(i->when() != w);
78 cols_.bottom().add(c1);
79 cols_.bottom().add(c2);
90 PCursor<Score_column*>
91 Score::find_col(Moment w,bool mus)
95 if (i->when() == w && i->musical_ == mus)
110 for (; i.ok(); i++) {
111 pscore_p_->add(i->pcol_l_);
113 clean_cols(); // can't move clean_cols() farther up.
119 for (iter_top(staffs_,i); i.ok(); i++) {
129 for (iter_top(staffs_,i); i.ok(); i++) {
131 assert(i->score_l_ == this);
135 for (iter_top(cols_,cc); cc.ok() && (cc+1).ok(); cc++) {
136 assert(cc->when() <= (cc+1)->when());
147 for (iter_top(staffs_,i); i.ok(); i++) {
150 for (iter_top(cols_,i); i.ok(); i++) {
160 Score::Score(Paperdef*p)
163 paper_p_ = p; // ?? safe?
175 Score::output(String s)
178 if (paper_p_->outfile=="")
179 paper_p_->outfile = s;
181 if ( errorlevel_i_ ) {
182 *mlog << "lilypond: warning: no output to: " << paper_p_->outfile
183 << " (errorlevel=" << errorlevel_i_ << ")" << endl;
187 *mlog << "output to " << paper_p_->outfile << "...\n";
189 Tex_stream the_output(paper_p_->outfile);
191 the_output << "% outputting Score, defined at: " <<
193 sourcefile_l (defined_ch_c_l_)->file_line_no_str(defined_ch_c_l_) << "\n";
194 pscore_p_->output(the_output);
203 staffs_.bottom().add(s);
207 Score::add_marks(Array<String> s_arr, Array<Moment> m_arr)
209 for (int i=0; i < s_arr.size(); i++) {
210 String mark_str (s_arr[i]);
211 if (markers_assoc_.elt_query(mark_str) &&
212 m_arr[i] != markers_assoc_[mark_str])
214 error("Conflicting marker: `" + s_arr[i]+ "\'");
216 markers_assoc_[s_arr[i]] = m_arr[i];