mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-04-09 07:12:07 -04:00
cava: remove input config
This commit is contained in:
@@ -16,11 +16,17 @@ DankOSD {
|
|||||||
enableMouseInteraction: true
|
enableMouseInteraction: true
|
||||||
|
|
||||||
function getPlaybackIcon() {
|
function getPlaybackIcon() {
|
||||||
if (player.playbackState === MprisPlaybackState.Playing)
|
if (!player)
|
||||||
return "play_arrow"
|
return "music_note";
|
||||||
if (player.playbackState === MprisPlaybackState.Paused || player.playbackState === MprisPlaybackState.Stopped)
|
switch (player.playbackState) {
|
||||||
return "pause"
|
case MprisPlaybackState.Playing:
|
||||||
return "music_note"
|
return "play_arrow";
|
||||||
|
case MprisPlaybackState.Paused:
|
||||||
|
case MprisPlaybackState.Stopped:
|
||||||
|
return "pause";
|
||||||
|
default:
|
||||||
|
return "music_note";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function togglePlaying() {
|
function togglePlaying() {
|
||||||
@@ -29,17 +35,28 @@ DankOSD {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onPlayerChanged: {
|
||||||
|
if (!player)
|
||||||
|
hide();
|
||||||
|
}
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: player
|
target: player
|
||||||
|
|
||||||
function handleUpdate() {
|
function handleUpdate() {
|
||||||
|
if (!root.player?.trackTitle) return;
|
||||||
if (SettingsData.osdMediaPlaybackEnabled) {
|
if (SettingsData.osdMediaPlaybackEnabled) {
|
||||||
root.show()
|
root.show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function onIsPlayingChanged() { handleUpdate() }
|
function onIsPlayingChanged() {
|
||||||
function onTrackChanged() { if (!useVertical) handleUpdate() }
|
handleUpdate();
|
||||||
|
}
|
||||||
|
function onTrackChanged() {
|
||||||
|
if (!useVertical)
|
||||||
|
handleUpdate();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
content: Loader {
|
content: Loader {
|
||||||
@@ -57,6 +74,11 @@ DankOSD {
|
|||||||
width: parent.width - Theme.spacingS * 2
|
width: parent.width - Theme.spacingS * 2
|
||||||
height: 40
|
height: 40
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
anchors.fill: parent
|
||||||
|
onClicked: root.hide()
|
||||||
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
width: Theme.iconSize
|
width: Theme.iconSize
|
||||||
height: Theme.iconSize
|
height: Theme.iconSize
|
||||||
@@ -78,7 +100,10 @@ DankOSD {
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
cursorShape: Qt.PointingHandCursor
|
cursorShape: Qt.PointingHandCursor
|
||||||
onClicked: togglePlaying()
|
onClicked: {
|
||||||
|
togglePlaying();
|
||||||
|
root.hide();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -87,7 +112,7 @@ DankOSD {
|
|||||||
x: parent.gap * 2 + Theme.iconSize
|
x: parent.gap * 2 + Theme.iconSize
|
||||||
width: parent.width - Theme.iconSize - parent.gap * 3
|
width: parent.width - Theme.iconSize - parent.gap * 3
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
text: (`${player.trackTitle || I18n.tr("Unknown Title")} • ${player.trackArtist || I18n.tr("Unknown Artist")}`)
|
text: player ? `${player.trackTitle || I18n.tr("Unknown Title")} • ${player.trackArtist || I18n.tr("Unknown Artist")}` : ""
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
font.pixelSize: Theme.fontSizeMedium
|
||||||
font.weight: Font.Medium
|
font.weight: Font.Medium
|
||||||
color: Theme.surfaceText
|
color: Theme.surfaceText
|
||||||
@@ -103,6 +128,11 @@ DankOSD {
|
|||||||
Item {
|
Item {
|
||||||
property int gap: Theme.spacingS
|
property int gap: Theme.spacingS
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
anchors.fill: parent
|
||||||
|
onClicked: root.hide()
|
||||||
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
width: Theme.iconSize
|
width: Theme.iconSize
|
||||||
height: Theme.iconSize
|
height: Theme.iconSize
|
||||||
@@ -124,7 +154,10 @@ DankOSD {
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
cursorShape: Qt.PointingHandCursor
|
cursorShape: Qt.PointingHandCursor
|
||||||
onClicked: togglePlaying()
|
onClicked: {
|
||||||
|
togglePlaying();
|
||||||
|
root.hide();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,7 +30,29 @@ Singleton {
|
|||||||
id: cavaProcess
|
id: cavaProcess
|
||||||
|
|
||||||
running: root.cavaAvailable && root.refCount > 0
|
running: root.cavaAvailable && root.refCount > 0
|
||||||
command: ["sh", "-c", "printf '[general]\\nframerate=25\\nbars=6\\nautosens=0\\nsensitivity=30\\nlower_cutoff_freq=50\\nhigher_cutoff_freq=12000\\n[input]\\nsample_rate=48000\\n[output]\\nmethod=raw\\nraw_target=/dev/stdout\\ndata_format=ascii\\nchannels=mono\\nmono_option=average\\n[smoothing]\\nnoise_reduction=35\\nintegral=90\\ngravity=95\\nignore=2\\nmonstercat=1.5' | cava -p /dev/stdin"]
|
command: ["sh", "-c", `cat <<'CAVACONF' | cava -p /dev/stdin
|
||||||
|
[general]
|
||||||
|
framerate=25
|
||||||
|
bars=6
|
||||||
|
autosens=0
|
||||||
|
sensitivity=30
|
||||||
|
lower_cutoff_freq=50
|
||||||
|
higher_cutoff_freq=12000
|
||||||
|
|
||||||
|
[output]
|
||||||
|
method=raw
|
||||||
|
raw_target=/dev/stdout
|
||||||
|
data_format=ascii
|
||||||
|
channels=mono
|
||||||
|
mono_option=average
|
||||||
|
|
||||||
|
[smoothing]
|
||||||
|
noise_reduction=35
|
||||||
|
integral=90
|
||||||
|
gravity=95
|
||||||
|
ignore=2
|
||||||
|
monstercat=1.5
|
||||||
|
CAVACONF`]
|
||||||
|
|
||||||
onRunningChanged: {
|
onRunningChanged: {
|
||||||
if (!running) {
|
if (!running) {
|
||||||
|
|||||||
Reference in New Issue
Block a user