diff options
-rw-r--r-- | engines/agos/agos.cpp | 2 | ||||
-rw-r--r-- | engines/draci/draci.cpp | 2 | ||||
-rw-r--r-- | engines/groovie/music.cpp | 2 | ||||
-rw-r--r-- | engines/kyra/kyra_v1.cpp | 2 | ||||
-rw-r--r-- | engines/lure/sound.cpp | 2 | ||||
-rw-r--r-- | engines/m4/m4.cpp | 2 | ||||
-rw-r--r-- | engines/made/made.cpp | 2 | ||||
-rw-r--r-- | engines/parallaction/parallaction_br.cpp | 2 | ||||
-rw-r--r-- | engines/parallaction/parallaction_ns.cpp | 2 | ||||
-rw-r--r-- | engines/queen/music.cpp | 2 | ||||
-rw-r--r-- | engines/saga/saga.cpp | 2 | ||||
-rw-r--r-- | engines/sci/sfx/music.cpp | 4 | ||||
-rw-r--r-- | engines/sci/sfx/music.h | 2 | ||||
-rw-r--r-- | engines/scumm/scumm.cpp | 2 | ||||
-rw-r--r-- | engines/sky/sky.cpp | 2 | ||||
-rw-r--r-- | engines/tinsel/tinsel.cpp | 2 | ||||
-rw-r--r-- | engines/touche/midi.cpp | 2 | ||||
-rw-r--r-- | sound/mididrv.cpp | 5 | ||||
-rw-r--r-- | sound/mididrv.h | 2 |
19 files changed, 23 insertions, 20 deletions
diff --git a/engines/agos/agos.cpp b/engines/agos/agos.cpp index 4f4c6fc0a2..2ebc0e0206 100644 --- a/engines/agos/agos.cpp +++ b/engines/agos/agos.cpp @@ -552,7 +552,7 @@ Common::Error AGOSEngine::init() { (getPlatform() == Common::kPlatformPC)) { // Setup midi driver - int midiDriver = MidiDriver::detectMusicDriver(MDT_ADLIB | MDT_MIDI); + MidiDriverType midiDriver = MidiDriver::detectMusicDriver(MDT_ADLIB | MDT_MIDI); _nativeMT32 = ((midiDriver == MD_MT32) || ConfMan.getBool("native_mt32")); _driver = MidiDriver::createMidi(midiDriver); diff --git a/engines/draci/draci.cpp b/engines/draci/draci.cpp index 785da9ad6e..9ccd1b598a 100644 --- a/engines/draci/draci.cpp +++ b/engines/draci/draci.cpp @@ -119,7 +119,7 @@ int DraciEngine::init() { _dubbingArchive = new SoundArchive(dubbingPath, kDubbingFrequency); _sound = new Sound(_mixer); - int midiDriver = MidiDriver::detectMusicDriver(MDT_MIDI | MDT_ADLIB | MDT_PREFER_MIDI); + MidiDriverType midiDriver = MidiDriver::detectMusicDriver(MDT_MIDI | MDT_ADLIB | MDT_PREFER_MIDI); bool native_mt32 = ((midiDriver == MD_MT32) || ConfMan.getBool("native_mt32")); //bool adlib = (midiDriver == MD_ADLIB); diff --git a/engines/groovie/music.cpp b/engines/groovie/music.cpp index b504ffde1f..1f38dab97e 100644 --- a/engines/groovie/music.cpp +++ b/engines/groovie/music.cpp @@ -383,7 +383,7 @@ MusicPlayerXMI::MusicPlayerXMI(GroovieEngine *vm, const Common::String >lName) _midiParser = MidiParser::createParser_XMIDI(); // Create the driver - int driver = detectMusicDriver(MDT_MIDI | MDT_ADLIB | MDT_PREFER_MIDI); + MidiDriverType driver = detectMusicDriver(MDT_MIDI | MDT_ADLIB | MDT_PREFER_MIDI); _driver = createMidi(driver); this->open(); diff --git a/engines/kyra/kyra_v1.cpp b/engines/kyra/kyra_v1.cpp index 875f4a6ba5..92feec7608 100644 --- a/engines/kyra/kyra_v1.cpp +++ b/engines/kyra/kyra_v1.cpp @@ -105,7 +105,7 @@ Common::Error KyraEngine_v1::init() { if (!_flags.useDigSound) { // We prefer AdLib over MIDI, since generally AdLib is better supported - int midiDriver = MidiDriver::detectMusicDriver(MDT_PCSPK | MDT_MIDI | MDT_ADLIB); + MidiDriverType midiDriver = MidiDriver::detectMusicDriver(MDT_PCSPK | MDT_MIDI | MDT_ADLIB); if (_flags.platform == Common::kPlatformFMTowns) { if (_flags.gameID == GI_KYRA1) diff --git a/engines/lure/sound.cpp b/engines/lure/sound.cpp index 271df25c19..674d0209d3 100644 --- a/engines/lure/sound.cpp +++ b/engines/lure/sound.cpp @@ -46,7 +46,7 @@ SoundManager::SoundManager() { _soundData = NULL; _paused = false; - int midiDriver = MidiDriver::detectMusicDriver(MDT_MIDI | MDT_ADLIB | MDT_PREFER_MIDI); + MidiDriverType midiDriver = MidiDriver::detectMusicDriver(MDT_MIDI | MDT_ADLIB | MDT_PREFER_MIDI); _isRoland = midiDriver != MD_ADLIB; _nativeMT32 = ((midiDriver == MD_MT32) || ConfMan.getBool("native_mt32")); diff --git a/engines/m4/m4.cpp b/engines/m4/m4.cpp index 094a3124c8..683aae2f46 100644 --- a/engines/m4/m4.cpp +++ b/engines/m4/m4.cpp @@ -150,7 +150,7 @@ Common::Error M4Engine::run() { _screen = new M4Surface(true); // Special form for creating screen reference - int midiDriver = MidiDriver::detectMusicDriver(MDT_MIDI | MDT_ADLIB | MDT_PREFER_MIDI); + MidiDriverType midiDriver = MidiDriver::detectMusicDriver(MDT_MIDI | MDT_ADLIB | MDT_PREFER_MIDI); bool native_mt32 = ((midiDriver == MD_MT32) || ConfMan.getBool("native_mt32")); MidiDriver *driver = MidiDriver::createMidi(midiDriver); diff --git a/engines/made/made.cpp b/engines/made/made.cpp index e826e3788a..d665c66115 100644 --- a/engines/made/made.cpp +++ b/engines/made/made.cpp @@ -95,7 +95,7 @@ MadeEngine::MadeEngine(OSystem *syst, const MadeGameDescription *gameDesc) : Eng _script = new ScriptInterpreter(this); - int midiDriver = MidiDriver::detectMusicDriver(MDT_MIDI | MDT_ADLIB | MDT_PREFER_MIDI); + MidiDriverType midiDriver = MidiDriver::detectMusicDriver(MDT_MIDI | MDT_ADLIB | MDT_PREFER_MIDI); bool native_mt32 = ((midiDriver == MD_MT32) || ConfMan.getBool("native_mt32")); //bool adlib = (midiDriver == MD_ADLIB); diff --git a/engines/parallaction/parallaction_br.cpp b/engines/parallaction/parallaction_br.cpp index 033350643e..80090f3f0b 100644 --- a/engines/parallaction/parallaction_br.cpp +++ b/engines/parallaction/parallaction_br.cpp @@ -61,7 +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. - int midiDriver = MidiDriver::detectMusicDriver(MDT_MIDI | MDT_ADLIB | MDT_PREFER_MIDI); + MidiDriverType midiDriver = MidiDriver::detectMusicDriver(MDT_MIDI | MDT_ADLIB | MDT_PREFER_MIDI); MidiDriver *driver = MidiDriver::createMidi(midiDriver); _soundManI = new DosSoundMan_br(this, driver); } else { diff --git a/engines/parallaction/parallaction_ns.cpp b/engines/parallaction/parallaction_ns.cpp index 4b25f536ac..e271ba595e 100644 --- a/engines/parallaction/parallaction_ns.cpp +++ b/engines/parallaction/parallaction_ns.cpp @@ -167,7 +167,7 @@ Common::Error Parallaction_ns::init() { _disk->init(); if (getPlatform() == Common::kPlatformPC) { - int midiDriver = MidiDriver::detectMusicDriver(MDT_MIDI | MDT_ADLIB | MDT_PREFER_MIDI); + MidiDriverType midiDriver = MidiDriver::detectMusicDriver(MDT_MIDI | MDT_ADLIB | MDT_PREFER_MIDI); MidiDriver *driver = MidiDriver::createMidi(midiDriver); _soundManI = new DosSoundMan_ns(this, driver); _soundManI->setMusicVolume(ConfMan.getInt("music_volume")); diff --git a/engines/queen/music.cpp b/engines/queen/music.cpp index 3d5bfbdf73..69d83b2c68 100644 --- a/engines/queen/music.cpp +++ b/engines/queen/music.cpp @@ -45,7 +45,7 @@ MidiMusic::MidiMusic(QueenEngine *vm) _queuePos = _lastSong = _currentSong = 0; queueClear(); - int midiDriver = MidiDriver::detectMusicDriver(MDT_MIDI | MDT_ADLIB | MDT_PREFER_MIDI); + MidiDriverType midiDriver = MidiDriver::detectMusicDriver(MDT_MIDI | MDT_ADLIB | MDT_PREFER_MIDI); _adlib = (midiDriver == MD_ADLIB); _nativeMT32 = ((midiDriver == MD_MT32) || ConfMan.getBool("native_mt32")); diff --git a/engines/saga/saga.cpp b/engines/saga/saga.cpp index 84d151223f..5553291cef 100644 --- a/engines/saga/saga.cpp +++ b/engines/saga/saga.cpp @@ -227,7 +227,7 @@ Common::Error SagaEngine::run() { _console = new Console(this); // Graphics should be initialized before music - int midiDriver = MidiDriver::detectMusicDriver(MDT_MIDI | MDT_ADLIB | MDT_PREFER_MIDI); + MidiDriverType midiDriver = MidiDriver::detectMusicDriver(MDT_MIDI | MDT_ADLIB | MDT_PREFER_MIDI); bool native_mt32 = ((midiDriver == MD_MT32) || ConfMan.getBool("native_mt32")); bool adlib = (midiDriver == MD_ADLIB); diff --git a/engines/sci/sfx/music.cpp b/engines/sci/sfx/music.cpp index ad0fe25b00..ea3ab28e63 100644 --- a/engines/sci/sfx/music.cpp +++ b/engines/sci/sfx/music.cpp @@ -252,7 +252,7 @@ void SciMusic::loadPatchMT32() { } } //---------------------------------------- -void SciMusic::soundInitSnd(SoundRes*res, sciSound *pSnd) { +void SciMusic::soundInitSnd(SoundRes *res, sciSound *pSnd) { //_mutex.lock(); SoundRes::tagTrack *pTrack = NULL; switch (_midiType) { @@ -268,6 +268,8 @@ void SciMusic::soundInitSnd(SoundRes*res, sciSound *pSnd) { case MD_MT32: pTrack = res->getTrackByType(SoundRes::kTrackMT32); break; + default: + break; } // attempting to select default MT-32/Roland track if (!pTrack) diff --git a/engines/sci/sfx/music.h b/engines/sci/sfx/music.h index 26aa2d2bb9..71729881e6 100644 --- a/engines/sci/sfx/music.h +++ b/engines/sci/sfx/music.h @@ -163,7 +163,7 @@ protected: Audio::Mixer *_pMixer; MidiDriver *_pMidiDrv; - int _midiType; + MidiDriverType _midiType; Common::Mutex _mutex; Common::Array<sciSound *> _playList; diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index 0fc43b8e22..2478a1c819 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -1635,7 +1635,7 @@ void ScummEngine_v100he::resetScumm() { #endif void ScummEngine::setupMusic(int midi) { - int midiDriver = MidiDriver::detectMusicDriver(midi); + MidiDriverType midiDriver = MidiDriver::detectMusicDriver(midi); _native_mt32 = ((midiDriver == MD_MT32) || ConfMan.getBool("native_mt32")); switch (midiDriver) { diff --git a/engines/sky/sky.cpp b/engines/sky/sky.cpp index 6b42141ee7..a1a1024e39 100644 --- a/engines/sky/sky.cpp +++ b/engines/sky/sky.cpp @@ -256,7 +256,7 @@ Common::Error SkyEngine::init() { _systemVars.gameVersion = _skyDisk->determineGameVersion(); - int midiDriver = MidiDriver::detectMusicDriver(MDT_ADLIB | MDT_MIDI | MDT_PREFER_MIDI); + MidiDriverType midiDriver = MidiDriver::detectMusicDriver(MDT_ADLIB | MDT_MIDI | MDT_PREFER_MIDI); if (midiDriver == MD_ADLIB) { _systemVars.systemFlags |= SF_SBLASTER; _skyMusic = new AdlibMusic(_mixer, _skyDisk); diff --git a/engines/tinsel/tinsel.cpp b/engines/tinsel/tinsel.cpp index 6a200b446d..f002a3beca 100644 --- a/engines/tinsel/tinsel.cpp +++ b/engines/tinsel/tinsel.cpp @@ -850,7 +850,7 @@ TinselEngine::TinselEngine(OSystem *syst, const TinselGameDescription *gameDesc) if (cd_num >= 0) _system->openCD(cd_num); - int midiDriver = MidiDriver::detectMusicDriver(MDT_MIDI | MDT_ADLIB | MDT_PREFER_MIDI); + MidiDriverType midiDriver = MidiDriver::detectMusicDriver(MDT_MIDI | MDT_ADLIB | MDT_PREFER_MIDI); bool native_mt32 = ((midiDriver == MD_MT32) || ConfMan.getBool("native_mt32")); //bool adlib = (midiDriver == MD_ADLIB); diff --git a/engines/touche/midi.cpp b/engines/touche/midi.cpp index d77dbf5bfa..9dbef4d76f 100644 --- a/engines/touche/midi.cpp +++ b/engines/touche/midi.cpp @@ -92,7 +92,7 @@ void MidiPlayer::setVolume(int volume) { } int MidiPlayer::open() { - int midiDriver = MidiDriver::detectMusicDriver(MDT_MIDI | MDT_ADLIB | MDT_PREFER_MIDI); + MidiDriverType midiDriver = MidiDriver::detectMusicDriver(MDT_MIDI | MDT_ADLIB | MDT_PREFER_MIDI); _nativeMT32 = ((midiDriver == MD_MT32) || ConfMan.getBool("native_mt32")); _driver = MidiDriver::createMidi(midiDriver); int ret = _driver->open(); diff --git a/sound/mididrv.cpp b/sound/mididrv.cpp index c7e7b757ba..1e721e9086 100644 --- a/sound/mididrv.cpp +++ b/sound/mididrv.cpp @@ -224,7 +224,7 @@ MidiDriverType MidiDriver::detectMusicDriver(int flags) { return musicDriver; } -MidiDriver *MidiDriver::createMidi(int midiDriver) { +MidiDriver *MidiDriver::createMidi(MidiDriverType midiDriver) { switch (midiDriver) { case MD_NULL: return MidiDriver_NULL_create(); @@ -280,8 +280,9 @@ MidiDriver *MidiDriver::createMidi(int midiDriver) { #if defined(__amigaos4__) case MD_CAMD: return MidiDriver_CAMD_create(); #endif + default: + error("Invalid midi driver selected"); } - error("Invalid midi driver selected"); return NULL; } diff --git a/sound/mididrv.h b/sound/mididrv.h index 10813f7300..3a03759f76 100644 --- a/sound/mididrv.h +++ b/sound/mididrv.h @@ -139,7 +139,7 @@ public: */ static const MidiDriverDescription *getAvailableMidiDrivers(); - static MidiDriver *createMidi(int midiDriver); + static MidiDriver *createMidi(MidiDriverType midiDriver); static MidiDriverType detectMusicDriver(int flags); |