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_;
29 TRANSLATOR_DECLARATIONS(Rhythmic_column_engraver);
32 virtual void acknowledge_grob (Grob_info);
33 virtual void create_grobs ();
34 virtual void stop_translation_timestep ();
35 virtual void start_translation_timestep ();
40 Rhythmic_column_engraver::Rhythmic_column_engraver ()
52 Rhythmic_column_engraver::create_grobs ()
54 if (rhead_l_arr_.size ())
58 note_column_ = new Item (get_property ("NoteColumn"));
59 Note_column::set_interface (note_column_);
60 announce_grob (note_column_, 0);
63 for (int i=0; i < rhead_l_arr_.size (); i++)
65 if (!rhead_l_arr_[i]->get_parent (X_AXIS))
66 Note_column::add_head (note_column_, rhead_l_arr_[i]);
68 rhead_l_arr_.set_size (0);
75 && !dotcol_l_->get_parent (X_AXIS))
77 Note_column::set_dotcol (note_column_, dotcol_l_);
81 && !stem_l_->get_parent (X_AXIS))
83 Note_column::set_stem (note_column_, stem_l_);
91 Rhythmic_column_engraver::acknowledge_grob (Grob_info i)
93 Item * item = dynamic_cast <Item *> (i.grob_l_);
94 if (item && Stem::has_interface (item))
98 else if (item && Rhythmic_head::has_interface (item))
100 rhead_l_arr_.push (item);
102 else if (item && Dot_column::has_interface (item))
109 Rhythmic_column_engraver::stop_translation_timestep ()
113 typeset_grob (note_column_);
119 typeset_grob (spacing_);
120 last_spacing_ = spacing_;
126 Rhythmic_column_engraver::start_translation_timestep ()
134 ENTER_DESCRIPTION(Rhythmic_column_engraver,
135 /* descr */ "Generates NoteColumn, an objects that groups stems, noteheads and rests.",
136 /* creats*/ "NoteColumn",
137 /* acks */ "stem-interface rhythmic-head-interface dot-column-interface",