]> git.donarmstrong.com Git - lilypond.git/blob - lily/apply-context-iterator.cc
new file.
[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--2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
7   
8 */
9
10 #include "simple-music-iterator.hh"
11 #include "context.hh"
12 #include "music.hh"
13 #include "input.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
27 void
28 Apply_context_iterator::process (Moment m)
29 {
30   SCM proc = get_music ()->get_property ("procedure");
31
32   if (ly_c_procedure_p (proc))
33     scm_call_1 (proc, get_outlet ()->self_scm ());
34   else
35     get_music ()->origin ()->warning (_("\\applycontext argument is not a procedure"));
36   
37   Simple_music_iterator::process (m);
38 }
39
40 IMPLEMENT_CTOR_CALLBACK (Apply_context_iterator);
41