2 performer-group-performer.cc -- implement Performer_group
4 source file of the GNU LilyPond music typesetter
6 (c) 1996--2007 Han-Wen Nienhuys <hanwen@xs4all.nl>
7 Jan Nieuwenhuizen <janneke@gnu.org>
10 #include "performer-group.hh"
13 #include "audio-element.hh"
16 ADD_TRANSLATOR_GROUP (Performer_group
,
31 Performer_group::announce_element (Audio_element_info info
)
33 announce_infos_
.push_back (info
);
35 = context ()->get_parent_context ()->implementation ();
37 if (Performer_group
*eg
= dynamic_cast<Performer_group
*> (t
))
38 eg
->announce_element (info
);
42 Performer_group::acknowledge_audio_elements ()
44 for (vsize j
= 0; j
< announce_infos_
.size (); j
++)
46 Audio_element_info info
= announce_infos_
[j
];
48 for (SCM p
= get_simple_trans_list (); scm_is_pair (p
); p
= scm_cdr (p
))
50 Translator
*t
= unsmob_translator (scm_car (p
));
51 Performer
*eng
= dynamic_cast<Performer
*> (t
);
52 if (eng
&& eng
!= info
.origin_trans_
)
53 eng
->acknowledge_audio_element (info
);
59 performer_each (SCM list
, Performer_method method
)
61 for (SCM p
= list
; scm_is_pair (p
); p
= scm_cdr (p
))
63 Performer
*e
= dynamic_cast<Performer
*> (unsmob_translator (scm_car (p
)));
70 Performer_group::do_announces ()
72 for (SCM s
= context ()->children_contexts ();
73 scm_is_pair (s
); s
= scm_cdr (s
))
75 Context
*c
= unsmob_context (scm_car (s
));
76 Performer_group
*group
77 = dynamic_cast<Performer_group
*> (c
->implementation ());
79 group
->do_announces ();
84 performer_each (get_simple_trans_list (),
85 &Performer::create_audio_elements
);
87 if (!announce_infos_
.size ())
90 acknowledge_audio_elements ();
91 announce_infos_
.clear ();