Fix volume/brightness by 5

This commit is contained in:
Kamil Trzciński 2022-11-18 15:56:44 +01:00
parent aac4810c05
commit b672c4e9c3
4 changed files with 9 additions and 9 deletions

View file

@ -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);
}
/// <summary>

View file

@ -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)

View file

@ -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()

View file

@ -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).