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
5656 emit settingsChanged();
5757 }
5858
59+void PerformanceScriptingInterface::setCustomRefreshRate(RefreshRateManager::RefreshRateRegime refreshRateRegime, int value)
60+{
61+ qApp->getRefreshRateManager().setCustomRefreshRate(refreshRateRegime, value);
62+ emit settingsChanged();
63+}
64+
65+int PerformanceScriptingInterface::getCustomRefreshRate(RefreshRateManager::RefreshRateRegime refreshRateRegime) const {
66+ return qApp->getRefreshRateManager().getCustomRefreshRate(refreshRateRegime);
67+}
68+
5969 PerformanceScriptingInterface::RefreshRateProfile PerformanceScriptingInterface::getRefreshRateProfile() const {
6070 return (PerformanceScriptingInterface::RefreshRateProfile)qApp->getRefreshRateManager().getRefreshRateProfile();
6171 }
6272
6373 QStringList PerformanceScriptingInterface::getRefreshRateProfileNames() const {
64− static const QStringList refreshRateProfileNames = { "ECO", "INTERACTIVE", "REALTIME" };
74+ static const QStringList refreshRateProfileNames = { "ECO", "INTERACTIVE", "REALTIME", "CUSTOM" };
6575 return refreshRateProfileNames;
6676 }
6777