mirror of
https://github.com/DarthAffe/RGB.NET.git
synced 2025-12-12 17:48:31 +00:00
Small Novation-detection refactoring
This commit is contained in:
parent
4f478879c2
commit
505e7481f7
@ -65,11 +65,10 @@ public sealed class NovationDeviceProvider : AbstractRGBDeviceProvider
|
||||
MidiOutCaps outCaps = OutputDeviceBase.GetDeviceCapabilities(index);
|
||||
if (outCaps.name == null) continue;
|
||||
|
||||
string deviceName = outCaps.name.ToUpperInvariant();
|
||||
NovationDevices? deviceId = (NovationDevices?)Enum.GetValues(typeof(NovationDevices))
|
||||
.Cast<Enum>()
|
||||
.Where(x => x.GetDeviceId() != null)
|
||||
.FirstOrDefault(x => deviceName.Contains(x.GetDeviceId()!.ToUpperInvariant()));
|
||||
.FirstOrDefault(x => outCaps.name.Contains(x.GetDeviceId()!, StringComparison.InvariantCultureIgnoreCase));
|
||||
|
||||
if (deviceId == null) continue;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user