Take off portion of device name that is susceptible to localization

This commit is contained in:
Travis Nickles 2018-01-15 17:42:47 -06:00
parent be10ab29b2
commit 4c0bbb5bf8

View File

@ -62,14 +62,7 @@ namespace DS4Windows.DS4Library
endpointVolume = interfacePointer as IAudioEndpointVolume; endpointVolume = interfacePointer as IAudioEndpointVolume;
endpointVolume.RegisterControlChangeNotify(this); endpointVolume.RegisterControlChangeNotify(this);
} }
else if (deviceName.Contains("Headset Earphone (Wireless Controller)")) else if (deviceName.Contains("(Wireless Controller)"))
{
object interfacePointer;
Marshal.ThrowExceptionForHR(audioDevice.Activate(ref IID_IAudioEndpointVolume, ClsCtx.ALL, IntPtr.Zero, out interfacePointer));
endpointVolume = interfacePointer as IAudioEndpointVolume;
endpointVolume.RegisterControlChangeNotify(this);
}
else if (deviceName.Contains("Headset Microphone (Wireless Controller)"))
{ {
object interfacePointer; object interfacePointer;
Marshal.ThrowExceptionForHR(audioDevice.Activate(ref IID_IAudioEndpointVolume, ClsCtx.ALL, IntPtr.Zero, out interfacePointer)); Marshal.ThrowExceptionForHR(audioDevice.Activate(ref IID_IAudioEndpointVolume, ClsCtx.ALL, IntPtr.Zero, out interfacePointer));