]> git.donarmstrong.com Git - lilypond.git/blob - lily/rhythmic-head.cc
release: 1.3.131
[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--2001 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 */
8
9 #include "rhythmic-head.hh"
10 #include "debug.hh"
11 #include "rest.hh"
12 #include "stem.hh"
13 #include "staff-symbol-referencer.hh"
14 #include "item.hh"
15
16
17 Item*
18 Rhythmic_head::dots_l (Grob*me) 
19 {
20   SCM s = me->get_grob_property ("dot");
21   return dynamic_cast<Item*> (unsmob_grob (s));
22 }
23
24 int
25 Rhythmic_head::balltype_i (Grob*me) 
26 {
27   SCM s = me->get_grob_property ("duration-log");
28   
29   return gh_number_p (s) ? gh_scm2int (s) : 0;
30 }
31
32 Item*
33 Rhythmic_head::stem_l (Grob*me) 
34 {
35   SCM s = me->get_grob_property ("stem");
36   return dynamic_cast<Item*> (unsmob_grob (s));
37 }
38
39 int
40 Rhythmic_head::dot_count (Grob*me) 
41 {
42   return dots_l (me)
43     ? gh_scm2int (dots_l (me)->get_grob_property ("dot-count")) : 0;
44 }
45
46 void
47 Rhythmic_head::set_dots (Grob*me,Item *dot_l)
48 {
49   me->set_grob_property ("dot", dot_l->self_scm ());
50 }
51
52
53 void
54 Rhythmic_head::set_interface (Grob*me)
55 {
56   me->set_interface (ly_symbol2scm ("rhythmic-head-interface"));
57 }
58
59 bool
60 Rhythmic_head::has_interface (Grob*me)
61 {
62   return me &&  me->has_interface (ly_symbol2scm ("rhythmic-head-interface"));
63 }