-
Notifications
You must be signed in to change notification settings - Fork 1
/
MidiParser_Facade.h
42 lines (39 loc) · 1.17 KB
/
MidiParser_Facade.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
# pragma once
# pragma comment(lib, "MidiParser.lib")
class MidiParser_Facade
{
// http://www.cs.cmu.edu/~music/cmsip/readings/Standard-MIDI-file-format-updated.pdf
// http://www.nyu.edu/classes/bello/FMT_files/9_MIDI_code.pdf
typedef std::vector<std::vector<unsigned>> Times_;
typedef std::vector<std::vector<int16_t>> Notes_;
Times_ times_;
Notes_ notes_;
std::string log_;
std::vector<std::string> trackNames_;
MidiParser_Facade() = delete;
public:
explicit MidiParser_Facade(const char* fileName); // may throw
explicit MidiParser_Facade(const wchar_t* fileName);// This module must be called just once, \
// therefore everything is done in constructor
const Times_& GetMilliSeconds() const
{
return times_;
}
const Notes_& GetNotes() const
{
return notes_;
}
const std::string& GetLog() const
{
return log_;
}
const std::vector<std::string>& GetTrackNames() const
{
return trackNames_;
}
private:
MidiParser_Facade(const MidiParser_Facade&) = delete;
MidiParser_Facade(const MidiParser_Facade&&) = delete;
MidiParser_Facade& operator=(const MidiParser_Facade&) = delete;
MidiParser_Facade&& operator=(const MidiParser_Facade&&) = delete;
};