feat: sequence editor undo/redo, collapsible browser, playhead easing
Sequence editor: undo and redo, a collapsible browser with chips, search over sequences too, name in the header row, Beats/Seconds dropdown, Delete beside Save. Playhead eases between poll results. Lanes keep their phase when a step ends late, so they no longer drift. The rig's default room is two columns of bars facing each other, and the simulator has a read-only debug hook for the playback checks. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
a1c8ce853b
commit
02440be55d
7 files changed
+252
-109
No files matched your search
+17
-5
@@ -80,7 +80,7 @@ typedef struct {
|
||||
} player_t;
|
||||
|
||||
typedef struct {
|
||||
char m[MACS_MAX][13];
|
||||
char m[MACS_MAX][GROUP_ID_MAX]; // a MAC, or a Wi-Fi driver's hostname
|
||||
int n;
|
||||
} macs_t;
|
||||
|
||||
@@ -184,8 +184,10 @@ static bool macs_has(const macs_t *s, const char *mac)
|
||||
|
||||
static void macs_add(macs_t *s, const char *mac)
|
||||
{
|
||||
if (s->n < MACS_MAX && !macs_has(s, mac)) {
|
||||
snprintf(s->m[s->n++], 13, "%s", mac);
|
||||
size_t len = strlen(mac);
|
||||
if (s->n < MACS_MAX && len < sizeof(s->m[0]) && !macs_has(s, mac)) {
|
||||
memcpy(s->m[s->n], mac, len + 1);
|
||||
s->n++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -836,6 +838,16 @@ static void fire(const char *seq_id, const char *zone_id, const char *profile_id
|
||||
static void step_lane(player_t *p, int i, int64_t now)
|
||||
{
|
||||
lane_t *l = &p->lane[i];
|
||||
// A time lane's next step starts when this one was due, not when the player noticed: restarting from
|
||||
// now loses the lateness on every step, more on lanes with more steps, so lanes drift apart. One that
|
||||
// fell far behind (a stall) starts from now rather than racing through steps to catch up.
|
||||
int64_t start = now;
|
||||
if (l->timed) {
|
||||
int64_t due = l->t0 + (int64_t)l->step[l->idx].ms * 1000;
|
||||
if (due <= now && now - due < 500000) {
|
||||
start = due;
|
||||
}
|
||||
}
|
||||
if (l->idx + 1 >= l->n) {
|
||||
if (p->loop) {
|
||||
if (i == 0) {
|
||||
@@ -844,7 +856,7 @@ static void step_lane(player_t *p, int i, int64_t now)
|
||||
}
|
||||
l->count = 0;
|
||||
l->idx = 0;
|
||||
l->t0 = now;
|
||||
l->t0 = start;
|
||||
l->last[0] = 0; // step 0 goes up again on each wrap
|
||||
if (l->chase) {
|
||||
chase_move(l);
|
||||
@@ -857,7 +869,7 @@ static void step_lane(player_t *p, int i, int64_t now)
|
||||
} else {
|
||||
l->count = 0;
|
||||
l->idx++;
|
||||
l->t0 = now;
|
||||
l->t0 = start;
|
||||
if (l->chase) {
|
||||
chase_move(l);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user