X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fapply-context-iterator.cc;h=adf708da35259234ec376c6414ebc904d1110d33;hb=8e6e4cd90a1bd536422ebdec9bc0f2d75a8df7f5;hp=ea01600f6076db680846240f5546c737b7bc014d;hpb=b1323f33e9aa4b9eea05eefb8755c907d4d762d4;p=lilypond.git diff --git a/lily/apply-context-iterator.cc b/lily/apply-context-iterator.cc index ea01600f60..adf708da35 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--2006 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_property ("procedure"); - scm_call_1 (proc, get_outlet ()->self_scm()); - + if (ly_is_procedure (proc)) + scm_call_1 (proc, get_outlet ()->self_scm ()); + else + get_music ()->origin ()->warning (_ ("\\applycontext argument is not a procedure")); + Simple_music_iterator::process (m); } IMPLEMENT_CTOR_CALLBACK (Apply_context_iterator); - +