feat: pattern gallery as a preset editor; chase steps; sim split with the preset editor
- Pattern gallery shows the controller's presets, one at a time, with a dropdown, Save, Add preset, and the controller's field labels, delay limits and colour counts. Edits show in the preview; Save writes to the controller only. - Presets are always timed in ms (beat_time is no longer sent to drivers); beats stay in sequences. - Chase steps of 0 hold still; the marquee style is removed from the controller, the gallery and the driver (submodule commit 12a8e22). - The rig's split pane opens the preset editor too (Rig / Presets switch and a Preset editor menu entry). - Sequence editor, room layout and simulator controls from earlier work are included. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
8c783ab926
commit
cb51a726bc
79 files changed
+5183
-934
No files matched your search
+21
-12
@@ -770,27 +770,36 @@ static void restore(const macs_t *drivers, const char *zone)
|
||||
send_lane(&s_base, i);
|
||||
}
|
||||
} else {
|
||||
// The zone's last preset, on these drivers only (a pseudo player with one target)
|
||||
static target_t t;
|
||||
player_t one = { .target = &t, .ntargets = 1 };
|
||||
t.n = 0;
|
||||
char z[ZONE_TARGETS_MAX][GROUP_ID_MAX];
|
||||
int n = engine_zone_targets(zone, z, ZONE_TARGETS_MAX);
|
||||
for (int i = 0; i < n && t.n < TGROUPS_MAX; i++) {
|
||||
snprintf(t.g[t.n++], GROUP_ID_MAX, "%s", z[i]);
|
||||
// The drivers the one-shot lit go back to their background: the zone's last preset if the driver is in
|
||||
// the zone, else off (a driver outside the zone has no background). One target each, by its own group
|
||||
// (d<mac>). Wi-Fi drivers (hostname ids) are not handled here
|
||||
static target_t tin[MACS_MAX], tout[MACS_MAX];
|
||||
int nin = 0, nout = 0;
|
||||
for (int i = 0; i < drivers->n; i++) {
|
||||
if (strlen(drivers->m[i]) != 12) {
|
||||
continue;
|
||||
}
|
||||
target_t *tt = engine_mac_in_zone(drivers->m[i], zone) ? &tin[nin++] : &tout[nout++];
|
||||
tt->n = 1;
|
||||
snprintf(tt->g[0], GROUP_ID_MAX, "d%s", drivers->m[i]);
|
||||
}
|
||||
player_t pin = { .target = tin, .ntargets = nin };
|
||||
player_t pout = { .target = tout, .ntargets = nout };
|
||||
uint32_t allin = nin >= 32 ? 0xffffffffu : (1u << nin) - 1;
|
||||
uint32_t allout = nout >= 32 ? 0xffffffffu : (1u << nout) - 1;
|
||||
const char *cur = engine_zone_current(zone);
|
||||
if (cur && strcmp(cur, "off")) {
|
||||
if (nin && cur && strcmp(cur, "off")) {
|
||||
cJSON *presets = cJSON_CreateObject();
|
||||
cJSON *pl = engine_preset_payload(cur);
|
||||
if (pl) {
|
||||
cJSON_AddItemToObject(presets, cur, pl);
|
||||
}
|
||||
upload(&one, 1, presets);
|
||||
select_on(&one, 1, cur);
|
||||
upload(&pin, allin, presets);
|
||||
select_on(&pin, allin, cur);
|
||||
} else {
|
||||
select_on(&one, 1, "off");
|
||||
select_on(&pin, allin, "off");
|
||||
}
|
||||
select_on(&pout, allout, "off");
|
||||
}
|
||||
s_restoring = false;
|
||||
s_restore.n = 0;
|
||||
|
||||
Reference in new issue
Block a user