*/
-struct Score_column {
+class Score_column {
+ friend class Score;
+ friend class Score_walker;
+ bool musical_b_;
+ Moment when_;
+ void set_breakable();
+public:
/// indirection to column
PCol * pcol_l_;
/// length of notes/rests in this column
Array<Moment> durations;
-
- bool musical_;
-
/* *************** */
+
Moment when() { return when_; }
Score_column(Moment when);
static int compare(Score_column & c1, Score_column &c2);
void add_duration(Moment );
void preprocess();
- void set_breakable();
+ bool breakable_b();
+ bool musical_b() { return musical_b_; }
bool used();
void print() const;
-private:
- Moment when_;
+
};
instantiate_compare(Score_column&, Score_column::compare);
for (; i.ok(); i++) {
assert(i->used());
PCursor<Score_column*> j(i+1);
- if (i->musical_) {
+ if (i->musical_b()) {
assert(j.ok());
for (int n=0; n < i->durations.size(); n++) {
Moment d = i->durations[n];
+/*
+ sccol.cc -- implement Score_column
+
+ source file of the LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
#include "debug.hh"
#include "pcol.hh"
#include "sccol.hh"
{
when_ = w;
pcol_l_ = new PCol(0);
- musical_ = false;
+ musical_b_ = false;
}
bool
Score_column::print() const
{
#ifndef NPRINT
- mtor << "Score_column { mus "<< musical_ <<" at " << when_<<'\n';
+ mtor << "Score_column { mus "<< musical_b_ <<" at " << when_<<'\n';
mtor << "durations: [";
for (int i=0; i < durations.size(); i++)
mtor << durations[i] << " ";
}
int
-Tdescription_compare(Moment &a , Moment& b)
+Moment_compare(Moment &a , Moment& b)
{
return sign(a-b);
}
void
Score_column::preprocess()
{
- durations.sort(Tdescription_compare);
+ durations.sort(Moment_compare);
}
void
Score_column::add_duration(Moment d)
}
durations.push(d);
}
+
+bool
+Score_column::breakable_b()
+{
+ return pcol_l_->breakable_b();
+}