]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/context.cc
Fix some bugs in the dynamic engraver and PostScript backend
[lilypond.git] / lily / context.cc
index 7ab871b15ec9b033e4e55b40216666ffa671af7b..5e97a6171de24c24830548e4c141ed763d587dac 100644 (file)
@@ -345,15 +345,19 @@ Context::internal_get_property (SCM sym) const
   return val;
 }
 
+/*
+Called by the send_stream_event macro. props is a 0-terminated array of
+properties and corresponding values, interleaved. This method should not
+be called from any other place than the send_stream_event macro.
+*/
 void
 Context::internal_send_stream_event (SCM type, SCM props[])
 {
   Stream_event *e = new Stream_event (this, type);
-  for (int i = 0; props[i]; i++)
-  {
-    assert(props[i+1]);
-    e->internal_set_property (props[i], props[i+1]);
-  }
+  for (int i = 0; props[i]; i += 2)
+    {
+      e->internal_set_property (props[i], props[i+1]);
+    }
   event_source_->broadcast (e);
   e->unprotect ();
 }
@@ -656,3 +660,16 @@ set_context_property_on_children (Context *trans, SCM sym, SCM val)
       set_context_property_on_children (trg, sym, ly_deep_copy (val));
     }
 }
+
+bool
+melisma_busy (Context *tr)
+{
+  SCM melisma_properties = tr->get_property ("melismaBusyProperties");
+  bool busy = false;
+
+  for (; scm_is_pair (melisma_properties);
+       melisma_properties = scm_cdr (melisma_properties))
+    busy = busy || to_boolean (tr->internal_get_property (scm_car (melisma_properties)));
+
+  return busy;
+}