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:
@@ -17,7 +17,7 @@ Loader {
|
||||
active: false
|
||||
|
||||
// Track if the visualizer should be shown (lockscreen active + media playing + non-compact mode)
|
||||
readonly property bool needsSpectrum: 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" && MediaService.isPlaying
|
||||
|
||||
onActiveChanged: {
|
||||
if (root.active && root.needsSpectrum) {
|
||||
|
||||
@@ -264,7 +264,7 @@ Item {
|
||||
Loader {
|
||||
anchors.fill: parent
|
||||
anchors.margins: 4
|
||||
active: Settings.data.audio.visualizerType === "linear"
|
||||
active: Settings.data.audio.visualizerType === "linear" && MediaService.isPlaying
|
||||
z: 0
|
||||
sourceComponent: NLinearSpectrum {
|
||||
anchors.fill: parent
|
||||
@@ -278,7 +278,7 @@ Item {
|
||||
Loader {
|
||||
anchors.fill: parent
|
||||
anchors.margins: 4
|
||||
active: Settings.data.audio.visualizerType === "mirrored"
|
||||
active: Settings.data.audio.visualizerType === "mirrored" && MediaService.isPlaying
|
||||
z: 0
|
||||
sourceComponent: NMirroredSpectrum {
|
||||
anchors.fill: parent
|
||||
@@ -292,7 +292,7 @@ Item {
|
||||
Loader {
|
||||
anchors.fill: parent
|
||||
anchors.margins: 4
|
||||
active: Settings.data.audio.visualizerType === "wave"
|
||||
active: Settings.data.audio.visualizerType === "wave" && MediaService.isPlaying
|
||||
z: 0
|
||||
sourceComponent: NWaveSpectrum {
|
||||
anchors.fill: parent
|
||||
|
||||
Reference in New Issue
Block a user