2 engravergroup.cc -- implement Engraver_group_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--2001 Han-Wen Nienhuys <hanwen@cs.uu.nl>
9 #include "flower-proto.hh"
10 #include "engraver-group-engraver.hh"
11 #include "engraver.hh"
13 #include "paper-score.hh"
17 ADD_THIS_TRANSLATOR (Engraver_group_engraver
);
20 Engraver_group_engraver::announce_grob (Grob_info info
)
22 announce_info_arr_
.push (info
);
23 Engraver::announce_grob (info
);
28 Engraver_group_engraver::create_grobs ()
31 for (SCM p
= simple_trans_list_
; gh_pair_p (p
); p
= gh_cdr (p
))
33 Translator
* t
= unsmob_translator (gh_car (p
));
34 Engraver
* eng
= dynamic_cast<Engraver
*> (t
);
41 Engraver_group_engraver::acknowledge_grobs ()
43 for (int j
=0; j
< announce_info_arr_
.size (); j
++)
45 Grob_info info
= announce_info_arr_
[j
];
46 for (SCM p
= simple_trans_list_
; gh_pair_p (p
); p
= gh_cdr (p
))
48 Translator
* t
= unsmob_translator (gh_car (p
));
49 Engraver
* eng
= dynamic_cast<Engraver
*> (t
);
50 if (eng
&& eng
!= info
.origin_trans_l_
)
51 eng
->acknowledge_grob (info
);
57 Engraver_group_engraver::do_announces ()
59 for (SCM p
= trans_group_list_
; gh_pair_p (p
); p
=gh_cdr (p
))
61 Translator
* t
= unsmob_translator (gh_car (p
));
62 dynamic_cast<Engraver_group_engraver
*> (t
)->do_announces ();
67 while (announce_info_arr_
.size ())
70 announce_info_arr_
.clear ();
78 order is : top to bottom (as opposed to do_announces)
81 Engraver_group_engraver::process_music ()
83 for (SCM p
= simple_trans_list_
; gh_pair_p (p
); p
=gh_cdr (p
))
85 Translator
* t
= unsmob_translator (gh_car (p
));
86 Engraver
* eng
= dynamic_cast<Engraver
*> (t
);
89 eng
->process_music ();
91 for (SCM p
= trans_group_list_
; gh_pair_p (p
); p
=gh_cdr (p
))
93 Translator
* t
= unsmob_translator (gh_car (p
));
94 Engraver
*eng
= dynamic_cast<Engraver
*> (t
);
96 eng
->process_music ();