MCPcopy Create free account
hub / github.com/WarmUpTill/SceneSwitcher / CheckCondition

Method CheckCondition

plugins/usb/macro-condition-usb.cpp:41–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39}
40
41bool MacroConditionUSB::CheckCondition()
42{
43 const auto devs = GetUSBDevices();
44 if (devs.empty()) {
45 return false;
46 }
47
48 for (const auto &dev : devs) {
49 if (_vendorID.Matches(dev.vendorID) &&
50 _productID.Matches(dev.productID) &&
51 _busNumber.Matches(dev.busNumber) &&
52 _deviceAddress.Matches(dev.deviceAddress) &&
53 _vendorName.Matches(dev.vendorName) &&
54 _productName.Matches(dev.productName) &&
55 _serialNumber.Matches(dev.serialNumber)) {
56 SetTempVarValue("vendorID", dev.vendorID);
57 SetTempVarValue("productID", dev.productID);
58 SetTempVarValue("busNumber", dev.busNumber);
59 SetTempVarValue("deviceAddress", dev.deviceAddress);
60 SetTempVarValue("vendorName", dev.vendorName);
61 SetTempVarValue("productName", dev.productName);
62 SetTempVarValue("serialNumber", dev.serialNumber);
63 return true;
64 }
65 }
66 return false;
67}
68
69bool MacroConditionUSB::Save(obs_data_t *obj) const
70{

Callers

nothing calls this directly

Calls 4

GetUSBDevicesFunction · 0.85
SetTempVarValueFunction · 0.85
emptyMethod · 0.45
MatchesMethod · 0.45

Tested by

no test coverage detected