]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.0.32
authorfred <fred>
Sun, 24 Mar 2002 19:32:15 +0000 (19:32 +0000)
committerfred <fred>
Sun, 24 Mar 2002 19:32:15 +0000 (19:32 +0000)
hdr/sccol.hh
src/calcideal.cc
src/sccol.cc

index 1d2f4022bbb9bd90de0ab062be548ded4a5042e3..8237822219d4d58197454df845f9b3c551029c7f 100644 (file)
 
     */
 
-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);
index 79db657588e043ef0a1eb93c6f1bfd7813d5a5ea..a656482e7dca39507df33c16aa3a760da04ec3e6 100644 (file)
@@ -20,7 +20,7 @@ Score::calc_idealspacing()
     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];
index 2d826094da5f51b725cb62553594b150e0e47a26..1722599b210ef089f4de69b5433468b6ec0ab0de 100644 (file)
@@ -1,3 +1,11 @@
+/*
+  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"
@@ -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();
+}