ScummVM API documentation
mt32.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 AGOS_DRIVERS_ACCOLADE_MT32_H
23#define AGOS_DRIVERS_ACCOLADE_MT32_H
24
25#include "audio/mt32gm.h"
26
27namespace AGOS {
28
30protected:
31 static const uint8 SFX_PROGRAM_BASE = 0x75;
32 static const uint8 SYSEX_INSTRUMENT_ASSIGNMENT[7];
33
34public:
36
37 int open(MidiDriver *driver, bool nativeMT32) override;
39 void send(int8 source, uint32 b) override;
40
41 int8 mapSourceChannel(uint8 source, uint8 dataChannel) override;
42 void deinitSource(uint8 source) override;
43
44 // Read the specified data from INSTR.DAT or MUSIC.DRV.
45 void readDriverData(byte *driverData, uint16 driverDataSize, bool isMusicDrv);
46
47 // Loads the specified instrument for the specified instrument source.
48 void loadSfxInstrument(uint8 source, byte *instrumentData);
49 // Changes the channel assigned to the specified SFX source to the SFX
50 // program number.
51 void changeSfxInstrument(uint8 source);
52
53protected:
54 // simple mapping between MIDI channel and MT32 channel
55 byte _channelRemapping[16];
56 // simple mapping between MIDI instruments and MT32 instruments
57 byte _instrumentRemapping[128];
58
59 // Indicates if a MIDI channel is locked by an SFX source and unavailable
60 // for music.
61 bool _channelLocks[MIDI_CHANNEL_COUNT];
62};
63
64} // End of namespace AGOS
65
66#endif
Definition: mt32.h:29
void deinitSource(uint8 source) override
void send(int8 source, uint32 b) override
int8 mapSourceChannel(uint8 source, uint8 dataChannel) override
Definition: mt32gm.h:111
void send(uint32 b) override
int open() override
Definition: mididrv.h:313