2 engravergroup.cc -- implement Engraver_group_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
10 #include "engraver-group-engraver.hh"
11 #include "engraver.hh"
14 #include "score-element.hh"
17 ADD_THIS_TRANSLATOR(Engraver_group_engraver
);
20 Engraver_group_engraver::announce_element (Score_element_info info
)
22 announce_info_arr_
.push (info
);
23 Engraver::announce_element (info
);
27 Engraver_group_engraver::do_announces()
29 Link_array
<Translator_group
> groups
= group_l_arr ();
30 for (int i
=0; i
< groups
.size(); i
++)
32 Engraver_group_engraver
* group
= dynamic_cast<Engraver_group_engraver
*> (groups
[i
]);
35 group
->do_announces();
41 Link_array
<Translator
> nongroups
= nongroup_l_arr ();
42 while (announce_info_arr_
.size ())
44 for (int j
=0; j
< announce_info_arr_
.size(); j
++)
46 Score_element_info info
= announce_info_arr_
[j
];
49 info
.req_l_
= &dummy_req
;
50 for (int i
=0; i
< nongroups
.size(); i
++)
51 { // Is this good enough?
52 Engraver
* eng
= dynamic_cast<Engraver
*> (nongroups
[i
]);
53 if (eng
&& eng
!= info
.origin_trans_l_arr_
[0])
54 eng
->acknowledge_element (info
);
57 announce_info_arr_
.clear ();
58 for (int i
=0; i
< nongroups
.size(); i
++)
60 Engraver
* eng
= dynamic_cast<Engraver
*> (nongroups
[i
]);
62 eng
->process_acknowledged ();
70 Engraver_group_engraver::get_staff_info() const
72 Staff_info inf
= Engraver::get_staff_info();
74 Link_array
<Translator
> simple_translators
= nongroup_l_arr ();
75 for (int i
=0; i
< simple_translators
.size(); i
++)
77 Engraver
* eng
= dynamic_cast<Engraver
*> (simple_translators
[i
]);
79 eng
->fill_staff_info (inf
);