mirror of
https://github.com/lubosz/overte.git
synced 2025-08-07 19:21:16 +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();
|
auto devices = userInputMapper->getDevices();
|
||||||
QSet<QString> foundDevices;
|
QSet<QString> foundDevices;
|
||||||
for (const auto& deviceMapping : devices) {
|
for (const auto& deviceMapping : devices) {
|
||||||
auto device = deviceMapping.second.get();
|
auto deviceID = deviceMapping.first;
|
||||||
auto deviceName = QString(device->getName()).remove(ScriptingInterface::SANITIZE_NAME_EXPRESSION);
|
if (deviceID != userInputMapper->getStandardDeviceID()) {
|
||||||
qCDebug(controllers) << "Device" << deviceMapping.first << ":" << deviceName;
|
auto device = deviceMapping.second.get();
|
||||||
foundDevices.insert(device->getName());
|
auto deviceName = QString(device->getName()).remove(ScriptingInterface::SANITIZE_NAME_EXPRESSION);
|
||||||
if (_hardware.contains(deviceName)) {
|
qCDebug(controllers) << "Device" << deviceMapping.first << ":" << deviceName;
|
||||||
continue;
|
foundDevices.insert(device->getName());
|
||||||
}
|
if (_hardware.contains(deviceName)) {
|
||||||
|
|
||||||
// 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;
|
continue;
|
||||||
}
|
}
|
||||||
_endpoints[input] = std::make_shared<LambdaEndpoint>([=] {
|
|
||||||
auto deviceProxy = userInputMapper->getDeviceProxy(input);
|
// Expose the IDs to JS
|
||||||
if (!deviceProxy) {
|
_hardware.insert(deviceName, createDeviceMap(device));
|
||||||
return 0.0f;
|
|
||||||
|
// 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