mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-08 07:22:25 +02:00
don't include Standard device in Controllers.Hardware
This commit is contained in:
parent
251a55b1fb
commit
7d48fe9187
1 changed files with 25 additions and 22 deletions
|
@ -481,31 +481,34 @@ namespace controller {
|
|||
auto devices = userInputMapper->getDevices();
|
||||
QSet<QString> foundDevices;
|
||||
for (const auto& deviceMapping : devices) {
|
||||
auto device = deviceMapping.second.get();
|
||||
auto deviceName = QString(device->getName()).remove(ScriptingInterface::SANITIZE_NAME_EXPRESSION);
|
||||
qCDebug(controllers) << "Device" << deviceMapping.first << ":" << deviceName;
|
||||
foundDevices.insert(device->getName());
|
||||
if (_hardware.contains(deviceName)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Expose the IDs to JS
|
||||
_hardware.insert(deviceName, createDeviceMap(device));
|
||||
|
||||
// Create the endpoints
|
||||
for (const auto& inputMapping : device->getAvailabeInputs()) {
|
||||
const auto& input = inputMapping.first;
|
||||
// Ignore aliases
|
||||
if (_endpoints.count(input)) {
|
||||
auto deviceID = deviceMapping.first;
|
||||
if (deviceID != userInputMapper->getStandardDeviceID()) {
|
||||
auto device = deviceMapping.second.get();
|
||||
auto deviceName = QString(device->getName()).remove(ScriptingInterface::SANITIZE_NAME_EXPRESSION);
|
||||
qCDebug(controllers) << "Device" << deviceMapping.first << ":" << deviceName;
|
||||
foundDevices.insert(device->getName());
|
||||
if (_hardware.contains(deviceName)) {
|
||||
continue;
|
||||
}
|
||||
_endpoints[input] = std::make_shared<LambdaEndpoint>([=] {
|
||||
auto deviceProxy = userInputMapper->getDeviceProxy(input);
|
||||
if (!deviceProxy) {
|
||||
return 0.0f;
|
||||
|
||||
// Expose the IDs to JS
|
||||
_hardware.insert(deviceName, createDeviceMap(device));
|
||||
|
||||
// Create the endpoints
|
||||
for (const auto& inputMapping : device->getAvailabeInputs()) {
|
||||
const auto& input = inputMapping.first;
|
||||
// Ignore aliases
|
||||
if (_endpoints.count(input)) {
|
||||
continue;
|
||||
}
|
||||
return deviceProxy->getValue(input, 0);
|
||||
});
|
||||
_endpoints[input] = std::make_shared<LambdaEndpoint>([=] {
|
||||
auto deviceProxy = userInputMapper->getDeviceProxy(input);
|
||||
if (!deviceProxy) {
|
||||
return 0.0f;
|
||||
}
|
||||
return deviceProxy->getValue(input, 0);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue