lilypond-0.0.40
[lilypond.git] / src / melodicstaff.cc
blobdf760d6a7afd6a756c77af90d970c099d3660c3f
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 "linepstaff.hh"
9 //#include "rhythmstaff.hh"
10 #include "sccol.hh"
11 #include "localkeyitem.hh"
12 #include "request.hh"
14 const int NO_LINES=5;
17 void
18 Melodic_staff::set_output(PScore*ps)
20 theline_l_ = new Linestaff(NO_LINES,ps); // theline_l_ is added to pscore later.
21 Simple_staff::set_output(ps);
25 Notehead*
26 Melodic_staff::get_notehead(Note_req *rq, int bottom)
28 Notehead *n =new Notehead((NO_LINES-1)*2);
29 n->set_rhythmic(rq->rhythmic());
30 n->position = rq->note()->height() + bottom;
31 n->defined_ch_c_l_m = rq->defined_ch_c_l_m;
32 return n;
35 Item *
36 Melodic_staff::get_TYPESET_item(Command*com)
38 if (com->args[0] == "KEY") {
39 return new Keyitem(NO_LINES); // urgh. depends on clef.
40 } else
41 return Simple_staff::get_TYPESET_item(com);
44 Stem *
45 Melodic_staff::get_stem(Stem_req*rq)
47 Stem * s = new Stem(NO_LINES-1);
48 s->flag = rq->balltype;
49 return s;
52 Rest*
53 Melodic_staff::get_rest(Rest_req*rq)
55 Rest*r = Simple_staff::get_rest(rq);
56 if (rq->balltype <= 2)
57 r->translate(Offset(0, NO_LINES * paper()->internote()));
58 return r;
61 Local_key_item*
62 Melodic_staff::get_local_key_item()
64 return new Local_key_item(-2);