mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
fix(media): gate spectrum pipeline on playback to cut idle CPU
Issue: #2393
This commit is contained in:
@@ -16,7 +16,7 @@ NBox {
|
||||
readonly property bool hasActivePlayer: MediaService.currentPlayer && MediaService.canPlay
|
||||
|
||||
// SpectrumService registration for visualizer
|
||||
readonly property bool needsSpectrum: Settings.data.audio.visualizerType !== "" && Settings.data.audio.visualizerType !== "none"
|
||||
readonly property bool needsSpectrum: Settings.data.audio.visualizerType !== "" && Settings.data.audio.visualizerType !== "none" && MediaService.isPlaying
|
||||
|
||||
onNeedsSpectrumChanged: {
|
||||
if (root.needsSpectrum) {
|
||||
@@ -138,7 +138,7 @@ NBox {
|
||||
// Background visualizer on top of the artwork
|
||||
Loader {
|
||||
anchors.fill: parent
|
||||
active: Settings.data.audio.visualizerType !== "" && Settings.data.audio.visualizerType !== "none"
|
||||
active: root.needsSpectrum
|
||||
|
||||
sourceComponent: {
|
||||
switch (Settings.data.audio.visualizerType) {
|
||||
|
||||
Reference in New Issue
Block a user