mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-08-04 04:28:30 -04:00
cava: optimize CPU burn
related #631
(cherry picked from commit 2c5a1a2804)
This commit is contained in:
@@ -8,7 +8,7 @@ Item {
|
||||
|
||||
readonly property MprisPlayer activePlayer: MprisController.activePlayer
|
||||
readonly property bool isPlaying: activePlayer !== null && activePlayer.playbackState === MprisPlaybackState.Playing
|
||||
readonly property bool live: visible && isPlaying
|
||||
readonly property bool live: visible && (Window.window?.visible ?? false) && isPlaying
|
||||
|
||||
width: 20
|
||||
height: Theme.iconSize
|
||||
|
||||
@@ -1477,12 +1477,16 @@ Item {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
||||
Item {
|
||||
id: lockVisualizer
|
||||
|
||||
width: 20
|
||||
height: Theme.iconSize
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
||||
readonly property bool live: visible && (Window.window?.visible ?? false) && MprisController.activePlayer?.playbackState === MprisPlaybackState.Playing
|
||||
|
||||
Loader {
|
||||
active: MprisController.activePlayer?.playbackState === MprisPlaybackState.Playing
|
||||
active: lockVisualizer.live
|
||||
|
||||
sourceComponent: Component {
|
||||
Ref {
|
||||
@@ -1492,7 +1496,7 @@ Item {
|
||||
}
|
||||
|
||||
Timer {
|
||||
running: !CavaService.cavaAvailable && MprisController.activePlayer?.playbackState === MprisPlaybackState.Playing
|
||||
running: !CavaService.cavaAvailable && lockVisualizer.live
|
||||
interval: 256
|
||||
repeat: true
|
||||
onTriggered: {
|
||||
|
||||
Reference in New Issue
Block a user