1
0

proper warning on input device missing

This commit is contained in:
YuRaNnNzZZ 2024-12-18 15:01:30 +03:00
parent 7f6af76270
commit d727c65c70
Signed by: YuRaNnNzZZ
GPG Key ID: 5F71738C85A6006D

View File

@ -44,9 +44,9 @@ namespace SwitchMicMonitorDevice
MMDevice device = enumerator.GetDevice(micId); MMDevice device = enumerator.GetDevice(micId);
if (device == null) if (device == null)
{ {
enumerator.Dispose(); Console.WriteLine("Output device {0} not found", micId);
Console.WriteLine("Device {0} not found", micId); enumerator.Dispose();
return; return;
} }
@ -63,7 +63,14 @@ namespace SwitchMicMonitorDevice
string outDeviceId = args[1]; string outDeviceId = args[1];
MMDevice dev2 = enumerator.GetDevice(outDeviceId); MMDevice dev2 = enumerator.GetDevice(outDeviceId);
if (dev2 == null) return; if (dev2 == null)
{
Console.WriteLine("Input device {0} not found", outDeviceId);
enumerator.Dispose();
return;
}
store.SetValue(PROP_KEY_MONITORING_ENABLE, PROP_BOOL_ENABLE); store.SetValue(PROP_KEY_MONITORING_ENABLE, PROP_BOOL_ENABLE);
store.Commit(); store.Commit();