-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathevent.cpp
More file actions
86 lines (71 loc) · 1.13 KB
/
event.cpp
File metadata and controls
86 lines (71 loc) · 1.13 KB
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
//event.cpp
#include "event.h"
Event::Event(Note *n) {
note=n;
type=NOTE;
}
Event::Event(Silence *s) {
silence=s;
type=SILENCE;
}
Event::Event() {
type=LOOP_START;
note=0;
}
Event::Event(Type t) {
type=t;
}
Event::Event(int n) {
type=LOOP_END;
repeats=n;
}
Event::Event(int control, int value){
type=CONTROL_CHANGE;
CC.control=control;
CC.value=value;
}
Event::Event(SysEx *sx) {
type=SYSEX;
sysEx=sx;
}
Event::Event(Chord *c) {
type=CHORD;
chord=c;
}
Event::Event(Type t, int v) {
type=t;
value=v;
}
Event::Event(Channel *c, string l):Wait(c,l){
type=WAIT;
}
Event::Event(Channel *c){
channel=c;
type=BREAK;
}
Event::Event(vector <int> v):values(v){
type=SWEEP;
}
bool Event::isQueueEvent(){
switch(type) {
case NOTE:
case PROGRAM_CHANGE:
case CONTROL_CHANGE:
case CLOCK_TICK:
case CHORD:
case START:
case STOP:
case SYSEX: return true;
default: return false;
}
}
bool Event::isFlowControlEvent(){
switch(type) {
case LABEL:
case BREAK:
case LOOP_START:
case LOOP_END:
case FIRST_ENDING: return true;
default: return false;
}
}