X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fapply-context-iterator.cc;h=3ed593be587a187b779a55199955a8a459d51cd0;hb=5b4b0d6e9a197e8f9eb085b7c2ad78b8be3e5cfc;hp=feb3a8346076a0ef9437d1c2b72c995c397e71e9;hpb=e58fce49b3113408254011774685370b8233df17;p=lilypond.git diff --git a/lily/apply-context-iterator.cc b/lily/apply-context-iterator.cc index feb3a83460..3ed593be58 100644 --- a/lily/apply-context-iterator.cc +++ b/lily/apply-context-iterator.cc @@ -1,29 +1,37 @@ -#include "simple-music-iterator.hh" -#include "translator-group.hh" +/* + apply-context-iterator.cc -- implement Apply_context_iterator + + source file of the GNU LilyPond music typesetter + + (c) 2004--2008 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: - VIRTUAL_COPY_CONS (Music_iterator); - 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"); - scm_call_1 (proc, get_outlet ()->self_scm()); - - Simple_music_iterator::process(m); + 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); - +