X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Ftiming-engraver.cc;h=53b326cd511932ac76641ef7ba3e54cba303e3ac;hb=b1323f33e9aa4b9eea05eefb8755c907d4d762d4;hp=dfdf4d51d02a5cf646379f95d122012db2d1601a;hpb=baf32731650d510882eeb52d02f4ca0c816c7c29;p=lilypond.git diff --git a/lily/timing-engraver.cc b/lily/timing-engraver.cc index dfdf4d51d0..53b326cd51 100644 --- a/lily/timing-engraver.cc +++ b/lily/timing-engraver.cc @@ -3,10 +3,9 @@ source file of the GNU LilyPond music typesetter - (c) 1997--2002 Han-Wen Nienhuys + (c) 1997--2004 Han-Wen Nienhuys */ -#include "translator-group.hh" -#include "command-request.hh" +#include "context.hh" #include "grob-info.hh" #include "multi-measure-rest.hh" #include "timing-translator.hh" @@ -19,16 +18,14 @@ class Timing_engraver : public Timing_translator, public Engraver { protected: - /* - Needed to know whether we're advancing in grace notes, or not. - */ + /* Needed to know whether we're advancing in grace notes, or not. */ Moment last_moment_; virtual void start_translation_timestep (); virtual void stop_translation_timestep (); public: - TRANSLATOR_DECLARATIONS(Timing_engraver); + TRANSLATOR_DECLARATIONS (Timing_engraver); }; @@ -44,28 +41,28 @@ Timing_engraver::start_translation_timestep () { Timing_translator::start_translation_timestep (); - SCM nonauto = get_property ("barNonAuto"); + SCM automatic_bars = get_property ("automaticBars"); Moment now = now_mom (); SCM which = get_property ("whichBar"); - /* - Set the first bar of the score? - */ + /* Set the first bar of the score? */ if (!gh_string_p (which)) which = (now.main_part_ || now.main_part_ == last_moment_.main_part_) ? SCM_EOL : scm_makfrom0str ("|"); Moment mp = measure_position (); - bool start_of_measure = (last_moment_.main_part_ != now.main_part_&& !mp.main_part_ ); + bool start_of_measure = (last_moment_.main_part_ != now.main_part_ + && !mp.main_part_); if (start_of_measure) { - Moment mlen = Moment(measure_length ()); - unsmob_grob (get_property ("currentCommandColumn"))->set_grob_property ("measure-length", mlen.smobbed_copy()); + Moment mlen = Moment (measure_length ()); + unsmob_grob (get_property ("currentCommandColumn")) + ->set_property ("measure-length", mlen.smobbed_copy ()); } - if (!gh_string_p (which) && !to_boolean (nonauto)) + if (!gh_string_p (which) && to_boolean (automatic_bars)) { SCM always = get_property ("barAlways"); @@ -76,25 +73,25 @@ Timing_engraver::start_translation_timestep () } } - daddy_trans_->set_property ("whichBar", which); + daddy_context_->set_property ("whichBar", which); } void Timing_engraver::stop_translation_timestep () { Timing_translator::stop_translation_timestep (); - daddy_trans_->set_property ("whichBar", SCM_EOL); + daddy_context_->set_property ("whichBar", SCM_EOL); last_moment_ = now_mom (); - } -ENTER_DESCRIPTION(Timing_engraver, -/* descr */ " Responsible for synchronizing timing information from staves. -Normally in @code{Score}. In order to create polyrhythmic music, -this engraver should be removed from @code{Score} and placed in -@code{Staff}.", +ENTER_DESCRIPTION (Timing_engraver, +/* descr */ " Responsible for synchronizing timing information from staves. " +"Normally in @code{Score}. In order to create polyrhythmic music, " +"this engraver should be removed from @code{Score} and placed in " +"@code{Staff}.", /* creats*/ "", -/* acks */ "", -/* reads */ "timeSignatureFraction barNonAuto whichBar barAlways defaultBarType skipBars timing oneBeat measureLength measurePosition currentBarNumber", +/* accepts */ "", +/* acks */ "", +/* reads */ "timeSignatureFraction automaticBars whichBar barAlways defaultBarType skipBars timing measureLength measurePosition currentBarNumber", /* write */ "");