10 #include "sourcefile.hh"
15 *mlog << "\nProcessing music ..." << flush;
18 if (last() == Moment(0)) {
19 warning("Need to have music in a score.", defined_ch_c_l_);
22 // distribute commands to disciples
23 pscore_p_ = new PScore(paper_p_);
24 for (iter_top(staffs_,i); i.ok(); i++) {
25 i->set_output(pscore_p_);
26 i->truncate_cols(last());
30 // do this after processing, staffs first have to generate PCols.
31 find_col(last(), false)->set_breakable();
46 for (iter_top(staffs_,i); i.ok(); i++)
49 for (iter_top(cols_,c); c.ok(); ) {
50 if (!c->pcol_l_->used()) {
59 this sux. We should have Score_column create the appropriate PCol.
60 Unfortunately, PCols don't know about their position.
62 PCursor<Score_column*>
63 Score::create_cols(Moment w)
65 Score_column* c1 = new Score_column(w);
66 Score_column* c2 = new Score_column(w);
74 assert(i->when() != w);
80 cols_.bottom().add(c1);
81 cols_.bottom().add(c2);
92 PCursor<Score_column*>
93 Score::find_col(Moment w, bool mus)
98 if (i->when() == w && i->musical_ == mus)
113 for (; i.ok(); i++) {
114 pscore_p_->add(i->pcol_l_);
116 clean_cols(); // can't move clean_cols() farther up.
123 for (iter_top(staffs_,i); i.ok(); i++) {
133 for (iter_top(staffs_,i); i.ok(); i++) {
135 assert(i->score_l_ == this);
139 for (iter_top(cols_,cc); cc.ok() && (cc+1).ok(); cc++) {
140 assert(cc->when() <= (cc+1)->when());
151 for (iter_top(staffs_,i); i.ok(); i++) {
154 for (iter_top(cols_,i); i.ok(); i++) {
164 Score::Score(Paperdef*paper_p)
179 Score::output(String s)
182 if (paper_p_->outfile=="")
183 paper_p_->outfile = s;
185 if ( errorlevel_i_ ) {
186 *mlog << "lilypond: warning: no output to: " << paper_p_->outfile
187 << " (errorlevel=" << errorlevel_i_ << ")" << endl;
191 *mlog << "output to " << paper_p_->outfile << "...\n";
193 Tex_stream the_output(paper_p_->outfile);
195 the_output << "% outputting Score, defined at: " <<
197 sourcefile_l (defined_ch_c_l_)->file_line_no_str(defined_ch_c_l_) << "\n";
198 pscore_p_->output(the_output);
207 staffs_.bottom().add(s);
211 Score::add_marks(Array<String> s_arr, Array<Moment> m_arr)
213 for (int i=0; i < s_arr.size(); i++) {
214 String mark_str (s_arr[i]);
215 if (markers_assoc_.elt_query(mark_str) &&
216 m_arr[i] != markers_assoc_[mark_str])
218 error("Conflicting marker: `" + s_arr[i]+ "\'");
220 markers_assoc_[s_arr[i]] = m_arr[i];