]> git.donarmstrong.com Git - lilypond.git/commitdiff
(finalize): add to instrument
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 21 Mar 2006 12:21:43 +0000 (12:21 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 21 Mar 2006 12:21:43 +0000 (12:21 +0000)
name global System. This also fixes chopped instrument names, but
doesn't crash when there are slurs/beams.

ChangeLog
lily/instrument-name-engraver.cc
lily/score-engraver.cc
lily/system.cc

index 555b64142b7aba4ca5274a33eebd48fc5bffe83c..8ae8c90ffa3850f2283c4ab8b0d05eae579527fb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2006-03-21  Han-Wen Nienhuys  <lilydev@localhost.localdomain>
 
+       * lily/instrument-name-engraver.cc (finalize): add to instrument
+       name global System. This also fixes chopped instrument names, but
+       doesn't crash when there are slurs/beams.
+
        * lily/slur-configuration.cc (add_score): disallow negative slur
        scores.
        
index 66ef592273fc371da3cc49f24657edd2a1522f77..a2bf75a777eb767b1dacf6890f59c7540a7317f6 100644 (file)
@@ -13,6 +13,7 @@
 #include "axis-group-interface.hh"
 #include "align-interface.hh"
 #include "text-interface.hh"
+#include "system.hh"
 
 #include "translator.icc"
 
@@ -53,10 +54,9 @@ Instrument_name_engraver::process_music ()
          || Text_interface::is_markup (short_text))
        {
          text_spanner_ = make_spanner ("InstrumentName", SCM_EOL);
+         
          Grob *col = unsmob_grob (get_property ("currentCommandColumn"));
-         text_spanner_->set_bound (LEFT,
-                                   unsmob_grob (get_property ("currentCommandColumn")));
-         Axis_group_interface::add_element (col, text_spanner_);
+         text_spanner_->set_bound (LEFT, col);
          text_spanner_->set_property ("text", short_text);
          text_spanner_->set_property ("long-text", long_text);
        }
@@ -86,6 +86,16 @@ Instrument_name_engraver::finalize ()
                                unsmob_grob (get_property ("currentCommandColumn")));
 
       Pointer_group_interface::set_ordered (text_spanner_, ly_symbol2scm ("elements"), false);
+
+      System *system = get_root_system (text_spanner_);
+
+      /*
+       UGH, should handle this in Score_engraver.
+       */
+      if (system)
+       Axis_group_interface::add_element (system, text_spanner_);
+      else
+       text_spanner_->programming_error ("can't find root system");
     }
 }
 
@@ -101,7 +111,8 @@ ADD_TRANSLATOR (Instrument_name_engraver,
                /* create */
                "InstrumentName ",
                
-               /* accept */ "",
+               /* accept */
+               "",
                
                /* read */
                "vocNam vocalName instrument instr "
index 7b9c5ef282e546148d9adc078dc4d1ba474006fa..a91b39b33f74805065e6a85c434aa19a44336074 100644 (file)
@@ -173,9 +173,11 @@ ADD_TRANSLATOR_GROUP (Score_engraver,
 
                      /* accept */
                      "break-event",
+                     
                      /* read */
                      "currentMusicalColumn "
                      "currentCommandColumn "
                      "verticallySpacedContexts",
+
                      /* write */
                      "");
index ddf5c613cd3e33cd58dc3aca97f6a3c083e68ed1..d9b2122c3b99ecc6360ab846c152b72bb15d989f 100644 (file)
@@ -484,6 +484,6 @@ ADD_INTERFACE (System, "system-interface",
 
               /* properties */
               "all-elements "
+              "columns "
               "spaceable-staves "
-              "columns"
               )