diff options
| author | Paul Gilbert | 2013-02-24 06:36:26 -0800 |
|---|---|---|
| committer | Paul Gilbert | 2013-02-24 06:36:26 -0800 |
| commit | 86306893c8bde348fb9487d7ca331ebbe79a376f (patch) | |
| tree | ac747fc3d2b2ea51eb2f3c735bc36e6e8b4cb544 /audio | |
| parent | 76bf7b7c04931c3a7304f3c004221eaf4da05b3a (diff) | |
| parent | 79bbd015ab30740f4630b5fa707b6983106a14ee (diff) | |
| download | scummvm-rg350-86306893c8bde348fb9487d7ca331ebbe79a376f.tar.gz scummvm-rg350-86306893c8bde348fb9487d7ca331ebbe79a376f.tar.bz2 scummvm-rg350-86306893c8bde348fb9487d7ca331ebbe79a376f.zip | |
Merge pull request #309 from dreammaster/hopkins
Hopkins FBI Pull Request
Diffstat (limited to 'audio')
| -rw-r--r-- | audio/mods/protracker.cpp | 16 | ||||
| -rw-r--r-- | audio/mods/protracker.h | 8 |
2 files changed, 21 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 5f47c4453b..50528fc599 100644 --- a/audio/mods/protracker.h +++ b/audio/mods/protracker.h @@ -26,6 +26,7 @@ * - agos * - parallaction * - gob + * - hopkins */ #ifndef AUDIO_MODS_PROTRACKER_H @@ -35,6 +36,10 @@ namespace Common { class SeekableReadStream; } +namespace Modules { +class Module; +} + namespace Audio { class AudioStream; @@ -48,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 |
