lilypond-0.1.26
[lilypond.git] / lily / score-column.cc
blob1827c046393de0e10719120ea9078ec6b8d16928
1 /*
2 score-column.cc -- implement Score_column
4 source file of the GNU LilyPond music typesetter
6 (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
7 */
9 #include "debug.hh"
10 #include "p-col.hh"
11 #include "score-column.hh"
13 Score_column::Score_column (Moment w)
15 when_ = w;
16 musical_b_ = false;
19 void
20 Score_column::do_print() const
22 #ifndef NPRINT
23 DOUT << "mus "<< musical_b_ <<" at " << when_<<'\n';
24 DOUT << "durations: [";
25 for (int i=0; i < durations.size(); i++)
26 DOUT << durations[i] << " ";
27 DOUT << "]\n";
28 Paper_column::do_print();
29 #endif
32 int
33 Moment_compare (Moment const &m1, Moment const &m2)
35 return sign (m1-m2);
38 void
39 Score_column::preprocess()
41 durations.sort (Moment_compare);
44 void
45 Score_column::add_duration (Moment d)
47 assert (d);
48 for (int i = 0; i< durations.size(); i++)
50 if (d == durations[i])
51 return ;
53 durations.push (d);
56 IMPLEMENT_IS_TYPE_B1(Score_column, Paper_column);