History

Custom refresh rate profile WIP

This adds a Custom refresh rate profile with configurable refresh rate regimes. Unfortunately this commit does not work yet. The SpinBoxes inside GraphicsSettings are on top of each other, and changing the values for the Custom profile through e.g. the JS API does not actually affect the refresh rate cap at all for some reason.

latex committed 2 years ago

Commit a6646d81 parent f1475e46 files · +190 −4Browse files

Showing the changes to interface/src/scripting/PerformanceScriptingInterface.cpp (1 of 6 files). Show all

Unified · Split

interface/src/scripting/PerformanceScriptingInterface.cpp+11−1
@@ -56,12 +56,22 @@ void PerformanceScriptingInterface::setRefreshRateProfile(RefreshRateProfile ref · 55 unmodified lines
56 emit settingsChanged();56 emit settingsChanged();
57}57}
58 58
59void PerformanceScriptingInterface::setCustomRefreshRate(RefreshRateManager::RefreshRateRegime refreshRateRegime, int value)
60{
61 qApp->getRefreshRateManager().setCustomRefreshRate(refreshRateRegime, value);
62 emit settingsChanged();
63}
64
65int PerformanceScriptingInterface::getCustomRefreshRate(RefreshRateManager::RefreshRateRegime refreshRateRegime) const {
66 return qApp->getRefreshRateManager().getCustomRefreshRate(refreshRateRegime);
67}
68
59PerformanceScriptingInterface::RefreshRateProfile PerformanceScriptingInterface::getRefreshRateProfile() const {69PerformanceScriptingInterface::RefreshRateProfile PerformanceScriptingInterface::getRefreshRateProfile() const {
60 return (PerformanceScriptingInterface::RefreshRateProfile)qApp->getRefreshRateManager().getRefreshRateProfile();70 return (PerformanceScriptingInterface::RefreshRateProfile)qApp->getRefreshRateManager().getRefreshRateProfile();
61}71}
62 72
63QStringList PerformanceScriptingInterface::getRefreshRateProfileNames() const {73QStringList PerformanceScriptingInterface::getRefreshRateProfileNames() const {
64 static const QStringList refreshRateProfileNames = { "ECO", "INTERACTIVE", "REALTIME" };74 static const QStringList refreshRateProfileNames = { "ECO", "INTERACTIVE", "REALTIME", "CUSTOM" };
65 return refreshRateProfileNames;75 return refreshRateProfileNames;
66}76}
67 77