X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fauto-beam-engraver.cc;h=af4f1fc2d9fc6ae4fae6ad689fe39bcb6df0ea80;hb=d664f5a7153ec2b1a1c4c9fba2d2174bf3140695;hp=9f5e53da69fa27b3dfa465fcc17cff9ef45c8c7f;hpb=ade2bb7da653fbd9d670590afd67376fe69c59dd;p=lilypond.git diff --git a/lily/auto-beam-engraver.cc b/lily/auto-beam-engraver.cc index 9f5e53da69..af4f1fc2d9 100644 --- a/lily/auto-beam-engraver.cc +++ b/lily/auto-beam-engraver.cc @@ -3,7 +3,7 @@ source file of the GNU LilyPond music typesetter - (c) 1999--2007 Jan Nieuwenhuizen + (c) 1999--2008 Jan Nieuwenhuizen */ #include "bar-line.hh" @@ -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; @@ -106,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_); @@ -273,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 @@ -307,27 +302,24 @@ Auto_beam_engraver::finalize () void -Auto_beam_engraver::acknowledge_beam (Grob_info info) +Auto_beam_engraver::acknowledge_beam (Grob_info /* info */) { - (void)info; check_bar_property (); if (stems_) end_beam (); } void -Auto_beam_engraver::acknowledge_bar_line (Grob_info info) +Auto_beam_engraver::acknowledge_bar_line (Grob_info /* info */) { - (void)info; check_bar_property (); if (stems_) end_beam (); } void -Auto_beam_engraver::acknowledge_rest (Grob_info info) +Auto_beam_engraver::acknowledge_rest (Grob_info /* info */) { - (void)info; check_bar_property (); if (stems_) end_beam (); @@ -390,10 +382,11 @@ Auto_beam_engraver::acknowledge_stem (Grob_info info) return; grouping_->add_stem (now - beam_start_moment_ + beam_start_location_, - durlog - 2); + durlog - 2, + Stem::is_invisible (stem)); 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 @@ -428,12 +421,16 @@ ADD_ACKNOWLEDGER (Auto_beam_engraver, bar_line); ADD_ACKNOWLEDGER (Auto_beam_engraver, beam); ADD_ACKNOWLEDGER (Auto_beam_engraver, rest); ADD_TRANSLATOR (Auto_beam_engraver, - /* doc */ "Generate beams based on measure characteristics and observed " - "Stems. Uses beatLength, measureLength and measurePosition to decide " - "when to start and stop a beam. Overriding beaming is done through " - "@ref{Stem_engraver} properties @code{stemLeftBeamCount} and " - "@code{stemRightBeamCount}. ", - /* create */ "Beam", + /* doc */ + "Generate beams based on measure characteristics and observed" + " Stems. Uses @code{beatLength}, @code{measureLength}, and" + " @code{measurePosition} to decide when to start and stop a" + " beam. Overriding beaming is done through" + " @ref{Stem_engraver} properties @code{stemLeftBeamCount} and" + " @code{stemRightBeamCount}.", + + /* create */ + "Beam ", /* read */ "autoBeaming " @@ -441,4 +438,6 @@ ADD_TRANSLATOR (Auto_beam_engraver, "beatLength " "subdivideBeams ", - /* write */ ""); + /* write */ + "" + );