aboutsummaryrefslogtreecommitdiff
path: root/audio
diff options
context:
space:
mode:
authorEugene Sandulenko2013-07-04 04:58:54 -0700
committerEugene Sandulenko2013-07-04 04:58:54 -0700
commit49210a803a53b84bcabe42fd339a1b205236c34d (patch)
treed5916067b55404324fb70a3d3ee0a8f672f92679 /audio
parent2b980e86e3db2ebc2279761ba29c0be4f24e03dc (diff)
parentb286a6d033287dce11dfa4216ad11728b892667d (diff)
downloadscummvm-rg350-49210a803a53b84bcabe42fd339a1b205236c34d.tar.gz
scummvm-rg350-49210a803a53b84bcabe42fd339a1b205236c34d.tar.bz2
scummvm-rg350-49210a803a53b84bcabe42fd339a1b205236c34d.zip
Merge pull request #331 from sev-/gsoc2012-eventsrecorder
GSoC2012: Event Recorder (reworked)
Diffstat (limited to 'audio')
-rw-r--r--audio/mixer.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/audio/mixer.cpp b/audio/mixer.cpp
index 8ff364b98d..ab3ed9eb2d 100644
--- a/audio/mixer.cpp
+++ b/audio/mixer.cpp
@@ -20,6 +20,8 @@
*
*/
+#include "gui/EventRecorder.h"
+
#include "common/util.h"
#include "common/system.h"
#include "common/textconsole.h"
@@ -427,6 +429,7 @@ void MixerImpl::pauseHandle(SoundHandle handle, bool paused) {
bool MixerImpl::isSoundIDActive(int id) {
Common::StackLock lock(_mutex);
+ g_eventRec.updateSubsystems();
for (int i = 0; i != NUM_CHANNELS; i++)
if (_channels[i] && _channels[i]->getId() == id)
return true;
@@ -443,6 +446,7 @@ int MixerImpl::getSoundID(SoundHandle handle) {
bool MixerImpl::isSoundHandleActive(SoundHandle handle) {
Common::StackLock lock(_mutex);
+ g_eventRec.updateSubsystems();
const int index = handle._val % NUM_CHANNELS;
return _channels[index] && _channels[index]->getHandle()._val == handle._val;
}
@@ -556,12 +560,12 @@ void Channel::pause(bool paused) {
_pauseLevel++;
if (_pauseLevel == 1)
- _pauseStartTime = g_system->getMillis();
+ _pauseStartTime = g_system->getMillis(true);
} else if (_pauseLevel > 0) {
_pauseLevel--;
if (!_pauseLevel) {
- _pauseTime = (g_system->getMillis() - _pauseStartTime);
+ _pauseTime = (g_system->getMillis(true) - _pauseStartTime);
_pauseStartTime = 0;
}
}
@@ -579,7 +583,7 @@ Timestamp Channel::getElapsedTime() {
if (isPaused())
delta = _pauseStartTime - _mixerTimeStamp;
else
- delta = g_system->getMillis() - _mixerTimeStamp - _pauseTime;
+ delta = g_system->getMillis(true) - _mixerTimeStamp - _pauseTime;
// Convert the number of samples into a time duration.
@@ -599,13 +603,12 @@ int Channel::mix(int16 *data, uint len) {
assert(_stream);
int res = 0;
-
if (_stream->endOfData()) {
// TODO: call drain method
} else {
assert(_converter);
_samplesConsumed = _samplesDecoded;
- _mixerTimeStamp = g_system->getMillis();
+ _mixerTimeStamp = g_system->getMillis(true);
_pauseTime = 0;
res = _converter->flow(*_stream, data, len, _volL, _volR);
_samplesDecoded += res;