From 77de0b0ade368387264c209d989eae00af864f72 Mon Sep 17 00:00:00 2001 From: Lemmy Date: Fri, 6 Mar 2026 22:34:14 -0500 Subject: [PATCH] chore(cava): CavaService => SpectrumService --- Assets/settings-default.json | 2 +- Commons/Migrations/Migration57.qml | 16 +++++++++++ Commons/Migrations/MigrationRegistry.qml | 4 ++- Commons/Settings.qml | 4 +-- Modules/Bar/Widgets/AudioVisualizer.qml | 16 +++++------ Modules/Bar/Widgets/MediaMini.qml | 26 ++++++++--------- Modules/Cards/MediaCard.qml | 26 ++++++++--------- .../Widgets/DesktopAudioVisualizer.qml | 24 ++++++++-------- .../Widgets/DesktopMediaPlayer.qml | 28 +++++++++---------- Modules/LockScreen/LockScreen.qml | 18 ++++++------ Modules/LockScreen/LockScreenPanel.qml | 6 ++-- Modules/Panels/Media/MediaPlayerPanel.qml | 26 ++++++++--------- .../Settings/Tabs/Audio/VisualizerSubTab.qml | 6 ++-- Scripts/bash/template-apply.sh | 2 +- .../{CavaService.qml => SpectrumService.qml} | 24 ++++++++-------- 15 files changed, 123 insertions(+), 105 deletions(-) create mode 100644 Commons/Migrations/Migration57.qml rename Services/Media/{CavaService.qml => SpectrumService.qml} (87%) diff --git a/Assets/settings-default.json b/Assets/settings-default.json index 2ef36828b..a2dfa2453 100644 --- a/Assets/settings-default.json +++ b/Assets/settings-default.json @@ -470,7 +470,7 @@ "audio": { "volumeStep": 5, "volumeOverdrive": false, - "cavaFrameRate": 30, + "spectrumFrameRate": 30, "visualizerType": "linear", "mprisBlacklist": [], "preferredPlayer": "", diff --git a/Commons/Migrations/Migration57.qml b/Commons/Migrations/Migration57.qml new file mode 100644 index 000000000..a8e3444bd --- /dev/null +++ b/Commons/Migrations/Migration57.qml @@ -0,0 +1,16 @@ +import QtQuick + +QtObject { + id: root + + function migrate(adapter, logger, rawJson) { + logger.i("Settings", "Migrating settings to v57 (cavaFrameRate -> spectrumFrameRate)"); + + if (rawJson && rawJson.audio && rawJson.audio.cavaFrameRate !== undefined) { + adapter.audio.spectrumFrameRate = rawJson.audio.cavaFrameRate; + logger.i("Settings", "Migrated cavaFrameRate:", rawJson.audio.cavaFrameRate, "-> spectrumFrameRate"); + } + + return true; + } +} diff --git a/Commons/Migrations/MigrationRegistry.qml b/Commons/Migrations/MigrationRegistry.qml index e4905ae33..51e546cef 100644 --- a/Commons/Migrations/MigrationRegistry.qml +++ b/Commons/Migrations/MigrationRegistry.qml @@ -28,7 +28,8 @@ QtObject { 53: migration53Component, 54: migration54Component, 55: migration55Component, - 56: migration56Component + 56: migration56Component, + 57: migration57Component }) // Migration components @@ -54,4 +55,5 @@ QtObject { property Component migration54Component: Migration54 {} property Component migration55Component: Migration55 {} property Component migration56Component: Migration56 {} + property Component migration57Component: Migration57 {} } diff --git a/Commons/Settings.qml b/Commons/Settings.qml index 71b4a87e6..fa65ae69b 100644 --- a/Commons/Settings.qml +++ b/Commons/Settings.qml @@ -25,7 +25,7 @@ Singleton { - Default cache directory: ~/.cache/noctalia */ readonly property alias data: adapter // Used to access via Settings.data.xxx.yyy - readonly property int settingsVersion: 56 + readonly property int settingsVersion: 57 property bool isDebug: Quickshell.env("NOCTALIA_DEBUG") === "1" readonly property string shellName: "noctalia" readonly property string configDir: Quickshell.env("NOCTALIA_CONFIG_DIR") || (Quickshell.env("XDG_CONFIG_HOME") || Quickshell.env("HOME") + "/.config") + "/" + shellName + "/" @@ -677,7 +677,7 @@ Singleton { property JsonObject audio: JsonObject { property int volumeStep: 5 property bool volumeOverdrive: false - property int cavaFrameRate: 30 + property int spectrumFrameRate: 30 property string visualizerType: "linear" property list mprisBlacklist: [] property string preferredPlayer: "" diff --git a/Modules/Bar/Widgets/AudioVisualizer.qml b/Modules/Bar/Widgets/AudioVisualizer.qml index c01be7adc..4edd7a28e 100644 --- a/Modules/Bar/Widgets/AudioVisualizer.qml +++ b/Modules/Bar/Widgets/AudioVisualizer.qml @@ -45,20 +45,20 @@ Item { readonly property bool shouldShow: (currentVisualizerType !== "" && currentVisualizerType !== "none") && (!hideWhenIdle || MediaService.isPlaying) - // Register/unregister with CavaService based on visibility - readonly property string cavaComponentId: "bar:audiovisualizer:" + root.screen.name + ":" + root.section + ":" + root.sectionWidgetIndex + // Register/unregister with SpectrumService based on visibility + readonly property string spectrumComponentId: "bar:audiovisualizer:" + root.screen.name + ":" + root.section + ":" + root.sectionWidgetIndex onShouldShowChanged: { if (root.shouldShow) { - CavaService.registerComponent(root.cavaComponentId); + SpectrumService.registerComponent(root.spectrumComponentId); } else { - CavaService.unregisterComponent(root.cavaComponentId); + SpectrumService.unregisterComponent(root.spectrumComponentId); } } Component.onDestruction: { if (root.shouldShow) { - CavaService.unregisterComponent(root.cavaComponentId); + SpectrumService.unregisterComponent(root.spectrumComponentId); } } @@ -177,7 +177,7 @@ Item { id: linearComponent NLinearSpectrum { anchors.fill: parent - values: CavaService.values + values: SpectrumService.values fillColor: root.fillColor showMinimumSignal: true vertical: root.isVerticalBar @@ -189,7 +189,7 @@ Item { id: mirroredComponent NMirroredSpectrum { anchors.fill: parent - values: CavaService.values + values: SpectrumService.values fillColor: root.fillColor showMinimumSignal: true vertical: root.isVerticalBar @@ -200,7 +200,7 @@ Item { id: waveComponent NWaveSpectrum { anchors.fill: parent - values: CavaService.values + values: SpectrumService.values fillColor: root.fillColor showMinimumSignal: true vertical: root.isVerticalBar diff --git a/Modules/Bar/Widgets/MediaMini.qml b/Modules/Bar/Widgets/MediaMini.qml index 3e83dd57c..a54b1fc63 100644 --- a/Modules/Bar/Widgets/MediaMini.qml +++ b/Modules/Bar/Widgets/MediaMini.qml @@ -73,31 +73,31 @@ Item { return showArtistFirst ? (artist ? `${artist} - ${track}` : track) : (artist ? `${track} - ${artist}` : track); } - // CavaService registration for visualizer - readonly property string cavaComponentId: "bar:mediamini:" + root.screen?.name + ":" + root.section + ":" + root.sectionWidgetIndex - readonly property bool needsCava: root.showVisualizer && root.visualizerType !== "" && root.visualizerType !== "none" && !root.isHidden + // SpectrumService registration for visualizer + readonly property string spectrumComponentId: "bar:mediamini:" + root.screen?.name + ":" + root.section + ":" + root.sectionWidgetIndex + readonly property bool needsSpectrum: root.showVisualizer && root.visualizerType !== "" && root.visualizerType !== "none" && !root.isHidden Layout.preferredHeight: isVertical ? -1 : Style.getBarHeightForScreen(screenName) Layout.preferredWidth: isVertical ? Style.getBarHeightForScreen(screenName) : -1 Layout.fillHeight: false Layout.fillWidth: false - onNeedsCavaChanged: { - if (root.needsCava) { - CavaService.registerComponent(root.cavaComponentId); + onNeedsSpectrumChanged: { + if (root.needsSpectrum) { + SpectrumService.registerComponent(root.spectrumComponentId); } else { - CavaService.unregisterComponent(root.cavaComponentId); + SpectrumService.unregisterComponent(root.spectrumComponentId); } } Component.onCompleted: { - if (root.needsCava) { - CavaService.registerComponent(root.cavaComponentId); + if (root.needsSpectrum) { + SpectrumService.registerComponent(root.spectrumComponentId); } } Component.onDestruction: { - CavaService.unregisterComponent(root.cavaComponentId); + SpectrumService.unregisterComponent(root.spectrumComponentId); } // Layout @@ -420,7 +420,7 @@ Item { NLinearSpectrum { width: parent.width - Style.marginS height: 20 - values: CavaService.values + values: SpectrumService.values fillColor: Color.mPrimary opacity: 0.4 barPosition: root.barPosition @@ -432,7 +432,7 @@ Item { NMirroredSpectrum { width: parent.width - Style.marginS height: parent.height - Style.marginS - values: CavaService.values + values: SpectrumService.values fillColor: Color.mPrimary opacity: 0.4 } @@ -443,7 +443,7 @@ Item { NWaveSpectrum { width: parent.width - Style.marginS height: parent.height - Style.marginS - values: CavaService.values + values: SpectrumService.values fillColor: Color.mPrimary opacity: 0.4 } diff --git a/Modules/Cards/MediaCard.qml b/Modules/Cards/MediaCard.qml index b9f12f036..e042d3374 100644 --- a/Modules/Cards/MediaCard.qml +++ b/Modules/Cards/MediaCard.qml @@ -15,26 +15,26 @@ NBox { // Track whether we have an active media player readonly property bool hasActivePlayer: MediaService.currentPlayer && MediaService.canPlay - // CavaService registration for visualizer - readonly property bool needsCava: Settings.data.audio.visualizerType !== "" && Settings.data.audio.visualizerType !== "none" + // SpectrumService registration for visualizer + readonly property bool needsSpectrum: Settings.data.audio.visualizerType !== "" && Settings.data.audio.visualizerType !== "none" - onNeedsCavaChanged: { - if (root.needsCava) { - CavaService.registerComponent("mediacard"); + onNeedsSpectrumChanged: { + if (root.needsSpectrum) { + SpectrumService.registerComponent("mediacard"); } else { - CavaService.unregisterComponent("mediacard"); + SpectrumService.unregisterComponent("mediacard"); } } Component.onCompleted: { - if (root.needsCava) { - CavaService.registerComponent("mediacard"); + if (root.needsSpectrum) { + SpectrumService.registerComponent("mediacard"); } updateCachedWallpaper(); } Component.onDestruction: { - CavaService.unregisterComponent("mediacard"); + SpectrumService.unregisterComponent("mediacard"); } property string wallpaper: WallpaperService.getWallpaper(screen.name) @@ -157,7 +157,7 @@ NBox { id: linearComponent NLinearSpectrum { anchors.fill: parent - values: CavaService.values + values: SpectrumService.values fillColor: Color.mPrimary opacity: 0.8 } @@ -167,7 +167,7 @@ NBox { id: mirroredComponent NMirroredSpectrum { anchors.fill: parent - values: CavaService.values + values: SpectrumService.values fillColor: Color.mPrimary opacity: 0.8 } @@ -177,7 +177,7 @@ NBox { id: waveComponent NWaveSpectrum { anchors.fill: parent - values: CavaService.values + values: SpectrumService.values fillColor: Color.mPrimary opacity: 0.8 } @@ -268,7 +268,7 @@ NBox { // No media player detected - centered disc icon NIcon { anchors.centerIn: parent - visible: !root.hasActivePlayer && CavaService.isIdle + visible: !root.hasActivePlayer && SpectrumService.isIdle icon: "disc" pointSize: Style.fontSizeXXXL * 3 color: Color.mOnSurfaceVariant diff --git a/Modules/DesktopWidgets/Widgets/DesktopAudioVisualizer.qml b/Modules/DesktopWidgets/Widgets/DesktopAudioVisualizer.qml index 419abf561..24464cace 100644 --- a/Modules/DesktopWidgets/Widgets/DesktopAudioVisualizer.qml +++ b/Modules/DesktopWidgets/Widgets/DesktopAudioVisualizer.qml @@ -25,29 +25,29 @@ DraggableDesktopWidget { readonly property bool shouldShow: visualizerType !== "" && visualizerType !== "none" && (!hideWhenIdle || MediaService.isPlaying) readonly property bool isHidden: !shouldShow - readonly property bool shouldRegisterCava: shouldShow + readonly property bool shouldRegisterSpectrum: shouldShow // Keep widget visible in edit mode so users can move/configure it visible: !root.isHidden || DesktopWidgetRegistry.editMode - readonly property string cavaComponentId: "desktop:audiovisualizer:" + (root.screen ? root.screen.name : "unknown") + ":" + root.widgetIndex + readonly property string spectrumComponentId: "desktop:audiovisualizer:" + (root.screen ? root.screen.name : "unknown") + ":" + root.widgetIndex - onShouldRegisterCavaChanged: { - if (root.shouldRegisterCava) { - CavaService.registerComponent(root.cavaComponentId); + onShouldRegisterSpectrumChanged: { + if (root.shouldRegisterSpectrum) { + SpectrumService.registerComponent(root.spectrumComponentId); } else { - CavaService.unregisterComponent(root.cavaComponentId); + SpectrumService.unregisterComponent(root.spectrumComponentId); } } Component.onCompleted: { - if (root.shouldRegisterCava) { - CavaService.registerComponent(root.cavaComponentId); + if (root.shouldRegisterSpectrum) { + SpectrumService.registerComponent(root.spectrumComponentId); } } Component.onDestruction: { - CavaService.unregisterComponent(root.cavaComponentId); + SpectrumService.unregisterComponent(root.spectrumComponentId); } implicitWidth: Math.round(visualizerWidth * widgetScale) @@ -88,7 +88,7 @@ DraggableDesktopWidget { id: linearComponent NLinearSpectrum { anchors.fill: parent - values: CavaService.values + values: SpectrumService.values fillColor: root.fillColor showMinimumSignal: true } @@ -98,7 +98,7 @@ DraggableDesktopWidget { id: mirroredComponent NMirroredSpectrum { anchors.fill: parent - values: CavaService.values + values: SpectrumService.values fillColor: root.fillColor showMinimumSignal: true } @@ -108,7 +108,7 @@ DraggableDesktopWidget { id: waveComponent NWaveSpectrum { anchors.fill: parent - values: CavaService.values + values: SpectrumService.values fillColor: root.fillColor showMinimumSignal: true } diff --git a/Modules/DesktopWidgets/Widgets/DesktopMediaPlayer.qml b/Modules/DesktopWidgets/Widgets/DesktopMediaPlayer.qml index 18d7b1fa9..143ab7cc4 100644 --- a/Modules/DesktopWidgets/Widgets/DesktopMediaPlayer.qml +++ b/Modules/DesktopWidgets/Widgets/DesktopMediaPlayer.qml @@ -32,26 +32,26 @@ DraggableDesktopWidget { readonly property bool isHidden: (shouldHideIdle || shouldHideEmpty) && !DesktopWidgetRegistry.editMode visible: !isHidden - // CavaService registration for visualizer - readonly property string cavaComponentId: "desktopmediaplayer:" + (root.screen ? root.screen.name : "unknown") - readonly property bool needsCava: root.shouldShowVisualizer && !root.isHidden + // SpectrumService registration for visualizer + readonly property string spectrumComponentId: "desktopmediaplayer:" + (root.screen ? root.screen.name : "unknown") + readonly property bool needsSpectrum: root.shouldShowVisualizer && !root.isHidden - onNeedsCavaChanged: { - if (root.needsCava) { - CavaService.registerComponent(root.cavaComponentId); + onNeedsSpectrumChanged: { + if (root.needsSpectrum) { + SpectrumService.registerComponent(root.spectrumComponentId); } else { - CavaService.unregisterComponent(root.cavaComponentId); + SpectrumService.unregisterComponent(root.spectrumComponentId); } } Component.onCompleted: { - if (root.needsCava) { - CavaService.registerComponent(root.cavaComponentId); + if (root.needsSpectrum) { + SpectrumService.registerComponent(root.spectrumComponentId); } } Component.onDestruction: { - CavaService.unregisterComponent(root.cavaComponentId); + SpectrumService.unregisterComponent(root.spectrumComponentId); } readonly property bool showPrev: hasPlayer && MediaService.canGoPrevious @@ -82,7 +82,7 @@ DraggableDesktopWidget { anchors.bottomMargin: 0 z: 0 clip: true - active: needsCava + active: needsSpectrum layer.enabled: true layer.smooth: true layer.effect: MultiEffect { @@ -114,7 +114,7 @@ DraggableDesktopWidget { id: linearComponent NLinearSpectrum { anchors.fill: parent - values: CavaService.values + values: SpectrumService.values fillColor: Color.mPrimary opacity: 0.5 } @@ -124,7 +124,7 @@ DraggableDesktopWidget { id: mirroredComponent NMirroredSpectrum { anchors.fill: parent - values: CavaService.values + values: SpectrumService.values fillColor: Color.mPrimary opacity: 0.5 } @@ -134,7 +134,7 @@ DraggableDesktopWidget { id: waveComponent NWaveSpectrum { anchors.fill: parent - values: CavaService.values + values: SpectrumService.values fillColor: Color.mPrimary opacity: 0.5 } diff --git a/Modules/LockScreen/LockScreen.qml b/Modules/LockScreen/LockScreen.qml index de4db5b88..ad02d2428 100644 --- a/Modules/LockScreen/LockScreen.qml +++ b/Modules/LockScreen/LockScreen.qml @@ -17,13 +17,13 @@ Loader { active: false // Track if the visualizer should be shown (lockscreen active + media playing + non-compact mode) - readonly property bool needsCava: root.active && !Settings.data.general.compactLockScreen && Settings.data.audio.visualizerType !== "" && Settings.data.audio.visualizerType !== "none" + readonly property bool needsSpectrum: root.active && !Settings.data.general.compactLockScreen && Settings.data.audio.visualizerType !== "" && Settings.data.audio.visualizerType !== "none" onActiveChanged: { - if (root.active && root.needsCava) { - CavaService.registerComponent("lockscreen"); + if (root.active && root.needsSpectrum) { + SpectrumService.registerComponent("lockscreen"); } else { - CavaService.unregisterComponent("lockscreen"); + SpectrumService.unregisterComponent("lockscreen"); } if (root.active) { @@ -33,11 +33,11 @@ Loader { } } - onNeedsCavaChanged: { - if (root.needsCava) { - CavaService.registerComponent("lockscreen"); + onNeedsSpectrumChanged: { + if (root.needsSpectrum) { + SpectrumService.registerComponent("lockscreen"); } else { - CavaService.unregisterComponent("lockscreen"); + SpectrumService.unregisterComponent("lockscreen"); } } @@ -47,7 +47,7 @@ Loader { } Component.onDestruction: { - CavaService.unregisterComponent("lockscreen"); + SpectrumService.unregisterComponent("lockscreen"); LockKeysService.unregisterComponent("lockscreen"); } diff --git a/Modules/LockScreen/LockScreenPanel.qml b/Modules/LockScreen/LockScreenPanel.qml index bb996be7e..e62fe89b7 100644 --- a/Modules/LockScreen/LockScreenPanel.qml +++ b/Modules/LockScreen/LockScreenPanel.qml @@ -268,7 +268,7 @@ Item { z: 0 sourceComponent: NLinearSpectrum { anchors.fill: parent - values: CavaService.values + values: SpectrumService.values fillColor: Color.mPrimary opacity: 0.4 } @@ -281,7 +281,7 @@ Item { z: 0 sourceComponent: NMirroredSpectrum { anchors.fill: parent - values: CavaService.values + values: SpectrumService.values fillColor: Color.mPrimary opacity: 0.4 } @@ -294,7 +294,7 @@ Item { z: 0 sourceComponent: NWaveSpectrum { anchors.fill: parent - values: CavaService.values + values: SpectrumService.values fillColor: Color.mPrimary opacity: 0.4 } diff --git a/Modules/Panels/Media/MediaPlayerPanel.qml b/Modules/Panels/Media/MediaPlayerPanel.qml index 246f9dff4..ddf82e829 100644 --- a/Modules/Panels/Media/MediaPlayerPanel.qml +++ b/Modules/Panels/Media/MediaPlayerPanel.qml @@ -49,24 +49,24 @@ SmartPanel { readonly property bool isSideBySide: root.compactMode && root.showAlbumArt - readonly property bool needsCava: root.showVisualizer && root.visualizerType !== "" && root.visualizerType !== "none" && root.isPanelOpen + readonly property bool needsSpectrum: root.showVisualizer && root.visualizerType !== "" && root.visualizerType !== "none" && root.isPanelOpen - onNeedsCavaChanged: { - if (root.needsCava) { - CavaService.registerComponent("mediaplayerpanel"); + onNeedsSpectrumChanged: { + if (root.needsSpectrum) { + SpectrumService.registerComponent("mediaplayerpanel"); } else { - CavaService.unregisterComponent("mediaplayerpanel"); + SpectrumService.unregisterComponent("mediaplayerpanel"); } } Component.onCompleted: { - if (root.needsCava) { - CavaService.registerComponent("mediaplayerpanel"); + if (root.needsSpectrum) { + SpectrumService.registerComponent("mediaplayerpanel"); } } Component.onDestruction: { - CavaService.unregisterComponent("mediaplayerpanel"); + SpectrumService.unregisterComponent("mediaplayerpanel"); } panelContent: Item { @@ -238,7 +238,7 @@ SmartPanel { Loader { anchors.fill: parent z: 0 - active: !!(root.needsCava && !root.showAlbumArt) + active: !!(root.needsSpectrum && !root.showAlbumArt) sourceComponent: visualizerSource } @@ -276,7 +276,7 @@ SmartPanel { anchors.fill: parent anchors.margins: Style.marginS z: 2 - active: !!(root.needsCava && root.showAlbumArt) + active: !!(root.needsSpectrum && root.showAlbumArt) sourceComponent: visualizerSource } } @@ -492,7 +492,7 @@ SmartPanel { NLinearSpectrum { width: parent.width - Style.marginS height: 20 - values: CavaService.values + values: SpectrumService.values fillColor: Color.mPrimary opacity: 0.4 barPosition: Settings.getBarPositionForScreen(root.screen?.name) @@ -504,7 +504,7 @@ SmartPanel { NMirroredSpectrum { width: parent.width - Style.marginS height: parent.height - Style.marginS - values: CavaService.values + values: SpectrumService.values fillColor: Color.mPrimary opacity: 0.4 } @@ -515,7 +515,7 @@ SmartPanel { NWaveSpectrum { width: parent.width - Style.marginS height: parent.height - Style.marginS - values: CavaService.values + values: SpectrumService.values fillColor: Color.mPrimary opacity: 0.4 } diff --git a/Modules/Panels/Settings/Tabs/Audio/VisualizerSubTab.qml b/Modules/Panels/Settings/Tabs/Audio/VisualizerSubTab.qml index ab50c8549..fda4fa58e 100644 --- a/Modules/Panels/Settings/Tabs/Audio/VisualizerSubTab.qml +++ b/Modules/Panels/Settings/Tabs/Audio/VisualizerSubTab.qml @@ -82,8 +82,8 @@ ColumnLayout { }) } ] - currentKey: Settings.data.audio.cavaFrameRate - defaultValue: Settings.getDefaultValue("audio.cavaFrameRate") - onSelected: key => Settings.data.audio.cavaFrameRate = key + currentKey: Settings.data.audio.spectrumFrameRate + defaultValue: Settings.getDefaultValue("audio.spectrumFrameRate") + onSelected: key => Settings.data.audio.spectrumFrameRate = key } } diff --git a/Scripts/bash/template-apply.sh b/Scripts/bash/template-apply.sh index 3b600c9dc..6e425a575 100755 --- a/Scripts/bash/template-apply.sh +++ b/Scripts/bash/template-apply.sh @@ -241,7 +241,7 @@ cava) # Reload cava if it's running, but only if it's not using stdin config if pgrep -f cava >/dev/null; then - # Check if Cava is running with -p /dev/stdin (managed by CavaService) + # Check if Cava is running with -p /dev/stdin (standalone cava) if ! pgrep -af cava | grep -q -- "-p.*stdin"; then pkill -USR1 cava fi diff --git a/Services/Media/CavaService.qml b/Services/Media/SpectrumService.qml similarity index 87% rename from Services/Media/CavaService.qml rename to Services/Media/SpectrumService.qml index bc0f4c68b..00972a9e4 100644 --- a/Services/Media/CavaService.qml +++ b/Services/Media/SpectrumService.qml @@ -14,14 +14,14 @@ Singleton { function registerComponent(componentId) { root.registeredComponents[componentId] = true; root.registeredComponents = Object.assign({}, root.registeredComponents); - Logger.d("Cava", "Component registered:", componentId, "- total:", root.registeredCount); + Logger.d("Spectrum", "Component registered:", componentId, "- total:", root.registeredCount); } // Unregister a component when it no longer needs audio data. function unregisterComponent(componentId) { delete root.registeredComponents[componentId]; root.registeredComponents = Object.assign({}, root.registeredComponents); - Logger.d("Cava", "Component unregistered:", componentId, "- total:", root.registeredCount); + Logger.d("Spectrum", "Component unregistered:", componentId, "- total:", root.registeredCount); } // Check if a component is registered @@ -57,7 +57,7 @@ Singleton { property var config: ({ "general": { "bars": barsCount, - "framerate": Settings.data.audio.cavaFrameRate, + "framerate": Settings.data.audio.spectrumFrameRate, "autosens": 1, "sensitivity": 100, "lower_cutoff_freq": 50, @@ -96,7 +96,7 @@ Singleton { repeat: false onTriggered: { if (root.shouldRun && !process.running) { - Logger.w("Cava", "Restarting after crash..."); + Logger.w("Spectrum", "Restarting after crash..."); process.running = true; } } @@ -107,7 +107,7 @@ Singleton { stdinEnabled: true command: ["cava", "-p", "/dev/stdin"] onRunningChanged: { - Logger.d("Cava", "Process running:", running); + Logger.d("Spectrum", "Process running:", running); } onExited: { stdinEnabled = true; @@ -115,18 +115,18 @@ Singleton { if (root.shouldRun) { root._crashCount++; if (root._crashCount <= root._maxCrashes) { - Logger.w("Cava", "Process exited unexpectedly, restarting in 2s... (attempt " + root._crashCount + "/" + root._maxCrashes + ")"); + Logger.w("Spectrum", "Process exited unexpectedly, restarting in 2s... (attempt " + root._crashCount + "/" + root._maxCrashes + ")"); restartTimer.start(); } else { - Logger.e("Cava", "Process crashed too many times (" + root._maxCrashes + "), giving up"); + Logger.e("Spectrum", "Process crashed too many times (" + root._maxCrashes + "), giving up"); } } else { - Logger.d("Cava", "Process exited (no longer needed)"); + Logger.d("Spectrum", "Process exited (no longer needed)"); root._crashCount = 0; } } onStarted: { - Logger.d("Cava", "Process started"); + Logger.d("Spectrum", "Process started"); for (const k in config) { if (typeof config[k] !== "object") { write(k + "=" + config[k] + "\n"); @@ -184,7 +184,7 @@ Singleton { root.isIdle = true; // Set all values to 0 one final time root.values = Array(root.barsCount).fill(0); - Logger.d("Cava", "Idle detected - stopped rendering"); + Logger.d("Spectrum", "Idle detected - stopped rendering"); } // Don't update values while idle return; @@ -194,7 +194,7 @@ Singleton { root.idleFrameCount = 0; if (root.isIdle) { root.isIdle = false; - Logger.d("Cava", "Audio detected - resumed rendering"); + Logger.d("Spectrum", "Audio detected - resumed rendering"); } } @@ -208,7 +208,7 @@ Singleton { stderr: StdioCollector { onStreamFinished: { if (text.trim()) { - Logger.w("Cava", "Error", text); + Logger.w("Spectrum", "Error", text); } } }