diff options
Diffstat (limited to 'engines/fullpipe')
-rw-r--r-- | engines/fullpipe/fullpipe.h | 2 | ||||
-rw-r--r-- | engines/fullpipe/sound.cpp | 24 |
2 files changed, 25 insertions, 1 deletions
diff --git a/engines/fullpipe/fullpipe.h b/engines/fullpipe/fullpipe.h index 0f3e057b5a..7c7ac0525e 100644 --- a/engines/fullpipe/fullpipe.h +++ b/engines/fullpipe/fullpipe.h @@ -273,6 +273,8 @@ public: void lift_startExitQueue(); void lift_sub05(ExCommand *ex); + GameVar *_musicGameVar; + Audio::SoundHandle _sceneTrackHandle; public: bool _isSaveAllowed; diff --git a/engines/fullpipe/sound.cpp b/engines/fullpipe/sound.cpp index 8c6b01fae4..da9e7e3984 100644 --- a/engines/fullpipe/sound.cpp +++ b/engines/fullpipe/sound.cpp @@ -28,6 +28,7 @@ #include "fullpipe/ngiarchive.h" #include "common/memstream.h" #include "audio/audiostream.h" +#include "audio/decoders/vorbis.h" #include "audio/decoders/wave.h" namespace Fullpipe { @@ -117,10 +118,31 @@ void Sound::setPanAndVolumeByStaticAni() { void FullpipeEngine::setSceneMusicParameters(GameVar *var) { warning("STUB: FullpipeEngine::setSceneMusicParameters()"); + // TODO: Finish this (MINDELAY, MAXDELAY, LOCAL, SEQUENCE, STARTDELAY etc) + stopAllSoundStreams(); + _musicGameVar = var; } void FullpipeEngine::startSceneTrack() { - debug(3, "STUB: FullpipeEngine::startSceneTrack()"); + // TODO: Finish this +#ifdef USE_VORBIS + if (g_fp->_mixer->isSoundHandleActive(_sceneTrackHandle)) + return; + + GameVar *musicTrackVar = _musicGameVar->getSubVarByName("MUSIC")->getSubVarByName("TRACKS")->_subVars; + if (!musicTrackVar) + return; + + char *trackName = musicTrackVar->_varName; + Common::File *track = new Common::File(); + if (!track->open(trackName)) { + warning("Could not open %s", trackName); + delete track; + return; + } + Audio::RewindableAudioStream *ogg = Audio::makeVorbisStream(track, DisposeAfterUse::YES); + g_fp->_mixer->playStream(Audio::Mixer::kMusicSoundType, &_sceneTrackHandle, ogg); +#endif } void FullpipeEngine::stopAllSounds() { |