-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathMIDICommand.h
66 lines (55 loc) · 1.36 KB
/
MIDICommand.h
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
60
61
62
63
64
65
66
#ifndef MIDIMESSAGE_H
#define MIDIMESSAGE_H
class MIDICommand
{
public:
enum MIDICommandType {NOTEON, NOTEOFF};
MIDICommand();
MIDICommand(MIDICommandType type, unsigned char channel, unsigned char note, unsigned char velocity);
MIDICommandType getType();
void setType(const MIDICommandType & type);
unsigned char getNote();
void setNote(const unsigned char & note);
unsigned char getVelocity();
void setVelocity(const unsigned char & velocity);
unsigned char getChannel();
void setChannel(const unsigned char & channel);
private:
MIDICommandType type_;
unsigned char channel_;
unsigned char note_;
unsigned char velocity_;
};
inline MIDICommand::MIDICommandType MIDICommand::getType()
{
return type_;
}
inline void MIDICommand::setType(const MIDICommand::MIDICommandType & type)
{
type_ = type;
}
inline unsigned char MIDICommand::getNote()
{
return note_;
}
inline void MIDICommand::setNote(const unsigned char & note)
{
note_ = note;
}
inline unsigned char MIDICommand::getVelocity()
{
return velocity_;
}
inline void MIDICommand::setVelocity(const unsigned char & velocity)
{
velocity_ = velocity;
}
inline unsigned char MIDICommand::getChannel()
{
return channel_;
}
inline void MIDICommand::setChannel(const unsigned char & channel)
{
channel_ = channel;
}
#endif // MIDIMESSAGE_H