2 new-staff-margin-engraver.cc -- implement Instrument_name_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
10 #include "engraver.hh"
13 #include "system-start-delimiter.hh"
14 #include "side-position-interface.hh"
15 #include "align-interface.hh"
17 class Instrument_name_engraver : public Engraver
22 void create_text (SCM s);
24 VIRTUAL_COPY_CONS(Translator);
25 Instrument_name_engraver ();
27 virtual void acknowledge_grob (Grob_info);
28 virtual void stop_translation_timestep ();
31 ADD_THIS_TRANSLATOR(Instrument_name_engraver);
33 Instrument_name_engraver::Instrument_name_engraver ()
41 Instrument_name_engraver::stop_translation_timestep ()
51 FIXME: use different mechanics, and use a markup-p function?
54 Instrument_name_engraver::create_text (SCM txt)
58 text_ = new Item (get_property ("InstrumentName"));
61 text_->set_grob_property ("text", txt);
63 else if (text_->get_grob_property ("text") == SCM_EOL)
68 text_->set_parent (delim_, Y_AXIS);
70 announce_grob (text_,0);
75 Instrument_name_engraver::acknowledge_grob (Grob_info i)
77 if (Bar::has_interface (i.elem_l_))
79 SCM s = get_property ("instrument");
81 if (now_mom () > Moment (0))
82 s = get_property ("instr");
84 // if (gh_string_p (s))
90 if (Align_interface::has_interface (i.elem_l_)
91 && Align_interface::axis (i.elem_l_) == Y_AXIS
92 //System_start_delimiter::has_interface (i.elem_l_)
93 && i.origin_trans_l_->daddy_trans_l_ == daddy_trans_l_)