2 mark-engraver.cc -- implement Metronome_mark_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 1998--2004 Jan Nieuwenhuizen <janneke@gnu.org>
11 #include "note-column.hh"
12 #include "bar-line.hh"
13 #include "time-signature.hh"
14 #include "engraver.hh"
15 #include "engraver-group-engraver.hh"
20 put stuff over or next to bars. Examples: bar numbers, marginal notes,
23 class Metronome_mark_engraver : public Engraver
26 TRANSLATOR_DECLARATIONS (Metronome_mark_engraver);
32 void create_items (Music*);
34 virtual void stop_translation_timestep ();
35 virtual bool try_music (Music *ev);
36 virtual void process_music ();
39 Metronome_mark_engraver::Metronome_mark_engraver ()
46 Metronome_mark_engraver::stop_translation_timestep ()
50 Grob*mc = unsmob_grob (get_property( "currentMusicalColumn"));
51 text_->set_parent (mc, X_AXIS);
52 text_->set_property ("side-support-elements" , get_property ("stavesFound"));
61 Metronome_mark_engraver::create_items (Music *rq)
66 text_ = make_item ("MetronomeMark", rq->self_scm () );
72 Metronome_mark_engraver::try_music (Music* r)
79 Metronome_mark_engraver::process_music ()
83 create_items (mark_ev_);
85 SCM proc = get_property ("metronomeMarkFormatter");
86 SCM result= scm_call_2 (proc, mark_ev_->self_scm (),
87 context ()->self_scm ());
89 text_->set_property ("text", result);
93 ENTER_DESCRIPTION (Metronome_mark_engraver,
94 /* descr */ "Engrave metro nome marking. This delegates the formatting work "
95 "to the function in the metronomeMarkFormatter property. "
96 "The mark is put over all staves. "
97 "The staves are taken from the @code{stavesFound} property, "
98 "which is maintained by @code{@ref{Staff_collecting_engraver}}. "
101 /* creats*/ "MetronomeMark",
102 /* accepts */ "metronome-change-event",
104 /* reads */ "stavesFound metronomeMarkFormatter",