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.
Showing the changes to interface/src/scripting/PerformanceScriptingInterface.cpp (1 of 6 files). Show all
Unified · Split
| @@ -56,12 +56,22 @@ void PerformanceScriptingInterface::setRefreshRateProfile(RefreshRateProfile ref · 55 unmodified lines | |||
| 56 | emit settingsChanged(); | 56 | emit settingsChanged(); |
| 57 | } | 57 | } |
| 58 | 58 | ||
| 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 | |||
| 59 | PerformanceScriptingInterface::RefreshRateProfile PerformanceScriptingInterface::getRefreshRateProfile() const { | 69 | PerformanceScriptingInterface::RefreshRateProfile PerformanceScriptingInterface::getRefreshRateProfile() const { |
| 60 | return (PerformanceScriptingInterface::RefreshRateProfile)qApp->getRefreshRateManager().getRefreshRateProfile(); | 70 | return (PerformanceScriptingInterface::RefreshRateProfile)qApp->getRefreshRateManager().getRefreshRateProfile(); |
| 61 | } | 71 | } |
| 62 | 72 | ||
| 63 | QStringList PerformanceScriptingInterface::getRefreshRateProfileNames() const { | 73 | QStringList 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 | ||