diff options
author | Marisa-Chan | 2014-02-24 22:47:28 +0700 |
---|---|---|
committer | Marisa-Chan | 2014-02-24 22:47:28 +0700 |
commit | 1af6f404f441a7a2d77bb0f23d1dbb1c838cf56c (patch) | |
tree | dcbcb667cdb5a7dbe0e3515e9f8443ed5839cb0b /engines | |
parent | 8e02e06db153a68e86239c09b79565b0372cd789 (diff) | |
download | scummvm-rg350-1af6f404f441a7a2d77bb0f23d1dbb1c838cf56c.tar.gz scummvm-rg350-1af6f404f441a7a2d77bb0f23d1dbb1c838cf56c.tar.bz2 scummvm-rg350-1af6f404f441a7a2d77bb0f23d1dbb1c838cf56c.zip |
ZVISION: Add subtitles support for MusicNode.
Diffstat (limited to 'engines')
-rw-r--r-- | engines/zvision/music_node.cpp | 14 | ||||
-rw-r--r-- | engines/zvision/music_node.h | 2 |
2 files changed, 16 insertions, 0 deletions
diff --git a/engines/zvision/music_node.cpp b/engines/zvision/music_node.cpp index 31d222aead..b716b3ead1 100644 --- a/engines/zvision/music_node.cpp +++ b/engines/zvision/music_node.cpp @@ -46,6 +46,7 @@ MusicNode::MusicNode(ZVision *engine, uint32 key, Common::String &filename, bool _attenuate = 0; _pantrack = false; _pantrack_X = 0; + _sub = NULL; Audio::RewindableAudioStream *audioStream; @@ -69,12 +70,22 @@ MusicNode::MusicNode(ZVision *engine, uint32 key, Common::String &filename, bool if (_key != StateKey_NotSet) _engine->getScriptManager()->setStateValue(_key, 1); + + Common::String subname = filename; + subname.setChar('s', subname.size() - 3); + subname.setChar('u', subname.size() - 2); + subname.setChar('b', subname.size() - 1); + + if (_engine->getSearchManager()->hasFile(subname)) + _sub = new Subtitle(_engine, subname); } MusicNode::~MusicNode() { _engine->_mixer->stopHandle(_handle); if (_key != StateKey_NotSet) _engine->getScriptManager()->setStateValue(_key, 2); + if (_sub) + delete _sub; debug(1, "MusicNode: %d destroyed\n", _key); } @@ -117,6 +128,9 @@ bool MusicNode::process(uint32 deltaTimeInMillis) { if (_pantrack || _volume != _newvol) setVolume(_newvol); + + if (_sub) + _sub->process(_engine->_mixer->getSoundElapsedTime(_handle) / 100); } return false; } diff --git a/engines/zvision/music_node.h b/engines/zvision/music_node.h index 6e3033f6b0..d24496fc02 100644 --- a/engines/zvision/music_node.h +++ b/engines/zvision/music_node.h @@ -25,6 +25,7 @@ #include "audio/mixer.h" #include "zvision/sidefx.h" +#include "zvision/subtitles.h" namespace Common { class String; @@ -64,6 +65,7 @@ private: int32 _crossfade_time; bool _stereo; Audio::SoundHandle _handle; + Subtitle *_sub; }; class PanTrackNode : public SideFX { |