lilypond-1.3.145
[lilypond.git] / lily / g-stem-staff-side.cc
blob4d96f2ff52add8f4c066fcc8acb1f4c55fdba0ce
1 /*
2 g-stem-staff-side.cc -- implement G_stem_staff_side
4 source file of the GNU LilyPond music typesetter
6 (c) 1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
8 */
10 #include "g-stem-staff-side.hh"
11 #include "stem.hh"
13 G_stem_staff_side_item::G_stem_staff_side_item ()
15 stem_l_ =0;
16 relative_dir_ = CENTER;
19 void
20 G_stem_staff_side_item::do_substitute_element_pointer (Score_element*o,
21 Score_element*n)
23 if (o == stem_l_)
25 stem_l_ = dynamic_cast<Stem*> (n);
29 void
30 G_stem_staff_side_item::set_stem (Stem*s)
32 stem_l_ =s;
33 add_dependency (s);
37 Direction
38 G_stem_staff_side_item::get_default_direction () const
40 return relative_dir_ * stem_l_->dir_;
43 void
44 G_stem_staff_side_item::do_pre_processing ()
46 SCM p = remove_elt_property (padding_scm_sym);
47 if (p != SCM_BOOL_F && stem_l_)
49 p = SCM_CDR (p);
50 set_elt_property (padding_scm_sym,
51 gh_double2scm(stem_l_->staff_line_leading_f ()
52 * gh_scm2double (p)));
54 G_staff_side_item::do_pre_processing ();