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:
jimmyandClaude Haiku 5.5 committed 2026-11-17 07:16:51 +13:00
1 parent 8c783ab926
commit cb51a726bc
79 files changed
+5183 -934

No files matched your search

+15 -3
View File
@@ -293,7 +293,9 @@ static bool wifi_in_group(const cJSON *dev, const char *id, const char *gid)
return cJSON_IsString(name) && names && name_seen(names, cJSON_GetArraySize(names), name->valuestring);
}
if (gid[0] == 'd') {
return false; // a driver's own group is an ESP-NOW MAC
// a driver's own group: d<mac>, the MAC in its record (a Wi-Fi driver's record has one too)
const cJSON *mac = cJSON_GetObjectItem(dev, "mac");
return cJSON_IsString(mac) && !strcmp(mac->valuestring, gid + 1);
}
const cJSON *group = cJSON_GetObjectItem(store_coll("group"), gid);
const cJSON *list = group ? cJSON_GetObjectItem(group, "devices") : NULL, *it;
@@ -737,9 +739,10 @@ static const char *const TOP_SHORT[][2] = {
};
static const char *const PRESET_SHORT[][2] = {
{ "pattern", "p" }, { "colors", "c" }, { "delay", "d" }, { "brightness", "b" }, { "auto", "a" }, { "background", "bg" },
{ "fade", "f" }, { "beat_time", "tb" },
{ "fade", "f" },
};
static const char *const PRESET_KEYS[] = { "p", "c", "d", "b", "a", "bg", "n1", "n2", "n3", "n4", "n5", "n6", "f", "tb" };
// Presets are always timed in ms; beats belong to sequences (seqplay.c), so no tb goes to drivers
static const char *const PRESET_KEYS[] = { "p", "c", "d", "b", "a", "bg", "n1", "n2", "n3", "n4", "n5", "n6", "f" };
static const char *short_key(const char *const map[][2], size_t n, const char *k)
{
@@ -1403,3 +1406,12 @@ esp_err_t engine_init(void)
rel_set_announce_cb(on_announce);
return ESP_OK;
}
bool engine_mac_in_zone(const char *hex12, const char *zone_id)
{
uint8_t mac[6];
if (!hex_mac(hex12, mac)) {
return false;
}
return driver_in_zone(mac, device_name_for(mac), zone_id);
}