]> git.donarmstrong.com Git - lilypond.git/blob - lily/rest.cc
release: 0.0.44
[lilypond.git] / lily / rest.cc
1 /*
2   rest.cc -- implement Rest
3
4   source file of the LilyPond music typesetter
5
6   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
7 */
8 #include "duration.hh"
9 #include "rest.hh"
10 #include "dimen.hh" 
11 #include "debug.hh"
12 #include "paper-def.hh"
13 #include "lookup.hh"
14 #include "molecule.hh"
15 #include "rest.hh"
16
17 Rest::Rest(Duration d)
18 {
19     balltype = d.type_i_;
20     dots = d.dots_i_;
21     pos_i_ = 0;
22 }
23
24
25 void
26 Rest::do_print()const
27 {
28 #ifndef NPRINT
29     mtor << "Rest "<<balltype<< "dots " << dots;
30     Item::print();
31 #endif
32 }
33
34 Molecule*
35 Rest::brew_molecule_p()const
36 {
37     Paper_def *p =paper();
38
39     Symbol s;
40     s = p->lookup_l()->rest(balltype);
41     
42     Molecule *m = new Molecule(Atom(s));
43     if (dots) {
44         Symbol d =p->lookup_l()->dots(dots);
45         Molecule dm;
46         dm.add(Atom(d));
47         m->add_right(dm);
48     }
49     m->translate(Offset(0,pos_i_ * paper()->internote()));
50     return m;
51 }
52