X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fquote-iterator.cc;h=3eaf002c0b9557d1705e777cf8f077fb2e73931f;hb=399569e1bb52f884620d0314bcfd2cedb5a25199;hp=9ca8fd25b7ed4dacf22b551e35bf838350894f91;hpb=8b500afb9431f5471e385fa2eeb8fde868e4fc49;p=lilypond.git diff --git a/lily/quote-iterator.cc b/lily/quote-iterator.cc index 9ca8fd25b7..3eaf002c0b 100644 --- a/lily/quote-iterator.cc +++ b/lily/quote-iterator.cc @@ -3,12 +3,13 @@ source file of the GNU LilyPond music typesetter - (c) 2004--2006 Han-Wen Nienhuys + (c) 2004--2008 Han-Wen Nienhuys */ #include "music-wrapper-iterator.hh" #include "context.hh" +#include "dispatcher.hh" #include "input.hh" #include "international.hh" #include "lily-guile.hh" @@ -33,7 +34,7 @@ public: DECLARE_SCHEME_CALLBACK (constructor, ()); bool quote_ok () const; - bool accept_music_type (Music *) const; + bool accept_music_type (Stream_event *) const; protected: virtual void derived_mark () const; @@ -52,16 +53,14 @@ Quote_iterator::do_quit () } bool -Quote_iterator::accept_music_type (Music *mus) const +Quote_iterator::accept_music_type (Stream_event *ev) const { - SCM accept = get_outlet ()->get_property ("quotedEventTypes"); - for (SCM s = mus->get_property ("types"); - scm_is_pair (s); s = scm_cdr (s)) + for (SCM accept = get_outlet ()->get_property ("quotedEventTypes"); + scm_is_pair (accept); accept = scm_cdr (accept)) { - if (scm_memq (scm_car (s), accept) != SCM_BOOL_F) + if (ev->internal_in_event_class (scm_car (accept))) return true; } - return false; } @@ -230,11 +229,12 @@ Quote_iterator::process (Moment m) { SCM ev_acc = scm_car (s); - Music *mus = unsmob_music (scm_car (ev_acc)); - if (!mus) + Stream_event *ev = unsmob_stream_event (scm_car (ev_acc)); + if (!ev) programming_error ("no music found in quote"); - else if (accept_music_type (mus)) + else if (accept_music_type (ev)) { + /* create a transposed copy if necessary */ if (quote_pitch || me_pitch) { Pitch qp, mp; @@ -244,15 +244,12 @@ Quote_iterator::process (Moment m) mp = *me_pitch; Pitch diff = pitch_interval (qp, mp); - - SCM copy = ly_music_deep_copy (mus->self_scm ()); - mus = unsmob_music (copy); - - transposed_musics_ = scm_cons (copy, transposed_musics_); - mus->transpose (diff); + ev = ev->clone (); + + transpose_mutable (ev->get_property_alist (true), diff); + transposed_musics_ = scm_cons (ev->unprotect (), transposed_musics_); } - - quote_outlet_.get_outlet ()->try_music (mus); + quote_outlet_.get_outlet ()->event_source ()->broadcast (ev); } }