-
Notifications
You must be signed in to change notification settings - Fork 0
/
ChannelEvent.h
132 lines (99 loc) · 2.47 KB
/
ChannelEvent.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
//
// Created by madsy on 19.03.17.
//
#ifndef MIDITEST_CHANNELEVENT_H
#define MIDITEST_CHANNELEVENT_H
#include "MidiEvent.h"
class MidiEventFactory;
//Base class for channel-based events. All channel-based events have a channel.
class ChannelEvent : public MidiEvent {
public:
friend class MidiEventFactory;
virtual unsigned int pGetChannelIndex() const override;
void print() override;
protected:
ChannelEvent(unsigned int timestamp, int ch);
private:
int pChannel;
};
class ChEvtNoteOff : public ChannelEvent {
public:
friend class MidiEventFactory;
int getKey() const;
int getVelocity() const;
void print() override;
protected:
ChEvtNoteOff(unsigned int timestamp, int ch, int k, int v);
private:
int pKey;
int pVelocity;
};
class ChEvtNoteOn : public ChannelEvent {
public:
friend class MidiEventFactory;
int getKey() const;
int getVelocity() const;
void print() override;
protected:
ChEvtNoteOn(unsigned int timestamp, int ch, int k, int v);
private:
int pKey;
int pVelocity;
};
//Polyphonic Key Pressure
class ChEvtAfterTouch1 : public ChannelEvent {
public:
friend class MidiEventFactory;
int getKey() const;
int getPressure() const;
void print() override;
protected:
ChEvtAfterTouch1(unsigned int timestamp, int ch, int k, int p);
private:
int pKey;
int pPressure;
};
class ChEvtControlChange : public ChannelEvent {
public:
friend class MidiEventFactory;
int getControllerID() const;
int getValue() const;
void print() override;
protected:
ChEvtControlChange(unsigned int timestamp, int ch, int id, int val);
private:
int pControllerID;
int pValue;
};
class ChEvtProgramChange : public ChannelEvent {
public:
friend class MidiEventFactory;
int getPatchValue() const;
void print() override;
protected:
ChEvtProgramChange(unsigned int timestamp, int ch, int patch);
private:
int pPatch;
};
//Channel pressure
class ChEvtAfterTouch2 : public ChannelEvent {
public:
friend class MidiEventFactory;
int getPressure() const;
void print() override;
protected:
ChEvtAfterTouch2(unsigned int timestamp, int ch, int p);
private:
int pPressure;
};
class ChEvtPitchWheel : public ChannelEvent {
public:
friend class MidiEventFactory;
int getValue() const;
void print() override;
protected:
ChEvtPitchWheel(unsigned int timestamp, int ch, int v);
private:
int pValue;
};
#endif //MIDITEST_CHANNELEVENT_H