aboutsummaryrefslogtreecommitdiff
path: root/audio
diff options
context:
space:
mode:
authorTorbjörn Andersson2013-01-27 18:18:04 +0100
committerTorbjörn Andersson2013-01-27 18:18:04 +0100
commita50c05f7d0b98a1777f7b97af54bb2c842de0318 (patch)
tree3f0b1dfd362721cc8a5263abe3690cfda319d93c /audio
parent9d1d5a09c4a1fb2ca827755e197ea7726eaa39ab (diff)
downloadscummvm-rg350-a50c05f7d0b98a1777f7b97af54bb2c842de0318.tar.gz
scummvm-rg350-a50c05f7d0b98a1777f7b97af54bb2c842de0318.tar.bz2
scummvm-rg350-a50c05f7d0b98a1777f7b97af54bb2c842de0318.zip
HOPKINS: Work around broken cadavre.mod in OS/2 and BeOS versions
A large part of cadavre.mod is broken. No new notes play, and only the old background sounds remain. It's possible, perhaps even probable, that the original MOD player didn't have this problem, but all standalone players I've tried do, so I'm assuming it's the file that's broken. We work around it by changing the length of the song after it's been loaded to only include the good parts.
Diffstat (limited to 'audio')
-rw-r--r--audio/mods/protracker.cpp16
-rw-r--r--audio/mods/protracker.h7
2 files changed, 20 insertions, 3 deletions
diff --git a/audio/mods/protracker.cpp b/audio/mods/protracker.cpp
index 1e18d5adf8..c947f256e0 100644
--- a/audio/mods/protracker.cpp
+++ b/audio/mods/protracker.cpp
@@ -90,6 +90,14 @@ private:
public:
ProtrackerStream(Common::SeekableReadStream *stream, int offs, int rate, bool stereo);
+ Modules::Module *getModule() {
+ // Ordinarily, the Module is not meant to be seen outside of
+ // this class, but occasionally, it's useful to be able to
+ // manipulate it directly. The Hopkins engine uses this to
+ // repair a broken song.
+ return &_module;
+ }
+
private:
void interrupt();
@@ -462,8 +470,12 @@ void ProtrackerStream::interrupt() {
namespace Audio {
-AudioStream *makeProtrackerStream(Common::SeekableReadStream *stream, int offs, int rate, bool stereo) {
- return new Modules::ProtrackerStream(stream, offs, rate, stereo);
+AudioStream *makeProtrackerStream(Common::SeekableReadStream *stream, int offs, int rate, bool stereo, Modules::Module **module) {
+ Modules::ProtrackerStream *protrackerStream = new Modules::ProtrackerStream(stream, offs, rate, stereo);
+ if (module) {
+ *module = protrackerStream->getModule();
+ }
+ return (AudioStream *)protrackerStream;
}
} // End of namespace Audio
diff --git a/audio/mods/protracker.h b/audio/mods/protracker.h
index 6cee1a84bf..50528fc599 100644
--- a/audio/mods/protracker.h
+++ b/audio/mods/protracker.h
@@ -36,6 +36,10 @@ namespace Common {
class SeekableReadStream;
}
+namespace Modules {
+class Module;
+}
+
namespace Audio {
class AudioStream;
@@ -49,9 +53,10 @@ class AudioStream;
* @param stream the ReadStream from which to read the ProTracker data
* @param rate TODO
* @param stereo TODO
+ * @param module can be used to return the Module object (rarely useful)
* @return a new AudioStream, or NULL, if an error occurred
*/
-AudioStream *makeProtrackerStream(Common::SeekableReadStream *stream, int offs = 0, int rate = 44100, bool stereo = true);
+AudioStream *makeProtrackerStream(Common::SeekableReadStream *stream, int offs = 0, int rate = 44100, bool stereo = true, Modules::Module **module = 0);
} // End of namespace Audio