mirror of
https://github.com/overte-org/overte.git
synced 2025-08-04 05:03:31 +02:00
Add mutex to setter
This commit is contained in:
parent
2c6003e40b
commit
c1aa5e9308
2 changed files with 10 additions and 6 deletions
|
@ -179,10 +179,16 @@ namespace controller {
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList ScriptingInterface::getRunningInputDeviceNames() {
|
QStringList ScriptingInterface::getRunningInputDeviceNames() {
|
||||||
QMutexLocker locker(&_mutex);
|
QMutexLocker locker(&_getRunningDevicesMutex);
|
||||||
return _runningInputDeviceNames;
|
return _runningInputDeviceNames;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ScriptingInterface::updateRunningInputDevices(const QString& deviceName, bool isRunning, const QStringList& runningDevices) {
|
||||||
|
QMutexLocker locker(&_setRunningDevicesMutex);
|
||||||
|
_runningInputDeviceNames = runningDevices;
|
||||||
|
emit inputDeviceRunningChanged(deviceName, isRunning);
|
||||||
|
}
|
||||||
|
|
||||||
bool ScriptingInterface::triggerHapticPulseOnDevice(unsigned int device, float strength, float duration, controller::Hand hand) const {
|
bool ScriptingInterface::triggerHapticPulseOnDevice(unsigned int device, float strength, float duration, controller::Hand hand) const {
|
||||||
return DependencyManager::get<UserInputMapper>()->triggerHapticPulseOnDevice(device, strength, duration, hand);
|
return DependencyManager::get<UserInputMapper>()->triggerHapticPulseOnDevice(device, strength, duration, hand);
|
||||||
}
|
}
|
||||||
|
|
|
@ -539,10 +539,7 @@ namespace controller {
|
||||||
*/
|
*/
|
||||||
virtual void releaseActionEvents() { _actionsCaptured = false; }
|
virtual void releaseActionEvents() { _actionsCaptured = false; }
|
||||||
|
|
||||||
void updateRunningInputDevices(const QString& deviceName, bool isRunning, const QStringList& runningDevices) {
|
void updateRunningInputDevices(const QString& deviceName, bool isRunning, const QStringList& runningDevices);
|
||||||
_runningInputDeviceNames = runningDevices;
|
|
||||||
emit inputDeviceRunningChanged(deviceName, isRunning);
|
|
||||||
}
|
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
|
@ -629,7 +626,8 @@ namespace controller {
|
||||||
std::atomic<bool> _wheelCaptured { false };
|
std::atomic<bool> _wheelCaptured { false };
|
||||||
std::atomic<bool> _actionsCaptured { false };
|
std::atomic<bool> _actionsCaptured { false };
|
||||||
|
|
||||||
QMutex _mutex;
|
QMutex _setRunningDevicesMutex;
|
||||||
|
QMutex _getRunningDevicesMutex;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue