]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.0.14
authorfred <fred>
Tue, 3 Dec 1996 23:54:59 +0000 (23:54 +0000)
committerfred <fred>
Tue, 3 Dec 1996 23:54:59 +0000 (23:54 +0000)
hdr/sccol.hh
hdr/stcol.hh
src/sccol.cc
src/stcol.cc

index f8aceb23040813329b40cf6496fd78e3ea688564..b61a02682f10aefd1cc01f281ad02ab2763bad6f 100644 (file)
@@ -29,6 +29,8 @@ struct Score_column {
     static int compare(Score_column & c1, Score_column &c2) {
        return sgn(c1.when - c2.when);
     }
+    void add_duration(Real );
+    void preprocess();
     void set_breakable() {
         pcol_->set_breakable();
     }
index 17469a4db54accd50a224a654c719fcd5136e195..a620f8795d65c77e007d5b1a43cee4812f9d06fa 100644 (file)
@@ -26,6 +26,7 @@ struct Staff_column {
     bool mus() const;
     Real when() const;
     void add(Voice_element*ve);
+
     /****************************************************************
       VIRTUAL
     ****************************************************************/
index c29d26cf4a3b98e9ca844da4c517bcf1bffc0119..be242059af5d2f8193ca0126021bce5eb79239a4 100644 (file)
@@ -26,3 +26,24 @@ Score_column::print() const
     mtor << "}\n";
 #endif
 }
+
+int
+Real_compare(Real &a , Real& b)
+{
+    return sgn(a-b);
+}
+
+void
+Score_column::preprocess()
+{
+    durations.sort(Real_compare);
+}
+void
+Score_column::add_duration(Real d)
+{
+    for (int i = 0; i< durations.sz(); i++) {
+       if (d == durations[i])
+           return ;
+    }
+    durations.add(d);
+}
index 799daed31641fa4aa23e078a8edc7f4429b29821..abb27d17da8023f10fa396f634a546053c668ebf 100644 (file)
@@ -19,7 +19,7 @@ Staff_column::add(Voice_element*ve)
 {
     Real d= ve->duration;
     if (d){
-       score_column->durations.add(d);
+       score_column->add_duration(d);
     }
        
     v_elts.add(ve);
@@ -28,3 +28,4 @@ Staff_column::add(Voice_element*ve)
 Staff_column::Staff_column(Score_column*s) {
     score_column = s;
 }
+