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_;
26 TRANSLATOR_DECLARATIONS(Rhythmic_column_engraver);
29 virtual void acknowledge_grob (Grob_info);
30 virtual void create_grobs ();
31 virtual void stop_translation_timestep ();
32 virtual void start_translation_timestep ();
38 Rhythmic_column_engraver::Rhythmic_column_engraver ()
47 Rhythmic_column_engraver::create_grobs ()
49 if (rhead_l_arr_.size ())
53 ncol_p_ = new Item (get_property ("NoteColumn"));
54 Note_column::set_interface (ncol_p_);
55 announce_grob (ncol_p_, 0);
58 for (int i=0; i < rhead_l_arr_.size (); i++)
60 if (!rhead_l_arr_[i]->parent_l (X_AXIS))
61 Note_column::add_head (ncol_p_, rhead_l_arr_[i]);
63 rhead_l_arr_.set_size (0);
70 && !dotcol_l_->parent_l (X_AXIS))
72 Note_column::set_dotcol (ncol_p_, dotcol_l_);
76 && !stem_l_->parent_l (X_AXIS))
78 Note_column::set_stem (ncol_p_, stem_l_);
86 Rhythmic_column_engraver::acknowledge_grob (Grob_info i)
88 Item * item = dynamic_cast <Item *> (i.grob_l_);
89 if (item && Stem::has_interface (item))
93 else if (item && Rhythmic_head::has_interface (item))
95 rhead_l_arr_.push (item);
97 else if (item && Dot_column::has_interface (item))
104 Rhythmic_column_engraver::stop_translation_timestep ()
108 typeset_grob (ncol_p_);
114 Rhythmic_column_engraver::start_translation_timestep ()
122 ENTER_DESCRIPTION(Rhythmic_column_engraver,
123 /* descr */ "Generates NoteColumn, an objects that groups stems, noteheads and rests.",
124 /* creats*/ "NoteColumn",
125 /* acks */ "stem-interface rhythmic-head-interface dot-column-interface",