-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathevent.h
More file actions
67 lines (62 loc) · 1.49 KB
/
event.h
File metadata and controls
67 lines (62 loc) · 1.49 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
//event.h
#ifndef EVENT_H
#define EVENT_H
#include <string>
#include <alsa/asoundlib.h>
#include "note.h"
#include "silence.h"
#include "sysex.h"
#include "chord.h"
#include "label.h"
struct Wait_t{
Channel *channel;
string label;
Wait_t(Channel *c, string l):channel(c),label(l){}
};
class Event {
public:
enum Type {NOTE, LOOP_START, LOOP_END, FIRST_ENDING, PROGRAM_CHANGE, CONTROL_CHANGE, SYSEX, CHORD, SILENCE, VOLUME, TIME, GATE, CLOCKONOFF, CLOCK_TICK,
START, STOP, LABEL, WAIT, WAKEUP, JUMP, SWEEP, BREAK};
Type type;
union {
Note *note;
Silence *silence;
SysEx *sysEx;
int programNumber;
int repeats; //for loops
int value; //for volume,
struct {
int control;
int value;
} CC;
struct {
int numerator;
int division;
} TM;
struct Wait_t Wait;
Chord *chord;
bool clockOn;
Label *label;
snd_seq_tick_time_t tick; //for WAKEUP
vector<int> values; //for sweep
Channel *channel; //for BREAK
};
Event(Note *n);
Event(Silence *s);
Event();
Event(Type t);
Event(int n); //LOOP_END
Event(int control, int value); //CONTROL_CHANGE
Event(SysEx *sx);
Event(Chord *c);
Event(Type t, int value);
Event(bool clk):clockOn(clk){type=CLOCKONOFF;}
Event(Label *l):label(l){type=LABEL;}
Event(Channel *n, string l); //wait and jump
Event(Channel *n); //BREAK
Event(vector <int> v);
bool isQueueEvent();
bool isFlowControlEvent();
//~Event(){}
};
#endif