Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
65a6e2a
fix(gui): gray OFF / green ON toolbar and hover-only 8% solid paint, …
masarray Oct 28, 2026
2f03e12
fix(native): prevent auto-sizing audio selector peer; one-shot post-s…
masarray Oct 28, 2026
2c353f3
test(gui): lock requested gray idle/green selected toolbar and paint-…
masarray Oct 28, 2026
46fe083
feat(snapshot-ui): add compact Show/Snapshot manager, safes and recov…
masarray Oct 28, 2026
db78158
style(snapshot): lightweight compact manager and channel safes, no ho…
masarray Oct 28, 2026
10c36c0
feat(snapshot): persistent Save/Update/Rename/Delete/Recall, safes an…
masarray Oct 28, 2026
0bc9045
fix(snapshot): visible native-safety notice on list click and accessi…
masarray Oct 28, 2026
b317265
a11y(snapshot): keyboard-accessible current Show/Snapshot shortcut
masarray Oct 28, 2026
7843a1c
build(gui): source-owned toolbar palette, paint-only hover and snapsh…
masarray Oct 28, 2026
36dd1a3
build(gui): regenerate offline HTML with native-safe snapshot manager…
masarray Oct 28, 2026
cc42152
test(ui): grey idle/green active toolbar and snapshot save/update/saf…
masarray Oct 28, 2026
9f64d82
docs(architecture): Soundcraft-inspired Shows/Snapshots with native 1…
masarray Oct 28, 2026
9d659f8
test(native/gui): enforce one-shot setup sizing and honest snapshot C…
masarray Oct 28, 2026
cf550a8
test(snapshot): restore clean Recall Safes state after browser CRUD i…
masarray Oct 28, 2026
6771125
test(snapshot): isolate file-origin persistence, verify reload + upda…
masarray Oct 28, 2026
9401ba2
test(hover): compare stable background after pointer leave and assert…
masarray Oct 28, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
213 changes: 191 additions & 22 deletions AR-MIX-Live-FX-Host-Standalone-v0.3.html

Large diffs are not rendered by default.

68 changes: 68 additions & 0 deletions docs/ARD_SNAPSHOT_SHOWS_NATIVE_TRANSACTIONAL_20261028.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# ArSonMix — Shows, Snapshots, Safe Recall (2026-10-28)

## Goal and grounded baseline

Make left-rail recall as convenient as Soundcraft Ui's Show/Snapshot workflow, **without pretending a WebView visual snapshot is a real native audio state**. A Show contains named Snapshots. Fast selection in the left rail, accessible management from the current snapshot label, and optional per-channel Recall Safes. A Snapshot can restore an entire mix; Safes preserve selected live channels.

Current code audited:
- `web/app.js`: browser/UI-only scene state + localStorage JSON. This change adds a small manager for Save New, Update, Recall, Rename, Delete, Recall Safes, last-state Undo, clear native unsupported notice. Nothing here proves a VST3 state transition.
- `src/NativePresetArchive.h` + `Main.cpp`: real native .armix save/restore for a narrower CH1 FX chain, with VST3 binary state and validation.
- `docs/P1H_NATIVE_MULTICHANNEL_VST3_20261028.md`: up to 10 separate native channel FX processors now exist in opt-in LAB, but 10CH Show/Snapshot serialization and safe live atomic recall have **not** shipped.
- `src/StudioBackup.h`: vault and native data backup exists, but not a completed multi-Show transactional store.

## UX contract

| Entry | Behavior |
| --- | --- |
| Left rail snapshot row | Quick select/recall, highlights loaded item, visibly identifies factory/user |
| + SAVE SNAPSHOT | Opens compact manager, name, selection, safes, action grid |
| SAVE NEW | Unique name, never overwrites existing snapshot |
| UPDATE | Two-click confirmation, changes selected user snapshot only |
| RENAME | Keeps snapshot content and stable selected item, rejects duplicate names |
| DELETE | Two-click confirmation, factory entries immutable |
| RECALL | Applies recorded state but preserves current state of Safe channels |
| UNDO RECALL | Restores previous mix in preview; future native version must be transactional |
| Header snapshot selector | Opens same manager, keyboard-operable |
| Native mode before final engine support | **Explicitly refuses fake UI-only snapshot writes/recalls**, points user to native MY SOUNDS |

Do not auto-switch driver, sample rate, buffer, physical ports, mute policy, capture/render clocks or ASIO devices when recalling a Show or Snapshot. Hardware configuration is a separate reviewed action.

## Native implementation (next gated milestone, not marked done)

### 1. State model and stable identity

`ShowV2 {id, name, schema=2, channelSafety, snapshotOrder, currentSnapshotId, created, updated}`.
`SnapshotV2 {id, name, created, modified, sourceBuild, channelStates, masterState, busStates, pluginRefs, pluginStateHashes}`.

Every one of the 10 channel records uses a stable channel ID, plus fader, gain/trim, PAN, mute, solo, polarity/HPF, stereo/mono port contract, FX ordered identities (path in managed vault + plugin UID + binary fingerprint + bypass), sends and bus state. Master record contains its own gain, mute, mono/stereo and FX state. Only opt-in routing states that can actually execute in native P1H/P1G may be declared persisted; no phantom GUI FX processors. Full vendor VST3 getStateInformation/setStateInformation blobs must be round-tripped intact.

### 2. Storage and lifecycle

Managed portable workspace path: `shows/<showId>/manifest.json`, `snapshots/<snapshotId>.json`, immutable `blobs/<sha256>.bin` references; no vendor plugin redistribution. Restrict file count/size, validate UUID/name/path, use JSON schema version + migrations, checksum and byte cap per plugin and show. Write on worker/control thread: stage all blobs and manifest in same-volume temporary files, flush, rename atomically, retain previous generation and recovery journal. Corrupt/missing plugin archives leave the prior snapshot and active graph intact. Failed Save never replaces the last known good session. Make all existing shows included in Studio Backup/Restore.

### 3. Safe native recall pipeline

1. Prepare immutable recall plan off audio callback. Resolve all 10 native VST3 identities from the trusted catalog/vault and validate ports, buses, CPU/latency and settings.
2. Freeze mapping of channel Safes, currently selected physical device/ports and driver generation. Apply Safes to **stable channel IDs**, not GUI strip positions.
3. Instantiate/processors, restore binary vendor state and prepare 10CH DSP + buses on the control thread. If any required plugin is missing/incompatible, show exact channel/slot error and **do not publish a partial state**.
4. Publish exactly one new generation to the audio callback (immutable pointer/generation or existing graph handoff protocol). Never hold file, allocation, parsing, plugin state operations or mutex on the realtime thread.
5. At a callback boundary, de-click output with a bounded documented fade as required by graph semantics, retain old generation until acknowledged and safely retired. Respect Orbit and bypass envelope state transitions; do not regress P0 anti-crackle.
6. Only after native acknowledgment: update the WebView "current snapshot", rebind fader/PAN/mute/FX and record event. On timeout/failure recover prior graph; no "Saved" or "Recalled" success while pending.

**Live-safety policy:** current CH1 native MY SOUNDS operations may require a muted output. The new 10CH pipeline must not copy/paste that blocking audio path into live performance; gate any non-RT-safe vendor plugin behavior and visibly offer MUTE/RETRY instead.

### 4. Tests and release gates

- Unit: schema/manifest validation, safe mappings across reorder, duplicate/rename/delete, atomic file failure rollback, multi-snapshot show migration, missing/corrupt VST3 blob.
- Native CTest: 10 unique plugin identities; successful and failed prepare; generation ownership; one logical commit; bypass envelope and DearVR Orbit association preserved; repeated recall does not leak/copy callbacks; 10CH send/master state assertions.
- UI: 11 strips geometry unchanged; keyboard accessibility; left rail list; correct "pending/failure/success" state; no fake native success. Snapshot managers do not run in meter hot-path or create periodic timers.
- Hardware FAT: real Windows WASAPI/ASIO, multi-device, buffer 128/256/480, plugin editor open, 60-minute idle/active switching, audible crackle/click and xrun monitoring on onboard graphics. Compare old/new session after restart, unplug/replug and backup on a new PC.

### 5. Milestone order

- **P0 done in this PR:** correct toolbar OFF/ON and lightweight hover; stabilize JUCE Audio Setup initial viewport; preview manager CRUD + safes/recovery; explicit native guard.
- **P1 next:** native ShowV2/10CH SnapshotV2 storage, disk worker and signed runtime source-of-truth; portable backups, round-trip all 10 plugin blobs.
- **P2 next:** native transactional immutable recall with ack/de-click, SAFES and full live UI binding; tests and device FAT.
- **P3:** A/B audition, snapshot differences, Show import/export/merge with conflict preview and per-Show undo history.

No PR should be marked production-ready merely because HTML preview values persist to localStorage.
25 changes: 23 additions & 2 deletions src/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,34 @@ class AudioSetupWindow final : public juce::DocumentWindow
setResizeLimits (580, 430, 1300, 1000);
auto* selector = new juce::AudioDeviceSelectorComponent (
manager, 1, 2, 1, 2, false, false, false, false);
setContentOwned (selector, true);
// The selector changes its preferred content size while enumerating
// Windows audio devices. Never let that asynchronously resize the
// top-level peer: it causes an incorrectly scaled first paint on some
// Windows/Intel graphics paths until the user moves the dialog.
// The window owns the component but fixes the viewport geometry.
setContentOwned (selector, false);
centreWithSize (740, 590);
}
void closeButtonPressed() override { setVisible (false); }
void visibilityChanged() override
{
if (isVisible()) wasVisible_ = true;
if (isVisible())
{
wasVisible_ = true;
// Reflow once after the native HWND is visible. This is one
// deferred message-thread paint, not a timer or repeated redraw.
juce::MessageManager::callAsync (
[safe = juce::Component::SafePointer<AudioSetupWindow> (this)]
{
if (safe == nullptr || ! safe->isVisible()) return;
if (auto* content = safe->getContentComponent())
{
content->resized();
content->repaint();
}
safe->repaint();
});
}
else if (wasVisible_)
{
wasVisible_ = false;
Expand Down
5 changes: 4 additions & 1 deletion tests/button_asset_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@
assert '--b180-edge:#747f7f' in css
assert '--b180-off-ink:#172229' in css
assert '--b180-ink:var(--b180-off-ink)' in css
assert '--b180-color:#c8d99b' in css and '--b180-color:#e5f4a2' in css
assert '#app .toolbar-actions .nav button.btn-180:not(.selected):not(.active):not([aria-pressed="true"])' in css
assert '--b180-color:var(--b180-off)' in css and '--b180-color:var(--b180-on-green)' in css
assert 'color-mix(in srgb,var(--b180-color) 92%,#fff 8%)' in css
assert 'transition:none!important' in css
assert 'transform 0ms!important' in css
assert '--b180-color:var(--b180-on-cyan)' in css
assert '--b180-color:var(--b180-on-magenta)' in css
Expand Down
22 changes: 22 additions & 0 deletions tests/gui_workflow_contract_test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,25 @@ test('native 12Hz status uses one capped shared visual meter scheduler',()=>{
// Check the light-weight, source-labelled capture triage contract in the same
// existing Node test invocation; no second CI job or browser required.
import './audio_capture_triage_contract_test.mjs';

test('ASIO/WASAPI selector has stable outer geometry and one-shot repaint',()=>{
const block=cpp.slice(cpp.indexOf('class AudioSetupWindow final'),cpp.indexOf('class ConsoleWindow final'));
assert.ok(block.includes('setContentOwned (selector, false)'),'device enumeration cannot auto-resize top-level HWND');
assert.ok(block.includes('centreWithSize (740, 590)'));
assert.ok(block.includes('juce::MessageManager::callAsync'));
assert.ok(block.includes('content->resized();')&&block.includes('content->repaint();'));
assert.ok(block.includes('juce::Component::SafePointer<AudioSetupWindow>'));
assert.ok(!block.includes('startTimer')&&!block.includes('setContentOwned (selector, true)'));
});
test('snapshot manager is honest about native persistence and supports recovery',()=>{
for(const id of ['snapshotModal','snapshotPick','snapshotName','snapshotSaveNew','snapshotUpdate',
'snapshotRename','snapshotDelete','snapshotRecall','snapshotUndo','snapshotSafes'])
assert.ok(html.includes('id="'+id+'"'),id);
for(const part of ['snapshotNativeBlocked','snapshotMergeSafes','snapshotUndo',
'snapshotPendingAction','snapshotValidName','armix-v03-undo-recall','armix-v03-snapshot-safes'])
assert.ok(app.includes(part),part);
assert.match(app,/if\(snapshotNativeBlocked\(\)\)return/);
assert.match(app,/localStorage\.setItem\('armix-v03-snapshots'/);
assert.ok(css.includes('#snapshotModal .snapshot-panel'));
assert.ok(!app.includes("prompt('Name this mixer snapshot"));
});
57 changes: 53 additions & 4 deletions tests/ui_smoke.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,9 +296,48 @@ def shared_shadow_shape(shadow):
assert 'LUFS-I' in await page.locator('#masterLeft .master-analysis').inner_text()
# Buttons must describe and perform actual distinct actions: no "..." blank cap.
assert await page.locator('.left-rail #addScene').inner_text()=='+ SAVE SNAPSHOT'
await page.locator('#addScene').click()
assert await page.locator('#snapshotModal').is_visible()
assert await page.locator('#snapshotPick option').count()==4
assert await page.locator('#snapshotScope').is_visible()
await page.locator('#snapshotClose').click()
assert await page.locator('#snapshotModal').is_hidden()
assert await page.locator('.left-rail #saveFxPreset').inner_text()=='SAVE FX'
assert await page.locator('.left-rail #menuScene').inner_text()=='EXPORT'
assert await page.locator('.left-rail .rail-bottom button').count()==3

# Real persistence requires a stable origin; page.set_content() above
# uses about:blank where browser localStorage is intentionally denied.
# Run CRUD/reload on the same local-file origin shipped by Windows.
snapPage=await browser.new_page(viewport={"width":1680,"height":920})
await snapPage.goto((project/"AR-MIX-Live-FX-Host-Standalone-v0.3.html").as_uri())
await snapPage.locator('#addScene').click()
await snapPage.locator('#snapshotName').fill('Friday Vocal')
await snapPage.locator('#snapshotSaveNew').click()
assert await snapPage.locator('#snapshotPick option').count()==5, await snapPage.locator('#snapshotFeedback').inner_text()
assert 'Friday Vocal' in await snapPage.locator('#scenesList').inner_text()
await snapPage.locator('[data-snapshot-safe="0"]').check()
assert await snapPage.evaluate("localStorage.getItem('armix-v03-snapshot-safes')")=='["0"]'
await snapPage.locator('#snapshotUpdate').click()
await snapPage.locator('#snapshotUpdate').click()
assert 'Updated' in await snapPage.locator('#snapshotFeedback').inner_text()
await snapPage.reload()
await snapPage.locator('#addScene').click()
assert await snapPage.locator('#snapshotPick option').count()==5
assert await snapPage.locator('[data-snapshot-safe="0"]').is_checked()
await snapPage.locator('#snapshotName').fill('Friday Vocal V2')
await snapPage.locator('#snapshotRename').click()
await snapPage.locator('#snapshotRename').click()
assert 'Friday Vocal V2' in await snapPage.locator('#scenesList').inner_text()
await snapPage.locator('#snapshotRecall').click()
assert await snapPage.locator('#snapshotUndo').is_enabled()
await snapPage.locator('#snapshotUndo').click()
await snapPage.locator('[data-snapshot-safe="0"]').uncheck()
await snapPage.locator('#snapshotDelete').click()
await snapPage.locator('#snapshotDelete').click()
assert await snapPage.locator('#snapshotPick option').count()==4
await snapPage.close()

# Owner's global BTN-180 hardware recipe: 7 toolbar + 8 left rail.
# Single solid face, identical resting 7-shadow model, no Button 19.
assert await page.locator('.toolbar-actions .nav button.btn-180').count()==7
Expand All @@ -322,7 +361,7 @@ def shared_shadow_shape(shadow):
assert style[key]['image']=='none',(key,style)
assert style[key]['shadow'].count('rgb')==7,(key,style)
assert style[key]['radius']=='3px',(key,style)
assert style['nav']['face']=='rgb(200, 217, 155)' and style['selected']['face']=='rgb(229, 244, 162)',style
assert style['nav']['face']=='rgb(203, 209, 209)' and style['selected']['face']=='rgb(145, 237, 172)',style
assert style['railOn']['face']=='rgb(237, 184, 223)',style
# Audio Device shares the physical BTN-180 toolbar face and dark ink.
# The OFF state is truthful in UI-only preview. Explicitly force ON
Expand Down Expand Up @@ -370,18 +409,26 @@ def shared_shadow_shape(shadow):
assert all(abs(active['rect'][k]-pre[k])<=.2 for k in ('x','y','width','height')),active
# Utility ON is soft cyan, not the old green/purple polarity palettes.
await page.locator('[data-hpf="0"]').click()
await page.wait_for_timeout(190)
await page.mouse.move(1,1)
await page.wait_for_timeout(65)
cyan=await page.locator('[data-hpf="0"]').evaluate("(e)=>getComputedStyle(e).backgroundColor")
assert cyan=='rgb(148, 232, 237)',cyan
await page.locator('[data-hpf="0"]').hover()
hover=await page.locator('[data-hpf="0"]').evaluate("""e=>({
face:getComputedStyle(e).backgroundColor,filter:getComputedStyle(e).filter,
transition:getComputedStyle(e).transitionDuration
})""")
assert hover['face']!=cyan and hover['filter']=='none' and all(x=='0s' for x in hover['transition'].split(', ')),hover
await page.mouse.move(1,1)
await page.locator('[data-hpf="0"]').click()
# Navigation remains mutually exclusive; selected is only a color latch.
await page.locator('[data-view="FX RACK"]').click()
await page.wait_for_function("""()=>{
const on=document.querySelector('[data-view="FX RACK"]');
const off=document.querySelector('[data-view="MIX"]');
return on.classList.contains('selected') && !off.classList.contains('selected')
&& getComputedStyle(on).backgroundColor==='rgb(229, 244, 162)'
&& getComputedStyle(off).backgroundColor==='rgb(200, 217, 155)';
&& getComputedStyle(on).getPropertyValue('--b180-color').trim()==='#91edac'
&& getComputedStyle(off).getPropertyValue('--b180-color').trim()==='#cbd1d1';
}""")
nav=page.locator('[data-view="FX RACK"]')
navBefore=await nav.evaluate("(e)=>e.getBoundingClientRect().toJSON()")
Expand Down Expand Up @@ -955,6 +1002,7 @@ async def image_for(selector):
assert off_mute == await image_for('[data-solo="0"]')
await page.locator('[data-mute="0"]').click()
assert await page.locator('[data-mute="0"]').get_attribute('aria-pressed') == 'true'
await page.mouse.move(1,1) # avoid the intentionally brighter hover skin during palette assertion
# BTN-180 color transition is 45ms, while tactile press is immediate.
await page.wait_for_function("""()=>getComputedStyle(document.querySelector('[data-mute="0"]')).backgroundColor==='rgb(249, 154, 164)'""",timeout=2500)
assert await image_for('[data-mute="0"]') != await image_for('[data-solo="0"]'), await page.evaluate("""()=>{
Expand All @@ -966,6 +1014,7 @@ async def image_for(selector):
}""")
await page.locator('[data-solo="0"]').click()
assert await page.locator('[data-solo="0"]').get_attribute('aria-pressed') == 'true'
await page.mouse.move(1,1)
await page.wait_for_function("""()=>getComputedStyle(document.querySelector('[data-solo="0"]')).backgroundColor==='rgb(244, 212, 121)'""",timeout=2500)
assert await image_for('[data-solo="0"]') != await image_for('[data-mute="0"]')
await page.locator('[data-mute="0"]').click()
Expand Down
Loading
Loading