PowerControl: Expose all settings and apply them in order

Since some settings impact others, the application will
apply them in a correct order with a fixed delay.

This additionally exposes all settings, just some of them
are not persisted on create, only on change.
This commit is contained in:
Kamil Trzciński 2023-01-10 11:12:31 +01:00
parent 12de2267bf
commit 2ff2864f23
11 changed files with 115 additions and 32 deletions

View file

@ -7,6 +7,8 @@ namespace PowerControl.Options
public static Menu.MenuItemWithOptions Instance = new Menu.MenuItemWithOptions()
{
Name = "CPU",
PersistentKey = "CPUFrequency",
PersistOnCreate = false,
Options = { "Default", "Power-Save", "Balanced", "Max" },
ApplyDelay = 1000,
ActiveOption = "?",

View file

@ -7,6 +7,8 @@ namespace PowerControl.Options
public static Menu.MenuItemWithOptions Instance = new Menu.MenuItemWithOptions()
{
Name = "FAN",
PersistentKey = "FANMode",
PersistOnCreate = false,
ApplyDelay = 500,
OptionsValues = delegate ()
{

View file

@ -7,6 +7,8 @@ namespace PowerControl.Options
public static Menu.MenuItemWithOptions Instance = new Menu.MenuItemWithOptions()
{
Name = "GPU",
PersistentKey = "GPUFrequency",
PersistOnCreate = false,
Options = { "Default", "400MHz", "800MHz", "1200MHz", "1600MHz" },
ApplyDelay = 1000,
Visible = VangoghGPU.IsSupported,

View file

@ -31,14 +31,22 @@ namespace PowerControl.Options
// Since the RadeonSoftware will try to revert values
RadeonSoftware.Kill();
if (!GPUScaling.Enabled)
return "Off";
return GPUScaling.Mode.ToString();
},
Impacts =
{
Resolution.Instance,
RefreshRate.Instance,
FPSLimit.Instance
},
AfterApply = () =>
{
Resolution.Instance.Update();
RefreshRate.Instance.Update();
FPSLimit.Instance.Reset();
FPSLimit.Instance.Update();
if (!GPUScaling.Enabled)
return "Off";
return GPUScaling.Mode.ToString();
}
};
}

View file

@ -33,6 +33,7 @@ namespace PowerControl.Options
public static Menu.MenuItemWithOptions ModeInstance = new Menu.MenuItemWithOptions()
{
Name = "OSD Mode",
PersistentKey = "PerformanceOverlayMode",
ApplyDelay = 500,
OptionsValues = delegate ()
{

View file

@ -28,6 +28,10 @@ namespace PowerControl.Options
return DisplayResolutionController.GetRefreshRate().ToString();
},
Impacts =
{
FPSLimit.Instance
},
AfterApply = () =>
{
// force reset and refresh of FPS limit

View file

@ -33,12 +33,20 @@ namespace PowerControl.Options
{
var selectedResolution = new DisplayResolutionController.DisplayResolution(selected);
DisplayResolutionController.SetResolution(selectedResolution);
return DisplayResolutionController.GetResolution().ToString();
},
Impacts =
{
RefreshRate.Instance,
FPSLimit.Instance
},
AfterApply = () =>
{
// force refresh Refresh Rate
RefreshRate.Instance.Update();
// force reset and refresh of FPS limit
FPSLimit.Instance.Reset();
FPSLimit.Instance.Update();
return DisplayResolutionController.GetResolution().ToString();
}
};
}

View file

@ -7,6 +7,8 @@ namespace PowerControl.Options
public static Menu.MenuItemWithOptions Instance = new Menu.MenuItemWithOptions()
{
Name = "Controller",
PersistentKey = "SteamController",
PersistOnCreate = false,
ApplyDelay = 500,
OptionsValues = delegate ()
{

View file

@ -8,6 +8,8 @@ namespace PowerControl.Options
public static Menu.MenuItemWithOptions Instance = new Menu.MenuItemWithOptions()
{
Name = "TDP",
PersistentKey = "TDP",
PersistOnCreate = false,
Options = { "3W", "4W", "5W", "6W", "7W", "8W", "10W", "12W", "15W" },
ApplyDelay = 1000,
ResetValue = () => { return "15W"; },