]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/dynamic-engraver.cc
Basic-notation reorg and misc small fixes.
[lilypond.git] / lily / dynamic-engraver.cc
index 8d4cb2880f195d1cd0c819092023872ffb154fb5..6720e777454fd1a2c95da545ddd4c62652dd1186 100644 (file)
@@ -207,15 +207,18 @@ Dynamic_engraver::process_music ()
 
          string start_type
            = ly_symbol2string (current_cresc_ev_->get_property ("name"));
-
-         /*
-           ugh. Use push/pop?
-         */
+         
          if (start_type == "DecrescendoEvent")
            start_type = "decrescendo";
          else if (start_type == "CrescendoEvent")
            start_type = "crescendo";
+         
+                                      
 
+         /*
+           UGH. TODO: should read from original event, so appearance
+           may be altered with \tweak.
+          */
          SCM s = get_property ((start_type + "Spanner").c_str ());
          if (!scm_is_symbol (s) || s == ly_symbol2scm ("hairpin"))
            {
@@ -323,11 +326,21 @@ Dynamic_engraver::typeset_all ()
 {
   if (finished_cresc_)
     {
-      if (!finished_cresc_->get_bound (RIGHT))
+      bool use_bar = to_boolean (get_property ("hairpinToBarline"))
+       && scm_is_string (get_property ("whichBar"))
+       && !script_ev_;
+                         
+      
+      if (!finished_cresc_->get_bound (RIGHT)
+         || use_bar)
        {
+         Grob *column_bound = unsmob_grob (use_bar
+                                           ? get_property ("currentCommandColumn")
+                                           : get_property ("currentMusicalColumn"));
+           
          finished_cresc_->set_bound (RIGHT, script_
                                      ? script_
-                                     : unsmob_grob (get_property ("currentMusicalColumn")));
+                                     : column_bound);
 
          if (finished_line_spanner_)
            add_bound_item (finished_line_spanner_,