diff --git a/PowerControl/Helpers/WindowsMasterVolume.cs b/PowerControl/Helpers/WindowsMasterVolume.cs index da194a9..a48848c 100644 --- a/PowerControl/Helpers/WindowsMasterVolume.cs +++ b/PowerControl/Helpers/WindowsMasterVolume.cs @@ -42,9 +42,9 @@ namespace PowerControl.Helpers } } - public static int GetMasterVolume10() + public static int GetMasterVolume(double roundValue) { - return (int)(Math.Round(GetMasterVolume() / 10.0) * 10.0); + return (int)(Math.Round(GetMasterVolume() / roundValue) * roundValue); } /// diff --git a/PowerControl/Helpers/WindowsSettingsBrightnessController.cs b/PowerControl/Helpers/WindowsSettingsBrightnessController.cs index 687b678..cd8ffb9 100644 --- a/PowerControl/Helpers/WindowsSettingsBrightnessController.cs +++ b/PowerControl/Helpers/WindowsSettingsBrightnessController.cs @@ -23,9 +23,9 @@ namespace PowerControl.Helpers return -1; } - public static int Get10() + public static int Get(double roundValue = 10.0) { - return (int)(Math.Round(Get() / 10.0) * 10.0); + return (int)(Math.Round(Get() / roundValue) * roundValue); } public static void Set(int brightness) diff --git a/PowerControl/MenuStack.cs b/PowerControl/MenuStack.cs index 9b78423..126a43d 100644 --- a/PowerControl/MenuStack.cs +++ b/PowerControl/MenuStack.cs @@ -24,13 +24,13 @@ namespace PowerControl CurrentValue = delegate() { - return Helpers.WindowsSettingsBrightnessController.Get10(); + return Helpers.WindowsSettingsBrightnessController.Get(5.0); }, ApplyValue = delegate(object selected) { Helpers.WindowsSettingsBrightnessController.Set((int)selected); - return Helpers.WindowsSettingsBrightnessController.Get10(); + return Helpers.WindowsSettingsBrightnessController.Get(5.0); } }, new Menu.MenuItemWithOptions() @@ -39,14 +39,14 @@ namespace PowerControl Options = { 0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100 }, CurrentValue = delegate() { - return Helpers.AudioManager.GetMasterVolume10(); + return Helpers.AudioManager.GetMasterVolume(5.0); }, ApplyValue = delegate(object selected) { Helpers.AudioManager.SetMasterVolumeMute(false); Helpers.AudioManager.SetMasterVolume((int)selected); - return Helpers.AudioManager.GetMasterVolume10(); + return Helpers.AudioManager.GetMasterVolume(5.0); } }, new Menu.MenuItemWithOptions() diff --git a/RELEASE.md b/RELEASE.md index 88ef7ec..fe72398 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -11,6 +11,6 @@ - Fix ryzenadj creating console window - Swap icons of PerformanceOverlay and PowerControl - Improve FanControl UI -- Make increments for Brightness and Volume in 5 +- Make increments for Brightness and Volume in 5 (fixed) If you found it useful buy me [Ko-fi](https://ko-fi.com/ayufan).