]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/beam-engraver.cc
use springs instead of fixed/distance pairs
[lilypond.git] / lily / beam-engraver.cc
index 0432218ce2a02337f4cdf732d395f67a54e23d09..90357c5264f0929718127e52518240d3597ac580 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 1998--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  (c) 1998--2007 Han-Wen Nienhuys <hanwen@xs4all.nl>
 */
 
 #include "beam.hh"
@@ -46,9 +46,9 @@ protected:
   /// moment (global time) where beam started.
   Moment beam_start_mom_;
 
-  bool subdivide_beams_;
-  Moment beat_length_;
-
+  Beaming_options beaming_options_;
+  Beaming_options finished_beaming_options_;
+  
   void typeset_beam ();
   void set_melisma (bool);
 
@@ -135,13 +135,17 @@ Beam_engraver::process_music ()
       beam_start_location_ = mp;
       beam_start_mom_ = now_mom ();
 
+      beaming_options_.from_context (context ());
       beam_info_ = new Beaming_pattern;
       /* urg, must copy to Auto_beam_engraver too */
     }
 
   typeset_beam ();
   if (stop_ev_ && beam_)
-    announce_end_grob (beam_, stop_ev_->self_scm ());
+    {
+      announce_end_grob (beam_, stop_ev_->self_scm ());
+      
+    }
 }
 
 void
@@ -151,8 +155,8 @@ Beam_engraver::typeset_beam ()
     {
       if (!finished_beam_->get_bound (RIGHT))
        finished_beam_->set_bound (RIGHT, finished_beam_->get_bound (LEFT));
-         
-      finished_beam_info_->beamify (context ());
+      
+      finished_beam_info_->beamify (finished_beaming_options_);
       Beam::set_beaming (finished_beam_, finished_beam_info_);
 
       delete finished_beam_info_;
@@ -179,7 +183,8 @@ Beam_engraver::stop_translation_timestep ()
     {
       finished_beam_ = beam_;
       finished_beam_info_ = beam_info_;
-
+      finished_beaming_options_ = beaming_options_;
+      
       stop_ev_ = 0;
       beam_ = 0;
       beam_info_ = 0;
@@ -210,7 +215,7 @@ Beam_engraver::acknowledge_rest (Grob_info info)
   if (beam_
       && !scm_is_number (info.grob ()->get_property_data ("staff-position")))
     {
-      chain_offset_callback (info.grob(),
+      chain_offset_callback (info.grob (),
                             Beam::rest_collision_callback_proc, Y_AXIS);
     }
 }