2 rhythmic-column-grav.cc -- implement Rhythmic_column_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
10 #include "rhythmic-column-engraver.hh"
11 #include "note-head.hh"
13 #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 if (!rhead_l_arr_[i]->dim_cache_[X_AXIS]->parent_l_)
39 ncol_p_->add_head (rhead_l_arr_[i]);
41 rhead_l_arr_.set_size (0);
48 && !dotcol_l_->dim_cache_[X_AXIS]->parent_l_)
50 ncol_p_->set_dotcol (dotcol_l_);
54 && !stem_l_->dim_cache_[X_AXIS]->parent_l_)
56 ncol_p_->set_stem (stem_l_);
61 bool wegrace = get_property ("weAreGraceContext",0).to_bool ();
64 for (int i=0; i < grace_slur_endings_.size(); i++)
65 grace_slur_endings_[i]->add_column (ncol_p_);
66 grace_slur_endings_.clear ();
71 Rhythmic_column_engraver::acknowledge_element (Score_element_info i)
73 if ((get_property ("weAreGraceContext",0).to_bool () !=
74 (i.elem_l_->get_elt_property (grace_scm_sym) != SCM_BOOL_F))
75 && !dynamic_cast<Slur*> (i.elem_l_))
78 Item * item = dynamic_cast <Item *> (i.elem_l_);
79 if (Stem*s=dynamic_cast<Stem *> (item))
83 else if (Rhythmic_head*r=dynamic_cast<Rhythmic_head *> (item))
85 rhead_l_arr_.push (r);
87 else if (Dot_column*d =dynamic_cast<Dot_column *> (item))
91 else if (Slur *s = dynamic_cast<Slur*> (i.elem_l_))
94 end slurs starting on grace notes
97 if (s->get_elt_property (grace_scm_sym) != SCM_BOOL_F)
98 grace_slur_endings_.push (s);
103 Rhythmic_column_engraver::do_pre_move_processing()
107 Scalar sh = get_property ("horizontalNoteShift", 0);
109 if (sh.to_bool () && sh.isnum_b ())
111 ncol_p_->set_elt_property (horizontal_shift_scm_sym,
112 gh_int2scm (int (sh)));
115 typeset_element (ncol_p_);
121 Rhythmic_column_engraver::do_post_move_processing()
123 grace_slur_endings_.clear ();
128 ADD_THIS_TRANSLATOR(Rhythmic_column_engraver);