]> git.donarmstrong.com Git - lilypond.git/blob - lily/rhythmic-head.cc
Run `make grand-replace'.
[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--2008 Han-Wen Nienhuys <hanwen@xs4all.nl>
7 */
8
9 #include "rhythmic-head.hh"
10
11 #include "warn.hh"
12 #include "rest.hh"
13 #include "stem.hh"
14 #include "staff-symbol-referencer.hh"
15 #include "item.hh"
16
17 Item *
18 Rhythmic_head::get_dots (Grob *me)
19 {
20   SCM s = me->get_object ("dot");
21   return unsmob_item (s);
22 }
23
24 Item *
25 Rhythmic_head::get_stem (Grob *me)
26 {
27   SCM s = me->get_object ("stem");
28   return unsmob_item (s);
29 }
30
31 int
32 Rhythmic_head::dot_count (Grob *me)
33 {
34   return get_dots (me)
35     ? scm_to_int (get_dots (me)->get_property ("dot-count")) : 0;
36 }
37
38 void
39 Rhythmic_head::set_dots (Grob *me, Item *dot)
40 {
41   me->set_object ("dot", dot->self_scm ());
42 }
43
44 int
45 Rhythmic_head::duration_log (Grob *me)
46 {
47   SCM s = me->get_property ("duration-log");
48   return scm_is_number (s) ? scm_to_int (s) : 0;
49 }
50
51 ADD_INTERFACE (Rhythmic_head,
52                "Note head or rest.",
53                
54                /* properties */
55                "dot "
56                "duration-log "
57                "stem "
58                );