mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2025-01-14 17:29:41 +01:00
Use different volume scale for mic volume
Not exact but it is fairly close
This commit is contained in:
parent
cb2b27e868
commit
81d2d1899b
@ -26,13 +26,19 @@ namespace DS4Windows.DS4Library
|
|||||||
return vol;
|
return vol;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private DataFlow instAudioFlags = DataFlow.Render;
|
||||||
|
|
||||||
public void RefreshVolume()
|
public void RefreshVolume()
|
||||||
{
|
{
|
||||||
float pfLevel = 0;
|
float pfLevel = 0;
|
||||||
|
|
||||||
if (endpointVolume != null)
|
if (endpointVolume != null)
|
||||||
endpointVolume.GetMasterVolumeLevelScalar(out pfLevel);
|
endpointVolume.GetMasterVolumeLevelScalar(out pfLevel);
|
||||||
|
|
||||||
|
if (instAudioFlags == DataFlow.Render)
|
||||||
vol = Convert.ToUInt32((75 - 20) * (--pfLevel * pfLevel * pfLevel + 1) + 20);
|
vol = Convert.ToUInt32((75 - 20) * (--pfLevel * pfLevel * pfLevel + 1) + 20);
|
||||||
|
else if (instAudioFlags == DataFlow.Capture)
|
||||||
|
vol = Convert.ToUInt32((60 - 0) * pfLevel + 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnNotify(IntPtr pNotify)
|
public void OnNotify(IntPtr pNotify)
|
||||||
@ -60,6 +66,7 @@ namespace DS4Windows.DS4Library
|
|||||||
{
|
{
|
||||||
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));
|
||||||
|
instAudioFlags = audioFlags;
|
||||||
endpointVolume = interfacePointer as IAudioEndpointVolume;
|
endpointVolume = interfacePointer as IAudioEndpointVolume;
|
||||||
endpointVolume.RegisterControlChangeNotify(this);
|
endpointVolume.RegisterControlChangeNotify(this);
|
||||||
}
|
}
|
||||||
|
2
TODO.md
2
TODO.md
@ -4,7 +4,7 @@
|
|||||||
* Add cross dead zone (per axis) for sticks
|
* Add cross dead zone (per axis) for sticks
|
||||||
* Abstract output slots
|
* Abstract output slots
|
||||||
* Abstract KB+M codes to allow different event systems (Vmulti)
|
* Abstract KB+M codes to allow different event systems (Vmulti)
|
||||||
* Add volume scale to mic volume. Mic volume too loud otherwise
|
* ~~Add volume scale to mic volume. Mic volume too loud otherwise~~
|
||||||
* Check Toggle action label in old WinForms build
|
* Check Toggle action label in old WinForms build
|
||||||
* Look into adding JSON package
|
* Look into adding JSON package
|
||||||
* Check if unhandled exception logging for threads is needed
|
* Check if unhandled exception logging for threads is needed
|
||||||
|
Loading…
x
Reference in New Issue
Block a user