source file of the GNU LilyPond music typesetter
- (c) 1997--2003 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
-#include "translator-group.hh"
-
+#include "context.hh"
#include "grob-info.hh"
#include "multi-measure-rest.hh"
#include "timing-translator.hh"
Moment last_moment_;
virtual void start_translation_timestep ();
+ virtual void initialize ();
virtual void stop_translation_timestep ();
public:
}
+void
+Timing_engraver::initialize ()
+{
+ Timing_translator::initialize ();
+
+ SCM which = get_property ("whichBar");
+ Moment now = now_mom ();
+
+ /* 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 ("|");
+
+ daddy_context_->set_property ("whichBar", which);
+}
+
void
Timing_engraver::start_translation_timestep ()
/* 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 ("|");
+ which = SCM_EOL;
Moment mp = measure_position ();
bool start_of_measure = (last_moment_.main_part_ != now.main_part_
{
Moment mlen = Moment (measure_length ());
unsmob_grob (get_property ("currentCommandColumn"))
- ->set_grob_property ("measure-length", mlen.smobbed_copy ());
+ ->set_property ("measure-length", mlen.smobbed_copy ());
}
if (!gh_string_p (which) && to_boolean (automatic_bars))
}
}
- 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 ();
-
}
/* 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}.",
+"@code{Staff}. "
+"\n\nThis engraver adds the alias @code{Timing} to its containing context."
+
+ ,
/* creats*/ "",
/* accepts */ "",
/* acks */ "",