mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
Add mutex
This commit is contained in:
parent
5ccbc5c029
commit
2c6003e40b
2 changed files with 9 additions and 1 deletions
|
@ -178,6 +178,11 @@ namespace controller {
|
|||
return inputRecorder->getSaveDirectory();
|
||||
}
|
||||
|
||||
QStringList ScriptingInterface::getRunningInputDeviceNames() {
|
||||
QMutexLocker locker(&_mutex);
|
||||
return _runningInputDeviceNames;
|
||||
}
|
||||
|
||||
bool ScriptingInterface::triggerHapticPulseOnDevice(unsigned int device, float strength, float duration, controller::Hand hand) const {
|
||||
return DependencyManager::get<UserInputMapper>()->triggerHapticPulseOnDevice(device, strength, duration, hand);
|
||||
}
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#include <QThread>
|
||||
#include <QtCore/QObject>
|
||||
#include <QtCore/QVariant>
|
||||
#include <QMutex>
|
||||
|
||||
#include <QtQml/QJSValue>
|
||||
#include <QtScript/QScriptValue>
|
||||
|
@ -436,7 +437,7 @@ namespace controller {
|
|||
* @function Controller.getRunningInputDevices
|
||||
* @returns {string[]} An array of strings with the names
|
||||
*/
|
||||
Q_INVOKABLE QStringList getRunningInputDeviceNames() { return _runningInputDeviceNames; }
|
||||
Q_INVOKABLE QStringList getRunningInputDeviceNames();
|
||||
|
||||
bool isMouseCaptured() const { return _mouseCaptured; }
|
||||
bool isTouchCaptured() const { return _touchCaptured; }
|
||||
|
@ -627,6 +628,8 @@ namespace controller {
|
|||
std::atomic<bool> _touchCaptured { false };
|
||||
std::atomic<bool> _wheelCaptured { false };
|
||||
std::atomic<bool> _actionsCaptured { false };
|
||||
|
||||
QMutex _mutex;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue