aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorMarisa-Chan2014-01-17 09:32:06 +0700
committerMarisa-Chan2014-01-17 09:32:06 +0700
commit61224e7225061551765c07b691e8d8c5da3434df (patch)
tree51e3b002cd79f3f5299ed55fa7378156cd04bde6 /engines
parent9803f7e6c045d625ee41e5b2769b1b2de3ab8ee3 (diff)
downloadscummvm-rg350-61224e7225061551765c07b691e8d8c5da3434df.tar.gz
scummvm-rg350-61224e7225061551765c07b691e8d8c5da3434df.tar.bz2
scummvm-rg350-61224e7225061551765c07b691e8d8c5da3434df.zip
ZVISION: Move MusicNode to use Audio::SoundHandle.
Diffstat (limited to 'engines')
-rw-r--r--engines/zvision/music_node.cpp9
-rw-r--r--engines/zvision/music_node.h2
-rw-r--r--engines/zvision/zvision.cpp7
-rw-r--r--engines/zvision/zvision.h2
4 files changed, 6 insertions, 14 deletions
diff --git a/engines/zvision/music_node.cpp b/engines/zvision/music_node.cpp
index 6be4683178..709b554823 100644
--- a/engines/zvision/music_node.cpp
+++ b/engines/zvision/music_node.cpp
@@ -57,13 +57,12 @@ MusicNode::MusicNode(ZVision *engine, uint32 key, Common::String &filename, bool
audioStream = makeRawZorkStream(filename, _engine);
}
- _id = _engine->getAudioId();
if (_loop) {
Audio::LoopingAudioStream *loopingAudioStream = new Audio::LoopingAudioStream(audioStream, 0, DisposeAfterUse::YES);
- _engine->_mixer->playStream(Audio::Mixer::kPlainSoundType, 0, loopingAudioStream, _id, _volume);
+ _engine->_mixer->playStream(Audio::Mixer::kPlainSoundType, &_handle, loopingAudioStream, -1, _volume);
} else {
- _engine->_mixer->playStream(Audio::Mixer::kPlainSoundType, 0, audioStream, _id, _volume);
+ _engine->_mixer->playStream(Audio::Mixer::kPlainSoundType, &_handle, audioStream, -1, _volume);
}
if (_key != StateKey_NotSet)
@@ -71,14 +70,14 @@ MusicNode::MusicNode(ZVision *engine, uint32 key, Common::String &filename, bool
}
MusicNode::~MusicNode() {
- _engine->_mixer->stopID(_id);
+ _engine->_mixer->stopHandle(_handle);
if (_key != StateKey_NotSet)
_engine->getScriptManager()->setStateValue(_key, 2);
debug(1, "MusicNode: %d destroyed\n", _key);
}
bool MusicNode::process(uint32 deltaTimeInMillis) {
- if (! _engine->_mixer->isSoundIDActive(_id))
+ if (! _engine->_mixer->isSoundHandleActive(_handle))
return stop();
return false;
}
diff --git a/engines/zvision/music_node.h b/engines/zvision/music_node.h
index 6aed4556fa..973feaf175 100644
--- a/engines/zvision/music_node.h
+++ b/engines/zvision/music_node.h
@@ -23,6 +23,7 @@
#ifndef ZVISION_MUSIC_NODE_H
#define ZVISION_MUSIC_NODE_H
+#include "audio/mixer.h"
#include "zvision/sidefx.h"
namespace Common {
@@ -55,6 +56,7 @@ private:
bool _crossfade;
int32 _crossfade_delta;
int32 _crossfade_time;
+ Audio::SoundHandle _handle;
};
} // End of namespace ZVision
diff --git a/engines/zvision/zvision.cpp b/engines/zvision/zvision.cpp
index 05923ce079..f21498c315 100644
--- a/engines/zvision/zvision.cpp
+++ b/engines/zvision/zvision.cpp
@@ -201,13 +201,6 @@ Common::String ZVision::generateAutoSaveFileName() {
return Common::String::format("%s.auto", _targetName.c_str());
}
-int ZVision::getAudioId() {
- _aud_id++;
- if (_aud_id < 0)
- _aud_id = 0;
- return _aud_id;
-}
-
void ZVision::setRenderDelay(uint delay) {
_rendDelay = delay;
}
diff --git a/engines/zvision/zvision.h b/engines/zvision/zvision.h
index 23c5f60a4a..26d7644eb0 100644
--- a/engines/zvision/zvision.h
+++ b/engines/zvision/zvision.h
@@ -153,8 +153,6 @@ public:
*/
void playVideo(Video::VideoDecoder &videoDecoder, const Common::Rect &destRect = Common::Rect(0, 0, 0, 0), bool skippable = true);
- int getAudioId();
-
Common::String generateSaveFileName(uint slot);
Common::String generateAutoSaveFileName();