]> git.donarmstrong.com Git - lilypond.git/blob - rhythmstaff.cc
98d17d522ce75b11621dfc056b4c6d67d9c27461
[lilypond.git] / rhythmstaff.cc
1 #include "molecule.hh"
2 #include "notehead.hh"
3 #include "stem.hh"
4 #include "linestaff.hh"
5 #include "rhythmstaff.hh"
6 #include "paper.hh"
7 #include "sccol.hh" 
8
9
10 void
11 Rhythmic_staff::set_output(PScore*ps)
12 {
13     theline = new Linestaff(1,ps);
14     Simple_staff::set_output(ps);
15 }
16
17
18 void
19 Rhythmic_column::typeset_command(Command *com, int breakst)
20 {
21     Item *i =new Item;
22     Molecule*m = create_command_mol(com);
23     i->output=m;
24     m->translate(Offset(0,
25                         -staff_->score_->paper_->standard_height()/2));
26     typeset_item(i, breakst);
27 }
28
29 void
30 Rhythmic_column::typeset_req(Request *rq)
31 {
32     Item *i ;
33     if (rq->note()) {
34         Notehead *n =new Notehead(1);
35         n->balltype = rq->rhythmic()->balltype;
36         n->dots = rq->rhythmic()->dots;
37         n->position = 0;
38         i = n;
39     } else if (rq->rest()) {
40         i =new Item;
41         Molecule*m=create_req_mol(rq);
42         i->output=m;
43     }
44     typeset_item(i);
45 }
46
47 void
48 Rhythmic_column::typeset_stem(Stem_req*rq)
49 {
50     Stem * s = new Stem(0);
51     s->minnote = s->maxnote = 0;
52     s->flag = rq->stem_number;
53     typeset_item(s);
54 }
55
56 /*
57   creation
58   */
59 Staff *
60 get_new_rhythmstaff()
61 {
62     return new Rhythmic_staff;
63 }
64
65
66 Staff_column*
67 Rhythmic_staff::create_col(Score_column*s)
68 {
69     return new Rhythmic_column(s,this);
70 }
71
72 Rhythmic_staff*
73 Rhythmic_staff::clone() const
74 {
75     return new Rhythmic_staff(*this);
76 }