]> git.donarmstrong.com Git - lilypond.git/blob - lily/rest.cc
release: 0.1.15
[lilypond.git] / lily / rest.cc
1 /*
2   rest.cc -- implement 
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
7 */
8
9 #include "molecule.hh"
10 #include "paper-def.hh"
11 #include "lookup.hh"
12 #include "rest.hh"
13 #include "dots.hh"
14 #include "axis-group-element.hh"
15 #include "p-score.hh"
16
17 void
18 Rest::do_add_processing ()
19 {
20   if (balltype_i_ == 0)
21     position_i_ += 6;
22   else if (balltype_i_ == 1)
23     position_i_ += 4;
24   Rhythmic_head::do_add_processing ();
25   if (dots_l_)
26       dots_l_->position_i_ = position_i_;
27 }
28
29 Rest::Rest ()
30 {
31   position_i_ =0;
32 }
33
34 Molecule *
35 Rest::brew_molecule_p () const
36 {
37   int staff_size_i_ =8;
38   bool streepjes_b = (position_i_<-1) || (position_i_ > staff_size_i_+1);
39   
40   Atom s(paper ()->lookup_l()->rest (balltype_i_, streepjes_b));
41   Molecule * m = new Molecule ( Atom (s));
42   m->translate (position_i_ *  paper ()->internote_f (), Y_AXIS);
43   return m;
44 }
45
46 IMPLEMENT_IS_TYPE_B1(Rest, Rhythmic_head);