]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/dynamic-engraver.cc
Merge branch 'cvs-head' of ssh+git://hanwen@repo.or.cz/srv/git/lilypond into master...
[lilypond.git] / lily / dynamic-engraver.cc
index 09a7e3930535a52b7a89686c7fde09ad804eb4cb..a0e99ad0479b308915bc88b4cef09c18b154f217 100644 (file)
@@ -97,7 +97,7 @@ Dynamic_engraver::listen_absolute_dynamic (Stream_event *ev)
   /*
     TODO: probably broken.
   */
-  script_ev_ = ev;
+  ASSIGN_EVENT_ONCE (script_ev_, ev);
 }
 
 IMPLEMENT_TRANSLATOR_LISTENER (Dynamic_engraver, span_dynamic);
@@ -106,9 +106,14 @@ Dynamic_engraver::listen_span_dynamic (Stream_event *ev)
 {
   Direction d = to_dir (ev->get_property ("span-direction"));
 
-  accepted_spanevents_drul_[d] = ev;
-  if (current_cresc_ev_ && d == START)
-    accepted_spanevents_drul_[STOP] = ev;
+  if (d == START)
+    ASSIGN_EVENT_ONCE (accepted_spanevents_drul_[START], ev);
+  
+  /* Cancel any ongoing crescendo, either explicitly by \! or
+     implicitly by a new crescendo. Also avoid warning if cresc is
+     cancelled both implicitly and explicitly. */
+  if ((d == STOP || current_cresc_ev_) && !accepted_spanevents_drul_[STOP])
+    ASSIGN_EVENT_ONCE (accepted_spanevents_drul_[STOP], ev);
 }
 
 void
@@ -236,9 +241,6 @@ Dynamic_engraver::process_music ()
                                                     ly_symbol2scm ("adjacent-hairpins"),
                                                     finished_cresc_);
                }
-             cresc_->set_property ("grow-direction",
-                                   scm_from_int ((start_type == "crescendo")
-                                                 ? BIGGER : SMALLER));
            }
 
          /*
@@ -483,6 +485,5 @@ ADD_TRANSLATOR (Dynamic_engraver,
                "which takes care of vertical positioning.  ",
 
                /* create */ "DynamicLineSpanner DynamicText Hairpin TextSpanner",
-               /* accept */ "absolute-dynamic-event crescendo-event decrescendo-event",
                /* read */ "",
                /* write */ "");