2 rhythmic-column-grav.cc -- implement Rhythmic_column_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
9 #include "rhythmic-column-engraver.hh"
10 #include "note-head.hh"
12 #include "note-column.hh"
14 #include "dot-column.hh"
15 #include "musical-request.hh"
17 Rhythmic_column_engraver::Rhythmic_column_engraver()
26 Rhythmic_column_engraver::process_acknowledged ()
28 if (rhead_l_arr_.size ())
32 ncol_p_ = new Note_column;
33 announce_element (Score_element_info (ncol_p_, 0));
36 for (int i=0; i < rhead_l_arr_.size (); i++)
38 ncol_p_->add_head (rhead_l_arr_[i]);
40 rhead_l_arr_.set_size (0);
48 ncol_p_->set_dotcol (dotcol_l_);
53 ncol_p_->set_stem (stem_l_);
57 for (int i=0; i < script_l_arr_.size(); i++)
60 ncol_p_->add_script (script_l_arr_[i]);
63 script_l_arr_.clear();
68 Rhythmic_column_engraver::acknowledge_element (Score_element_info i)
70 Item * item = dynamic_cast <Item *> (i.elem_l_);
73 if (dynamic_cast<Script *> (item)
75 && dynamic_cast <Musical_req *> (i.req_l_))
77 script_l_arr_.push ((Script*)item);
79 else if (dynamic_cast<Stem *> (item))
81 stem_l_ = (Stem*) item;
83 else if (dynamic_cast<Rhythmic_head *> (item))
85 rhead_l_arr_.push ((Rhythmic_head*)item);
87 else if (dynamic_cast<Dot_column *> (item))
89 dotcol_l_ = (Dot_column*) item;
94 Rhythmic_column_engraver::do_pre_move_processing()
98 if (! ncol_p_->h_shift_b_)
100 ncol_p_->h_shift_b_ = get_property ("hshift").operator bool ();
102 ncol_p_->dir_ =(Direction) int(get_property ("ydirection"));
104 typeset_element (ncol_p_);
110 Rhythmic_column_engraver::do_post_move_processing()
112 script_l_arr_.clear();
120 IMPLEMENT_IS_TYPE_B1(Rhythmic_column_engraver,Engraver);
121 ADD_THIS_TRANSLATOR(Rhythmic_column_engraver);