]> git.donarmstrong.com Git - lilypond.git/blob - lily/rhythmic-head.cc
release: 1.1.67
[lilypond.git] / lily / rhythmic-head.cc
1 /*
2   rhythmic-head.cc -- implement 
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 void
21 Rhythmic_head::do_add_processing ()
22 {
23   if (dots_i_ && !dots_l_)
24     {
25       assert (false);
26     }
27   if (dots_l_)
28     {
29       dots_l_->dots_i_ = dots_i_;
30     }
31 }
32
33 void
34 Rhythmic_head::do_post_processing ()
35 {
36   if (dots_l_)
37     {
38       dots_l_->position_i_ = position_i_;
39     }
40 }
41
42
43 void
44 Rhythmic_head::add_dots (Dots *dot_l)
45 {
46   dots_l_ = dot_l;  
47   dot_l->add_dependency (this);  
48 }
49
50 Rhythmic_head::Rhythmic_head ()
51 {
52   dots_l_ =0;
53   balltype_i_ =0;
54   dots_i_ = 0;
55   stem_l_ =0;
56   position_i_ =0;
57 }
58
59 void
60 Rhythmic_head::do_substitute_element_pointer (Score_element*o,Score_element*n)
61 {
62   if (o == dots_l_)
63     dots_l_ = dynamic_cast<Dots *> (n) ;
64   else if (o == stem_l_)
65     stem_l_ = dynamic_cast<Stem*>(n);
66 }
67
68
69 void
70 Rhythmic_head::do_print () const
71 {
72 #ifndef NPRINT
73   DOUT << "balltype = "<< balltype_i_ << "dots = " << dots_i_;
74 #endif
75 }
76