[Scummvm-cvs-logs] scummvm master -> e25195d8f5bffbeb7d84785311437aa19c345f03

sev- sev at scummvm.org
Sat Apr 26 16:01:22 CEST 2014


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
e25195d8f5 FULLPIPE: Implement Sound::play()


Commit: e25195d8f5bffbeb7d84785311437aa19c345f03
    https://github.com/scummvm/scummvm/commit/e25195d8f5bffbeb7d84785311437aa19c345f03
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2014-04-26T17:00:11+03:00

Commit Message:
FULLPIPE: Implement Sound::play()

Changed paths:
    engines/fullpipe/sound.cpp



diff --git a/engines/fullpipe/sound.cpp b/engines/fullpipe/sound.cpp
index 8280d64..271b103 100644
--- a/engines/fullpipe/sound.cpp
+++ b/engines/fullpipe/sound.cpp
@@ -126,7 +126,17 @@ void Sound::setPanAndVolume(int vol, int pan) {
 }
 
 void Sound::play(int flag) {
-	warning("STUB: Sound::play()");
+	Audio::SoundHandle handle = getHandle();
+
+	if (g_fp->_mixer->isSoundHandleActive(handle))
+		return;
+
+	byte *soundData = loadData();
+	Common::MemoryReadStream *dataStream = new Common::MemoryReadStream(soundData, getDataSize());
+	Audio::RewindableAudioStream *wav = Audio::makeWAVStream(dataStream, DisposeAfterUse::YES);
+	Audio::AudioStream *audioStream = new Audio::LoopingAudioStream(wav, (flag == 1) ? 0 : 1);
+
+	g_fp->_mixer->playStream(Audio::Mixer::kSFXSoundType, &handle, audioStream);
 }
 
 void Sound::freeSound() {
@@ -300,12 +310,7 @@ void FullpipeEngine::playSound(int id, int flag) {
 		return;
 	}
 
-	byte *soundData = sound->loadData();
-	Common::MemoryReadStream *dataStream = new Common::MemoryReadStream(soundData, sound->getDataSize());
-	Audio::RewindableAudioStream *wav = Audio::makeWAVStream(dataStream, DisposeAfterUse::YES);
-	Audio::AudioStream *audioStream = new Audio::LoopingAudioStream(wav, (flag == 1) ? 0 : 1);
-	Audio::SoundHandle handle = sound->getHandle();
-	_mixer->playStream(Audio::Mixer::kSFXSoundType, &handle, audioStream);
+	sound->play(flag);
 }
 
 void FullpipeEngine::playTrack(GameVar *sceneVar, const char *name, bool delayed) {






More information about the Scummvm-git-logs mailing list