#include "translator-group.hh"
#include "key-item.hh"
-#include "local-key-item.hh"
#include "bar.hh"
-#include "note-head.hh"
#include "staff-symbol-referencer.hh"
#include "debug.hh"
#include "engraver.hh"
#include "direction.hh"
#include "side-position-interface.hh"
#include "item.hh"
-#include "custos.hh"
-/// where is c-0 in the staff?
+
class Clef_engraver : public Engraver
{
public:
protected:
virtual void stop_translation_timestep ();
virtual void start_translation_timestep ();
- virtual void create_grobs ();
+ virtual void process_music ();
virtual void acknowledge_grob (Grob_info);
-
+ virtual void do_creation_processing ();
private:
Item * clef_p_;
Item * octavate_p_;
void create_clef ();
void set_central_c (SCM, SCM, SCM);
void set_glyph ();
+ void inspect_clef_properties ();
};
Clef_engraver::Clef_engraver ()
void
Clef_engraver::acknowledge_grob (Grob_info info)
{
- create_grobs ();
Item * item =dynamic_cast <Item *> (info.elem_l_);
if (item)
{
if (Bar::has_interface (info.elem_l_)
&& gh_string_p (get_property ("clefGlyph")))
create_clef ();
-
- if (Note_head::has_interface (item)
- || Local_key_item::has_interface (item)
- || Custos::has_interface (item)
- )
- {
- int p = int (Staff_symbol_referencer::position_f (item))
- + gh_scm2int (get_property ("centralCPosition"));
- Staff_symbol_referencer::set_position (item, p);
- }
- else if (Key_item::has_interface (item))
+ if (Key_item::has_interface (item))
{
/*
Key_item adapts its formatting to make sure that the
}
void
-Clef_engraver::create_grobs ()
+Clef_engraver::process_music ()
+{
+ 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 ()
{
SCM glyph = get_property ("clefGlyph");
SCM clefpos = get_property ("clefPosition");