[Scummvm-git-logs] scummvm master -> 753c1c2fd9e13f5fa26e2585b9d74cd567243080
sev-
sev at scummvm.org
Sun Nov 7 19:39:54 UTC 2021
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:
753c1c2fd9 DIRECTOR: handle macbinary audio streams
Commit: 753c1c2fd9e13f5fa26e2585b9d74cd567243080
https://github.com/scummvm/scummvm/commit/753c1c2fd9e13f5fa26e2585b9d74cd567243080
Author: Misty De Meo (mistydemeo at gmail.com)
Date: 2021-11-07T20:39:51+01:00
Commit Message:
DIRECTOR: handle macbinary audio streams
Changed paths:
engines/director/sound.cpp
engines/director/sound.h
diff --git a/engines/director/sound.cpp b/engines/director/sound.cpp
index abb614125b..a44375fd6c 100644
--- a/engines/director/sound.cpp
+++ b/engines/director/sound.cpp
@@ -25,6 +25,7 @@
// License: GNU GPL v2 (see COPYING file for details)
#include "common/file.h"
+#include "common/macresman.h"
#include "common/substream.h"
#include "audio/decoders/wave.h"
@@ -766,14 +767,22 @@ bool SNDDecoder::hasLoopBounds() {
AudioFileDecoder::AudioFileDecoder(Common::String &path)
: AudioDecoder() {
_path = path;
+ _macresman = nullptr;
+}
+
+AudioFileDecoder::~AudioFileDecoder() {
+ delete _macresman;
}
Audio::AudioStream *AudioFileDecoder::getAudioStream(bool looping, bool forPuppet, DisposeAfterUse::Flag disposeAfterUse) {
if (_path.empty())
return nullptr;
- Common::File *file = new Common::File();
- if (!file->open(Common::Path(pathMakeRelative(_path), g_director->_dirSeparator))) {
+ _macresman = new Common::MacResManager();
+ _macresman->open(Common::Path(pathMakeRelative(_path), g_director->_dirSeparator));
+ Common::SeekableReadStream *file = _macresman->getDataFork();
+
+ if (file == nullptr) {
warning("Failed to open %s", _path.c_str());
delete file;
return nullptr;
diff --git a/engines/director/sound.h b/engines/director/sound.h
index 81f1848685..bfdb920366 100644
--- a/engines/director/sound.h
+++ b/engines/director/sound.h
@@ -32,6 +32,10 @@ namespace Audio {
class RewindableAudioStream;
}
+namespace Common {
+ class MacResManager;
+}
+
namespace Director {
class AudioDecoder;
@@ -244,7 +248,7 @@ private:
class AudioFileDecoder : public AudioDecoder {
public:
AudioFileDecoder(Common::String &path);
- ~AudioFileDecoder() {};
+ ~AudioFileDecoder();
void setPath(Common::String &path);
@@ -252,6 +256,7 @@ public:
private:
Common::String _path;
+ Common::MacResManager *_macresman;
};
} // End of namespace Director
More information about the Scummvm-git-logs
mailing list