]> git.donarmstrong.com Git - lilypond.git/blob - lily/dot-column-engraver.cc
release: 1.1.0
[lilypond.git] / lily / dot-column-engraver.cc
1 /*   
2   dot-column-engraver.cc -- implement Dot_column_engraver
3   
4   source file of the GNU LilyPond music typesetter
5   
6   (c) 1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7   
8  */
9
10 #include "dot-column-engraver.hh"
11 #include "rhythmic-head.hh"
12 #include "dot-column.hh"
13
14 Dot_column_engraver::Dot_column_engraver ()
15 {
16   dotcol_p_ =0;
17 }
18
19 void
20 Dot_column_engraver::do_pre_move_processing ()
21 {
22   if (dotcol_p_)
23     {
24       typeset_element (dotcol_p_);
25       dotcol_p_ =0;
26     }
27   head_l_arr_.clear ();
28 }
29
30 void
31 Dot_column_engraver::acknowledge_element (Score_element_info info)
32 {
33   Item * i=dynamic_cast <Item *> (info.elem_l_);
34   
35   if (! (i && i->is_type_b (Rhythmic_head::static_name ())))
36       return;
37
38   Rhythmic_head * h = (Rhythmic_head*)i;
39   
40   if (!h->dots_l_)
41     return;
42
43   if (!dotcol_p_)
44     {
45       dotcol_p_ = new Dot_column;
46       announce_element (Score_element_info (dotcol_p_, 0));
47     }
48
49   dotcol_p_->add_head (h);
50 }
51
52
53 ADD_THIS_TRANSLATOR(Dot_column_engraver);
54 IMPLEMENT_IS_TYPE_B1(Dot_column_engraver,Engraver);