]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/auto-beam-engraver.cc
Use the same line thickness as circle markup for box markup.
[lilypond.git] / lily / auto-beam-engraver.cc
index 4ff8d9d2b7c88e7632907e0651f02483ac90c55e..a98b05f48d953384474d5e5996fb023062b02eb1 100644 (file)
@@ -27,7 +27,6 @@ class Auto_beam_engraver : public Engraver
 
 protected:
   void stop_translation_timestep ();
-  void start_translation_timestep ();
   void process_music ();
   virtual void finalize ();
   virtual void derived_mark () const;
@@ -68,15 +67,17 @@ private:
   Moment beam_start_moment_;
   Moment beam_start_location_;
 
-  bool subdivide_beams_;
-  Moment beat_length_;
-
   // We act as if beam were created, and start a grouping anyway.
   Beaming_pattern *grouping_;
   SCM beam_settings_;
 
   Beaming_pattern *finished_grouping_;
 
+
+  Beaming_options beaming_options_;
+  Beaming_options finished_beaming_options_;
+  
+  
   void check_bar_property ();
 };
 
@@ -104,6 +105,16 @@ Auto_beam_engraver::check_bar_property ()
 void
 Auto_beam_engraver::process_music ()
 {
+  /*
+    don't beam over skips
+  */
+  if (stems_)
+    {
+      Moment now = now_mom ();
+      if (extend_mom_ < now)
+       end_beam ();
+    }
+
   if (scm_is_string (get_property ("whichBar")))
     {
       consider_end (shortest_mom_);
@@ -183,7 +194,7 @@ Auto_beam_engraver::create_beam ()
       return 0;
 
   /*
-    Can't use make_spanner_from_properties() because we have to use
+    Can't use make_spanner_from_properties () because we have to use
     beam_settings_.
   */
   Spanner *beam = new Spanner (beam_settings_);
@@ -207,6 +218,7 @@ Auto_beam_engraver::begin_beam ()
 
   stems_ = new vector<Item*>;
   grouping_ = new Beaming_pattern ();
+  beaming_options_.from_context (context ());
   beam_settings_ = updated_grob_properties (context (), ly_symbol2scm ("Beam"));
 
   beam_start_moment_ = now_mom ();
@@ -242,6 +254,7 @@ Auto_beam_engraver::end_beam ()
        {
          announce_end_grob (finished_beam_, SCM_EOL);
          finished_grouping_ = grouping_;
+         finished_beaming_options_ = beaming_options_;
        }
       delete stems_;
       stems_ = 0;
@@ -260,7 +273,7 @@ Auto_beam_engraver::typeset_beam ()
       if (!finished_beam_->get_bound (RIGHT))
        finished_beam_->set_bound (RIGHT, finished_beam_->get_bound (LEFT));
       
-      finished_grouping_->beamify (context ());
+      finished_grouping_->beamify (finished_beaming_options_);
       Beam::set_beaming (finished_beam_, finished_grouping_);
       finished_beam_ = 0;
 
@@ -269,26 +282,12 @@ Auto_beam_engraver::typeset_beam ()
     }
 }
 
-void
-Auto_beam_engraver::start_translation_timestep ()
-{
-  process_acknowledged_count_ = 0;
-  /*
-    don't beam over skips
-  */
-  if (stems_)
-    {
-      Moment now = now_mom ();
-      if (extend_mom_ < now)
-       end_beam ();
-    }
-  forbid_ = 0;
-}
-
 void
 Auto_beam_engraver::stop_translation_timestep ()
 {
   typeset_beam ();
+  process_acknowledged_count_ = 0;
+  forbid_ = 0;
 }
 
 void
@@ -389,7 +388,7 @@ Auto_beam_engraver::acknowledge_stem (Grob_info info)
                       durlog - 2);
   stems_->push_back (stem);
   last_add_mom_ = now;
-  extend_mom_ = max (extend_mom_, now) + get_event_length (ev);
+  extend_mom_ = max (extend_mom_, now) + get_event_length (ev, now);
 }
 
 void