aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/sound/wave_file.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/titanic/sound/wave_file.cpp')
-rw-r--r--engines/titanic/sound/wave_file.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/engines/titanic/sound/wave_file.cpp b/engines/titanic/sound/wave_file.cpp
index 7749a7bdfc..56e12e3e61 100644
--- a/engines/titanic/sound/wave_file.cpp
+++ b/engines/titanic/sound/wave_file.cpp
@@ -20,13 +20,35 @@
*
*/
+#include "audio/decoders/wave.h"
#include "titanic/sound/wave_file.h"
+#include "titanic/sound/sound_manager.h"
+#include "titanic/support/simple_file.h"
namespace Titanic {
+CWaveFile::~CWaveFile() {
+ if (_stream) {
+ _owner->soundFreed(_soundHandle);
+ delete _stream;
+ }
+}
+
int CWaveFile::fn1() {
// TODO
return 0;
}
+bool CWaveFile::loadSound(const CString &name) {
+ assert(!_stream);
+
+ StdCWadFile file;
+ if (!file.open(name))
+ return false;
+
+ Common::SeekableReadStream *stream = file.readStream();
+ _stream = Audio::makeWAVStream(stream->readStream(stream->size()), DisposeAfterUse::YES);
+}
+
+
} // End of namespace Titanic z