]> git.donarmstrong.com Git - lilypond.git/blob - src/rest.cc
release: 0.0.9
[lilypond.git] / src / rest.cc
1 #include "rest.hh"
2 #include "dimen.hh" 
3 #include "debug.hh"
4 #include "paper.hh"
5 #include "lookup.hh"
6 #include "molecule.hh"
7
8
9 Rest::Rest(int t, int d)
10 {
11     balltype = t;
12     dots = d;
13 }
14
15 void
16 Rest::print()const
17 {
18     mtor << "Rest "<<balltype<< "dots " << dots;
19     Item::print();
20 }
21
22 void
23 Rest::preprocess()
24 {
25     brew_molecole();
26 }
27
28 void
29 Rest::brew_molecole()
30 {
31     assert(pstaff_);
32     assert(!output);
33     Paperdef *p =paper();
34
35     Symbol s;
36     s = p->lookup_->rest(balltype);
37     
38     Molecule *m = new Molecule(Atom(s));
39     if (dots) {
40         Symbol d =p->lookup_->dots(dots);
41         Molecule dm;
42         dm.add(Atom(d));
43         m->add_right(dm);
44     }
45     output = m;
46 }
47