summaryrefslogtreecommitdiff
path: root/src/melodicstaff.cc
blob: 17916d2f228df22d559a269c731d5d806ce67bfb (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#include "melodicstaff.hh"
#include "stem.hh"
#include "rest.hh"
#include "notehead.hh"
#include "paper.hh"
#include "molecule.hh"
#include "linestaff.hh"
#include "rhythmstaff.hh"
#include "sccol.hh" 

const int NO_LINES=5;
const int BOTTOM_POSITION=2;	// e is on bottom line of 5-staff...

void
Melodic_staff::set_output(PScore*ps)
{
    theline = new Linestaff(NO_LINES,ps);
    Simple_staff::set_output(ps);
}


Notehead*
Melodic_staff::get_notehead(Note_req *rq)
{        
    int b  = rq->rhythmic()->balltype;
    int d  = rq->rhythmic()->dots;
    
    Notehead *n =new Notehead((NO_LINES-1)*2);
    n->balltype =b;
    n->dots = d;
    n->position = rq->note()->height() - BOTTOM_POSITION;
    return n;
}


Stem *
Melodic_staff::get_stem(Stem_req*rq)
{
    Stem * s = new Stem(NO_LINES-1);
    s->flag = rq->stem_number;
    return s;
}

/*
  creation
  */
Staff *
get_new_melodicstaff()
{
    return new Melodic_staff;
}



Melodic_staff*
Melodic_staff::clone()const
{
    return new Melodic_staff(*this);
}