X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Ftime-signature-engraver.cc;h=d57b35bf6eae9bb95c04d2d0d1dde3d85c9f6764;hb=9ead371f45f0a0c98e86e8e32eb86ef75c3af5a4;hp=53205cbb6cec18727a15ec91714570e3969b1634;hpb=c054eb280fd9953596eb164f67b0f9d5555c5a32;p=lilypond.git diff --git a/lily/time-signature-engraver.cc b/lily/time-signature-engraver.cc index 53205cbb6c..d57b35bf6e 100644 --- a/lily/time-signature-engraver.cc +++ b/lily/time-signature-engraver.cc @@ -43,7 +43,7 @@ protected: void process_music (); public: TRANSLATOR_DECLARATIONS (Time_signature_engraver); - DECLARE_TRANSLATOR_LISTENER (time_signature); + void listen_time_signature (Stream_event *); }; void @@ -60,7 +60,6 @@ Time_signature_engraver::Time_signature_engraver () last_time_fraction_ = SCM_BOOL_F; } -IMPLEMENT_TRANSLATOR_LISTENER (Time_signature_engraver, time_signature); void Time_signature_engraver::listen_time_signature (Stream_event *ev) { @@ -80,7 +79,7 @@ Time_signature_engraver::process_music () time_signature_ = make_item ("TimeSignature", time_cause_); time_signature_->set_property ("fraction", fr); - if (last_time_fraction_ == SCM_BOOL_F) + if (scm_is_false (last_time_fraction_)) time_signature_->set_property ("break-visibility", get_property ("initialTimeSignatureVisibility")); @@ -104,9 +103,9 @@ Time_signature_engraver::process_music () void Time_signature_engraver::stop_translation_timestep () { - if (time_signature_ && (time_cause_ != SCM_EOL)) + if (time_signature_ && !scm_is_null (time_cause_)) { - Moment *mp = Moment::unsmob (get_property ("measurePosition")); + Moment *mp = unsmob (get_property ("measurePosition")); if (mp && (mp->main_part_ > Rational (0)) && !to_boolean (get_property ("partialBusy"))) time_signature_->warning ("mid-measure time signature without \\partial"); @@ -116,7 +115,11 @@ Time_signature_engraver::stop_translation_timestep () time_cause_ = SCM_EOL; } -#include "translator.icc" +void +Time_signature_engraver::boot () +{ + ADD_LISTENER (Time_signature_engraver, time_signature); +} ADD_TRANSLATOR (Time_signature_engraver, /* doc */