]> git.donarmstrong.com Git - lilypond.git/blob - lily/apply-context-iterator.cc
* The grand 2005-2006 replace.
[lilypond.git] / lily / apply-context-iterator.cc
1 /*
2   apply-context-iterator.cc -- implement Apply_context_iterator
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 2004--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
7 */
8
9 #include "simple-music-iterator.hh"
10 #include "context.hh"
11 #include "music.hh"
12 #include "input.hh"
13
14 /**
15    Iterate a property.
16 */
17 class Apply_context_iterator : public Simple_music_iterator
18 {
19 public:
20   DECLARE_SCHEME_CALLBACK (constructor, ());
21 protected:
22   virtual void process (Moment);
23 };
24
25 void
26 Apply_context_iterator::process (Moment m)
27 {
28   SCM proc = get_music ()->get_property ("procedure");
29
30   if (ly_is_procedure (proc))
31     scm_call_1 (proc, get_outlet ()->self_scm ());
32   else
33     get_music ()->origin ()->warning (_ ("\\applycontext argument is not a procedure"));
34
35   Simple_music_iterator::process (m);
36 }
37
38 IMPLEMENT_CTOR_CALLBACK (Apply_context_iterator);
39