]> git.donarmstrong.com Git - lilypond.git/blob - lily/context-specced-music-iterator.cc
* lily/align-interface.cc (find_fixed_alignment_parent): new function.
[lilypond.git] / lily / context-specced-music-iterator.cc
1 /*   
2   context-specced-music-iterator.cc -- implement
3     Context_specced_music_iterator
4
5   source file of the GNU LilyPond music typesetter
6
7   (c) 2002--2003 Han-Wen Nienhuys <hanwen@cs.uu.nl>
8
9 */
10
11 #include "music-wrapper-iterator.hh"
12 #include "translator-group.hh"
13
14 class Context_specced_music_iterator : public Music_wrapper_iterator
15 {
16 public:
17   VIRTUAL_COPY_CONS(Music_iterator);
18   DECLARE_SCHEME_CALLBACK(constructor,());
19   virtual void construct_children ();
20 };
21
22 void
23 Context_specced_music_iterator::construct_children ()
24 {
25   SCM ct = get_music ()->get_mus_property ("context-type");
26   String c_type;
27   if (gh_string_p (ct))
28     c_type =  ly_scm2string (ct);
29   
30   String c_id;
31   SCM ci = get_music ()->get_mus_property ("context-id");
32   if (gh_string_p (ci))
33     c_id = ly_scm2string (ci);
34   
35   Translator_group* a
36     =report_to ()->find_create_translator (c_type, c_id);
37   
38   set_translator (a);
39
40   Music_wrapper_iterator::construct_children();
41 }
42 IMPLEMENT_CTOR_CALLBACK(Context_specced_music_iterator);