Showing the changes to libraries/script-engine/src/RecordingScriptingInterface.cpp (1 of 1 file). Show all
Unified · Split
| @@ -64,6 +64,11 @@ void RecordingScriptingInterface::playClip(NetworkClipLoaderPointer clipLoader, · 63 unmodified lines | |||
| 64 | } | 64 | } |
| 65 | 65 | ||
| 66 | void RecordingScriptingInterface::loadRecording(const QString& url, QScriptValue callback) { | 66 | void RecordingScriptingInterface::loadRecording(const QString& url, QScriptValue callback) { |
| 67 | if (QThread::currentThread() != thread()) { | ||
| 68 | BLOCKING_INVOKE_METHOD(this, "loadRecording", Q_ARG(const QString&, url), Q_ARG(QScriptValue, callback)); | ||
| 69 | return; | ||
| 70 | } | ||
| 71 | |||
| 67 | auto clipLoader = DependencyManager::get<recording::ClipCache>()->getClipLoader(url); | 72 | auto clipLoader = DependencyManager::get<recording::ClipCache>()->getClipLoader(url); |
| 68 | 73 | ||
| 69 | if (clipLoader->isLoaded()) { | 74 | if (clipLoader->isLoaded()) { |
| @@ -117,6 +122,11 @@ void RecordingScriptingInterface::startPlaying() { · 47 unmodified lines | |||
| 117 | } | 122 | } |
| 118 | 123 | ||
| 119 | void RecordingScriptingInterface::setPlayerVolume(float volume) { | 124 | void RecordingScriptingInterface::setPlayerVolume(float volume) { |
| 125 | if (QThread::currentThread() != thread()) { | ||
| 126 | BLOCKING_INVOKE_METHOD(this, "setPlayerVolume", Q_ARG(float, volume)); | ||
| 127 | return; | ||
| 128 | } | ||
| 129 | |||
| 120 | _player->setVolume(std::min(std::max(volume, 0.0f), 1.0f)); | 130 | _player->setVolume(std::min(std::max(volume, 0.0f), 1.0f)); |
| 121 | } | 131 | } |
| 122 | 132 | ||
| @@ -137,6 +147,11 @@ void RecordingScriptingInterface::setPlayFromCurrentLocation(bool playFromCurren · 14 unmodified lines | |||
| 137 | } | 147 | } |
| 138 | 148 | ||
| 139 | void RecordingScriptingInterface::setPlayerLoop(bool loop) { | 149 | void RecordingScriptingInterface::setPlayerLoop(bool loop) { |
| 150 | if (QThread::currentThread() != thread()) { | ||
| 151 | BLOCKING_INVOKE_METHOD(this, "setPlayerLoop", Q_ARG(bool, loop)); | ||
| 152 | return; | ||
| 153 | } | ||
| 154 | |||
| 140 | _player->loop(loop); | 155 | _player->loop(loop); |
| 141 | } | 156 | } |
| 142 | 157 | ||
| @@ -200,6 +215,11 @@ void RecordingScriptingInterface::stopRecording() { · 57 unmodified lines | |||
| 200 | return; | 215 | return; |
| 201 | } | 216 | } |
| 202 | 217 | ||
| 218 | if (QThread::currentThread() != thread()) { | ||
| 219 | BLOCKING_INVOKE_METHOD(this, "stopRecording"); | ||
| 220 | return; | ||
| 221 | } | ||
| 222 | |||
| 203 | _recorder->stop(); | 223 | _recorder->stop(); |
| 204 | _lastClip = _recorder->getClip(); | 224 | _lastClip = _recorder->getClip(); |
| 205 | _lastClip->seek(0); | 225 | _lastClip->seek(0); |