]> git.donarmstrong.com Git - lilypond.git/blob - lily/rhythmic-head.cc
release: 1.3.19
[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 "axis-group-element.hh"
17 #include "paper-score.hh"
18 #include "stem.hh"
19 #include "staff-symbol-referencer.hh"
20
21
22 Dots*
23 Rhythmic_head::dots_l () const
24 {
25   SCM s = get_elt_property ("dot");
26   return dynamic_cast<Dots*> (unsmob_element (s));
27 }
28
29 int
30 Rhythmic_head::balltype_i () const
31 {
32   SCM s = get_elt_property ("duration-log");
33   
34   return gh_number_p (s) ? gh_scm2int (s) : 0;
35 }
36
37 Stem*
38 Rhythmic_head::stem_l () const
39 {
40   SCM s = get_elt_property ("stem");
41   return dynamic_cast<Stem*> (unsmob_element (s));
42 }
43
44 int
45 Rhythmic_head::dot_count () const
46 {
47   return dots_l ()
48     ? gh_scm2int (dots_l ()->get_elt_property ("dot-count")) : 0;
49 }
50   
51 void
52 Rhythmic_head::do_post_processing ()
53 {
54   if (Dots *d = dots_l ())
55     {
56       Staff_symbol_referencer_interface si (d);
57       Staff_symbol_referencer_interface me (d);      
58       si.set_position(int (me.position_f ()));
59     }
60 }
61
62
63 void
64 Rhythmic_head::add_dots (Dots *dot_l)
65 {
66   set_elt_property ("dot", dot_l->self_scm_);
67   dot_l->add_dependency (this);  
68 }
69
70