diff options
Diffstat (limited to 'engines/parallaction')
-rw-r--r-- | engines/parallaction/parallaction_br.cpp | 4 | ||||
-rw-r--r-- | engines/parallaction/parallaction_ns.cpp | 4 | ||||
-rw-r--r-- | engines/parallaction/sound.h | 4 | ||||
-rw-r--r-- | engines/parallaction/sound_br.cpp | 12 | ||||
-rw-r--r-- | engines/parallaction/sound_ns.cpp | 14 |
5 files changed, 19 insertions, 19 deletions
diff --git a/engines/parallaction/parallaction_br.cpp b/engines/parallaction/parallaction_br.cpp index 457c421fd7..619a4f7559 100644 --- a/engines/parallaction/parallaction_br.cpp +++ b/engines/parallaction/parallaction_br.cpp @@ -61,9 +61,7 @@ Common::Error Parallaction_br::init() { _disk = new DosDisk_br(this); } _disk->setLanguage(2); // NOTE: language is now hardcoded to English. Original used command-line parameters. - MidiDriver::DeviceHandle dev = MidiDriver::detectDevice(MDT_MIDI | MDT_ADLIB | MDT_PREFER_GM); - MidiDriver *driver = MidiDriver::createMidi(dev); - _soundManI = new DosSoundMan_br(this, driver); + _soundManI = new DosSoundMan_br(this); } else { _disk = new AmigaDisk_br(this); _disk->setLanguage(2); // NOTE: language is now hardcoded to English. Original used command-line parameters. diff --git a/engines/parallaction/parallaction_ns.cpp b/engines/parallaction/parallaction_ns.cpp index c3d917a33d..ffac22e118 100644 --- a/engines/parallaction/parallaction_ns.cpp +++ b/engines/parallaction/parallaction_ns.cpp @@ -166,9 +166,7 @@ Common::Error Parallaction_ns::init() { _disk->init(); if (getPlatform() == Common::kPlatformPC) { - MidiDriver::DeviceHandle dev = MidiDriver::detectDevice(MDT_MIDI | MDT_ADLIB | MDT_PREFER_GM); - MidiDriver *driver = MidiDriver::createMidi(dev); - _soundManI = new DosSoundMan_ns(this, driver); + _soundManI = new DosSoundMan_ns(this); _soundManI->setMusicVolume(ConfMan.getInt("music_volume")); } else { _soundManI = new AmigaSoundMan_ns(this); diff --git a/engines/parallaction/sound.h b/engines/parallaction/sound.h index 7b3eff37cb..455189d1fc 100644 --- a/engines/parallaction/sound.h +++ b/engines/parallaction/sound.h @@ -140,7 +140,7 @@ class DosSoundMan_ns : public SoundMan_ns { public: - DosSoundMan_ns(Parallaction_ns *vm, MidiDriver *midiDriver); + DosSoundMan_ns(Parallaction_ns *vm); ~DosSoundMan_ns(); void playMusic(); void stopMusic(); @@ -228,7 +228,7 @@ class DosSoundMan_br : public SoundMan_br { Audio::AudioStream *loadChannelData(const char *filename, Channel *ch, bool looping); public: - DosSoundMan_br(Parallaction_br *vm, MidiDriver *midiDriver); + DosSoundMan_br(Parallaction_br *vm); ~DosSoundMan_br(); void playMusic(); diff --git a/engines/parallaction/sound_br.cpp b/engines/parallaction/sound_br.cpp index 1bc085fd34..9f807f5c73 100644 --- a/engines/parallaction/sound_br.cpp +++ b/engines/parallaction/sound_br.cpp @@ -204,7 +204,7 @@ MidiParser *createParser_MSC() { class MidiPlayer_MSC : public Audio::MidiPlayer { public: - MidiPlayer_MSC(MidiDriver *driver); + MidiPlayer_MSC(); ~MidiPlayer_MSC(); void play(Common::SeekableReadStream *stream); @@ -227,9 +227,11 @@ private: -MidiPlayer_MSC::MidiPlayer_MSC(MidiDriver *driver) +MidiPlayer_MSC::MidiPlayer_MSC() : _midiData(0), _paused(false) { - _driver = driver; + + MidiDriver::DeviceHandle dev = MidiDriver::detectDevice(MDT_MIDI | MDT_ADLIB | MDT_PREFER_GM); + _driver = MidiDriver::createMidi(dev); assert(_driver); int ret = _driver->open(); @@ -333,8 +335,8 @@ void MidiPlayer_MSC::timerCallback(void *p) { player->updateTimer(); } -DosSoundMan_br::DosSoundMan_br(Parallaction_br *vm, MidiDriver *driver) : SoundMan_br(vm) { - _midiPlayer = new MidiPlayer_MSC(driver); +DosSoundMan_br::DosSoundMan_br(Parallaction_br *vm) : SoundMan_br(vm) { + _midiPlayer = new MidiPlayer_MSC(); assert(_midiPlayer); } diff --git a/engines/parallaction/sound_ns.cpp b/engines/parallaction/sound_ns.cpp index 8f3f0c39e6..239ababb54 100644 --- a/engines/parallaction/sound_ns.cpp +++ b/engines/parallaction/sound_ns.cpp @@ -42,7 +42,7 @@ namespace Parallaction { class MidiPlayer : public Audio::MidiPlayer { public: - MidiPlayer(MidiDriver *driver); + MidiPlayer(); ~MidiPlayer(); void play(Common::SeekableReadStream *stream); @@ -57,10 +57,12 @@ private: bool _paused; }; -MidiPlayer::MidiPlayer(MidiDriver *driver) +MidiPlayer::MidiPlayer() : _midiData(0), _paused(false) { - assert(driver); - _driver = driver; + + MidiDriver::DeviceHandle dev = MidiDriver::detectDevice(MDT_MIDI | MDT_ADLIB | MDT_PREFER_GM); + _driver = MidiDriver::createMidi(dev); + assert(_driver); int ret = _driver->open(); if (ret == 0) { @@ -137,8 +139,8 @@ void MidiPlayer::timerCallback(void *p) { player->updateTimer(); } -DosSoundMan_ns::DosSoundMan_ns(Parallaction_ns *vm, MidiDriver *midiDriver) : SoundMan_ns(vm), _playing(false) { - _midiPlayer = new MidiPlayer(midiDriver); +DosSoundMan_ns::DosSoundMan_ns(Parallaction_ns *vm) : SoundMan_ns(vm), _playing(false) { + _midiPlayer = new MidiPlayer(); } DosSoundMan_ns::~DosSoundMan_ns() { |