mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-04-04 12:52:06 -04:00
cava: remove input config
This commit is contained in:
@@ -16,11 +16,17 @@ DankOSD {
|
||||
enableMouseInteraction: true
|
||||
|
||||
function getPlaybackIcon() {
|
||||
if (player.playbackState === MprisPlaybackState.Playing)
|
||||
return "play_arrow"
|
||||
if (player.playbackState === MprisPlaybackState.Paused || player.playbackState === MprisPlaybackState.Stopped)
|
||||
return "pause"
|
||||
return "music_note"
|
||||
if (!player)
|
||||
return "music_note";
|
||||
switch (player.playbackState) {
|
||||
case MprisPlaybackState.Playing:
|
||||
return "play_arrow";
|
||||
case MprisPlaybackState.Paused:
|
||||
case MprisPlaybackState.Stopped:
|
||||
return "pause";
|
||||
default:
|
||||
return "music_note";
|
||||
}
|
||||
}
|
||||
|
||||
function togglePlaying() {
|
||||
@@ -29,17 +35,28 @@ DankOSD {
|
||||
}
|
||||
}
|
||||
|
||||
onPlayerChanged: {
|
||||
if (!player)
|
||||
hide();
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: player
|
||||
|
||||
function handleUpdate() {
|
||||
if (!root.player?.trackTitle) return;
|
||||
if (SettingsData.osdMediaPlaybackEnabled) {
|
||||
root.show()
|
||||
root.show();
|
||||
}
|
||||
}
|
||||
|
||||
function onIsPlayingChanged() { handleUpdate() }
|
||||
function onTrackChanged() { if (!useVertical) handleUpdate() }
|
||||
function onIsPlayingChanged() {
|
||||
handleUpdate();
|
||||
}
|
||||
function onTrackChanged() {
|
||||
if (!useVertical)
|
||||
handleUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
content: Loader {
|
||||
@@ -57,6 +74,11 @@ DankOSD {
|
||||
width: parent.width - Theme.spacingS * 2
|
||||
height: 40
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: root.hide()
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
width: Theme.iconSize
|
||||
height: Theme.iconSize
|
||||
@@ -78,7 +100,10 @@ DankOSD {
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: togglePlaying()
|
||||
onClicked: {
|
||||
togglePlaying();
|
||||
root.hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,7 +112,7 @@ DankOSD {
|
||||
x: parent.gap * 2 + Theme.iconSize
|
||||
width: parent.width - Theme.iconSize - parent.gap * 3
|
||||
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.weight: Font.Medium
|
||||
color: Theme.surfaceText
|
||||
@@ -103,6 +128,11 @@ DankOSD {
|
||||
Item {
|
||||
property int gap: Theme.spacingS
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: root.hide()
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
width: Theme.iconSize
|
||||
height: Theme.iconSize
|
||||
@@ -124,7 +154,10 @@ DankOSD {
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: togglePlaying()
|
||||
onClicked: {
|
||||
togglePlaying();
|
||||
root.hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,29 @@ Singleton {
|
||||
id: cavaProcess
|
||||
|
||||
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: {
|
||||
if (!running) {
|
||||
|
||||
Reference in New Issue
Block a user