-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMidiEventFactory.h
50 lines (46 loc) · 1.79 KB
/
MidiEventFactory.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
//
// Created by madsy on 19.03.17.
//
#ifndef MIDITEST_MIDIEVENTFACTORY_H
#define MIDITEST_MIDIEVENTFACTORY_H
#include <fstream>
#include "MidiEvent.h"
#include "MidiIOUtils.h"
#include "ChannelEvent.h"
#include "SystemCommonEvent.h"
#include "SystemRealtimeEvent.h"
#include "MetaEvent.h"
class MidiEventFactory {
public:
MidiEventFactory(){};
~MidiEventFactory();
static std::shared_ptr<MidiEvent> createMidiEvent(unsigned int absolutetime, unsigned int& bytesread, std::ifstream& strm);
private:
static std::shared_ptr<MidiEvent>
createChannelEvent(unsigned int& bytesread,
std::ifstream& strm,
MidiEvent::ChannelEventType type,
unsigned int timestamp,
unsigned int absolutetime,
int channel);
static std::shared_ptr<MidiEvent>
createSystemCommonEvent(unsigned int& bytesread,
std::ifstream& strm,
MidiEvent::SystemCommonEventType type,
unsigned int timestamp,
unsigned int absolutetime);
static std::shared_ptr<MidiEvent>
createSystemRealtimeEvent(unsigned int& bytesread,
std::ifstream& strm,
MidiEvent::SystemRealtimeEventType type,
unsigned int timestamp,
unsigned int absolutetime);
static std::shared_ptr<MidiEvent>
createMetaEvent(unsigned int& bytesread,
std::ifstream& strm,
MidiEvent::MetaEventType type,
unsigned int timestamp,
unsigned int absolutetime);
static unsigned int previousChannelEventCode;
};
#endif //MIDITEST_MIDIEVENTFACTORY_H