]> git.donarmstrong.com Git - lilypond.git/blob - src/melodicstaff.cc
release: 0.0.9
[lilypond.git] / src / melodicstaff.cc
1 #include "melodicstaff.hh"
2 #include "stem.hh"
3 #include "rest.hh"
4 #include "notehead.hh"
5 #include "paper.hh"
6 #include "molecule.hh"
7 #include "linestaff.hh"
8 #include "rhythmstaff.hh"
9 #include "sccol.hh" 
10
11 const int NO_LINES=5;
12 const int BOTTOM_POSITION=2;    // e is on bottom line of 5-staff...
13
14 void
15 Melodic_staff::set_output(PScore*ps)
16 {
17     theline = new Linestaff(NO_LINES,ps);
18     Simple_staff::set_output(ps);
19 }
20
21
22 Notehead*
23 Melodic_staff::get_notehead(Note_req *rq)
24 {        
25     int b  = rq->rhythmic()->balltype;
26     int d  = rq->rhythmic()->dots;
27     
28     Notehead *n =new Notehead((NO_LINES-1)*2);
29     n->balltype =b;
30     n->dots = d;
31     n->position = rq->note()->height() - BOTTOM_POSITION;
32     return n;
33 }
34
35
36 Stem *
37 Melodic_staff::get_stem(Stem_req*rq)
38 {
39     Stem * s = new Stem(NO_LINES-1);
40     s->flag = rq->stem_number;
41     return s;
42 }
43
44 /*
45   creation
46   */
47 Staff *
48 get_new_melodicstaff()
49 {
50     return new Melodic_staff;
51 }
52
53
54
55 Melodic_staff*
56 Melodic_staff::clone()const
57 {
58     return new Melodic_staff(*this);
59 }