X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fapply-context-iterator.cc;h=7874509da21a69aeca96a8043a894ca87c6cf1d5;hb=c39943f60cffe2084c2f571fa838f0e34f89419b;hp=d8541f98c0e4f3027cba4a5189ca7e6a973f8bf1;hpb=e37010af17faa8b185de836664b6544bd29dc1d0;p=lilypond.git diff --git a/lily/apply-context-iterator.cc b/lily/apply-context-iterator.cc index d8541f98c0..7874509da2 100644 --- a/lily/apply-context-iterator.cc +++ b/lily/apply-context-iterator.cc @@ -1,28 +1,37 @@ -#include "simple-music-iterator.hh" +/* + apply-context-iterator.cc -- implement Apply_context_iterator + + source file of the GNU LilyPond music typesetter + + (c) 2004--2009 Han-Wen Nienhuys +*/ + #include "context.hh" +#include "input.hh" +#include "international.hh" #include "music.hh" +#include "simple-music-iterator.hh" -/** - Iterate a property. - */ class Apply_context_iterator : public Simple_music_iterator { public: - DECLARE_SCHEME_CALLBACK(constructor, ()); + DECLARE_SCHEME_CALLBACK (constructor, ()); protected: virtual void process (Moment); }; - void Apply_context_iterator::process (Moment m) { - SCM proc = get_music ()->get_mus_property ("procedure"); + SCM proc = get_music ()->get_property ("procedure"); + + if (ly_is_procedure (proc)) + scm_call_1 (proc, get_outlet ()->self_scm ()); + else + get_music ()->origin ()->warning (_ ("\\applycontext argument is not a procedure")); - scm_call_1 (proc, get_outlet ()->self_scm()); - Simple_music_iterator::process (m); } IMPLEMENT_CTOR_CALLBACK (Apply_context_iterator); - +