]> git.donarmstrong.com Git - lilypond.git/blob - lily/rhythmic-head.cc
release: 1.3.67
[lilypond.git] / lily / rhythmic-head.cc
1 /*
2   rhythmic-head.cc -- implement Rhythmic_head
3
4   source file of the GNU LilyPond music typesetter
5
6   (c)  1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 */
8
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"
19
20
21 Item*
22 Rhythmic_head::dots_l () const
23 {
24   SCM s = get_elt_pointer ("dot");
25   return dynamic_cast<Item*> (unsmob_element (s));
26 }
27
28 int
29 Rhythmic_head::balltype_i () const
30 {
31   SCM s = get_elt_property ("duration-log");
32   
33   return gh_number_p (s) ? gh_scm2int (s) : 0;
34 }
35
36 Stem*
37 Rhythmic_head::stem_l () const
38 {
39   SCM s = get_elt_pointer ("stem");
40   return dynamic_cast<Stem*> (unsmob_element (s));
41 }
42
43 int
44 Rhythmic_head::dot_count () const
45 {
46   return dots_l ()
47     ? gh_scm2int (dots_l ()->get_elt_property ("dot-count")) : 0;
48 }
49
50 void
51 Rhythmic_head::set_dots (Item *dot_l)
52 {
53   set_elt_pointer ("dot", dot_l->self_scm_);
54 }
55
56
57 Rhythmic_head::Rhythmic_head (SCM s)
58   : Item (s)
59 {
60 }