From 97455a862ec20c39de3054742df3356c9ebbdc9d Mon Sep 17 00:00:00 2001 From: Kainoa Kanter Date: Fri, 22 Aug 2025 10:11:51 -0700 Subject: [PATCH] feat: make audio visualizer FPS configurable --- Commons/Settings.qml | 1 + Modules/SettingsPanel/Tabs/AudioTab.qml | 33 +++++++++++++++++++++++++ Services/CavaService.qml | 2 +- 3 files changed, 35 insertions(+), 1 deletion(-) diff --git a/Commons/Settings.qml b/Commons/Settings.qml index 23fa432..08cebaf 100644 --- a/Commons/Settings.qml +++ b/Commons/Settings.qml @@ -234,6 +234,7 @@ Singleton { property bool showMiniplayerCava: false property string visualizerType: "linear" property int volumeStep: 5 + property int cavaFps: 60 } // ui diff --git a/Modules/SettingsPanel/Tabs/AudioTab.qml b/Modules/SettingsPanel/Tabs/AudioTab.qml index a644a47..9f992da 100644 --- a/Modules/SettingsPanel/Tabs/AudioTab.qml +++ b/Modules/SettingsPanel/Tabs/AudioTab.qml @@ -308,6 +308,39 @@ ColumnLayout { Settings.data.audio.visualizerType = key } } + + NText { + text: "Audio Visualizer FPS" + font.pointSize: Style.fontSizeM * scaling + font.weight: Style.fontWeightBold + color: Color.mOnSurface + } + + ColumnLayout { + spacing: Style.marginS * scaling + Layout.fillWidth: true + Layout.topMargin: Style.marginM * scaling + + RowLayout { + NSlider { + Layout.fillWidth: true + from: 0 + to: 360 + value: Settings.data.audio.cavaFps + stepSize: 1 + onMoved: { + Settings.data.audio.cavaFps = value + } + } + + NText { + text: Settings.data.audio.cavaFps + " FPS" + Layout.alignment: Qt.AlignVCenter + Layout.leftMargin: Style.marginS * scaling + color: Color.mOnSurface + } + } + } } } } diff --git a/Services/CavaService.qml b/Services/CavaService.qml index 4d41a91..c8d6f05 100644 --- a/Services/CavaService.qml +++ b/Services/CavaService.qml @@ -14,7 +14,7 @@ Singleton { property var config: ({ "general": { "bars": barsCount, - "framerate": 60, + "framerate": Settings.data.audio.cavaFps, "autosens": 1, "sensitivity": 100, "lower_cutoff_freq": 50,