X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fcontext.cc;h=4d949e8379c0a02f34003794b7f5e62bf3ec0b80;hb=3f0f59297670174562e7d66ae7dd8d73a04be6f8;hp=34b75523ea38d3e1e2f76c68bf606c55c7e02ee7;hpb=2f0c6eb19208485a86d3416db3f3640a1d54752a;p=lilypond.git diff --git a/lily/context.cc b/lily/context.cc index 34b75523ea..4d949e8379 100644 --- a/lily/context.cc +++ b/lily/context.cc @@ -91,6 +91,7 @@ Context::Context () definition_mods_ = SCM_EOL; event_source_ = 0; events_below_ = 0; + ancestor_lookup_ = SCM_UNDEFINED; smobify_self (); @@ -452,7 +453,7 @@ be called from any other place than the send_stream_event macro. void Context::internal_send_stream_event (SCM type, Input *origin, SCM props[]) { - Stream_event *e = new Stream_event (type, origin); + Stream_event *e = new Stream_event (make_event_class (type), origin); for (int i = 0; props[i]; i += 2) { e->set_property (props[i], props[i + 1]); @@ -593,6 +594,14 @@ Context::get_score_context () const return 0; } +SCM +Context::make_event_class (SCM event_type) +{ + if (SCM_UNBNDP (ancestor_lookup_)) + ancestor_lookup_ = get_global_context ()->ancestor_lookup_; + return scm_hashq_ref (ancestor_lookup_, event_type, SCM_EOL); +} + Output_def * Context::get_output_def () const { @@ -661,6 +670,8 @@ Context::mark_smob (SCM sm) if (me->events_below_) scm_gc_mark (me->events_below_->self_scm ()); + scm_gc_mark (me->ancestor_lookup_); + return me->properties_scm_; }