diff --git a/DS4Windows/DS4Library/DS4Audio.cs b/DS4Windows/DS4Library/DS4Audio.cs index 5f0748e..f54e043 100644 --- a/DS4Windows/DS4Library/DS4Audio.cs +++ b/DS4Windows/DS4Library/DS4Audio.cs @@ -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); } diff --git a/TODO.md b/TODO.md index 271130a..3935563 100644 --- a/TODO.md +++ b/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