Showing the changes to libraries/script-engine/src/AudioScriptingInterface.cpp (1 of 2 files). Show all
Unified · Split
| @@ -63,8 +63,15 @@ ScriptAudioInjector* AudioScriptingInterface::playSound(SharedSoundPointer sound · 62 unmodified lines | ||
| 63 | 63 | bool AudioScriptingInterface::setStereoInput(bool stereo) { |
| 64 | 64 | bool stereoInputChanged = false; |
| 65 | 65 | if (_localAudioInterface) { |
| 66 | − stereoInputChanged = _localAudioInterface->setIsStereoInput(stereo); | |
| 66 | + if (QThread::currentThread() != _localAudioInterface->thread()) { | |
| 67 | + // TODO: This can block the main thread which is not ideal, make this function and the UI calling it async | |
| 68 | + BLOCKING_INVOKE_METHOD(_localAudioInterface, "setIsStereoInput", Q_RETURN_ARG(bool, stereoInputChanged), | |
| 69 | + Q_ARG(bool, stereo)); | |
| 70 | + } else { | |
| 71 | + stereoInputChanged = _localAudioInterface->setIsStereoInput(stereo); | |
| 72 | + } | |
| 67 | 73 | } |
| 74 | + | |
| 68 | 75 | return stereoInputChanged; |
| 69 | 76 | } |
| 70 | 77 | |