2 This file is part of LilyPond, the GNU music typesetter.
4 Copyright (C) 2006--2011 Han-Wen Nienhuys <hanwen@lilypond.org>
7 LilyPond is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
12 LilyPond is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
21 #include "engraver.hh"
23 #include "text-interface.hh"
25 #include "translator.icc"
27 class Instrument_switch_engraver : public Engraver
30 TRANSLATOR_DECLARATIONS (Instrument_switch_engraver);
35 void stop_translation_time_step ();
36 void process_music ();
38 virtual void derived_mark () const;
42 Instrument_switch_engraver::derived_mark () const
44 scm_gc_mark (cue_name_);
47 Instrument_switch_engraver::Instrument_switch_engraver ()
54 TODO: should use an event.
57 Instrument_switch_engraver::process_music ()
59 SCM cue_text = get_property ("instrumentCueName");
61 if (!scm_is_eq (cue_name_, cue_text))
63 if (Text_interface::is_markup (cue_text))
65 text_ = make_item ("InstrumentSwitch", SCM_EOL);
66 text_->set_property ("text", cue_text);
73 Instrument_switch_engraver::stop_translation_time_step ()
78 ADD_TRANSLATOR (Instrument_switch_engraver,
80 "Create a cue text for taking instrument.",