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 Rhythmic_column_engraver::Rhythmic_column_engraver()
27 Rhythmic_column_engraver::process_acknowledged ()
29 if (rhead_l_arr_.size ())
33 ncol_p_ = new Note_column;
34 announce_element (Score_element_info (ncol_p_, 0));
37 for (int i=0; i < rhead_l_arr_.size (); i++)
39 if (!rhead_l_arr_[i]->parent_l(X_AXIS))
40 ncol_p_->add_head (rhead_l_arr_[i]);
42 rhead_l_arr_.set_size (0);
49 && !dotcol_l_->parent_l(X_AXIS))
51 ncol_p_->set_dotcol (dotcol_l_);
55 && !stem_l_->parent_l(X_AXIS))
57 ncol_p_->set_stem (stem_l_);
62 bool wegrace = get_property ("weAreGraceContext",0).to_bool ();
65 for (int i=0; i < grace_slur_endings_.size(); i++)
66 grace_slur_endings_[i]->add_column (ncol_p_);
67 grace_slur_endings_.clear ();
72 Rhythmic_column_engraver::acknowledge_element (Score_element_info i)
74 if ((get_property ("weAreGraceContext",0).to_bool () !=
75 (i.elem_l_->get_elt_property (grace_scm_sym) != SCM_BOOL_F))
76 && !dynamic_cast<Slur*> (i.elem_l_))
79 Item * item = dynamic_cast <Item *> (i.elem_l_);
80 if (Stem*s=dynamic_cast<Stem *> (item))
84 else if (Rhythmic_head*r=dynamic_cast<Rhythmic_head *> (item))
86 rhead_l_arr_.push (r);
88 else if (Dot_column*d =dynamic_cast<Dot_column *> (item))
92 else if (Slur *s = dynamic_cast<Slur*> (i.elem_l_))
95 end slurs starting on grace notes
98 if (s->get_elt_property (grace_scm_sym) != SCM_BOOL_F)
99 grace_slur_endings_.push (s);
104 Rhythmic_column_engraver::do_pre_move_processing()
108 Scalar sh = get_property ("horizontalNoteShift", 0);
111 ncol_p_->set_elt_property (horizontal_shift_scm_sym,
112 gh_int2scm (int (sh)));
115 sh = get_property ("forceHorizontalShift" ,0);
118 ncol_p_->set_elt_property (force_hshift_scm_sym,
119 gh_double2scm (double (sh)));
122 typeset_element (ncol_p_);
128 Rhythmic_column_engraver::do_post_move_processing()
130 grace_slur_endings_.clear ();
135 ADD_THIS_TRANSLATOR(Rhythmic_column_engraver);