diff --git a/gui/qml/Equalizer.qml b/gui/qml/Equalizer.qml index 7022dbf..ccf778c 100644 --- a/gui/qml/Equalizer.qml +++ b/gui/qml/Equalizer.qml @@ -12,7 +12,8 @@ Row { height: ui.px(12) // It bobs with the window's clock (ui.clock), eight times a second, - // in the frames the rest moves in. + // in the frames the rest moves in. The bars jump rather than glide: an + // easing would keep the whole window drawing at the screen's rate. property int step: -1 Connections { target: ui @@ -34,7 +35,6 @@ Row { anchors.bottom: parent.bottom radius: width / 2 color: Qt.alpha(eq.color, 0.85) - Behavior on height { enabled: !ui.calm; NumberAnimation { duration: 180; easing.type: Easing.InOutSine } } } } } diff --git a/gui/qml/Main.qml b/gui/qml/Main.qml index e293d4c..7445618 100644 --- a/gui/qml/Main.qml +++ b/gui/qml/Main.qml @@ -75,13 +75,14 @@ Window { readonly property int lift: theme.dark && effects ? Text.Raised : Text.Normal readonly property color liftColor: Qt.alpha("black", 0.35) // One clock for all that moves while music plays in the window - // in front — the backdrop's drift, the equalizers, the progress - // bar — so they move in the same frames, not each in its own: 20 - // ticks a second (8 without effects: only the equalizers). It - // stands while paused, in the background, minimized, with motion - // reduced, and under the visualizer. + // in front — the equalizers, the progress bar — so they move in + // the same frames, not each in its own. While the player view's + // backdrop moves it ticks with that (vizClock, 20 a second), else + // by itself: 20 ticks a second, 8 without effects (only the + // equalizers). It stands while paused, in the background, + // minimized, with motion reduced, and under the visualizer. property int clock: 0 // milliseconds it has run - readonly property bool pulsing: pulse.running + readonly property bool pulsing: win.pulsing readonly property int radius: px(16) readonly property int coverRadius: px(6) // every cover's corners, big or small readonly property int gap: px(24) @@ -90,13 +91,18 @@ Window { Store { id: store } + readonly property bool pulsing: !!store.st.playing && ui.awake && !ui.calm && win.visibility !== Window.Minimized && !(store.full && full.opacity === 1) Timer { - id: pulse interval: ui.effects ? 50 : 125 repeat: true - running: !!store.st.playing && ui.awake && !ui.calm && win.visibility !== Window.Minimized && !(store.full && full.opacity === 1) + running: win.pulsing && !vizClock.running onTriggered: ui.clock += interval } + Connections { + target: vizClock + enabled: win.pulsing && vizClock.running + function onTriggered() { ui.clock += Math.round(vizClock.frameTime * 1000) } + } // The cover's accent, picked once per cover. property string accentFor: "" diff --git a/gui/qml/viz/Waves.qml b/gui/qml/viz/Waves.qml index 462211a..3a9eb2e 100644 --- a/gui/qml/viz/Waves.qml +++ b/gui/qml/viz/Waves.qml @@ -1,16 +1,16 @@ import QtQuick import ".." +// Waves is the window's backdrop, drawn at full size: a layer at half +// the pixels drew a second frame after every tick and cost more than it +// saved. On large screens the stage draws it smaller anyway (FullStage's +// shrink). VizEffect { id: fx backgroundColor: ui.deep adaptiveScene: true - RenderSurface { id: surface; anchors.fill: parent; density: 0.5 } Backdrop { anchors.fill: parent running: fx.running - layer.enabled: ui.effects - layer.smooth: true - layer.textureSize: surface.textureSize } }