2 rest-collision-reg.cc -- implement Rest_collision_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
10 #include "rest-collision.hh"
11 #include "rest-collision-engraver.hh"
12 #include "collision.hh"
13 #include "note-column.hh"
17 ADD_THIS_TRANSLATOR(Rest_collision_engraver
);
19 Rest_collision_engraver::Rest_collision_engraver()
25 Rest_collision_engraver::process_acknowledged ()
27 if (rest_collision_p_
|| note_column_l_arr_
.size () < 2)
30 rest_collision_p_
= new Rest_collision
;
31 announce_element (Score_element_info (rest_collision_p_
, 0));
32 for (int i
=0; i
< note_column_l_arr_
.size (); i
++)
33 rest_collision_p_
->add_column (note_column_l_arr_
[i
]);
37 Rest_collision_engraver::acknowledge_element (Score_element_info i
)
39 if (dynamic_cast<Note_column
*> (i
.elem_l_
))
40 note_column_l_arr_
.push (dynamic_cast<Note_column
*> (i
.elem_l_
));
44 Rest_collision_engraver::do_pre_move_processing()
46 if (rest_collision_p_
)
48 typeset_element (rest_collision_p_
);
49 rest_collision_p_
= 0;
51 note_column_l_arr_
.clear ();