X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Frhythmic-music-iterator.cc;h=c1edba9702eb5476335adeb867db71a7a2e4de5c;hb=01df8ad908c92687d0c352e5ad5f067e52809423;hp=8d9e75ae723f4f2a70009d3616b9bbde13a0da3b;hpb=252ec5e71b5e121734a9c9897245137cb07e4a1f;p=lilypond.git diff --git a/lily/rhythmic-music-iterator.cc b/lily/rhythmic-music-iterator.cc index 8d9e75ae72..c1edba9702 100644 --- a/lily/rhythmic-music-iterator.cc +++ b/lily/rhythmic-music-iterator.cc @@ -1,7 +1,7 @@ /* This file is part of LilyPond, the GNU music typesetter. - Copyright (C) 2012 Mike Solomon + Copyright (C) 2012 Mike Solomon LilyPond is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -47,38 +47,34 @@ Rhythmic_music_iterator::process (Moment m) descend_to_bottom_context (); Context *c = get_outlet (); - Stream_event *ev = get_music ()->to_event (); + Stream_event *ev = get_music ()->to_event (c); SCM arts = ev->get_property ("articulations"); - + if (scm_is_pair (arts)) - { - // There is no point in broadcasting articulations like - // harmonic events that nobody listens to. Those work - // exclusively as articulations. - SCM listened = SCM_EOL; - SCM unlistened = SCM_EOL; - for (; scm_is_pair (arts); arts = scm_cdr (arts)) - { - if (scm_is_true - (scm_call_2 - (ly_lily_module_constant ("any"), - ly_lily_module_constant ("ly:is-listened-event-class"), - scm_call_1 - (ly_lily_module_constant ("ly:make-event-class"), - unsmob_stream_event (scm_car (arts)) - ->get_property ("class"))))) - listened = scm_cons (scm_car (arts), listened); - else - unlistened = scm_cons (scm_car (arts), unlistened); - } - ev->set_property ("articulations", scm_reverse_x (unlistened, SCM_EOL)); - c->event_source ()->broadcast (ev); - arts = scm_reverse_x (listened, SCM_EOL); - for (; scm_is_pair (arts); arts = scm_cdr (arts)) - c->event_source ()->broadcast (unsmob_stream_event (scm_car (arts))); - } + { + // There is no point in broadcasting articulations like + // harmonic events that nobody listens to. Those work + // exclusively as articulations. + SCM listened = SCM_EOL; + SCM unlistened = SCM_EOL; + for (; scm_is_pair (arts); arts = scm_cdr (arts)) + { + SCM art = scm_car (arts); + + if (c->event_source ()->is_listened_class + (unsmob_stream_event (art)->get_property ("class"))) + listened = scm_cons (art, listened); + else + unlistened = scm_cons (art, unlistened); + } + ev->set_property ("articulations", scm_reverse_x (unlistened, SCM_EOL)); + c->event_source ()->broadcast (ev); + arts = scm_reverse_x (listened, SCM_EOL); + for (; scm_is_pair (arts); arts = scm_cdr (arts)) + c->event_source ()->broadcast (unsmob_stream_event (scm_car (arts))); + } else - c->event_source ()->broadcast (ev); + c->event_source ()->broadcast (ev); ev->unprotect (); }