lilypond-1.3.65
[lilypond.git] / lily / rhythmic-head.cc
blobb6a83b6d438ca5a33b91d0ebaebff7874ba391f5
1 /*
2 rhythmic-head.cc -- implement Rhythmic_head
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 */
9 #include "rhythmic-head.hh"
10 #include "debug.hh"
11 #include "molecule.hh"
12 #include "paper-def.hh"
13 #include "lookup.hh"
14 #include "rest.hh"
15 #include "dots.hh"
16 #include "paper-score.hh"
17 #include "stem.hh"
18 #include "staff-symbol-referencer.hh"
21 Dots*
22 Rhythmic_head::dots_l () const
24 SCM s = get_elt_pointer ("dot");
25 return dynamic_cast<Dots*> (unsmob_element (s));
28 int
29 Rhythmic_head::balltype_i () const
31 SCM s = get_elt_property ("duration-log");
33 return gh_number_p (s) ? gh_scm2int (s) : 0;
36 Stem*
37 Rhythmic_head::stem_l () const
39 SCM s = get_elt_pointer ("stem");
40 return dynamic_cast<Stem*> (unsmob_element (s));
43 int
44 Rhythmic_head::dot_count () const
46 return dots_l ()
47 ? gh_scm2int (dots_l ()->get_elt_property ("dot-count")) : 0;
50 GLUE_SCORE_ELEMENT(Rhythmic_head,after_line_breaking);
51 SCM
52 Rhythmic_head::member_after_line_breaking ()
54 if (Dots *d = dots_l ())
56 Staff_symbol_referencer_interface si (d);
57 Staff_symbol_referencer_interface me (d);
58 si.set_position(int (me.position_f ()));
61 return SCM_UNDEFINED;
65 void
66 Rhythmic_head::add_dots (Dots *dot_l)
68 set_elt_pointer ("dot", dot_l->self_scm_);
69 dot_l->add_dependency (this);
73 Rhythmic_head::Rhythmic_head (SCM s)
74 : Item (s)