mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2024-11-26 11:04:21 +01:00
Add headphone volume support for DS4 v2 controllers
This commit is contained in:
parent
c5ef4196bd
commit
22912dff50
@ -56,6 +56,18 @@ namespace DS4Windows.DS4Library
|
||||
Marshal.ThrowExceptionForHR(audioDevice.Activate(ref IID_IAudioEndpointVolume, ClsCtx.ALL, IntPtr.Zero, out interfacePointer));
|
||||
endpointVolume = interfacePointer as IAudioEndpointVolume;
|
||||
}
|
||||
else if (deviceName.Contains("Headset Earphone (Wireless Controller)"))
|
||||
{
|
||||
object interfacePointer;
|
||||
Marshal.ThrowExceptionForHR(audioDevice.Activate(ref IID_IAudioEndpointVolume, ClsCtx.ALL, IntPtr.Zero, out interfacePointer));
|
||||
endpointVolume = interfacePointer as IAudioEndpointVolume;
|
||||
}
|
||||
else if (deviceName.Contains("Headset Microphone (Wireless Controller)"))
|
||||
{
|
||||
object interfacePointer;
|
||||
Marshal.ThrowExceptionForHR(audioDevice.Activate(ref IID_IAudioEndpointVolume, ClsCtx.ALL, IntPtr.Zero, out interfacePointer));
|
||||
endpointVolume = interfacePointer as IAudioEndpointVolume;
|
||||
}
|
||||
|
||||
Marshal.ReleaseComObject(audioDevice);
|
||||
}
|
||||
|
@ -419,6 +419,13 @@ namespace DS4Windows
|
||||
if (conType == ConnectionType.USB)
|
||||
{
|
||||
warnInterval = WARN_INTERVAL_USB;
|
||||
HidDeviceAttributes tempAttr = hDevice.Attributes;
|
||||
if (tempAttr.VendorId == 0x054C && tempAttr.ProductId == 0x09CC)
|
||||
{
|
||||
audio = new DS4Audio();
|
||||
micAudio = new DS4Audio(DS4Library.CoreAudio.DataFlow.Capture);
|
||||
}
|
||||
|
||||
synced = true;
|
||||
}
|
||||
else
|
||||
@ -1041,7 +1048,7 @@ namespace DS4Windows
|
||||
outputReportBuffer[8] = ligtBarColor.blue; // blue
|
||||
outputReportBuffer[9] = ledFlashOn; // flash on duration
|
||||
outputReportBuffer[10] = ledFlashOff; // flash off duration
|
||||
if (conType == ConnectionType.SONYWA)
|
||||
if (audio != null)
|
||||
{
|
||||
// Headphone volume levels
|
||||
outputReportBuffer[19] = outputReportBuffer[20] =
|
||||
|
Loading…
Reference in New Issue
Block a user