]> git.donarmstrong.com Git - lilypond.git/blob - lily/rhythmic-head.cc
release: 1.3.10
[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--1999 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
20
21 Dots*
22 Rhythmic_head::dots_l () const
23 {
24   SCM s = get_elt_property ("dot");
25   return dynamic_cast<Dots*> (unsmob_element (s));
26 }
27
28 Stem*
29 Rhythmic_head::stem_l () const
30 {
31   SCM s = get_elt_property ("stem");
32   return dynamic_cast<Stem*> (unsmob_element (s));
33 }
34
35 int
36 Rhythmic_head::dots_i () const
37 {
38   return dots_l () ? dots_l ()->dots_i_ : 0;
39 }
40   
41 void
42 Rhythmic_head::do_post_processing ()
43 {
44   if (dots_l ())
45     {
46       dots_l ()->set_position(int (position_f ()));
47     }
48 }
49
50
51 void
52 Rhythmic_head::add_dots (Dots *dot_l)
53 {
54   set_elt_property ("dot", dot_l->self_scm_);
55   dot_l->add_dependency (this);  
56 }
57
58 Rhythmic_head::Rhythmic_head ()
59 {
60   balltype_i_ =0;
61 }
62
63
64
65 void
66 Rhythmic_head::do_print () const
67 {
68 #ifndef NPRINT
69   DEBUG_OUT << "balltype = "<< balltype_i_ << "dots = " << dots_i ();
70 #endif
71 }
72