]> git.donarmstrong.com Git - lilypond.git/blob - lily/rhythmic-head.cc
release: 1.1.0
[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--1998 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 "p-score.hh"
18
19 void
20 Rhythmic_head::do_add_processing ()
21 {
22   if (dots_i_ && !dots_l_)
23     {
24       Dots *d = new Dots;
25       add_dots (d);
26       pscore_l_->typeset_element (d);
27       axis_group_l_a_[Y_AXIS]->add_element (d);
28       axis_group_l_a_[X_AXIS]->add_element (d);
29     }
30   if (dots_l_)
31     {
32       dots_l_->no_dots_i_ = dots_i_;
33     }
34 }
35
36 void
37 Rhythmic_head::add_dots (Dots *dot_l)
38 {
39   dots_l_ = dot_l;  
40   dot_l->add_dependency (this);  
41 }
42
43
44 Rhythmic_head::Rhythmic_head ()
45 {
46   dots_l_ =0;
47   balltype_i_ =0;
48   dots_i_ = 0;
49 }
50
51 void
52 Rhythmic_head::do_substitute_dependent (Score_element*o,Score_element*n)
53 {
54   if (o == dots_l_)
55     dots_l_ = n ? (Dots*)dynamic_cast <Item *> (n) :0;
56 }
57
58 IMPLEMENT_IS_TYPE_B1(Rhythmic_head, Item);
59 void
60 Rhythmic_head::do_print () const
61 {
62 #ifndef NPRINT
63   DOUT << "balltype = "<< balltype_i_ << "dots = " << dots_i_;
64 #endif
65 }
66