Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions gui/qml/Equalizer.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 } }
}
}
}
22 changes: 14 additions & 8 deletions gui/qml/Main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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: ""
Expand Down
8 changes: 4 additions & 4 deletions gui/qml/viz/Waves.qml
Original file line number Diff line number Diff line change
@@ -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
}
}
Loading