]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/score-column.cc
release: 0.1.8
[lilypond.git] / lily / score-column.cc
index 4387630e8da88cbc955a2c81f1961fe1a1a16558..9accf652a91627ca76c088eb38f510092d909102 100644 (file)
@@ -1,77 +1,67 @@
 /*
   score-column.cc -- implement Score_column
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
 
 #include "debug.hh"
-#include "pcol.hh"
+#include "p-col.hh"
 #include "score-column.hh"
 
-int
-Score_column::compare(Score_column & c1, Score_column &c2)
-{
-       return sign(c1.when_ - c2.when_);
-}
-
-void
-Score_column::set_breakable()
-{
-    pcol_l_->set_breakable();
-}
-
-Score_column::Score_column(Moment w)
+Score_column::Score_column (Moment w)
 {
     when_ = w;
-    pcol_l_ = new PCol(0);
     musical_b_ = false;
 }
 
-bool
-Score_column::used_b() {
-    return pcol_l_->used_b();
-}
-
 void
 Score_column::print() const
 {
 #ifndef NPRINT
-    mtor << "Score_column { mus "<< musical_b_ <<" at " <<  when_<<'\n';
-    mtor << "durations: [";
+    DOUT << "Score_column { mus "<< musical_b_ <<" at " <<  when_<<'\n';
+    DOUT << "durations: [";
     for (int i=0; i < durations.size(); i++)
-       mtor << durations[i] << " ";
-    mtor << "]\n";
-    pcol_l_->print();
-    mtor << "}\n";
+       DOUT << durations[i] << " ";
+    DOUT << "]\n";
+    PCol::print();
+    DOUT << "}\n";
 #endif
 }
 
 int
-Moment_compare(Moment &a , Moment& b)
+Moment_compare (Moment const &m1, Moment const &m2)
 {
-    return sign(a-b);
+    return sign (m1-m2);
 }
 
 void
 Score_column::preprocess()
 {
-    durations.sort(Moment_compare);
+    durations.sort (Moment_compare);
 }
+
 void
-Score_column::add_duration(Moment d)
+Score_column::add_duration (Moment d)
 {
-    assert(d);
+    assert (d);
     for (int i = 0; i< durations.size(); i++) {
        if (d == durations[i])
            return ;
     }
-    durations.push(d);
+    durations.push (d);
 }
 
-bool
-Score_column::breakable_b()
+void
+Score_column::do_set_breakable()
 {
-    return pcol_l_->breakable_b();
+    Score_column *c1 = new Score_column (when_);
+    Score_column *c2 = new Score_column (when_);
+    prebreak_p_ =c1;
+    postbreak_p_ = c2;
+    c1->durations = durations;
+    c2->durations = durations;
+    c1->musical_b_ 
+       = c2->musical_b_ = musical_b_;
 }