#include "engraver.hh"
#include "protected-scm.hh"
#include "clef.hh"
+#include "pitch.hh"
/*
TODO: The representation of key sigs is all fucked.
virtual void initialize ();
virtual void finalize ();
virtual bool try_music (Music *ev);
- virtual void stop_translation_timestep ();
- virtual void start_translation_timestep ();
- virtual void process_music ();
+ PRECOMPUTED_VIRTUAL void stop_translation_timestep ();
+ PRECOMPUTED_VIRTUAL void process_music ();
virtual void acknowledge_grob (Grob_info);
};
cancellation_->set_property ("old-accidentals", last);
cancellation_->set_property ("c0-position",
get_property ("middleCPosition"));
-
}
item_->set_property ("new-accidentals", key);
}
if (!def)
{
SCM vis = get_property ("explicitKeySignatureVisibility");
- if (ly_c_procedure_p (vis))
+ if (ly_is_procedure (vis))
item_->set_property ("break-visibility", vis);
}
}
void
Key_engraver::acknowledge_grob (Grob_info info)
{
- if (Clef::has_interface (info.grob_))
+ if (Clef::has_interface (info.grob ()))
{
SCM c = get_property ("createKeyOnClefChange");
if (to_boolean (c))
create_key (false);
}
}
- else if (Bar_line::has_interface (info.grob_)
+ else if (Bar_line::has_interface (info.grob ())
&& scm_is_pair (get_property ("keySignature")))
{
create_key (true);
item_ = 0;
context ()->set_property ("lastKeySignature", get_property ("keySignature"));
cancellation_ = 0;
+ key_ev_ = 0;
}
void
r->get_property ("tonic"));
}
-void
-Key_engraver::start_translation_timestep ()
-{
- key_ev_ = 0;
-}
-
void
Key_engraver::initialize ()
{
Pitch p (0, 0, 0);
context ()->set_property ("tonic", p.smobbed_copy ());
-
}
+#include "translator.icc"
+
ADD_TRANSLATOR (Key_engraver,
/* descr */ "",
/* creats*/ "KeySignature",