]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/translator.cc
Merge branch 'master' of git+ssh://jneem@git.sv.gnu.org/srv/git/lilypond into jneeman
[lilypond.git] / lily / translator.cc
index 8820879e019cc168c438790003873660ac89b8a0..ae1dfbe7ff5158e4a755dd08047022b7044e80fe 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 1997--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  (c) 1997--2007 Han-Wen Nienhuys <hanwen@xs4all.nl>
 */
 
 #include "translator.hh"
@@ -278,7 +278,7 @@ add_acknowledger (Engraver_void_function_engraver_grob_info ptr,
   interface_name += "-interface";
 
   /*
-    this is only called during program init, so safe to use scm_gc_protect_object()
+    this is only called during program init, so safe to use scm_gc_protect_object ()
   */
   inf.symbol_ = scm_gc_protect_object (ly_symbol2scm (interface_name.c_str ()));
   ack_array->push_back (inf);
@@ -295,6 +295,7 @@ generic_get_acknowledger (SCM sym, vector<Acknowledge_information> const *ack_ar
   return 0;
 }
 
+
 Moment
 get_event_length (Stream_event *e)
 {
@@ -305,6 +306,19 @@ get_event_length (Stream_event *e)
     return Moment (0);
 }
 
+Moment
+get_event_length (Stream_event *e, Moment now)
+{
+  Moment len = get_event_length (e);
+  
+  if (now.grace_part_)
+    {
+      len.grace_part_ = len.main_part_;
+      len.main_part_ = Rational (0);
+    }
+  return len;
+}
+
 /*
   Helper, used through ASSIGN_EVENT_ONCE to throw warnings for
   simultaneous events. The helper is only useful in listen_* methods
@@ -326,7 +340,7 @@ internal_event_assignment (Stream_event **old_ev, Stream_event *new_ev, const ch
       assert (0 == ev_class.find (prefix));
 
       /* "listen_foo_bar" -> "foo-bar" */
-      ev_class.erase (0, strlen(prefix));
+      ev_class.erase (0, strlen (prefix));
       replace_all (ev_class, '_', '-');
 
       new_ev->origin ()->warning (_f ("Two simultaneous %s events, junking this one", ev_class.c_str ()));