]> git.donarmstrong.com Git - lilypond.git/blob - lily/rhythmic-head.cc
patch::: 1.3.9.hwn2
[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
22 int
23 Rhythmic_head::dots_i () const
24 {
25   return dots_l_ ? dots_l_->dots_i_ : 0;
26 }
27   
28 void
29 Rhythmic_head::do_post_processing ()
30 {
31   if (dots_l_)
32     {
33       dots_l_->set_position(int (position_f ()));
34     }
35 }
36
37
38 void
39 Rhythmic_head::add_dots (Dots *dot_l)
40 {
41   dots_l_ = dot_l;  
42   dot_l->add_dependency (this);  
43 }
44
45 Rhythmic_head::Rhythmic_head ()
46 {
47   dots_l_ =0;
48   balltype_i_ =0;
49   stem_l_ =0;
50 }
51
52 void
53 Rhythmic_head::do_substitute_element_pointer (Score_element*o,Score_element*n)
54 {
55   Staff_symbol_referencer::do_substitute_element_pointer (o,n);
56   if (o == dots_l_)
57     dots_l_ = dynamic_cast<Dots *> (n) ;
58   else if (o == stem_l_)
59     stem_l_ = dynamic_cast<Stem*>(n);
60 }
61
62
63 void
64 Rhythmic_head::do_print () const
65 {
66 #ifndef NPRINT
67   DEBUG_OUT << "balltype = "<< balltype_i_ << "dots = " << dots_i ();
68 #endif
69 }
70