]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/beam.cc
* lily/ligature-bracket-engraver: Bugfix: Add missing stream event
[lilypond.git] / lily / beam.cc
index cf5e7c296c4728858a2499ba401f2b89a928f8d4..d114c69fc363f2caa5f73a5d16c1ef72988b536f 100644 (file)
@@ -26,7 +26,7 @@
 
 #include "beam.hh"
 
-#include "beaming.hh"
+#include "beaming-pattern.hh"
 #include "directional-element-interface.hh"
 #include "main.hh"
 #include "international.hh"
@@ -368,7 +368,7 @@ Beam::get_beam_segments (Grob *me_grob, Grob **common)
        i != stem_segments.end (); i++)
     {
       vector<Beam_stem_segment> segs = (*i).second;
-      vector_sort (segs, default_compare);
+      vector_sort (segs, less<Beam_stem_segment> ());
 
       Beam_segment current;
 
@@ -1169,8 +1169,6 @@ Beam::set_stem_lengths (SCM smob)
   for (vsize i = 0; i < stems.size (); i++)
     {
       Grob *s = stems[i];
-      if (Stem::is_invisible (s))
-       continue;
 
       bool french = to_boolean (s->get_property ("french-beaming"));
       Real stem_y = calc_stem_y (me, s, common,
@@ -1181,9 +1179,14 @@ Beam::set_stem_lengths (SCM smob)
        Make the stems go up to the end of the beam. This doesn't matter
        for normal beams, but for tremolo beams it looks silly otherwise.
       */
-      if (gap)
+      if (gap
+          && !Stem::is_invisible (s))
        stem_y += thick * 0.5 * get_grob_direction (s);
 
+      /*
+       Do set_stemend for invisible stems too, so tuplet brackets
+       have a reference point for sloping
+       */
       Stem::set_stemend (s, 2 * stem_y / staff_space);
     }
 
@@ -1191,7 +1194,7 @@ Beam::set_stem_lengths (SCM smob)
 }
 
 void
-Beam::set_beaming (Grob *me, Beaming_info_list const *beaming)
+Beam::set_beaming (Grob *me, Beaming_pattern const *beaming)
 {
   extract_grob_set (me, "stems", stems);
 
@@ -1208,11 +1211,11 @@ Beam::set_beaming (Grob *me, Beaming_info_list const *beaming)
          if (beaming_prop == SCM_EOL
              || index_get_cell (beaming_prop, d) == SCM_EOL)
            {
-             int count = beaming->infos_.at (i).beam_count_drul_[d];
+             int count = beaming->beamlet_count (i, d);
              if (i > 0
                  && i < stems.size () -1
                  && Stem::is_invisible (stem))
-               count = min (count, beaming->infos_.at (i).beam_count_drul_[-d]);
+               count = min (count, beaming->beamlet_count (i,-d));
 
              if ( ((i == 0 && d == LEFT)
                    || (i == stems.size ()-1 && d == RIGHT))
@@ -1301,7 +1304,7 @@ Beam::last_visible_stem (Grob *me)
 
   rest -> stem -> beam -> interpolate_y_position ()
 */
-MAKE_SCHEME_CALLBACK (Beam, rest_collision_callback, 2);
+MAKE_SCHEME_CALLBACK_WITH_OPTARGS (Beam, rest_collision_callback, 2, 1);
 SCM
 Beam::rest_collision_callback (SCM smob, SCM prev_offset)
 {