lilypond-0.1.35
[lilypond.git] / lily / collision-grav.cc
blobf1b71123904818c1b4d6cde9bd171bccdd7f5ac4
1 /*
2 collision-reg.cc -- implement Collision_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
7 */
9 #include "note-column.hh"
10 #include "collision-grav.hh"
11 #include "collision.hh"
13 void
14 Collision_engraver::acknowledge_element (Score_elem_info i)
16 if (i.elem_l_->is_type_b (Note_column::static_name ()))
18 Note_column * c = (Note_column*) i.elem_l_->item ();
19 if (c->rest_b ())
20 return ;
21 if (!col_p_)
23 col_p_ = new Collision;
24 announce_element (Score_elem_info (col_p_,0));
26 col_p_->add (c);
29 void
30 Collision_engraver::do_pre_move_processing()
32 if (col_p_)
34 typeset_element (col_p_);
35 col_p_ =0;
38 Collision_engraver::Collision_engraver()
40 col_p_ =0;
44 IMPLEMENT_IS_TYPE_B1(Collision_engraver,Engraver);
45 ADD_THIS_TRANSLATOR(Collision_engraver);