Set timer warning thresholds to 30 and 10 seconds
Beffroi/beffroi-tools/pipeline/head There was a failure building this commit Details

This commit is contained in:
Dandaedre 2026-11-12 09:55:37 +01:00
parent 0623037e5d
commit e6f2200469
4 changed files with 13 additions and 12 deletions

View File

@ -73,8 +73,8 @@ with progress bars; backup sync keeps its original status colors.
Presets keep Companion’s standard top bar with the button location.
Re-add copied presets to apply styling updates; linked presets update automatically.
The progress bar fills from left to right. It turns amber with 10 seconds left
and red with 5 seconds left. Timing displays are passive: pressing them does
The progress bar fills from left to right. It turns amber with 30 seconds left
and red with 10 seconds left. Timing displays are passive: pressing them does
not send a player command. Transport presets use symbols, colors, and labels;
all original text presets remain in **All commands**.
@ -114,7 +114,7 @@ not control playback. The hours field does not wrap at 24 hours.
Remaining time rounds up once before splitting; elapsed time rounds down. Both
follow the same player snapshots as the existing timers and freeze when paused.
All remaining digits turn amber at 10 seconds left and red at 5 seconds left.
All remaining digits turn amber at 30 seconds left and red at 10 seconds left.
Elapsed digits stay white. Offline/idle displays grey **-- | -- | --**; unknown
duration also makes the remaining timer unavailable. Elapsed time still works
when position is known but duration is not.

View File

@ -18,8 +18,8 @@ Choose **Transport & timing** in this connection's Presets:
- **Remaining / Elapsed**: live time with a progress bar (passive displays).
- **Playback state**: current state with matching color.
The bar fills left to right, turning amber with 10 media seconds left and red
with 5 seconds left. All 138 original command presets remain in **All commands**.
The bar fills left to right, turning amber with 30 media seconds left and red
with 10 seconds left. All 138 original command presets remain in **All commands**.
Open File opens a dialog on the player computer; it does not upload a file.
Transport buttons use white labels on filled backgrounds. Play is subdued blue
@ -37,7 +37,7 @@ In **Timers — large HH / MM / SS**, place **Remaining HH (1/3)**, **Remaining
is available. These passive buttons show large zero-padded digits, following the
main player's position; no playback commands are sent when pressed.
Remaining digits turn amber at 10 seconds left and red at 5 seconds. Unavailable
Remaining digits turn amber at 30 seconds left and red at 10 seconds. Unavailable
values show grey **--**. Remaining rounds up, elapsed rounds down, and hours do
not wrap at 24. Custom display variables are `remaining_hh/mm/ss` and
`elapsed_hh/mm/ss` (each suffix is a separate variable).

View File

@ -15,7 +15,7 @@ export function progressBar(state, image) {
const pixels = Buffer.alloc(width * height * 4)
if (state?.progress != null) {
const filled = Math.round((width * state.progress) / 100)
const color = state.remaining <= 5000 ? colors.red : state.remaining <= 10000 ? colors.amber : colors.green
const color = state.remaining <= 10000 ? colors.red : state.remaining <= 30000 ? colors.amber : colors.green
const barHeight = Math.min(height, Math.max(2, Math.round(height / 9)))
for (let y = height - barHeight; y < height; y++) {
for (let x = 0; x < width; x++) {
@ -198,9 +198,9 @@ export function feedbacks(getState, getSync = () => null, getLoadStatus = () =>
return { color: 0x889099 }
return {
color:
feedback.options.mode === 'remaining' && state.remaining <= 5000
feedback.options.mode === 'remaining' && state.remaining <= 10000
? colors.red
: feedback.options.mode === 'remaining' && state.remaining <= 10000
: feedback.options.mode === 'remaining' && state.remaining <= 30000
? colors.amber
: colors.white,
}

View File

@ -135,9 +135,10 @@ test('split timer presets are passive and countdown urgency follows remaining ti
assert.deepEqual(button.steps[0].down, [])
}
for (const [remaining, color] of [
[10001, 0xffffff],
[10000, 0xe09b20],
[5000, 0xba2936],
[30001, 0xffffff],
[30000, 0xe09b20],
[10001, 0xe09b20],
[10000, 0xba2936],
[0, 0xba2936],
]) {
const defs = feedbacks(() => ({ state: 'playing', remaining }))