Seperating the sequencer into multiple widgets.

This commit is contained in:
Johannes Findeisen 2026-11-06 21:39:38 +01:00
commit e664414796
23 changed files with 1455 additions and 914 deletions

View file

@ -3656,6 +3656,55 @@ and inspection of the actual [audio envelope capture](../screenshots/audio-veloc
---
## Phase 111 — Sequencer Master and Child Widgets
### Goal
Split the sequencer GUI into focused components. Keep `SequencerWidget` as the
master with real nested FLTK track, header, clip, velocity and ruler widgets,
preserving current editing behavior, the C domain boundary and saved projects.
### Tasks and acceptance criteria
- [x] Make the master own ruler and track groups; each track owns its header,
instrument selector, clip widgets and velocity lane through FLTK ownership.
- [x] Move child drawing and local input into dedicated track/header, clip,
velocity and ruler implementation files. Keep shared coordinates, selection,
scrolling and cross-track gesture completion in the master.
- [x] Extract editing commands/dialogs, instrument support and waveform caching
into separate source files and register them explicitly in CMake.
- [x] Reconcile views by stable C IDs, preserving surviving track identity through
reorder/undo and moving clip views into the destination track hierarchy.
- [x] Cancel gestures on project replacement and defer removed widget deletion
until event handlers can return; preserve instrument focus and shortcuts.
- [x] Exercise real parent/child membership, cross-track movement, velocity edits,
undo/redo, removal and project replacement through GUI integration tests,
including FLTK window-level event dispatch.
- [x] Update the architecture/component map, GUI guide, build guidance, README
and integration-test documentation.
### Implementation status
Implemented on 2026-11-06. The master now delegates track/header, clip, velocity
and ruler drawing/input to child classes; commands and support code are separate
translation units. See [the ownership and source map](ARCHITECTURE.md#sequencer-widget-ownership).
FLTK owns the hierarchy; indexes and captured-gesture pointers are borrowed.
Child views hold copied C metadata rather than pointers into project snapshots.
Removed children are detached/hidden and deleted through FLTK's deferred queue.
The master remains the single selection and edit/publication coordinator.
No dependency, core API, persistence or intended visual/workflow change is
introduced. Existing screenshots continue to describe the same interface.
Validation: the warning-enabled CMake build succeeds, all 55 existing CTests
pass, and the added `gui-sequencer` hierarchy/dispatched-gesture check passes.
The final build's main GUI and focused hierarchy tests were also rerun successfully.
The focused hierarchy/lifetime test passes Clang ASan/UBSan with leak detection
disabled for the unsanitized system FLTK library. Both audio-envelope captures
remain pixel-identical to the existing gallery. Physical hardware qualification
is unaffected.
---
## Recommended Execution Order
Reorder the phases when the audit reveals a blocking dependency. Do not mark a