]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/instrument-name-engraver.cc
release: 1.3.131
[lilypond.git] / lily / instrument-name-engraver.cc
index a42695aa1063489105c02e7d4a1d2a94cedfb451..852ef176d35a4a0b4d963b95cbb5d4c39a9e7b84 100644 (file)
@@ -3,7 +3,7 @@
   
   source file of the GNU LilyPond music typesetter
   
-  (c) 2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  (c) 2000--2001 Han-Wen Nienhuys <hanwen@cs.uu.nl>
   
  */
 
@@ -53,11 +53,13 @@ Instrument_name_engraver::create_text (SCM txt)
   if(!text_)
     {
       text_ = new Item (get_property ("InstrumentName"));
-      text_->set_grob_property ("text", txt);
-
+      
+      if (text_->get_grob_property ("text") != txt)
+       text_->set_grob_property ("text", txt);
+     
       if (delim_)
-       text_->set_parent (delim_, Y_AXIS);
-
+        text_->set_parent (delim_, Y_AXIS);
+      
       announce_grob (text_,0);
     }
 }
@@ -65,17 +67,19 @@ Instrument_name_engraver::create_text (SCM txt)
 void
 Instrument_name_engraver::acknowledge_grob (Grob_info i)
 {
-  SCM s = get_property ("instrument");
-  
-  if (now_mom () > Moment (0))
-    s = get_property ("instr");
-
-  if (gh_string_p (s))
+  if (Bar::has_interface (i.elem_l_))
     {
-      if (Bar::has_interface (i.elem_l_))
-       {
-         create_text (s);
-       }
+      SCM s = get_property ("instrument");
+  
+      if (now_mom () > Moment (0))
+       s = get_property ("instr");
+
+      /*
+       FIXME: use markup_p () to check type.
+      */
+      if (gh_string_p (s) || gh_pair_p (s))
+       create_text (s);
+         
     }
 
   if (Align_interface::has_interface (i.elem_l_)