mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2025-01-13 16:49:08 +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;
|
||||
}
|
||||
|
||||
private DataFlow instAudioFlags = DataFlow.Render;
|
||||
|
||||
public void RefreshVolume()
|
||||
{
|
||||
float pfLevel = 0;
|
||||
|
||||
if (endpointVolume != null)
|
||||
endpointVolume.GetMasterVolumeLevelScalar(out pfLevel);
|
||||
vol = Convert.ToUInt32((75 - 20) * (--pfLevel * pfLevel * pfLevel + 1) + 20);
|
||||
|
||||
if (instAudioFlags == DataFlow.Render)
|
||||
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)
|
||||
@ -60,6 +66,7 @@ namespace DS4Windows.DS4Library
|
||||
{
|
||||
object interfacePointer;
|
||||
Marshal.ThrowExceptionForHR(audioDevice.Activate(ref IID_IAudioEndpointVolume, ClsCtx.ALL, IntPtr.Zero, out interfacePointer));
|
||||
instAudioFlags = audioFlags;
|
||||
endpointVolume = interfacePointer as IAudioEndpointVolume;
|
||||
endpointVolume.RegisterControlChangeNotify(this);
|
||||
}
|
||||
|
2
TODO.md
2
TODO.md
@ -4,7 +4,7 @@
|
||||
* Add cross dead zone (per axis) for sticks
|
||||
* Abstract output slots
|
||||
* 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
|
||||
* Look into adding JSON package
|
||||
* Check if unhandled exception logging for threads is needed
|
||||
|
Loading…
x
Reference in New Issue
Block a user