2 rhythmic-column-grav.cc -- implement Rhythmic_column_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--2001 Han-Wen Nienhuys <hanwen@cs.uu.nl>
11 #include "engraver.hh"
12 #include "rhythmic-head.hh"
14 #include "note-column.hh"
15 #include "dot-column.hh"
16 #include "musical-request.hh"
19 class Rhythmic_column_engraver :public Engraver
21 Link_array<Grob> rhead_l_arr_;
27 VIRTUAL_COPY_CONS (Translator);
28 virtual void acknowledge_grob (Grob_info);
29 virtual void create_grobs ();
30 virtual void stop_translation_timestep ();
31 virtual void start_translation_timestep ();
33 Rhythmic_column_engraver ();
39 Rhythmic_column_engraver::Rhythmic_column_engraver ()
48 Rhythmic_column_engraver::create_grobs ()
50 if (rhead_l_arr_.size ())
54 ncol_p_ = new Item (get_property ("NoteColumn"));
55 Note_column::set_interface (ncol_p_);
56 announce_grob (ncol_p_, 0);
59 for (int i=0; i < rhead_l_arr_.size (); i++)
61 if (!rhead_l_arr_[i]->parent_l (X_AXIS))
62 Note_column::add_head (ncol_p_, rhead_l_arr_[i]);
64 rhead_l_arr_.set_size (0);
71 && !dotcol_l_->parent_l (X_AXIS))
73 Note_column::set_dotcol (ncol_p_, dotcol_l_);
77 && !stem_l_->parent_l (X_AXIS))
79 Note_column::set_stem (ncol_p_, stem_l_);
87 Rhythmic_column_engraver::acknowledge_grob (Grob_info i)
89 Item * item = dynamic_cast <Item *> (i.elem_l_);
90 if (item && Stem::has_interface (item))
94 else if (item && Rhythmic_head::has_interface (item))
96 rhead_l_arr_.push (item);
98 else if (item && Dot_column::has_interface (item))
105 Rhythmic_column_engraver::stop_translation_timestep ()
109 typeset_grob (ncol_p_);
115 Rhythmic_column_engraver::start_translation_timestep ()
121 ADD_THIS_TRANSLATOR (Rhythmic_column_engraver);