2 This file is part of LilyPond, the GNU music typesetter.
4 Copyright (C) 1996--2011 Han-Wen Nienhuys <hanwen@xs4all.nl>
5 Jan Nieuwenhuizen <janneke@gnu.org>
7 LilyPond is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
12 LilyPond is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
21 #include "performer-group.hh"
24 #include "audio-element.hh"
27 ADD_TRANSLATOR_GROUP (Performer_group,
42 Performer_group::announce_element (Audio_element_info info)
44 announce_infos_.push_back (info);
46 = context ()->get_parent_context ()->implementation ();
48 if (Performer_group *eg = dynamic_cast<Performer_group *> (t))
49 eg->announce_element (info);
53 Performer_group::acknowledge_audio_elements ()
55 for (vsize j = 0; j < announce_infos_.size (); j++)
57 Audio_element_info info = announce_infos_[j];
59 for (SCM p = get_simple_trans_list (); scm_is_pair (p); p = scm_cdr (p))
61 Translator *t = unsmob_translator (scm_car (p));
62 Performer *eng = dynamic_cast<Performer *> (t);
63 if (eng && eng != info.origin_trans_)
64 eng->acknowledge_audio_element (info);
70 performer_each (SCM list, Performer_method method)
72 for (SCM p = list; scm_is_pair (p); p = scm_cdr (p))
74 Performer *e = dynamic_cast<Performer *> (unsmob_translator (scm_car (p)));
81 Performer_group::do_announces ()
83 for (SCM s = context ()->children_contexts ();
84 scm_is_pair (s); s = scm_cdr (s))
86 Context *c = unsmob_context (scm_car (s));
87 Performer_group *group
88 = dynamic_cast<Performer_group *> (c->implementation ());
90 group->do_announces ();
95 performer_each (get_simple_trans_list (),
96 &Performer::create_audio_elements);
98 if (!announce_infos_.size ())
101 acknowledge_audio_elements ();
102 announce_infos_.clear ();