class Clef_engraver : public Engraver
{
public:
- VIRTUAL_COPY_CONS (Translator);
- Clef_engraver ();
+ TRANSLATOR_DECLARATIONS(Clef_engraver);
Direction octave_dir_;
virtual void start_translation_timestep ();
virtual void process_music ();
virtual void acknowledge_grob (Grob_info);
- virtual void do_creation_processing ();
private:
Item * clef_p_;
Item * octavate_p_;
void
Clef_engraver::acknowledge_grob (Grob_info info)
{
- Item * item =dynamic_cast <Item *> (info.elem_l_);
+ Item * item =dynamic_cast <Item *> (info.grob_l_);
if (item)
{
- if (Bar::has_interface (info.elem_l_)
+ if (Bar::has_interface (info.grob_l_)
&& gh_string_p (get_property ("clefGlyph")))
create_clef ();
- if (Key_item::has_interface (item))
- {
- /*
- Key_item adapts its formatting to make sure that the
- accidentals stay in the upper half of the staff. It needs
- to know c0-pos for this. (?)
- */
-
- item->set_grob_property ("c0-position", get_property ("centralCPosition"));
- }
}
}
clef_p_ = c;
}
- Staff_symbol_referencer::set_position (clef_p_,
- gh_scm2int (get_property ("clefPosition")));
+ SCM cpos = get_property ("clefPosition");
+
+ if (gh_number_p (cpos))
+ Staff_symbol_referencer::set_position (clef_p_, gh_scm2int (cpos));
SCM oct = get_property ("clefOctavation");
if (gh_number_p (oct) && gh_scm2int (oct))
inspect_clef_properties ();
}
-/*
- this must be done in creation_proc() since grace notes will be
- processed before Clef_engraver::prcoess_music()
-
- Grace notes and clef changes are still broken.
-*/
-void
-Clef_engraver::do_creation_processing ()
-{
- inspect_clef_properties ();
-}
-
void
Clef_engraver::inspect_clef_properties ()
{
{
}
-ADD_THIS_TRANSLATOR (Clef_engraver);
+
+ENTER_DESCRIPTION(Clef_engraver,
+/* descr */ "Determine and set reference point for pitches",
+/* creats*/ "Clef OctavateEight",
+/* acks */ "bar-line-interface",
+/* reads */ "clefPosition clefGlyph centralCPosition clefOctavation explicitClefVisibility",
+/* write */ "");