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>
9 #include "dimension-cache.hh"
11 #include "rhythmic-column-engraver.hh"
12 #include "note-head.hh"
14 #include "note-column.hh"
15 #include "dot-column.hh"
16 #include "musical-request.hh"
18 ADD_THIS_TRANSLATOR (Rhythmic_column_engraver);
20 Rhythmic_column_engraver::Rhythmic_column_engraver()
29 Rhythmic_column_engraver::process_acknowledged ()
31 if (rhead_l_arr_.size ())
35 ncol_p_ = new Note_column;
36 announce_element (Score_element_info (ncol_p_, 0));
39 for (int i=0; i < rhead_l_arr_.size (); i++)
41 if (!rhead_l_arr_[i]->parent_l(X_AXIS))
42 ncol_p_->add_head (rhead_l_arr_[i]);
44 rhead_l_arr_.set_size (0);
51 && !dotcol_l_->parent_l(X_AXIS))
53 ncol_p_->set_dotcol (dotcol_l_);
57 && !stem_l_->parent_l(X_AXIS))
59 ncol_p_->set_stem (stem_l_);
63 SCM wg = get_property ("weAreGraceContext",0);
64 bool wegrace = to_boolean (wg);
67 for (int i=0; i < grace_slur_endings_.size(); i++)
68 grace_slur_endings_[i]->add_column (ncol_p_);
69 grace_slur_endings_.clear ();
74 Rhythmic_column_engraver::acknowledge_element (Score_element_info i)
76 SCM wg = get_property ("weAreGraceContext",0);
77 bool wegrace = to_boolean (wg);
79 (i.elem_l_->get_elt_property ("grace") != SCM_UNDEFINED))
80 && !dynamic_cast<Slur*> (i.elem_l_))
83 Item * item = dynamic_cast <Item *> (i.elem_l_);
84 if (Stem*s=dynamic_cast<Stem *> (item))
88 else if (Rhythmic_head*r=dynamic_cast<Rhythmic_head *> (item))
90 rhead_l_arr_.push (r);
92 else if (Dot_column*d =dynamic_cast<Dot_column *> (item))
96 else if (Slur *s = dynamic_cast<Slur*> (i.elem_l_))
99 end slurs starting on grace notes
102 if (to_boolean (s->get_elt_property ("grace")))
103 grace_slur_endings_.push (s);
108 Rhythmic_column_engraver::do_pre_move_processing()
112 typeset_element (ncol_p_);
118 Rhythmic_column_engraver::do_post_move_processing()
120 grace_slur_endings_.clear ();