[Scummvm-git-logs] scummvm master -> cf1efc84308ec763ea78d166a14057a95c379cab
dreammaster
dreammaster at scummvm.org
Sun Nov 6 00:12:48 CET 2016
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:
cf1efc8430 TITANIC: Fix replaying cached previously played sounds
Commit: cf1efc84308ec763ea78d166a14057a95c379cab
https://github.com/scummvm/scummvm/commit/cf1efc84308ec763ea78d166a14057a95c379cab
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-11-05T19:12:39-04:00
Commit Message:
TITANIC: Fix replaying cached previously played sounds
Changed paths:
engines/titanic/sound/sound.cpp
engines/titanic/sound/wave_file.cpp
engines/titanic/sound/wave_file.h
diff --git a/engines/titanic/sound/sound.cpp b/engines/titanic/sound/sound.cpp
index fb8cc29..c288231 100644
--- a/engines/titanic/sound/sound.cpp
+++ b/engines/titanic/sound/sound.cpp
@@ -129,6 +129,7 @@ CWaveFile *CSound::loadSound(const CString &name) {
// Found it, so move it to the front of the list and return
_sounds.remove(soundItem);
_sounds.push_front(soundItem);
+ soundItem->_waveFile->reset();
return soundItem->_waveFile;
}
}
diff --git a/engines/titanic/sound/wave_file.cpp b/engines/titanic/sound/wave_file.cpp
index 2c583f2..f2366d1 100644
--- a/engines/titanic/sound/wave_file.cpp
+++ b/engines/titanic/sound/wave_file.cpp
@@ -106,4 +106,8 @@ uint CWaveFile::getFrequency() const {
return _stream->getRate();
}
+void CWaveFile::reset() {
+ _stream->rewind();
+}
+
} // End of namespace Titanic z
diff --git a/engines/titanic/sound/wave_file.h b/engines/titanic/sound/wave_file.h
index 19d3679..e4bb71a 100644
--- a/engines/titanic/sound/wave_file.h
+++ b/engines/titanic/sound/wave_file.h
@@ -81,6 +81,11 @@ public:
* Return the frequency of the loaded wave file
*/
uint getFrequency() const;
+
+ /**
+ * Resets the music stream
+ */
+ void reset();
};
} // End of namespace Titanic
More information about the Scummvm-git-logs
mailing list