]> git.donarmstrong.com Git - lilypond.git/blob - lily/rhythmic-head.cc
patch::: 1.3.99.jcn2
[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 "font-metric.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 #include "item.hh"
20
21
22 Item*
23 Rhythmic_head::dots_l (Score_element*me) 
24 {
25   SCM s = me->get_elt_property ("dot");
26   return dynamic_cast<Item*> (unsmob_element (s));
27 }
28
29 int
30 Rhythmic_head::balltype_i (Score_element*me) 
31 {
32   SCM s = me->get_elt_property ("duration-log");
33   
34   return gh_number_p (s) ? gh_scm2int (s) : 0;
35 }
36
37 Item*
38 Rhythmic_head::stem_l (Score_element*me) 
39 {
40   SCM s = me->get_elt_property ("stem");
41   return dynamic_cast<Item*> (unsmob_element (s));
42 }
43
44 int
45 Rhythmic_head::dot_count (Score_element*me) 
46 {
47   return dots_l (me)
48     ? gh_scm2int (dots_l (me)->get_elt_property ("dot-count")) : 0;
49 }
50
51 void
52 Rhythmic_head::set_dots (Score_element*me,Item *dot_l)
53 {
54   me->set_elt_property ("dot", dot_l->self_scm ());
55 }
56
57
58 void
59 Rhythmic_head::set_interface (Score_element*me)
60 {
61   me->set_interface (ly_symbol2scm ("rhythmic-head-interface"));
62 }
63
64 bool
65 Rhythmic_head::has_interface (Score_element*me)
66 {
67   return me &&  me->has_interface (ly_symbol2scm ("rhythmic-head-interface"));
68 }