-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMetaEvent.h
193 lines (174 loc) · 5.2 KB
/
MetaEvent.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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
//
// Created by madsy on 20.03.17.
//
#ifndef MIDITEST_METAEVENT_H
#define MIDITEST_METAEVENT_H
#include <vector>
#include "MidiEvent.h"
class MetaEvtSequenceNumber : public MidiEvent {
friend class MidiEventFactory;
public:
unsigned int getSequenceNumber() const;
void print() override;
protected:
MetaEvtSequenceNumber(unsigned int timestamp, unsigned int sequenceNum);
private:
unsigned int pSequenceNumber;
};
class MetaEvtText : public MidiEvent {
friend class MidiEventFactory;
public:
const std::string& getText() const;
void print() override;
protected:
MetaEvtText(unsigned int timestamp, const std::string& text);
private:
std::string pText;
};
class MetaEvtCopyright : public MidiEvent {
friend class MidiEventFactory;
public:
const std::string& getCopyRight() const;
void print() override;
protected:
MetaEvtCopyright(unsigned int timestamp, const std::string& copyright);
private:
std::string pCopyright;
};
class MetaEvtTrackName : public MidiEvent {
friend class MidiEventFactory;
public:
const std::string& getTrackName() const;
void print() override;
protected:
MetaEvtTrackName(unsigned int timestamp, const std::string& trackName);
private:
std::string pTrackName;
};
class MetaEvtInstrumentName : public MidiEvent {
friend class MidiEventFactory;
public:
const std::string& getInstrumentName() const;
void print() override;
protected:
MetaEvtInstrumentName(unsigned int timestamp, const std::string& instrumentName);
private:
std::string pInstrumentName;
};
class MetaEvtLyrics : public MidiEvent {
friend class MidiEventFactory;
public:
const std::string& getLyrics() const;
void print() override;
protected:
MetaEvtLyrics(unsigned int timestamp, const std::string& lyrics);
private:
std::string pLyrics;
};
class MetaEvtMarker : public MidiEvent {
friend class MidiEventFactory;
public:
const std::string& getMarker() const;
void print() override;
protected:
MetaEvtMarker(unsigned int timestamp, const std::string& marker);
private:
std::string pMarker;
};
class MetaEvtCuePoint : public MidiEvent {
friend class MidiEventFactory;
public:
const std::string& getCuePoint() const;
void print() override;
protected:
MetaEvtCuePoint(unsigned int timestamp, const std::string& cue);
private:
std::string pCuePoint;
};
class MetaEvtMidiChannelPrefix : public MidiEvent {
friend class MidiEventFactory;
public:
unsigned int getChannel() const;
void print() override;
protected:
MetaEvtMidiChannelPrefix(unsigned int timestamp, unsigned int channel);
private:
unsigned int pChannel;
};
class MetaEvtEndOfTrack : public MidiEvent {
friend class MidiEventFactory;
void print() override;
protected:
MetaEvtEndOfTrack(unsigned int timestamp);
};
class MetaEvtSetTempo : public MidiEvent {
friend class MidiEventFactory;
public:
unsigned int getTempo() const;
void print() override;
//24 bit tempo
protected:
MetaEvtSetTempo(unsigned int timestamp, unsigned int tempo);
private:
unsigned int pTempo;
};
class MetaEvtSMPTEOffset : public MidiEvent {
friend class MidiEventFactory;
public:
unsigned int getHours() const;
unsigned int getMinutes() const;
unsigned int getSeconds() const;
unsigned int getFrames() const;
unsigned int getSubFrames() const;
void print() override;
protected:
MetaEvtSMPTEOffset(unsigned int timestamp, unsigned int hours, unsigned int minutes, unsigned int seconds, unsigned int frames, unsigned int frame_fraction);
private:
unsigned int pHours;
unsigned int pMinutes;
unsigned int pSeconds;
unsigned int pFrames;
unsigned int pFractionFrames;
};
class MetaEvtTimeSignature : public MidiEvent {
friend class MidiEventFactory;
public:
unsigned int getNumerator() const;
unsigned int getDenominator() const;
unsigned int getClocksPerTick() const;
unsigned int getNotesPerClock() const;
void print() override;
//notes_per_clock is number of 1/32 notes per 24 midi clocks. Usually 8, so 1/4 note = 24 midi clocks
protected:
MetaEvtTimeSignature(unsigned int timestamp, unsigned int numerator, unsigned int denominator, unsigned int clocks_per_tick, unsigned int notes_per_clock);
private:
unsigned int pNumerator;
unsigned int pDenominator;
unsigned int pClocksPerTick;
unsigned int pNotesPerClock;
};
class MetaEvtKeySignature : public MidiEvent {
friend class MidiEventFactory;
public:
unsigned int getSharpFlats() const;
unsigned int getMinorMajor() const;
void print() override;
protected:
MetaEvtKeySignature(unsigned int timestamp, unsigned int sharpflats, unsigned int minormajor);
private:
unsigned int pSharpFlats;
unsigned int pMinorMajor;
};
class MetaEvtSequencerSpecific : public MidiEvent {
friend class MidiEventFactory;
public:
unsigned int getManufacturerID() const;
const std::vector<unsigned char>& getData() const;
void print() override;
protected:
MetaEvtSequencerSpecific(unsigned int timestamp, const std::vector<unsigned char>& data);
private:
std::vector<unsigned char> pData;
};
/* TODO: implement Key Signature and Sequencer-Specific Meta-event */
#endif //MIDITEST_METAEVENT_H