18
18
* along with this program; if not, write to the Free Software
19
19
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21
* $URL: https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/tags/release-1-2-1/backends/midi/stmidi.cpp $
22
* $Id: stmidi.cpp 50128 2010-06-21 21:36:36Z fingolfin $
34
34
* cycles. I might change so sysex messages are sent the other way later.
37
// Disable symbol overrides so that we can use system headers.
38
#define FORBIDDEN_SYMBOL_ALLOW_ALL
40
#include "common/scummsys.h"
37
42
#if defined __MINT__
39
44
#include <osbind.h>
40
#include "sound/mpu401.h"
45
#include "audio/mpu401.h"
41
46
#include "common/util.h"
42
#include "sound/musicplugin.h"
47
#include "audio/musicplugin.h"
44
49
class MidiDriver_STMIDI : public MidiDriver_MPU401 {
46
MidiDriver_STMIDI() : _isOpen (false) { }
51
MidiDriver_STMIDI() : _isOpen (false) { }
53
bool isOpen() const { return _isOpen; }
49
55
void send(uint32 b);
50
56
void sysEx(const byte *msg, uint16 length);
56
62
int MidiDriver_STMIDI::open() {
57
if ((_isOpen) && (!Bcostat(4)))
63
if (_isOpen && (!Bcostat(4)))
58
64
return MERR_ALREADY_OPEN;
59
65
warning("ST Midi Port Open");
119
125
class StMidiMusicPlugin : public MusicPluginObject {
121
const char *getName() const {
125
const char *getId() const {
129
MusicDevices getDevices() const;
130
Common::Error createInstance(MidiDriver **mididriver, MidiDriver::DeviceHandle = 0) const;
127
const char *getName() const {
131
const char *getId() const {
135
MusicDevices getDevices() const;
136
Common::Error createInstance(MidiDriver **mididriver, MidiDriver::DeviceHandle = 0) const;
133
139
MusicDevices StMidiMusicPlugin::getDevices() const {
134
MusicDevices devices;
135
// TODO: Return a different music type depending on the configuration
136
// TODO: List the available devices
137
devices.push_back(MusicDevice(this, "", MT_GM));
140
MusicDevices devices;
141
// TODO: Return a different music type depending on the configuration
142
// TODO: List the available devices
143
devices.push_back(MusicDevice(this, "", MT_GM));
141
147
Common::Error StMidiMusicPlugin::createInstance(MidiDriver **mididriver, MidiDriver::DeviceHandle) const {
142
*mididriver = new MidiDriver_STMIDI();
148
*mididriver = new MidiDriver_STMIDI();
144
return Common::kNoError;
150
return Common::kNoError;
147
153
//#if PLUGIN_ENABLED_DYNAMIC(STMIDI)
148
//REGISTER_PLUGIN_DYNAMIC(STMIDI, PLUGIN_TYPE_MUSIC, StMidiMusicPlugin);
154
//REGISTER_PLUGIN_DYNAMIC(STMIDI, PLUGIN_TYPE_MUSIC, StMidiMusicPlugin);
150
REGISTER_PLUGIN_STATIC(STMIDI, PLUGIN_TYPE_MUSIC, StMidiMusicPlugin);
156
REGISTER_PLUGIN_STATIC(STMIDI, PLUGIN_TYPE_MUSIC, StMidiMusicPlugin);