Skip to content

Commit

Permalink
Restored some blocking invoke calls in Recording API
Browse files Browse the repository at this point in the history
  • Loading branch information
ksuprynowicz committed May 23, 2024
1 parent 5786417 commit 8badda8
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions libraries/recording/src/recording/RecordingScriptingInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,11 @@ void RecordingScriptingInterface::loadRecording(const QString& url, const Script
}

void RecordingScriptingInterface::startPlaying() {
if (QThread::currentThread() != thread()) {
BLOCKING_INVOKE_METHOD(this, "startPlaying");
return;
}

Locker(_mutex);
_player->play();
}
Expand All @@ -143,6 +148,11 @@ void RecordingScriptingInterface::setPlayerAudioOffset(float audioOffset) {
}

void RecordingScriptingInterface::setPlayerTime(float time) {
if (QThread::currentThread() != thread()) {
BLOCKING_INVOKE_METHOD(this, "setPlayerTime", Q_ARG(float, time));
return;
}

Locker(_mutex);
_player->seek(time);
}
Expand Down Expand Up @@ -178,6 +188,11 @@ void RecordingScriptingInterface::pausePlayer() {
}

void RecordingScriptingInterface::stopPlaying() {
if (QThread::currentThread() != thread()) {
BLOCKING_INVOKE_METHOD(this, "stopPlaying");
return;
}

Locker(_mutex);
_player->stop();
}
Expand Down Expand Up @@ -273,6 +288,11 @@ bool RecordingScriptingInterface::saveRecordingToAsset(const ScriptValue& getCli
}

void RecordingScriptingInterface::loadLastRecording() {
if (QThread::currentThread() != thread()) {
BLOCKING_INVOKE_METHOD(this, "loadLastRecording");
return;
}

Locker(_mutex);

if (!_lastClip) {
Expand Down

0 comments on commit 8badda8

Please sign in to comment.