]> git.donarmstrong.com Git - lilypond.git/blob - lily/apply-context-iterator.cc
Fix some bugs in the dynamic engraver and PostScript backend
[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 "context.hh"
10 #include "input.hh"
11 #include "international.hh"
12 #include "music.hh"
13 #include "simple-music-iterator.hh"
14
15 /**
16    Iterate a property.
17 */
18 class Apply_context_iterator : public Simple_music_iterator
19 {
20 public:
21   DECLARE_SCHEME_CALLBACK (constructor, ());
22 protected:
23   virtual void process (Moment);
24 };
25
26 void
27 Apply_context_iterator::process (Moment m)
28 {
29   SCM proc = get_music ()->get_property ("procedure");
30
31   if (ly_is_procedure (proc))
32     scm_call_1 (proc, get_outlet ()->self_scm ());
33   else
34     get_music ()->origin ()->warning (_ ("\\applycontext argument is not a procedure"));
35
36   Simple_music_iterator::process (m);
37 }
38
39 IMPLEMENT_CTOR_CALLBACK (Apply_context_iterator);
40