2007-05-30 21:56:52 +00:00
|
|
|
/* ScummVM - Graphic Adventure Engine
|
|
|
|
*
|
|
|
|
* ScummVM is the legal property of its developers, whose names
|
|
|
|
* are too numerous to list here. Please refer to the COPYRIGHT
|
|
|
|
* file distributed with this source distribution.
|
2002-12-08 20:19:01 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
2005-10-18 01:30:26 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2002-12-08 20:19:01 +00:00
|
|
|
*
|
2006-02-11 12:47:47 +00:00
|
|
|
* $URL$
|
|
|
|
* $Id$
|
2002-12-08 20:19:01 +00:00
|
|
|
*/
|
|
|
|
|
2008-05-14 14:56:29 +00:00
|
|
|
#include "sound/midiplugin.h"
|
2002-12-08 20:19:01 +00:00
|
|
|
#include "sound/mpu401.h"
|
|
|
|
|
|
|
|
/* NULL driver */
|
|
|
|
class MidiDriver_NULL : public MidiDriver_MPU401 {
|
|
|
|
public:
|
2003-06-11 18:30:28 +00:00
|
|
|
int open() { return 0; }
|
2002-12-08 20:19:01 +00:00
|
|
|
void send(uint32 b) { }
|
|
|
|
};
|
|
|
|
|
2008-05-14 14:56:29 +00:00
|
|
|
|
|
|
|
// Plugin interface
|
|
|
|
|
|
|
|
class NullMidiPlugin : public MidiPluginObject {
|
|
|
|
public:
|
|
|
|
virtual const char *getName() const {
|
|
|
|
return "No music";
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual const char *getId() const {
|
|
|
|
return "null";
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual int getCapabilities() const {
|
|
|
|
return MDT_MIDI | MDT_PCSPK | MDT_ADLIB | MDT_TOWNS;
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual PluginError createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const;
|
|
|
|
};
|
|
|
|
|
|
|
|
PluginError NullMidiPlugin::createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const {
|
|
|
|
*mididriver = new MidiDriver_NULL();
|
|
|
|
|
|
|
|
return kNoError;
|
|
|
|
}
|
|
|
|
|
|
|
|
MidiDriver *MidiDriver_NULL_create(Audio::Mixer *mixer) {
|
|
|
|
MidiDriver *mididriver;
|
|
|
|
|
|
|
|
NullMidiPlugin p;
|
|
|
|
p.createInstance(mixer, &mididriver);
|
|
|
|
|
|
|
|
return mididriver;
|
2002-12-08 20:19:01 +00:00
|
|
|
}
|
2006-02-11 19:01:06 +00:00
|
|
|
|
|
|
|
#ifdef DISABLE_ADLIB
|
|
|
|
MidiDriver *MidiDriver_ADLIB_create(Audio::Mixer *mixer) {
|
2008-05-14 14:56:29 +00:00
|
|
|
return MidiDriver_NULL_create(mixer);
|
2006-02-11 19:01:06 +00:00
|
|
|
}
|
|
|
|
#endif
|
2008-05-14 14:56:29 +00:00
|
|
|
|
|
|
|
//#if PLUGIN_ENABLED_DYNAMIC(NULL)
|
|
|
|
//REGISTER_PLUGIN_DYNAMIC(NULL, PLUGIN_TYPE_MIDI, NullMidiPlugin);
|
|
|
|
//#else
|
|
|
|
REGISTER_PLUGIN_STATIC(NULL, PLUGIN_TYPE_MIDI, NullMidiPlugin);
|
|
|
|
//#endif
|