mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-08-06 13:38:28 -04:00
@@ -8,7 +8,7 @@ Item {
|
|||||||
|
|
||||||
readonly property MprisPlayer activePlayer: MprisController.activePlayer
|
readonly property MprisPlayer activePlayer: MprisController.activePlayer
|
||||||
readonly property bool isPlaying: activePlayer !== null && activePlayer.playbackState === MprisPlaybackState.Playing
|
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
|
width: 20
|
||||||
height: Theme.iconSize
|
height: Theme.iconSize
|
||||||
|
|||||||
@@ -1477,12 +1477,16 @@ Item {
|
|||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
|
id: lockVisualizer
|
||||||
|
|
||||||
width: 20
|
width: 20
|
||||||
height: Theme.iconSize
|
height: Theme.iconSize
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
|
||||||
|
readonly property bool live: visible && (Window.window?.visible ?? false) && MprisController.activePlayer?.playbackState === MprisPlaybackState.Playing
|
||||||
|
|
||||||
Loader {
|
Loader {
|
||||||
active: MprisController.activePlayer?.playbackState === MprisPlaybackState.Playing
|
active: lockVisualizer.live
|
||||||
|
|
||||||
sourceComponent: Component {
|
sourceComponent: Component {
|
||||||
Ref {
|
Ref {
|
||||||
@@ -1492,7 +1496,7 @@ Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Timer {
|
Timer {
|
||||||
running: !CavaService.cavaAvailable && MprisController.activePlayer?.playbackState === MprisPlaybackState.Playing
|
running: !CavaService.cavaAvailable && lockVisualizer.live
|
||||||
interval: 256
|
interval: 256
|
||||||
repeat: true
|
repeat: true
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ framerate=25
|
|||||||
bars=6
|
bars=6
|
||||||
autosens=0
|
autosens=0
|
||||||
sensitivity=30
|
sensitivity=30
|
||||||
|
sleep_timer=3
|
||||||
lower_cutoff_freq=50
|
lower_cutoff_freq=50
|
||||||
higher_cutoff_freq=12000
|
higher_cutoff_freq=12000
|
||||||
|
|
||||||
@@ -67,13 +68,18 @@ exec cava -p ${root._confPath} < /dev/null`]
|
|||||||
stdout: SplitParser {
|
stdout: SplitParser {
|
||||||
splitMarker: "\n"
|
splitMarker: "\n"
|
||||||
onRead: data => {
|
onRead: data => {
|
||||||
if (root.refCount > 0 && data.length > 0) {
|
if (root.refCount <= 0 || data.length === 0)
|
||||||
const parts = data.split(";");
|
return;
|
||||||
if (parts.length >= 6) {
|
|
||||||
const points = [parseInt(parts[0], 10), parseInt(parts[1], 10), parseInt(parts[2], 10), parseInt(parts[3], 10), parseInt(parts[4], 10), parseInt(parts[5], 10)];
|
const parts = data.split(";");
|
||||||
root.values = points;
|
if (parts.length < 6)
|
||||||
}
|
return;
|
||||||
}
|
|
||||||
|
const points = [parseInt(parts[0], 10), parseInt(parts[1], 10), parseInt(parts[2], 10), parseInt(parts[3], 10), parseInt(parts[4], 10), parseInt(parts[5], 10)];
|
||||||
|
if (points.every((v, i) => v === root.values[i]))
|
||||||
|
return;
|
||||||
|
|
||||||
|
root.values = points;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,7 +45,8 @@ Item {
|
|||||||
readonly property real blobMorphBoost: 1.7
|
readonly property real blobMorphBoost: 1.7
|
||||||
readonly property real blobSpinSpeed: 0.03
|
readonly property real blobSpinSpeed: 0.03
|
||||||
|
|
||||||
readonly property bool blobActive: CavaService.cavaAvailable && activePlayer?.playbackState === MprisPlaybackState.Playing && showAnimation && albumArtStatus === Image.Ready
|
readonly property bool onScreen: visible && (Window.window?.visible ?? false)
|
||||||
|
readonly property bool blobActive: CavaService.cavaAvailable && onScreen && activePlayer?.playbackState === MprisPlaybackState.Playing && showAnimation && albumArtStatus === Image.Ready
|
||||||
property var smoothedBands: [0, 0, 0, 0, 0, 0]
|
property var smoothedBands: [0, 0, 0, 0, 0, 0]
|
||||||
property var slowBands: [0, 0, 0, 0, 0, 0]
|
property var slowBands: [0, 0, 0, 0, 0, 0]
|
||||||
property var bandTargets: [0, 0, 0, 0, 0, 0]
|
property var bandTargets: [0, 0, 0, 0, 0, 0]
|
||||||
@@ -165,7 +166,7 @@ Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Loader {
|
Loader {
|
||||||
active: activePlayer?.playbackState === MprisPlaybackState.Playing && showAnimation
|
active: root.onScreen && activePlayer?.playbackState === MprisPlaybackState.Playing && showAnimation
|
||||||
sourceComponent: Component {
|
sourceComponent: Component {
|
||||||
Ref {
|
Ref {
|
||||||
service: CavaService
|
service: CavaService
|
||||||
@@ -183,7 +184,14 @@ Item {
|
|||||||
|
|
||||||
FrameAnimation {
|
FrameAnimation {
|
||||||
running: blobEffect.visible
|
running: blobEffect.visible
|
||||||
onTriggered: root.stepBlob(Math.min(frameTime, 0.05))
|
property real pending: 0
|
||||||
|
onTriggered: {
|
||||||
|
pending += frameTime;
|
||||||
|
if (pending < 0.03)
|
||||||
|
return;
|
||||||
|
root.stepBlob(Math.min(pending, 0.05));
|
||||||
|
pending = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ShaderEffect {
|
ShaderEffect {
|
||||||
|
|||||||
Reference in New Issue
Block a user