ScummVM API documentation
midiparser_hmp.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef AUDIO_MIDIPARSER_HMP_H
23 #define AUDIO_MIDIPARSER_HMP_H
24 
25 #include "audio/midiparser_smf.h"
26 
34 protected:
35  enum class HmpVersion {
36  VERSION_1,
37  VERSION_013195
38  };
39 
40  static const char HMP_HEADER[];
41  static const char HMP_HEADER_VERSION_1[];
42  static const char HMP_HEADER_VERSION_013195[];
43 
44  uint32 readDelta(const byte *&data) override;
45 
46  HmpVersion determineVersion(const byte *pos);
47 
48 public:
49  MidiParser_HMP(int8 source = -1);
50 
51  bool loadMusic(const byte *data, uint32 size) override;
52 
53  int32 determineDataSize(Common::SeekableReadStream *stream) override;
54 
55 protected:
56  HmpVersion _version;
57  uint32 _branchOffset;
58  // Total track length in seconds
59  uint32 _songLength;
60  uint32 _channelPriorities[16];
61  uint32 _deviceTrackMappings[32][5];
62  uint8 _restoreControllers[128];
63  uint32 _callbackPointer;
64  uint32 _callbackSegment;
65 };
66 
67 #endif
int32 determineDataSize(Common::SeekableReadStream *stream) override
Definition: stream.h:745
Definition: midiparser_hmp.h:33
Definition: midiparser_smf.h:30