lilypond-1.3.31
[lilypond.git] / lily / engraver-group-engraver.cc
blobf33939c62a80f1127596699aef8cd907588a514e
1 /*
2 engravergroup.cc -- implement Engraver_group_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 */
9 #include "proto.hh"
10 #include "engraver-group-engraver.hh"
11 #include "engraver.hh"
12 #include "debug.hh"
13 #include "paper-score.hh"
14 #include "score-element.hh"
17 ADD_THIS_TRANSLATOR(Engraver_group_engraver);
19 void
20 Engraver_group_engraver::announce_element (Score_element_info info)
22 announce_info_arr_.push (info);
23 Engraver::announce_element (info);
26 void
27 Engraver_group_engraver::do_announces()
29 for (Cons<Translator> *p = trans_p_list_.head_; p; p = p->next_)
31 if (Engraver_group_engraver *trg = dynamic_cast <Engraver_group_engraver *> (p->car_))
32 trg->do_announces ();
35 Request dummy_req;
37 while (announce_info_arr_.size ())
39 for (int j =0; j < announce_info_arr_.size(); j++)
41 Score_element_info info = announce_info_arr_[j];
43 if (!info.req_l_)
44 info.req_l_ = &dummy_req;
46 for (Cons<Translator> *p = trans_p_list_.head_; p; p = p->next_)
48 if (!dynamic_cast <Engraver_group_engraver *> (p->car_))
50 Engraver * eng = dynamic_cast<Engraver*> (p->car_);
51 if (eng && eng!= info.origin_trans_l_arr (this)[0])
52 eng->acknowledge_element (info);
57 announce_info_arr_.clear ();
58 for (Cons<Translator> *p = trans_p_list_.head_; p; p = p->next_)
60 if (!dynamic_cast <Engraver_group_engraver *> (p->car_))
62 Engraver * eng = dynamic_cast<Engraver*> (p->car_);
63 if (eng)
64 eng->process_acknowledged ();
71 Staff_info
72 Engraver_group_engraver::get_staff_info() const
74 Staff_info inf = Engraver::get_staff_info();
75 return inf;