diff options
author | Eugene Sandulenko | 2007-02-21 21:42:37 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2007-02-21 21:42:37 +0000 |
commit | b825fb858f204bfd07eaff77dee3100eb1b893bf (patch) | |
tree | 275ecee2b1dfecb3628ea5c7127a3890ced46999 /engines/parallaction/parallaction.cpp | |
parent | b2539cc19cf569bedc1521173943fe5693fad322 (diff) | |
download | scummvm-rg350-b825fb858f204bfd07eaff77dee3100eb1b893bf.tar.gz scummvm-rg350-b825fb858f204bfd07eaff77dee3100eb1b893bf.tar.bz2 scummvm-rg350-b825fb858f204bfd07eaff77dee3100eb1b893bf.zip |
Add support for MIDI music. THough the music is not yet heard since
there are no instrument assignments yet.
svn-id: r25774
Diffstat (limited to 'engines/parallaction/parallaction.cpp')
-rw-r--r-- | engines/parallaction/parallaction.cpp | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/engines/parallaction/parallaction.cpp b/engines/parallaction/parallaction.cpp index d7a023e97e..2f60f604c9 100644 --- a/engines/parallaction/parallaction.cpp +++ b/engines/parallaction/parallaction.cpp @@ -20,6 +20,15 @@ * */ +#include "common/stdafx.h" + +#include "common/util.h" +#include "common/file.h" +#include "common/config-manager.h" + +#include "sound/mididrv.h" +#include "sound/mixer.h" + #include "parallaction/parallaction.h" #include "parallaction/menu.h" #include "parallaction/parser.h" @@ -29,9 +38,6 @@ #include "parallaction/graphics.h" #include "parallaction/zone.h" -#include "common/util.h" -#include "common/file.h" -#include "common/config-manager.h" namespace Parallaction { @@ -170,6 +176,7 @@ Parallaction::Parallaction(OSystem *syst) : _musicData1 = 0; strcpy(_characterName1, "null"); + _midiPlayer = 0; _baseTime = 0; @@ -195,7 +202,7 @@ Parallaction::Parallaction(OSystem *syst) : Parallaction::~Parallaction() { - + delete _midiPlayer; } @@ -270,6 +277,11 @@ int Parallaction::init() { addNode(&_animations, &_yourself._zone._node); _graphics = new Graphics(this); + int midiDriver = MidiDriver::detectMusicDriver(MDT_MIDI | MDT_ADLIB | MDT_PREFER_MIDI); + MidiDriver *driver = MidiDriver::createMidi(midiDriver); + _midiPlayer = new MidiPlayer(driver); + + _mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, ConfMan.getInt("music_volume")); return 0; } @@ -856,19 +868,14 @@ void Parallaction::changeCharacter(const char *name) { refreshInventory(name); - stopMusic(); - if (scumm_stricmp(name, "night") && scumm_stricmp(name, "intsushi")) { if (!scumm_stricmp(name, "dino") || !scumm_stricmp(name, "minidino")) { - loadMusic("dino"); - } else - if (!scumm_stricmp(name, "donna") || !scumm_stricmp(name, "minidonna")) { - loadMusic("donna"); + _midiPlayer->play("dino"); + } else if (!scumm_stricmp(name, "donna") || !scumm_stricmp(name, "minidonna")) { + _midiPlayer->play("donna"); } else { - loadMusic("nuts"); + _midiPlayer->play("nuts"); } - - playMusic(); } } |