]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/beaming-info.cc
* input/regression/tie-chord.ly: use generateTiePattern to
[lilypond.git] / lily / beaming-info.cc
index 1165148b9415e729fc9ca56709c8a9d6d9d9d948..10f3681a5658a63196e4c7f92e00fe467782e864 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 1999--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  (c) 1999--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
 */
 
 #include "beaming.hh"
@@ -27,7 +27,7 @@ const int at_beat = 1 << 15;
 int
 Beaming_info_list::best_splitpoint_index (Moment &beat_length, bool subdivide) const
 {
-  int minden = INT_MAX;        
+  int minden = INT_MAX;
   int minidx = -1;
   Moment beat_pos;
 
@@ -74,10 +74,9 @@ Beaming_info_list::beamify (Moment &beat_length, bool subdivide)
   Direction d = LEFT;
 
   do
-    {
-      splits[d].beamify (beat_length, subdivide);
-    }
-  while (flip (&d) != LEFT);
+    splits[d].beamify (beat_length, subdivide);
+  while (flip (&d) != LEFT)
+    ;
 
   int middle_beams = (split ? 1
                      : min (splits[RIGHT].beam_extend_count (LEFT),
@@ -92,6 +91,8 @@ Beaming_info_list::beamify (Moment &beat_length, bool subdivide)
 
   infos_ = splits[LEFT].infos_;
   infos_.concat (splits[RIGHT].infos_);
+
+  clip_edges ();
 }
 
 void
@@ -99,3 +100,13 @@ Beaming_info_list::add_stem (Moment m, int b)
 {
   infos_.push (Beaming_info (m, b));
 }
+
+void
+Beaming_info_list::clip_edges ()
+{
+  if (infos_.size ())
+    {
+      infos_[0].beams_i_drul_[LEFT] = 0;
+      infos_.top().beams_i_drul_[RIGHT] = 0;
+    }
+}