mirror of
https://github.com/tuxdotrs/tpanel.git
synced 2026-09-19 18:19:02 +05:30
feat(cava): enhance visualizer sensitivity and response
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
[general]
|
[general]
|
||||||
bars = 14
|
bars = 14
|
||||||
framerate = 60
|
framerate = 60
|
||||||
|
sensitivity=140
|
||||||
|
|
||||||
[input]
|
[input]
|
||||||
method = pulse
|
method = pulse
|
||||||
|
|||||||
@@ -31,14 +31,28 @@ Rectangle {
|
|||||||
id: bar
|
id: bar
|
||||||
|
|
||||||
required property int index
|
required property int index
|
||||||
readonly property real value: Cava.values[index] ?? 0
|
readonly property real level: Math.min(1, (Cava.values[index] ?? 0) / root.maxValue)
|
||||||
|
|
||||||
width: (barRow.width - barRow.spacing * (root.barCount - 1)) / root.barCount
|
width: (barRow.width - barRow.spacing * (root.barCount - 1)) / root.barCount
|
||||||
height: Math.max(Theme.cava.barMinHeight, (bar.value / root.maxValue) * barRow.height)
|
height: Math.max(Theme.cava.barMinHeight, Math.pow(bar.level, 0.6) * barRow.height)
|
||||||
anchors.bottom: parent.bottom
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
radius: bar.width / 2
|
radius: bar.width / 2
|
||||||
color: Theme.colors.accent
|
color: Theme.colors.accent
|
||||||
antialiasing: true
|
antialiasing: true
|
||||||
|
opacity: 0.55 + 0.45 * bar.height / Math.max(1, barRow.height)
|
||||||
|
|
||||||
|
Behavior on height {
|
||||||
|
NumberAnimation {
|
||||||
|
duration: 90
|
||||||
|
easing.type: Easing.OutCubic
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Behavior on opacity {
|
||||||
|
NumberAnimation {
|
||||||
|
duration: 150
|
||||||
|
easing.type: Easing.OutCubic
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user