AudioVisualizer: Low vs High Quality via setting.

This commit is contained in:
ItsLemmy
2025-11-09 10:06:50 -05:00
parent 49c7c0cd72
commit 2cea2d12de
15 changed files with 135 additions and 14 deletions
+3 -1
View File
@@ -17,6 +17,7 @@ Item {
readonly property int valuesCount: (values && Array.isArray(values)) ? values.length : 0
readonly property int totalBars: valuesCount * 2
readonly property real barSlotSize: totalBars > 0 ? (vertical ? height : width) / totalBars : 0
readonly property bool highQuality: (Settings.data.audio.visualizerType === "low") ? false : true
Repeater {
model: root.totalBars
@@ -33,7 +34,8 @@ Item {
color: root.fillColor
border.color: root.strokeColor
border.width: root.strokeWidth
antialiasing: true
antialiasing: root.highQuality
smooth: root.highQuality
// Only update when value actually changes - reduces GPU load
width: vertical ? root.width * amp : root.barSlotSize * 0.5
+3 -2
View File
@@ -17,7 +17,7 @@ Item {
readonly property int valuesCount: (values && Array.isArray(values)) ? values.length : 0
readonly property int totalBars: valuesCount * 2
readonly property real barSlotSize: totalBars > 0 ? (vertical ? height : width) / totalBars : 0
readonly property bool highQuality: (Settings.data.audio.visualizerType === "low") ? false : true
readonly property real centerY: height / 2
readonly property real centerX: width / 2
@@ -38,7 +38,8 @@ Item {
color: root.fillColor
border.color: root.strokeColor
border.width: root.strokeWidth
antialiasing: true
antialiasing: root.highQuality
smooth: root.highQuality
width: vertical ? barSize : root.barSlotSize * 0.8
height: vertical ? root.barSlotSize * 0.8 : barSize
+3 -1
View File
@@ -46,7 +46,9 @@ Item {
Canvas {
id: canvas
anchors.fill: parent
antialiasing: true
antialiasing: false // Disable for better performance - shape is smooth enough without it
renderStrategy: Canvas.Threaded // Render in separate thread to reduce main thread load
renderTarget: Canvas.FramebufferObject // Use FBO for better performance
onPaint: {
var ctx = getContext("2d")