lilypond-1.3.130
[lilypond.git] / lily / rest-collision-grav.cc
blob3729f28e7e1a680866736fe8f8c67d2d1f221355
1 /*
2 rest-collision-reg.cc -- implement Rest_collision_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--1998 Han-Wen Nienhuys <hanwen@stack.nl>
7 */
9 #include "debug.hh"
10 #include "rest-collision.hh"
11 #include "rest-collision-grav.hh"
12 #include "collision.hh"
13 #include "note-column.hh"
16 IMPLEMENT_IS_TYPE_B1(Rest_collision_engraver, Engraver);
17 ADD_THIS_TRANSLATOR(Rest_collision_engraver);
19 Rest_collision_engraver::Rest_collision_engraver()
21 rest_collision_p_ =0;
24 void
25 Rest_collision_engraver::acknowledge_element (Score_elem_info i)
27 if (i.elem_l_->is_type_b (Note_column::static_name()))
29 // what should i do, what should _engraver do?
30 if (!rest_collision_p_)
32 rest_collision_p_ = new Rest_collision;
33 announce_element (Score_elem_info (rest_collision_p_, 0));
35 rest_collision_p_->add ((Note_column*)i.elem_l_->item());
39 void
40 Rest_collision_engraver::do_pre_move_processing()
42 if (rest_collision_p_)
44 typeset_element (rest_collision_p_);
45 rest_collision_p_ = 0;