*** empty log message ***
[lilypond.git] / lily / context-specced-music-iterator.cc
blob2f7445fd6760fa34bf96b8f65f93df2eab471d30
1 /*
2 context-specced-music-iterator.cc -- implement
3 Context_specced_music_iterator
5 source file of the GNU LilyPond music typesetter
7 (c) 2002--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
9 */
11 #include "music-wrapper-iterator.hh"
12 #include "context.hh"
14 class Context_specced_music_iterator : public Music_wrapper_iterator
16 public:
17 DECLARE_SCHEME_CALLBACK (constructor,());
18 virtual void construct_children ();
21 void
22 Context_specced_music_iterator::construct_children ()
24 SCM ct = get_music ()->get_property ("context-type");
26 String c_id;
27 SCM ci = get_music ()->get_property ("context-id");
28 if (gh_string_p (ci))
29 c_id = ly_scm2string (ci);
30 SCM ops = get_music ()->get_property ("property-operations");
32 Context * a
33 = get_outlet ()->find_create_context (ct, c_id, ops);
35 if (a
36 && to_boolean (get_music ()->get_property ("descend-only"))
37 && !is_child_context (get_outlet (), a))
38 a = 0;
40 if (a)
41 set_translator (a);
43 Music_wrapper_iterator::construct_children ();
46 IMPLEMENT_CTOR_CALLBACK (Context_specced_music_iterator);