diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sherlock/music.cpp | 24 | ||||
-rw-r--r-- | engines/sherlock/music.h | 1 | ||||
-rw-r--r-- | engines/sherlock/scalpel/drivers/adlib.cpp | 59 | ||||
-rw-r--r-- | engines/sherlock/scalpel/drivers/mididriver.h | 56 |
4 files changed, 1 insertions, 139 deletions
diff --git a/engines/sherlock/music.cpp b/engines/sherlock/music.cpp index a97e55d66b..0735f41d9a 100644 --- a/engines/sherlock/music.cpp +++ b/engines/sherlock/music.cpp @@ -29,8 +29,6 @@ namespace Sherlock { #define NUM_SONGS 45 -#define USE_SCI_MIDI_PLAYER 1 - /* This tells which song to play in each room, 0 = no song played */ static const char ROOM_SONG[62] = { 0, 20, 43, 6, 11, 2, 8, 15, 6, 28, @@ -216,34 +214,16 @@ Music::Music(SherlockEngine *vm, Audio::Mixer *mixer) : _vm(vm), _mixer(mixer) { _musicType = MidiDriver::getMusicType(dev); -#if USE_SCI_MIDI_PLAYER - _pMidiDrv = NULL; -#endif _driver = NULL; switch (_musicType) { case MT_ADLIB: -#if USE_SCI_MIDI_PLAYER - _pMidiDrv = MidiPlayer_AdLib_create(); -#else _driver = MidiDriver_AdLib_create(); -#endif break; default: _driver = MidiDriver::createMidi(dev); break; } -#if USE_SCI_MIDI_PLAYER - if (_pMidiDrv) { - assert(_pMidiDrv); - int ret = _pMidiDrv->open(); - if (ret == 0) { - _pMidiDrv->setTimerCallback(&_midiParser, &_midiParser.timerCallback); - } - _midiParser.setMidiDriver(_pMidiDrv); - _midiParser.setTimerRate(_pMidiDrv->getBaseTempo()); - } -#endif if (_driver) { assert(_driver); @@ -346,10 +326,6 @@ bool Music::playMusic(const Common::String &name) { if (_musicType == MT_ADLIB) { if (_driver) MidiDriver_AdLib_newMusicData(_driver, dataPos, dataSize); -#if USE_SCI_MIDI_PLAYER - if (_pMidiDrv) - MidiPlayer_AdLib_newMusicData(_pMidiDrv, dataPos, dataSize); -#endif } _midiParser.loadMusic(dataPos, dataSize); diff --git a/engines/sherlock/music.h b/engines/sherlock/music.h index c3710603cc..0ebc3e94e2 100644 --- a/engines/sherlock/music.h +++ b/engines/sherlock/music.h @@ -50,7 +50,6 @@ private: SherlockEngine *_vm; Audio::Mixer *_mixer; MidiParser_SH _midiParser; - MidiPlayer *_pMidiDrv; MidiDriver *_driver; public: 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); |