From fec8abc37d2378506f8a8903b5acd6698df12d22 Mon Sep 17 00:00:00 2001 From: fred Date: Sun, 24 Mar 2002 19:32:15 +0000 Subject: [PATCH] lilypond-0.0.32 --- hdr/sccol.hh | 18 +++++++++++------- src/calcideal.cc | 2 +- src/sccol.cc | 22 ++++++++++++++++++---- 3 files changed, 30 insertions(+), 12 deletions(-) diff --git a/hdr/sccol.hh b/hdr/sccol.hh index 1d2f4022bb..8237822219 100644 --- a/hdr/sccol.hh +++ b/hdr/sccol.hh @@ -21,29 +21,33 @@ */ -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 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); diff --git a/src/calcideal.cc b/src/calcideal.cc index 79db657588..a656482e7d 100644 --- a/src/calcideal.cc +++ b/src/calcideal.cc @@ -20,7 +20,7 @@ Score::calc_idealspacing() for (; i.ok(); i++) { assert(i->used()); PCursor 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]; diff --git a/src/sccol.cc b/src/sccol.cc index 2d826094da..1722599b21 100644 --- a/src/sccol.cc +++ b/src/sccol.cc @@ -1,3 +1,11 @@ +/* + sccol.cc -- implement Score_column + + source file of the LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys +*/ + #include "debug.hh" #include "pcol.hh" #include "sccol.hh" @@ -18,7 +26,7 @@ Score_column::Score_column(Moment w) { when_ = w; pcol_l_ = new PCol(0); - musical_ = false; + musical_b_ = false; } bool @@ -30,7 +38,7 @@ void 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] << " "; @@ -41,7 +49,7 @@ Score_column::print() const } int -Tdescription_compare(Moment &a , Moment& b) +Moment_compare(Moment &a , Moment& b) { return sign(a-b); } @@ -49,7 +57,7 @@ Tdescription_compare(Moment &a , Moment& b) void Score_column::preprocess() { - durations.sort(Tdescription_compare); + durations.sort(Moment_compare); } void Score_column::add_duration(Moment d) @@ -61,3 +69,9 @@ Score_column::add_duration(Moment d) } durations.push(d); } + +bool +Score_column::breakable_b() +{ + return pcol_l_->breakable_b(); +} -- 2.39.5