/*
- auto-beam-engraver.cc -- implement Auto_beam_engraver
+ auto-beam-engraver.cc -- implement Auto_beam_engraver
source file of the GNU LilyPond music typesetter
- (c) 1999--2004 Jan Nieuwenhuizen <janneke@gnu.org>
+ (c) 1999--2005 Jan Nieuwenhuizen <janneke@gnu.org>
*/
class Auto_beam_engraver : public Engraver
{
TRANSLATOR_DECLARATIONS (Auto_beam_engraver);
+
protected:
virtual void stop_translation_timestep ();
virtual void start_translation_timestep ();
/*
Determine end moment for auto beaming (or begin moment, but mostly
- 0==anywhere) In order of increasing priority:
+ 0== anywhere) In order of increasing priority:
i. begin anywhere, end at every beat
ii. end * <num> <den>
else
function = scm_list_n (ly_symbol2scm ("end"), SCM_UNDEFINED);
- Moment beat_length (1,4);
+ Moment beat_length (1, 4);
if (Moment * m = unsmob_moment (get_property ("beatLength")))
{
beat_length = *m;
}
- Moment measure_length (1,1);
+ Moment measure_length (1, 1);
int num = 4;
if (Moment* m = unsmob_moment (get_property ("measureLength")))
{
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));
+ beat_length_ = robust_scm2moment (get_property ("beatLength"), Moment(1, 4));
}
void
finished_beam_ = 0;
delete finished_grouping_;
- finished_grouping_= 0;
+ finished_grouping_ = 0;
}
}
void
Auto_beam_engraver::acknowledge_grob (Grob_info info)
{
+ /*
+ Duplicated from process_music(), since
+ Repeat_acknowledge_engraver::process_music() may also set whichBar
+ */
+ if (scm_is_string (get_property ("whichBar"))
+ && beam_start_moment_ < now_mom())
+ {
+ consider_end (shortest_mom_);
+ junk_beam ();
+ }
+
if (stems_)
{
if (Beam::has_interface (info.grob_))
count_ ++;
}
-ENTER_DESCRIPTION (Auto_beam_engraver,
+ADD_TRANSLATOR (Auto_beam_engraver,
/* descr */ "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 "