2 This file is part of LilyPond, the GNU music typesetter.
4 Copyright (C) 2006--2009 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"
24 #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 ();
40 Instrument_switch_engraver::Instrument_switch_engraver ()
47 TODO: should use an event.
50 Instrument_switch_engraver::process_music ()
52 SCM cue_text = get_property ("instrumentCueName");
54 if (!scm_is_eq (cue_name_, cue_text))
56 if (Text_interface::is_markup (cue_text))
58 text_ = make_item ("InstrumentSwitch", SCM_EOL);
59 text_->set_property ("text", cue_text);
66 Instrument_switch_engraver::stop_translation_time_step ()
71 ADD_TRANSLATOR (Instrument_switch_engraver,
73 "Create a cue text for taking instrument.",