]> git.donarmstrong.com Git - lilypond.git/blob - lily/rhythmic-head.cc
release: 1.1.58
[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       if (stem_l_)
39         dots_l_->resolve_dir_ = stem_l_->dir_;
40       dots_l_->position_i_ = position_i_;
41     }
42 }
43
44
45 void
46 Rhythmic_head::add_dots (Dots *dot_l)
47 {
48   dots_l_ = dot_l;  
49   dot_l->add_dependency (this);  
50 }
51
52 Rhythmic_head::Rhythmic_head ()
53 {
54   dots_l_ =0;
55   balltype_i_ =0;
56   dots_i_ = 0;
57   stem_l_ =0;
58   position_i_ =0;
59 }
60
61 void
62 Rhythmic_head::do_substitute_element_pointer (Score_element*o,Score_element*n)
63 {
64   if (o == dots_l_)
65     dots_l_ = dynamic_cast<Dots *> (n) ;
66   else if (o == stem_l_)
67     stem_l_ = dynamic_cast<Stem*>(n);
68 }
69
70
71 void
72 Rhythmic_head::do_print () const
73 {
74 #ifndef NPRINT
75   DOUT << "balltype = "<< balltype_i_ << "dots = " << dots_i_;
76 #endif
77 }
78