]> git.donarmstrong.com Git - lilypond.git/blob - src/melodicstaff.cc
release: 0.0.10
[lilypond.git] / src / melodicstaff.cc
1 #include "melodicstaff.hh"
2 #include "keyitem.hh"
3 #include "stem.hh"
4 #include "rest.hh"
5 #include "notehead.hh"
6 #include "paper.hh"
7 #include "molecule.hh"
8 #include "linestaff.hh"
9 #include "rhythmstaff.hh"
10 #include "sccol.hh" 
11 #include "localkeyitem.hh"
12
13 const int NO_LINES=5;
14
15
16 void
17 Melodic_staff::set_output(PScore*ps)
18 {
19     theline = new Linestaff(NO_LINES,ps);
20     Simple_staff::set_output(ps);
21 }
22
23
24 Notehead*
25 Melodic_staff::get_notehead(Note_req *rq, int bottom)
26 {        
27     int b  = rq->rhythmic()->balltype;
28     int d  = rq->rhythmic()->dots;
29     
30     Notehead *n =new Notehead((NO_LINES-1)*2);
31     n->balltype =b;
32     n->dots = d;
33     n->position = rq->note()->height() + bottom;
34     return n;
35 }
36
37 Item *
38 Melodic_staff::get_TYPESET_item(Command*com)
39 {
40     if (com->args[0] == "KEY") {
41         return new Keyitem(NO_LINES);   // urgh.
42     } else
43         return Simple_staff::get_TYPESET_item(com);
44 }
45
46 Stem *
47 Melodic_staff::get_stem(Stem_req*rq)
48 {
49     Stem * s = new Stem(NO_LINES-1);
50     s->flag = rq->stem_number;
51     return s;
52 }
53
54 /*
55   creation
56   */
57 Staff *
58 get_new_melodicstaff()
59 {
60     return new Melodic_staff;
61 }
62
63
64
65 Melodic_staff*
66 Melodic_staff::clone()const
67 {
68     return new Melodic_staff(*this);
69 }
70
71 Local_key_item* Melodic_staff::get_local_key_item()
72 {
73     return new Local_key_item(-2);
74 }
75