Let the queue page pin the frame animation
Waiting for the shuffle bag to land on the animation you are working on makes testing one of them tedious. The queue page now carries an Animation row next to Background: Auto keeps the per-track cycle, any other button pins the player to that animation until the mode changes again. The animation names live in config.js alongside their labels, so the server can validate them and the queue page can label its buttons; motion.js keys its registry by the same names. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Tg15tLAuT6NrCE1ZxKVgDB
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
import { connect } from '/shared/socket.js';
|
||||
import { OVERLAP_SECONDS, HARD_CUT_SECONDS, BACKGROUNDS } from '/config.js';
|
||||
import { OVERLAP_SECONDS, HARD_CUT_SECONDS, BACKGROUNDS, AUTO_ANIMATION } from '/config.js';
|
||||
import { createPlayer, loadApi, STATE } from './yt.js';
|
||||
import { startAnimationCycle } from './motion.js';
|
||||
import { requestCapture } from './capture.js';
|
||||
|
||||
const TICK_MS = 250;
|
||||
|
||||
let state = { items: [], currentId: null, background: 'pink' };
|
||||
let state = { items: [], currentId: null, background: 'pink', animation: AUTO_ANIMATION };
|
||||
let decks = [];
|
||||
let active = 0;
|
||||
let transition = null; // { until, duration, from, to } while crossfading
|
||||
@@ -74,7 +74,7 @@ async function start() {
|
||||
animationContext.capture = capture;
|
||||
});
|
||||
|
||||
animations = startAnimationCycle(animationContext);
|
||||
animations = startAnimationCycle(animationContext, state.animation);
|
||||
|
||||
decks = await Promise.all([
|
||||
makeDeck('deck-a', 0),
|
||||
@@ -325,8 +325,10 @@ initProbe();
|
||||
function onMessage(msg) {
|
||||
if (msg.type !== 'state') return;
|
||||
|
||||
const previousAnimation = state.animation;
|
||||
state = msg.state;
|
||||
applyBackground(state.background);
|
||||
if (state.animation !== previousAnimation) animations?.setMode(state.animation);
|
||||
updateGate();
|
||||
pumpProbe();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user