]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.0.27
authorfred <fred>
Sun, 24 Mar 2002 19:30:13 +0000 (19:30 +0000)
committerfred <fred>
Sun, 24 Mar 2002 19:30:13 +0000 (19:30 +0000)
hdr/misc.hh
src/beam.cc
src/inputcommand.cc

index fa8787674814708e5495751e033da6e94ebc15f3..ae288151a27fab8165f7d386703f542b2ddfb464 100644 (file)
@@ -1,11 +1,14 @@
 #ifndef MISC_HH
 #define MISC_HH
 
+#include "proto.hh"
 #include "real.hh"
 #include "moment.hh"
+#include "scalar.hh"
 
 Moment wholes(int dur, int dots);
-    
+
+Rhythmic_grouping parse_grouping(const Array<Scalar> &a);    
 double log_2(double x) ;
 int intlog2(int d);
 inline int
index abf94d157b284e8acc8e62fae4e74209fb1e4320..52080a39ab4091da451fdbb6483fd02d4f215677 100644 (file)
@@ -1,3 +1,5 @@
+#include "varray.hh"
+
 #include "dimen.hh"
 #include "beam.hh"
 #include "misc.hh"
@@ -72,8 +74,8 @@ Beam::set_default_dir()
     int dirs[2];
     dirs[0]=0; dirs[1] =0;
     for (iter_top(stems,i); i.ok(); i++) {
-       i->set_default_dir();
-       dirs[(i->dir+1)/2] ++;
+       int d = i->get_default_dir();
+       dirs[(d+1)/2] ++;
     }
     dir =  (dirs[0] > dirs[1]) ? -1 : 1;
     for (iter_top(stems,i); i.ok(); i++) {
index 251adedc8586840569705802f516fb54124a7ff1..aab0ea4a8b8a69ec599ce3da8a52c16611806abb 100644 (file)
@@ -158,18 +158,24 @@ get_bar_command(String w)
 }
 
 Array<int>
-get_default_grouping(int count)
+get_default_grouping(int count, int one_beat_note)
 {
     Array<int> s;
     if (!(count % 3 )) {
-       for (int i=0; i < count/3; i++)
+       for (int i=0; i < count/3; i++) {
            s.push(3);
+           s.push(one_beat_note);
+       }
     } else if (!(count %2)) {
-       for (int i=0; i < count/2; i++)
+       for (int i=0; i < count/2; i++) {
            s.push(2);
+           s.push(one_beat_note);
+       }
+           
     }else {
        s.push(2);
-       s.concat(get_default_grouping(count-2));
+       s.push(one_beat_note);
+       s.concat(get_default_grouping(count-2, one_beat_note));
     }
     return s;
 }