]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/auto-beam-engraver.cc
Fix some bugs in the dynamic engraver and PostScript backend
[lilypond.git] / lily / auto-beam-engraver.cc
index b7a92690571cfe26ce17bbae0468a85f436df170..5ced1d2cfef9815647a5fa0730dc2afa075c1065 100644 (file)
@@ -7,7 +7,7 @@
 */
 
 #include "engraver.hh"
-#include "beaming.hh"
+#include "beaming-pattern.hh"
 #include "beam.hh"
 #include "stem.hh"
 #include "warn.hh"
@@ -56,7 +56,7 @@ private:
   */
   Moment shortest_mom_;
   Spanner *finished_beam_;
-  Link_array__Item_ *stems_;
+  vector<Item*> *stems_;
 
   int process_acknowledged_count_;
   Moment last_add_mom_;
@@ -71,10 +71,10 @@ private:
   Moment beat_length_;
 
   // We act as if beam were created, and start a grouping anyway.
-  Beaming_info_list *grouping_;
+  Beaming_pattern *grouping_;
   SCM beam_settings_;
 
-  Beaming_info_list *finished_grouping_;
+  Beaming_pattern *finished_grouping_;
 
   void check_bar_property ();
 };
@@ -210,15 +210,13 @@ Auto_beam_engraver::begin_beam ()
       return;
     }
 
-  stems_ = new Link_array__Item_;
-  grouping_ = new Beaming_info_list;
+  stems_ = new vector<Item*>;
+  grouping_ = new Beaming_pattern ();
   beam_settings_ = updated_grob_properties (context (), ly_symbol2scm ("Beam"));
 
   beam_start_moment_ = now_mom ();
   beam_start_location_
     = robust_scm2moment (get_property ("measurePosition"), Moment (0));
-  subdivide_beams_ = ly_scm2bool (get_property ("subdivideBeams"));
-  beat_length_ = robust_scm2moment (get_property ("beatLength"), Moment (1, 4));
 }
 
 void
@@ -260,7 +258,10 @@ Auto_beam_engraver::typeset_beam ()
 {
   if (finished_beam_)
     {
-      finished_grouping_->beamify (beat_length_, subdivide_beams_);
+      if (!finished_beam_->get_bound (RIGHT))
+       finished_beam_->set_bound (RIGHT, finished_beam_->get_bound (LEFT));
+      
+      finished_grouping_->beamify (context ());
       Beam::set_beaming (finished_beam_, finished_grouping_);
       finished_beam_ = 0;