]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/instrument-switch-engraver.cc
Bump documentation license to v1.3+.
[lilypond.git] / lily / instrument-switch-engraver.cc
index a3694f075574ad8ffef4399426dd1ccd07ac0ace..dc09e03d10d360404a71995df5a39ad5f4134f7f 100644 (file)
@@ -3,19 +3,20 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 2006--2007 Han-Wen Nienhuys <hanwen@lilypond.org>
+  (c) 2006--2009 Han-Wen Nienhuys <hanwen@lilypond.org>
 
 */
 
 #include "engraver.hh"
 #include "item.hh"
+#include "text-interface.hh"
 #include "translator.icc"
 
 
 class Instrument_switch_engraver : public Engraver
 {
 
-  TRANSLATOR_DECLARATIONS(Instrument_switch_engraver);
+  TRANSLATOR_DECLARATIONS (Instrument_switch_engraver);
 protected:
   Grob *text_;
   SCM cue_name_;
@@ -41,8 +42,11 @@ Instrument_switch_engraver::process_music ()
   
   if (!scm_is_eq (cue_name_, cue_text))
     {
-      text_ = make_item ("InstrumentSwitch", SCM_EOL);
-      text_->set_property ("text", cue_text);
+      if (Text_interface::is_markup (cue_text))
+        {
+          text_ = make_item ("InstrumentSwitch", SCM_EOL);
+          text_->set_property ("text", cue_text);
+        }
       cue_name_ = cue_text;
     }
 }
@@ -53,11 +57,16 @@ Instrument_switch_engraver::stop_translation_time_step ()
   text_ = 0;
 }
 
-ADD_TRANSLATOR(Instrument_switch_engraver,
-              "Create a cue text for taking instrument.",
+ADD_TRANSLATOR (Instrument_switch_engraver,
+               /* doc */
+               "Create a cue text for taking instrument.",
                        
-              "InstrumentSwitch ",
+               /* create */
+               "InstrumentSwitch ",
 
-              "instrumentCueName",
+               /* read */
+               "instrumentCueName ",
                        
-              "");
+               /* write */
+               ""
+               );