]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/apply-context-iterator.cc
* lily/paper-book.cc: remove copyright & tagline. Remove
[lilypond.git] / lily / apply-context-iterator.cc
index e08887c6f9c6f502671a2a812a6b1adcd3656304..c2251bed270ec73d24c324bfe3d7d720c9e7c4ed 100644 (file)
@@ -1,6 +1,16 @@
+/* 
+  apply-context-iterator.cc --  implement Apply_context_iterator
+  
+  source file of the GNU LilyPond music typesetter
+  
+  (c) 2004 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  
+*/
+
 #include "simple-music-iterator.hh"
-#include "translator-group.hh"
+#include "context.hh"
 #include "music.hh"
+#include "input.hh"
 
 /**
   Iterate a property.  
@@ -8,7 +18,7 @@
 class Apply_context_iterator : public Simple_music_iterator
 {
 public:
-  DECLARE_SCHEME_CALLBACK(constructor, ());
+  DECLARE_SCHEME_CALLBACK (constructor, ());
 protected:
   virtual void process (Moment);
 };
@@ -17,9 +27,12 @@ protected:
 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());
+  if (ly_c_procedure_p (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);
 }