Add multi-segment LED targets, replace single color strip source + skip fields

Each target now has a segments list where each segment maps a color strip
source to a pixel range (start/end) on the device with optional reverse.
This enables composing multiple visualizations on a single LED strip.
Old targets auto-migrate from the single source format on load.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-23 12:49:26 +03:00
parent bbd2ac9910
commit 9d593379b8
14 changed files with 593 additions and 368 deletions

View File

@@ -1,4 +1,4 @@
<!-- Target Editor Modal (name, device, color strip source, standby) -->
<!-- Target Editor Modal (name, device, segments, settings) -->
<div id="target-editor-modal" class="modal" role="dialog" aria-modal="true" aria-labelledby="target-editor-title">
<div class="modal-content">
<div class="modal-header">
@@ -23,13 +23,14 @@
<select id="target-editor-device"></select>
</div>
<div class="form-group">
<div class="form-group" id="target-editor-segments-group">
<div class="label-row">
<label for="target-editor-css" data-i18n="targets.color_strip_source">Color Strip Source:</label>
<label data-i18n="targets.segments">Segments:</label>
<button type="button" class="hint-toggle" onclick="toggleHint(this)" title="?">?</button>
</div>
<small class="input-hint" style="display:none" data-i18n="targets.color_strip_source.hint">Color strip source that captures and processes screen pixels into LED colors</small>
<select id="target-editor-css"></select>
<small class="input-hint" style="display:none" data-i18n="targets.segments.hint">Each segment maps a color strip source to a pixel range on the LED strip. Gaps between segments stay black. A single segment with Start=0, End=0 auto-fits to the full strip.</small>
<div id="target-editor-segment-list"></div>
<button type="button" class="btn btn-secondary btn-sm" onclick="addTargetSegment()" data-i18n="targets.segments.add">+ Add Segment</button>
</div>
<div class="form-group" id="target-editor-fps-group">
@@ -48,24 +49,6 @@
<small id="target-editor-fps-rec" class="input-hint" style="display:none"></small>
</div>
<div class="form-group" id="target-editor-skip-group">
<div class="label-row">
<label data-i18n="targets.led_skip">LED Skip:</label>
<button type="button" class="hint-toggle" onclick="toggleHint(this)" title="?">?</button>
</div>
<small class="input-hint" style="display:none" data-i18n="targets.led_skip.hint">Number of LEDs at the start and end of the strip to keep black. Color sources will render only across the active (non-skipped) LEDs.</small>
<div class="inline-fields">
<div class="inline-field">
<label for="target-editor-skip-start" data-i18n="targets.led_skip_start">Start:</label>
<input type="number" id="target-editor-skip-start" min="0" value="0">
</div>
<div class="inline-field">
<label for="target-editor-skip-end" data-i18n="targets.led_skip_end">End:</label>
<input type="number" id="target-editor-skip-end" min="0" value="0">
</div>
</div>
</div>
<div class="form-group" id="target-editor-keepalive-group">
<div class="label-row">
<label for="target-editor-keepalive-interval">