diff options
author | Martin Kiewitz | 2015-05-31 12:16:30 +0200 |
---|---|---|
committer | Martin Kiewitz | 2015-05-31 12:16:30 +0200 |
commit | 35fe594133e3b68f5f77db9416d4a73f5924ba3e (patch) | |
tree | afd4a6a42f5b57c95b1ece19b4db85eaea795689 /engines/sherlock/scalpel/drivers | |
parent | 742b04cc49b499397e8b8e7e426e4d313ffcdc98 (diff) | |
download | scummvm-rg350-35fe594133e3b68f5f77db9416d4a73f5924ba3e.tar.gz scummvm-rg350-35fe594133e3b68f5f77db9416d4a73f5924ba3e.tar.bz2 scummvm-rg350-35fe594133e3b68f5f77db9416d4a73f5924ba3e.zip |
SHERLOCK: clean up adlib driver
Diffstat (limited to 'engines/sherlock/scalpel/drivers')
-rw-r--r-- | engines/sherlock/scalpel/drivers/adlib.cpp | 59 | ||||
-rw-r--r-- | engines/sherlock/scalpel/drivers/mididriver.h | 56 |
2 files changed, 1 insertions, 114 deletions
diff --git a/engines/sherlock/scalpel/drivers/adlib.cpp b/engines/sherlock/scalpel/drivers/adlib.cpp index 29ca1ba2bc..db1151c841 100644 --- a/engines/sherlock/scalpel/drivers/adlib.cpp +++ b/engines/sherlock/scalpel/drivers/adlib.cpp @@ -32,8 +32,6 @@ namespace Sherlock { -#define USE_SCI_MIDI_PLAYER 1 - #define SHERLOCK_ADLIB_VOICES_COUNT 9 #define SHERLOCK_ADLIB_NOTES_COUNT 96 @@ -286,29 +284,6 @@ private: void pitchBendChange(byte MIDIchannel, byte parameter1, byte parameter2); }; -#if USE_SCI_MIDI_PLAYER -class MidiPlayer_AdLib : public MidiPlayer { -public: - MidiPlayer_AdLib() : MidiPlayer() { _driver = new MidiDriver_AdLib(g_system->getMixer()); } - ~MidiPlayer_AdLib() { - delete _driver; - _driver = 0; - } - - int open(); - void close(); - - byte getPlayId() const; - int getPolyphony() const { return SHERLOCK_ADLIB_VOICES_COUNT; } - bool hasRhythmChannel() const { return false; } - void setVolume(byte volume) { static_cast<MidiDriver_AdLib *>(_driver)->setVolume(volume); } - - //int getLastChannel() const { return (static_cast<const MidiDriver_AdLib *>(_driver)->useRhythmChannel() ? 8 : 15); } - - void newMusicData(byte *musicData, int32 musicDataSize) { static_cast<MidiDriver_AdLib *>(_driver)->newMusicData(musicData, musicDataSize); } -}; -#endif - int MidiDriver_AdLib::open() { int rate = _mixer->getOutputRate(); @@ -650,43 +625,9 @@ void MidiDriver_AdLib::setRegister(int reg, int value) { } uint32 MidiDriver_AdLib::property(int prop, uint32 param) { -#if 0 - switch(prop) { - case MIDI_PROP_MASTER_VOLUME: - if (param != 0xffff) - _masterVolume = param; - return _masterVolume; - default: - break; - } -#endif return 0; } -#if USE_SCI_MIDI_PLAYER -int MidiPlayer_AdLib::open() { - return static_cast<MidiDriver_AdLib *>(_driver)->open(); -} - -void MidiPlayer_AdLib::close() { - if (_driver) { - _driver->close(); - } -} - -byte MidiPlayer_AdLib::getPlayId() const { - return 0x00; -} - -MidiPlayer *MidiPlayer_AdLib_create() { - return new MidiPlayer_AdLib(); -} - -void MidiPlayer_AdLib_newMusicData(MidiPlayer *driver, byte *musicData, int32 musicDataSize) { - static_cast<MidiPlayer_AdLib *>(driver)->newMusicData(musicData, musicDataSize); -} -#endif - MidiDriver *MidiDriver_AdLib_create() { return new MidiDriver_AdLib(g_system->getMixer()); } diff --git a/engines/sherlock/scalpel/drivers/mididriver.h b/engines/sherlock/scalpel/drivers/mididriver.h index f1366f8ebc..64213315e8 100644 --- a/engines/sherlock/scalpel/drivers/mididriver.h +++ b/engines/sherlock/scalpel/drivers/mididriver.h @@ -24,65 +24,11 @@ #define SHERLOCK_SOFTSEQ_MIDIDRIVER_H #include "sherlock/sherlock.h" -//#include "audio/mididrv.h" +#include "audio/mididrv.h" #include "common/error.h" namespace Sherlock { -#define USE_SCI_MIDIPLAYER 1 - -#if USE_SCI_MIDIPLAYER -enum { - MIDI_CHANNELS = 16, - MIDI_PROP_MASTER_VOLUME = 0 -}; - -#define MIDI_RHYTHM_CHANNEL 9 - -class MidiPlayer : public MidiDriver_BASE { -protected: - MidiDriver *_driver; - int8 _reverb; - -public: - MidiPlayer() : _driver(0), _reverb(-1) { } - - virtual int open() { return _driver->open(); } - virtual void close() { _driver->close(); } - virtual void send(uint32 b) { _driver->send(b); } - virtual uint32 getBaseTempo() { return _driver->getBaseTempo(); } - virtual bool hasRhythmChannel() const = 0; - virtual void setTimerCallback(void *timer_param, Common::TimerManager::TimerProc timer_proc) { _driver->setTimerCallback(timer_param, timer_proc); } - - virtual byte getPlayId() const = 0; - virtual int getPolyphony() const = 0; - virtual int getFirstChannel() const { return 0; } - //virtual int getLastChannel() const { return 15; } - - virtual void setVolume(byte volume) { - if(_driver) - _driver->property(MIDI_PROP_MASTER_VOLUME, volume); - } - - virtual int getVolume() { - return _driver ? _driver->property(MIDI_PROP_MASTER_VOLUME, 0xffff) : 0; - } - - // Returns the current reverb, or -1 when no reverb is active - int8 getReverb() const { return _reverb; } - // Sets the current reverb, used mainly in MT-32 - virtual void setReverb(int8 reverb) { _reverb = reverb; } - - // Special stuff for Sherlock Holmes -// virtual void newMusicData(byte *musicData, int32 musicDataSize); - -//protected: -}; - -extern MidiPlayer *MidiPlayer_AdLib_create(); -extern void MidiPlayer_AdLib_newMusicData(MidiPlayer *driver, byte *musicData, int32 musicDataSize); -#endif - extern MidiDriver *MidiDriver_AdLib_create(); extern void MidiDriver_AdLib_newMusicData(MidiDriver *driver, byte *musicData, int32 musicDataSize); |