diff --git a/.github/workflows/ui-smoke.yml b/.github/workflows/ui-smoke.yml index 97a671947..cbd8d6e5d 100644 --- a/.github/workflows/ui-smoke.yml +++ b/.github/workflows/ui-smoke.yml @@ -264,6 +264,10 @@ jobs: run: python tests/pages_m1_meter_gain_calibration_smoke.py - name: Verify M3 meter/clip/menu/FX/receiving multi-wire operator contract run: python tests/pages_m3_operator_visual_interaction_smoke.py + - name: Verify native v8 ACK, WIRE and accepted-snapshot consumer + run: python tests/operator_console_v6_smoke.py + - name: Validate native V6 published visual identity and control parity + run: node tests/operator_visual_identity_v6_contract_test.mjs - name: Run mixer UI smoke tests run: python tests/ui_smoke.py - name: Verify Preview V2 V7 physical visual geometry and modeless mixer workflow @@ -298,6 +302,8 @@ jobs: path: | pages-wire-main-1680.png pages-wire-main-*.png + operator-console-v6-1366-768.png + operator-console-v6-1680-900.png pages-v51-portrait-meter-1680.png pages-fader-rollback-console-1680.png pages-fader-rollback-detail-1680.png diff --git a/AR-MIX-Live-FX-Host-Standalone-v0.3.html b/AR-MIX-Live-FX-Host-Standalone-v0.3.html index d280a1443..e49e15157 100644 --- a/AR-MIX-Live-FX-Host-Standalone-v0.3.html +++ b/AR-MIX-Live-FX-Host-Standalone-v0.3.html @@ -612,7 +612,7 @@ Semantic colors alone define the latched state; only the transient :active pointer press moves the cap inward by 1px without changing its layout slot. */ :root{ - --b180-off:#cbd1d1;--b180-edge:#747f7f;--b180-off-ink:#172229; + --b180-off:#E7EFF0;--b180-edge:#747f7f;--b180-off-ink:#172229; --b180-color:var(--b180-off);--b180-border:var(--b180-edge); --b180-ink:var(--b180-off-ink); --b180-on-cyan:#94e8ed;--b180-on-green:#91edac; @@ -1448,6 +1448,163 @@ background-clip:content-box;border:0;box-shadow:none; } #app #mixer .meter .clip-led.latched{box-shadow:none!important} +/* Owner-approved V5 graphite hardware keys, production native/legacy console. + ONE SVG cutout legend, ONE white edge shine, asymmetric occluded leakage. + No hover repaint, SVG filters, blur, infinite animation, or fake audio state. + This module is LAST in the deterministic CSS build, replacing BTN-180 only + on opt-in tactile mixer buttons. Navigation, routing pins, meters, faders, + editor launchers, dropdowns and ordinary dialog actions are NOT backlit. */ +#app button.mx-hw-key { + --mx-hw-led:210,225,234; + position:relative!important; + display:inline-block!important; + box-sizing:border-box!important; + min-width:0!important; + padding:2px!important; + overflow:hidden!important; + isolation:isolate!important; + border:1px solid #0c151b!important; + border-radius:5px!important; + background:linear-gradient(180deg,#0b141b,#25343d)!important; + box-shadow:inset 0 2px 4px #03080db5!important; + color:transparent!important; + text-shadow:none!important; + letter-spacing:0!important; + line-height:normal!important; + filter:none!important; + backdrop-filter:none!important; + -webkit-backdrop-filter:none!important; + transform:none!important; + transition:none!important; + text-align:center!important; + cursor:pointer; + touch-action:manipulation; +} +#app button.mx-hw-key.mx-hw-mute {--mx-hw-led:255,64,85} +#app button.mx-hw-key.mx-hw-solo {--mx-hw-led:255,208,44} +#app button.mx-hw-key.mx-hw-cue {--mx-hw-led:90,200,231} +#app button.mx-hw-key.mx-hw-processing {--mx-hw-led:87,211,189} +#app button.mx-hw-key.mx-hw-phase {--mx-hw-led:243,164,81} +#app button.mx-hw-key.mx-hw-link {--mx-hw-led:163,141,235} +#app button.mx-hw-key.mx-hw-neutral {--mx-hw-led:210,225,234} +/* V5 leakage strategy: four tiny STATIC gradients only in the closest + 1–2px gap, unequal sides, lower-center stronger; top almost occluded. */ +#app button.mx-hw-key::before { + content:""!important; + display:block!important; + position:absolute!important; + inset:1px!important; + border:0!important; + border-radius:4px!important; + width:auto!important;height:auto!important; + transform:none!important; + pointer-events:none!important; + z-index:2!important; + opacity:0!important; + box-shadow:none!important; + background: + linear-gradient(90deg,transparent 0%,rgba(var(--mx-hw-led),.035) 18%, + rgba(var(--mx-hw-led),.16) 33%,rgba(var(--mx-hw-led),.46) 49%, + rgba(var(--mx-hw-led),.27) 63%,rgba(var(--mx-hw-led),.07) 80%,transparent 100%) + center bottom / calc(100% - 12px) 2px no-repeat, + linear-gradient(180deg,transparent 0%,transparent 30%, + rgba(var(--mx-hw-led),.045) 50%,rgba(var(--mx-hw-led),.21) 75%, + rgba(var(--mx-hw-led),.1) 88%,transparent 100%) + left bottom / 2px 100% no-repeat, + linear-gradient(180deg,transparent 0%,transparent 44%, + rgba(var(--mx-hw-led),.075) 65%,rgba(var(--mx-hw-led),.17) 85%, + transparent 100%) + right bottom / 2px 100% no-repeat, + linear-gradient(90deg,transparent 0%,transparent 34%, + rgba(var(--mx-hw-led),.055) 50%,transparent 67%,transparent 100%) + center top / calc(100% - 18px) 1px no-repeat!important; +} +#app button.mx-hw-key::after{content:none!important;display:none!important} +#app button.mx-hw-key[aria-pressed="true"]::before, +#app button.mx-hw-key.active::before, +#app button.mx-hw-key.selected::before, +#app button.mx-hw-key.power-on::before, +#app button.mx-hw-key[data-mx-hw-on="true"]::before {opacity:1!important} +#app button.mx-hw-key > svg.mx-hw-face { + position:absolute!important; + z-index:1!important; + top:2px!important;right:2px!important;bottom:2px!important;left:2px!important; + width:calc(100% - 4px)!important; + height:calc(100% - 4px)!important; + display:block!important; + min-height:0!important; + overflow:hidden!important; + pointer-events:none!important; + transform:translateY(0)!important; + transition:none!important; + filter:none!important; +} +#app button.mx-hw-key svg .mx-hw-lamp {opacity:0!important} +#app button.mx-hw-key[aria-pressed="true"] svg .mx-hw-lamp, +#app button.mx-hw-key.active svg .mx-hw-lamp, +#app button.mx-hw-key.selected svg .mx-hw-lamp, +#app button.mx-hw-key.power-on svg .mx-hw-lamp, +#app button.mx-hw-key[data-mx-hw-on="true"] svg .mx-hw-lamp {opacity:1!important} +#app button.mx-hw-key[aria-pressed="true"] > svg.mx-hw-face, +#app button.mx-hw-key.active > svg.mx-hw-face, +#app button.mx-hw-key[data-mx-hw-on="true"] > svg.mx-hw-face { + transform:translateY(1px)!important; +} +#app button.mx-hw-key > .mx-hw-screen-reader{ + position:absolute!important; + width:1px!important;height:1px!important; + margin:-1px!important;padding:0!important; + border:0!important;overflow:hidden!important; + clip-path:inset(50%)!important; + white-space:nowrap!important; +} +#app button.mx-hw-key:hover:not(:disabled){ + filter:none!important; + background:linear-gradient(180deg,#0b141b,#25343d)!important; + box-shadow:inset 0 2px 4px #03080db5!important; +} +#app button.mx-hw-key:active:not(:disabled){ + transform:none!important; + background:linear-gradient(180deg,#0b141b,#25343d)!important; + box-shadow:inset 0 2px 4px #03080db5!important; +} +#app button.mx-hw-key:active:not(:disabled) > svg.mx-hw-face{ + transform:translateY(1px)!important; +} +#app button.mx-hw-key:focus-visible{ + outline:2px solid #9bbecd!important; + outline-offset:2px!important; +} +#app button.mx-hw-key:disabled { + cursor:not-allowed!important; + opacity:.47!important; + filter:none!important; +} +#app button.mx-hw-key:disabled::before{opacity:0!important} +#app button.mx-hw-key:disabled svg .mx-hw-lamp{opacity:0!important} +/* Keep target strip geometry intact, bypassing the legacy BTN-180 face. */ +#app #mixer .channel-actions button.mx-hw-key, +#app #mixer .utility-row button.mx-hw-key { + flex:1 1 0; +} +/* The legacy MASTER MUTE was sized only by .candy. Own its 29px geometry + explicitly after replacing that obsolete class, matching every strip. */ +#app #masterLeft .master-actions button.mx-hw-key, +#app #masterMute.mx-hw-key{ + height:29px!important; + min-height:29px!important; + max-height:29px!important; + align-self:center!important; +} +#app #mixer [data-channel-format-toggle].mx-hw-key{ + min-width:20px!important; +} +#app .arV6Controls button.mx-hw-key{width:28px!important;height:28px!important;padding:2px!important} +#app .arV6FxSlot button.mx-hw-key{min-width:27px!important;min-height:22px!important;padding:2px!important} +#app .arV6Send button.mx-hw-key{min-width:34px!important;min-height:20px!important;padding:2px!important} +@media(prefers-reduced-motion:reduce){ + #app button.mx-hw-key,#app button.mx-hw-key > svg.mx-hw-face{transition:none!important} +}
@@ -2401,7 +3892,7 @@ ['Backing','♫',['EQ','Reverb'],-3.6,-25], ['Guitar','♬',['EQ','Compressor','Delay'],-7.9,30], ['Keyboard','▥',['EQ','Reverb'],-14.2,0], - ['FX Return','◎',['Reverb'],-5.1,0] + ['Input 10','♩',['Reverb'],-5.1,0] ]; const channels=raw.map((a,i)=>({id:i+1,name:a[0],icon:a[1],color:colors[i],inserts:[...a[2]],fader:a[3],pan:a[4],trim:0,mute:false,solo:false,pre:false,hpf:i%4!==0,stereo:i>=6})); let currentChannel=0, masterSelected=false, view='MIX', sceneIdx=0, timer=0; @@ -2656,19 +4147,38 @@ document.querySelectorAll('.strip.identity-editing').forEach(el=>el.classList.remove('identity-editing')); } function commitChannelIdentity(){ - if(editingChannel<0)return;const index=editingChannel; - const name=$('identityName').value.trim().replace(/\s+/g,' ').slice(0,26); + if(editingChannel<0)return; + const index=editingChannel, name=$('identityName').value.trim().replace(/\s+/g,' ').slice(0,26); if(!name){flash('Enter a channel name');$('identityName').focus();return} - channels[index].name=name;channels[index].icon=channelIcons.includes(editingIcon)?editingIcon:'♩'; - channels[index].color=channelPalette.includes(editingColor)?editingColor:colors[index]; - closeChannelIdentity();currentChannel=index;renderMixer(); + if(channels.some((c,i)=>i!==index&&c.name.trim().toLowerCase()===name.toLowerCase())){ + flash('Channel name already used');$('identityName').focus();return; + } + const ch=channels[index]; + ch.name=name;ch.icon=channelIcons.includes(editingIcon)?editingIcon:'♩'; + ch.color=channelPalette.includes(editingColor)?editingColor:colors[index]; + closeChannelIdentity();currentChannel=index; + // UI identity is not a native graph change. Do not remount any live FX/fader node. + const strip=document.querySelector('#mixer [data-strip="'+index+'"]'); + if(strip){ + strip.style.setProperty('--ch',ch.color); + for(const [sel,val] of [['.arChannelTopName',ch.name],['.arChannelTopIcon',ch.icon], + ['.strip-name .strip-caption',ch.name],['.strip-name .track-icon',ch.icon]]){ + const item=strip.querySelector(sel);if(item)item.textContent=val; + } + strip.querySelector('[data-identity-open]')?.setAttribute('aria-label','Edit '+ch.name+' name, icon and color'); + strip.querySelector('[data-editstrip]')?.setAttribute('aria-label','Double-click to edit '+ch.name+' name, icon and color'); + strip.querySelector('[data-fader]')?.setAttribute('aria-label',ch.name+' fader'); + const meter=strip.querySelector('.vu-bank'); + if(meter)meter.setAttribute('aria-label',ch.name+(ch.stereo?' stereo left and right meters':' mono meter')); + } + createSide(); if(view==='FX RACK')renderRackWorkspace(); - persistSession();flash('Channel identity updated'); + persistSession();flash('Channel label updated · native audio route unchanged'); } window.addEventListener('resize',positionChannelIdentity); $('mixer').addEventListener('scroll',positionChannelIdentity,{passive:true}); function makeStrip(ch,i){let inserts=ch.inserts.slice(0,6);while(inserts.length<6) inserts.push('');return `
-
${i+1}
${inserts.map((n,j)=>`
${n?``:''}
`).join('')}
+
CH ${String(i+1).padStart(2,'0')}
${inserts.map((n,j)=>`
${n?``:''}
`).join('')}
TRIM
dB
${fmt(ch.trim)}
${knobMarkup('trim',i,ch.trim,'Trim')}
${panMarkup(ch,i)}
${panText(ch.pan)}
${fmt(ch.fader)}
${ch.stereo?meterUnit(String(i)+'L','L')+meterUnit(String(i)+'R','R'):meterUnit(String(i),'')}${meterScaleMarkup()}
${faderScaleMarkup()}
@@ -2695,7 +4205,7 @@ window.__arMixSyncAcceptedChannelFormat=syncStripFormat; function renderMixer(){ const x=$('mixer'),scroll=x.scrollLeft; - x.innerHTML=channels.map(makeStrip).join('')+'
'; + x.innerHTML=channels.map(makeStrip).join('')+'
'; renderMaster();x.scrollLeft=scroll;createSide(); } let masterGain=-.1,masterPan=0,masterMute=false,masterMono=false,phones=-12,masterInserts=['Studio EQ','Brickwall Limiter'],masterBypassed={},pendingMasterSlot=null; @@ -2717,7 +4227,7 @@ function meterUnit(key,label){return `
`} function renderMaster(){ const host=$('masterLeft');if(!host)return; - host.innerHTML=`
MASTER
+ host.innerHTML=`
MAIN
${masterFxRows()}
@@ -2839,6 +4349,11 @@ if(b.dataset.pluginManager!==undefined){flash('Plugin Manager is available in the Windows desktop app');return} if(b.dataset.mySounds!==undefined){flash('Native VST3 presets are available in the Windows desktop app');return} if(b.dataset.choose!==undefined){chooseChannel(+b.dataset.choose);return} + if(b.dataset.identityOpen!==undefined){ + const index=Number(b.dataset.identityOpen); + if(Number.isInteger(index)&&index>=0&&index=channels.length)return; @@ -2854,11 +4369,11 @@ if(b.dataset.mute!==undefined){toggleState(+b.dataset.mute,'mute');return}if(b.dataset.solo!==undefined){toggleState(+b.dataset.solo,'solo');return} if(b.dataset.pre!==undefined){let i=+b.dataset.pre;channels[i].pre=!channels[i].pre;b.classList.toggle('active');send('phase',channels[i].pre,i);return} if(b.dataset.hpf!==undefined){let i=+b.dataset.hpf;channels[i].hpf=!channels[i].hpf;b.classList.toggle('active');send('hpf',channels[i].hpf,i);return} - if(b.dataset.masterInsert!==undefined){pendingMasterSlot=+b.dataset.masterInsert;openPluginBrowser(currentChannel,true);return} + if(b.dataset.masterInsert!==undefined){pendingMasterSlot=+b.dataset.masterInsert;if(!window.__JUCE__?.backend?.emitEvent)openQuickFx(currentChannel,pendingMasterSlot,b,true);return} if(b.dataset.masterPower!==undefined){const slot=+b.dataset.masterPower;masterBypassed[slot]=!masterBypassed[slot];renderMaster();persistSession();send('masterFxBypass',{slot,bypass:masterBypassed[slot]},-1);return} if(b.dataset.clip!==undefined){resetClip(b.dataset.clip);return} if(b.dataset.fxpower!==undefined){const [i,j]=b.dataset.fxpower.split(':').map(Number);setFxBypass(i,j,!bypassed[fxKey(i,j)]);return} - if(b.dataset.insert){let [i,j]=b.dataset.insert.split(':').map(Number);currentChannel=i;pendingSlot=j;openPluginBrowser(i);return} + if(b.dataset.insert){let [i,j]=b.dataset.insert.split(':').map(Number);if(!window.__JUCE__?.backend?.emitEvent)openQuickFx(i,j,b);return} if(b.dataset.deleteScene!==undefined){deleteMixerSnapshot(b.dataset.deleteScene);return} if(b.dataset.scene!==undefined){loadSnapshotByIndex(+b.dataset.scene);return} if(b.dataset.preset){applyQuickPreset(b.dataset.preset);return} @@ -3148,8 +4663,74 @@ return; } $('rackWorkspace').innerHTML=`
NO TECHNICAL PATCHBAY REQUIRED

Signal Flow — See where your voice goes

A beginner-first view of the real-time audio path. Select your audio device in Setup.

01 · INPUTMicrophoneAudio Interface
ASIO or WASAPI
➜
02 · FX CHAINVST3 PluginsEQ · Dynamics
Reverb · Delay
➜
03 · MIXERMix & MonitorFader · Pan
Master · Meters
➜
04 · OUTPUTSpeakers / StreamAudio Device
Streaming bridge later
⚠ In this trial the audio flow is a visual concept; no microphone is captured and no audio is sent to a livestream.
`} + +// Adopt PR #278 V5 contextual quick-insert on the ORIGINAL mixer. +// Desktop native operations remain owned by bridge.js; this uses preview +// catalog ONLY when JUCE is absent, never as a fabricated VST3 instance. +const arV5Quick=document.createElement('section'); +arV5Quick.className='arV5QuickFx';arV5Quick.hidden=true; +arV5Quick.setAttribute('role','dialog'); +arV5Quick.setAttribute('aria-label','Quick add effect'); +arV5Quick.innerHTML='
ADD FX
'+ + ''+ + '
'+ + '
Enter: insert · Esc: close
'; +document.querySelector('#app .workbench')?.append(arV5Quick); +const arV5Search=arV5Quick.querySelector('.arV5QuickSearch'), + arV5Results=arV5Quick.querySelector('.arV5QuickResults'); +let arV5Anchor=null; +function closeQuickFx(focus=false){ + if(arV5Quick.hidden)return; + arV5Quick.hidden=true; + if(focus&&arV5Anchor?.isConnected)arV5Anchor.focus(); + arV5Anchor=null; +} +function renderQuickFx(){ + if(arV5Quick.hidden)return; + arV5Results.replaceChildren(); + const q=arV5Search.value.trim().toLocaleLowerCase(); + const found=pluginCatalog.filter(p=> + (p.name+' '+p.type+' '+(p.hint||'')).toLocaleLowerCase().includes(q)); + for(const fx of found.slice(0,64)){ + const b=document.createElement('button');b.type='button'; + b.className='arV5QuickResult';b.dataset.fastPlugin=fx.name; + const title=document.createElement('span');title.textContent=fx.name; + const kind=document.createElement('small');kind.textContent=fx.type; + b.append(title,kind);arV5Results.append(b); + } + if(!found.length){const p=document.createElement('p');p.textContent='No matching demo effects';arV5Results.append(p);} +} +function openQuickFx(channel,slot,anchor,isMaster=false){ + if(window.__JUCE__?.backend?.emitEvent)return false; + if(!isMaster){currentChannel=channel;pendingMasterSlot=null;pendingSlot=slot;} + else pendingMasterSlot=slot; + arV5Anchor=anchor; + arV5Quick.querySelector('.arV5QuickHead strong').textContent= + (isMaster?'MAIN':channels[channel]?.name||'CHANNEL')+' · FX '+(slot+1)+' · UI PREVIEW'; + const host=arV5Quick.parentElement,r=anchor?.getBoundingClientRect(),p=host?.getBoundingClientRect(); + if(r&&p){arV5Quick.style.left=Math.max(6,Math.min(r.left-p.left,p.width-320))+'px'; + arV5Quick.style.top=Math.max(6,Math.min(r.bottom-p.top+4,p.height-360))+'px';} + arV5Quick.hidden=false;arV5Search.value='';renderQuickFx();arV5Search.focus();return true; +} +arV5Search.addEventListener('input',renderQuickFx); +arV5Quick.addEventListener('click',e=>{ + if(e.target.closest('[data-fast-close]')){closeQuickFx(true);return;} + if(e.target.closest('[data-fast-manager]')){ + closeQuickFx();openPluginBrowser(currentChannel,pendingMasterSlot!==null);return;} + const b=e.target.closest('[data-fast-plugin]');if(!b)return; + if(!pluginCatalog.some(p=>p.name===b.dataset.fastPlugin))return; + closeQuickFx();insertPlugin(b.dataset.fastPlugin); +}); +arV5Quick.addEventListener('keydown',e=>{ + if(e.key==='Escape'){e.preventDefault();e.stopPropagation();closeQuickFx(true);} + if(e.key==='Enter'&&e.target===arV5Search){ + const first=arV5Results.querySelector('[data-fast-plugin]'); + if(first){e.preventDefault();first.click();} + } +}); + function openPluginBrowser(idx,isMaster=false){if(!isMaster){currentChannel=idx;pendingMasterSlot=null}activeCategory='All';$('pluginModal').classList.remove('hidden');$('pluginTarget').textContent=isMaster?'Adding to MASTER bus · demo FX catalog':'Adding to '+channels[idx].name+' · virtual effects catalog';$('pluginSearch').value='';renderPluginBrowser();$('pluginSearch').focus()} -function closePluginBrowser(){$('pluginModal').classList.add('hidden')} +function closePluginBrowser(){closeQuickFx();$('pluginModal').classList.add('hidden')} function renderPluginBrowser(){document.querySelectorAll('[data-category]').forEach(b=>b.classList.toggle('active',b.dataset.category===activeCategory));const q=$('pluginSearch').value.trim().toLowerCase();let pool=pluginCatalog.filter(p=>(activeCategory==='All'||p.type===activeCategory)&&`${p.name} ${p.type} ${p.hint}`.toLowerCase().includes(q));$('pluginResults').innerHTML=pool.map(p=>``).join('')||'

No matching demo effects.

'} function insertPlugin(name){ if(pendingMasterSlot!==null){ @@ -3369,7 +4950,7 @@ $('pluginModal').addEventListener('click',e=>{if(e.target===$('pluginModal'))closePluginBrowser()}); $('channelIdentity').addEventListener('click',e=>{if(e.target===$('channelIdentity'))closeChannelIdentity()}); $('identityName').addEventListener('keydown',e=>{if(e.key==='Enter'){e.preventDefault();commitChannelIdentity()}}); -document.addEventListener('keydown',e=>{if(e.key==='Escape'){closePluginBrowser();closeChannelIdentity()}if((e.key==='Enter'||e.key===' ')&&e.target.matches('[data-editstrip]')){e.preventDefault();openChannelIdentity(+e.target.dataset.editstrip)}}); +document.addEventListener('keydown',e=>{if(e.key==='F8'&&!e.repeat&&!document.documentElement.classList.contains('ar-v6-active')){e.preventDefault();if(window.__JUCE__?.backend?.emitEvent)document.querySelector('[data-plugin-manager]')?.click();else{closeQuickFx();openPluginBrowser(currentChannel,pendingMasterSlot!==null)}return;}if(e.key==='Escape'){closeQuickFx();closePluginBrowser();closeChannelIdentity()}if((e.key==='Enter'||e.key===' ')&&e.target.matches('[data-editstrip]')){e.preventDefault();openChannelIdentity(+e.target.dataset.editstrip)}}); document.addEventListener('change',e=>{if(e.target.id==='rackChannel')chooseChannel(+e.target.value)}); document.addEventListener('click',e=>{const id=e.target.closest('button')?.id;if(id==='saveFxFromRack')saveFxChainPreset();else if(id==='recallFxPreset')recallFxChain();else if(id==='openSetupFromFlow')$('audioSetupBtn')?.click();else if(id==='flowFxButton')setView('FX RACK');else if(id==='backMixer')setView('MIX')}); // The UI-only envelope remains one atomic storage transaction, never a 5s @@ -3465,11 +5046,11 @@ const mixer=document.getElementById('mixer'); const host=document.querySelector('.workbench'); if(!mixer||!host)return; - let mode='FX', lastStatus={}, deviceInventory=null, ioTab='device', lastSignature='', focusedInput=2; + let mode='CONSOLE', lastStatus={}, deviceInventory=null, ioTab='device', lastSignature='', focusedInput=0; let monitorSendsExpanded=false; // DEVICE1: staged selections are UI-only; only positive native ACK changes active hardware. let deviceDraft=null,deviceBusy=false,deviceNote='',deviceRequest='',deviceRequestSeq=0,lastDeviceRefresh=0,lastDeviceRescan=0,applyMutePending=false,applyAfterDevice=null,applyBaseEpoch=0; - let deviceMatrixView='inputs',deviceMatrixWaitEpoch=null; // Never display old hardware pins after an APPLY ACK. + let deviceMatrixView='inputs',deviceMatrixWaitEpoch=null,deviceMatrixOpen=false; // Never display old hardware pins after an APPLY ACK. // Pending SOURCE ACK is a UI projection only; monitor.js owns the native route. let quickSourcePending=null; const el=id=>document.getElementById(id); @@ -3707,13 +5288,19 @@ return section; } + // Only an ACKed physical MAIN pair is a MAIN route. Available output pins + // are merely inventory, never proof that a route has been selected. const outputLabel=s=>{ - const out=s.mainOutputs?.length===2?s.mainOutputs:s.outputPorts||[]; - return s.ready&&Number.isInteger(out[0])&&Number.isInteger(out[1])? - 'MAIN → HW '+(out[0]+1)+'/'+(out[1]+1):'MAIN → NO HW OUTPUT'; + const out=s.mainOutputs,enabled=new Set(s.outputPorts||[]); + if(!s.ready)return 'MAIN → NO DEVICE'; + if(!Array.isArray(out)||out.length!==2)return 'MAIN → UNPATCHED'; + if(!Number.isInteger(out[0])||!Number.isInteger(out[1])|| + out[0]===out[1]||!enabled.has(out[0])||!enabled.has(out[1])) + return 'MAIN → INVALID L/R'; + return 'MAIN → HW '+(out[0]+1)+'/'+(out[1]+1); }; const toolbar=node('div','arMixerBankBar'); - toolbar.innerHTML='
NO HARDWARE · PREVIEW
'; + toolbar.innerHTML='
NO HARDWARE · PREVIEW
'; host.insertBefore(toolbar,mixer); // One genuinely selected-channel journey, NOT another DSP or source registry. // Four compact steps show ACKNOWLEDGED state, never stage a hidden graph. @@ -3912,7 +5499,7 @@ sofControls.hidden=true;toolbar.appendChild(sofControls); const overlay=node('div','arIOOverlay'); overlay.id='arIOOverlay';overlay.hidden=true; - overlay.innerHTML=''; + overlay.innerHTML=''; document.body.appendChild(overlay); const audioPath=node('div','arIOAudioPath');audioPath.id='arIOAudioPath'; audioPath.innerHTML='CAPTURE · WAITROUTE · WAITMIXER · WAITOUTPUT · WAIT'; @@ -4228,7 +5815,7 @@ window.__arMixOpenAudioIO=openIO; function closeIO(){overlay.hidden=true;matrixDraft.clear();matrixSide.clear();matrixMessage='';} function setMode(next){ - if(!['FX','ROUTE','SENDS'].includes(next))return; + if(!['CONSOLE','FX','ROUTE','SENDS'].includes(next))return; if(next!=='SENDS'&&sofBus>=0)leaveSof(); mode=next;mixer.dataset.ioMode=mode; toolbar.querySelectorAll('[data-mix-mode]').forEach(b=>{const selected=b.dataset.mixMode===mode;b.classList.toggle('active',selected);b.setAttribute('aria-pressed',String(selected));}); @@ -4247,7 +5834,7 @@ } if(strip.querySelector('.arChannelBank'))continue; const bank=node('div','arChannelBank'); - bank.innerHTML='
INPUT SOURCE · NATIVEOUTPUT DESTINATIONMAIN · UNKNOWN
NATIVE PATCH REQUIRED
AUX SENDS · PRE / POST
'; + bank.innerHTML='
INPUT SOURCE · NATIVEOUTPUT DESTINATION
NATIVE PATCH REQUIRED
AUX SENDS · PRE / POST
'; strip.querySelector('.rack')?.insertAdjacentElement('afterend',bank); } } @@ -4287,8 +5874,22 @@ const dirty=current!==valueFor(accepted)||channelFormat(r)!==channelFormat(accepted); const stage=strip.querySelector('.arBankStage'); const sourcePending=quickSourcePending?.channel===i&&quickSourcePending.epoch===s.epoch; - stage.textContent=!s.ready?'NO LIVE DEVICE':sourcePending?'PENDING · NATIVE ACK':dirty?'DRAFT · NOT APPLIED':r.mode==='NONE'?'UNPATCHED · SILENT':'LIVE · NATIVE ACK'; - stage.dataset.state=!s.ready?'offline':sourcePending?'draft':dirty?'draft':r.mode==='NONE'?'offline':'live'; + const verified=new Set(portList(s).map(p=>p.port)); + const validInput=r.mode==='NONE'|| + (r.mode==='MONO'&&verified.has(r.left)&&r.right===-1)|| + (r.mode==='STEREO'&&r.left!==r.right&&verified.has(r.left)&&verified.has(r.right)); + const acceptedValid=!accepted||accepted.mode==='NONE'|| + (accepted.mode==='MONO'&&verified.has(accepted.left)&&accepted.right===-1)|| + (accepted.mode==='STEREO'&&accepted.left!==accepted.right&&verified.has(accepted.left)&&verified.has(accepted.right)); + // Source is real hardware, processing M/ST is independent. A restored + // invalid legacy alias is NEVER 'ACK/LIVE', even after a native route ACK. + stage.textContent=!s.ready?'NO VERIFIED DEVICE': + sourcePending?'PENDING · NATIVE ACK': + (!validInput||!acceptedValid)?'INVALID PHYSICAL INPUT · RE-PATCH': + dirty?'DRAFT · NOT APPLIED':r.mode==='NONE'?'UNPATCHED · NO INPUT': + 'ROUTE ACK · PCM UNVERIFIED'; + stage.dataset.state=!s.ready?'offline':sourcePending||dirty?'draft': + (!validInput||!acceptedValid)?'invalid':r.mode==='NONE'?'offline':'ack'; // Four native AUX destinations are always visible, even when empty. // Render only after a topology change, never on meter telemetry. const slots=Array.from({length:4},(_,bus)=>{ @@ -4328,6 +5929,28 @@ if(info.textContent!==caption)info.textContent=caption; toolbar.querySelector('[data-mix-apply]').disabled=!isNative()||!s.ready||!!s.pending||(!overlay.hidden&&matrixDraft.size>0); for(const strip of mixer.querySelectorAll('.strip[data-strip]'))refreshStrip(strip,s); + // Read-only pinned MAIN route. Reattach on master DOM regeneration but + // do not alter its fader, meters, FX, callback or native router. + const master=mixer.querySelector('#masterLeft'); + if(master){ + let summary=master.querySelector('.arMainOutSummary'); + if(!summary){ + summary=node('div','arMainOutSummary'); + summary.setAttribute('aria-label','Accepted physical MAIN routing'); + const heading=node('span','arMainOutHeading','MAIN OUT · NATIVE'); + const output=node('button','arMainOutAction'); + output.type='button';output.dataset.mixPatch='output'; + output.dataset.master='1';output.title='Configure physical MAIN L/R (native ACK)'; + summary.append(heading,output); + master.querySelector('.master-ch-id')?.insertAdjacentElement('afterend',summary); + } + const output=summary.querySelector('.arMainOutAction'); + if(output){ + const next=outputLabel(s); + if(output.textContent!==next)output.textContent=next; + output.disabled=!isNative()||!s.ready; + } + } if(!overlay.hidden)refreshIO(); if(!sendEditor.hidden)drawSendEditor(); sofRefresh(s); @@ -4375,7 +5998,7 @@ const title=node('header','arIOQuickHeader'); const words=node('div',''); words.append(node('strong','','1 · INTERFACE INPUT → MIXER CHANNEL'), - node('small','','Choose a channel, mono/stereo source and actual driver input(s). STAGE → MUTE → APPLY.')); + node('small','','Choose one channel and one or two distinct verified capture pins. USE INPUT commits through native ACK.')); const jump=node('select','arIOJump'); jump.dataset.ioJump='1';jump.setAttribute('aria-label','Find mixer channel'); for(let i=0;i<10;i++){ @@ -4403,15 +6026,20 @@ for(let i=0;i<10;i++){ const r=channelState(s,i),accepted=s.acceptedRoute?.channels?.[i]; const row=node('div','arIOQuickRow');row.dataset.ioQuickRow=String(i); + row.hidden=i!==focusedInput; row.dataset.state=!s.ready?'offline':valueFor(r)!==valueFor(accepted)?'draft': r.mode==='NONE'?'empty':'live'; const identity=node('div','arIOQuickIdentity'); identity.append(node('strong','','CH '+String(i+1).padStart(2,'0')),node('small','',matrixLogicalName(i))); const mode=node('select','arIOQuickMode');mode.dataset.ioQuickMode='1'; mode.setAttribute('aria-label','CH '+(i+1)+' physical input type'); - for(const pair of [['NONE','NO INPUT'],['MONO','MONO'],['STEREO','STEREO'], + for(const pair of [['NONE','NO INPUT'],['MONO','MONO'],['STEREO','STEREO · 2 PINS'], ...(r.mode==='BUS'?[['BUS','INTERNAL BUS']]:[])]){ - const option=node('option','',pair[1]);option.value=pair[0];option.selected=r.mode===pair[0];mode.appendChild(option); + const option=node('option','',pair[1]);option.value=pair[0];option.selected=r.mode===pair[0]; + // An accepted legacy invalid stereo route must remain inspectable, + // but new STEREO selection requires two distinct enabled driver pins. + if(pair[0]==='STEREO'&&verified.length<2&&r.mode!=='STEREO')option.disabled=true; + mode.appendChild(option); } const left=sourceSelect(i,'left',r.left),right=sourceSelect(i,'right',r.right); left.disabled=!hardwareReady(s)||r.mode==='NONE'||r.mode==='BUS'; @@ -4421,12 +6049,23 @@ const stage=node('button','btn-180 arIOQuickStage','USE INPUT'); stage.dataset.ioQuickStage='1';stage.type='button'; stage.disabled=!hardwareReady(s)||r.mode==='BUS'; - action.append(stage,node('small','arIOQuickState',r.mode==='BUS'?'INTERNAL BUS': + const stereoInvalid=r.mode==='STEREO'&&(!verified.some(p=>p.port===r.left)|| + !verified.some(p=>p.port===r.right)||r.left===r.right); + if(stereoInvalid){ + row.dataset.state='invalid'; + // On a one-pin device, the accepted legacy stereo L=R route cannot + // be usable stereo. Offer ONE explicit native-safe MONO correction. + if(verified.length===1&&verified[0].port===r.left){ + stage.textContent='FIX AS MONO';stage.dataset.ioQuickFix='1'; + } + } + action.append(stage,node('small','arIOQuickState',stereoInvalid? + 'INVALID STEREO · SELECT DISTINCT L/R':r.mode==='BUS'?'INTERNAL BUS': !s.ready?'NO DEVICE':row.dataset.state==='draft'?'DRAFT · NOT LIVE': - row.dataset.state==='live'?'LIVE · ACK':'UNPATCHED')); + row.dataset.state==='live'?'ROUTE ACK · CHECK PCM':'UNPATCHED')); row.append(identity,mode,left,right,action);section.appendChild(row); } - section.appendChild(node('p','arIOQuickFooter','Select verified inputs, click USE INPUT. Native routing handles any required safe mute, ACK and re-arm automatically.')); + section.appendChild(node('p','arIOQuickFooter','ONE ACTION: USE INPUT → native safe route/ACK. No input PCM? Send playback into the selected recording endpoint, then check SIGNAL CHECK.')); return section; } function stageQuickInput(button){ @@ -4434,7 +6073,8 @@ const s=route(),pins=new Set(matrixPorts(s,'inputs')); if(!row||!Number.isInteger(channel)||channel<0||channel>=10||!hardwareReady(s)) return matrixSay('Choose an active driver and wait for any previous APPLY.'); - const mode=row.querySelector('[data-io-quick-mode]').value, + const mode=button.dataset.ioQuickFix==='1'?'MONO': + row.querySelector('[data-io-quick-mode]').value, left=Number(row.querySelector('[data-io-quick-pin="left"]').value), right=Number(row.querySelector('[data-io-quick-pin="right"]').value); if(mode==='MONO'&&!pins.has(left))return matrixSay('CH '+(channel+1)+' · choose a valid mono input.'); @@ -4856,7 +6496,7 @@ hidden.value=d.backend;panel.appendChild(hidden); } const same=deviceSameEndpoint(d),advanced=node('details','arIODeviceAdvanced'); - advanced.appendChild(node('summary','','BUFFER / SAMPLE RATE / HARDWARE PIN ENABLE')); + advanced.appendChild(node('summary','','ADVANCED · BUFFER / SAMPLE RATE')); const fields=node('div','arIODeviceFields'); const rateOpts=[[0,'AUTO · driver default']],bufferOpts=[[0,'AUTO · driver default']]; if(same){ @@ -4871,6 +6511,12 @@ deviceSelect('arIODeviceBuffer',d.bufferSize,bufferOpts,deviceBusy||!isNative()))); advanced.appendChild(fields); const pins=node('div','arIODevicePins'); + const pinHeading=node('div','arIOPinHeading'); + const enabledCount=Array.isArray(d.enabledInputs)?d.enabledInputs.length:0; + pinHeading.append(node('strong','','HARDWARE PORTS · ENABLE INPUTS / OUTPUTS'), + node('span','',enabledCount+' capture pin(s) selected · '+(enabledCount<2? + 'MONO ONLY until a second distinct input is enabled':'MONO / STEREO PAIRS POSSIBLE'))); + panel.appendChild(pinHeading); for(const [direction,names,selectedPins] of [ ['INPUT',same?a.inputNames:[],d.enabledInputs], ['OUTPUT',same?a.outputNames:[],d.enabledOutputs]]){ @@ -4890,7 +6536,9 @@ }); pins.appendChild(side); } - advanced.appendChild(pins);panel.appendChild(advanced); + // Input/output pin enabling is a BASIC step, not an advanced matrix. + // The original native device draft/ACK path remains unchanged. + panel.appendChild(pins);panel.appendChild(advanced); } const actions=node('div','arIODeviceActions'); const refresh=node('button','btn-180 arIODeviceRefresh','REFRESH DEVICES'); @@ -4910,9 +6558,18 @@ devicePinNextStep())); panel.appendChild(actions);body.appendChild(panel); - const matrixSection=node('section','arIODevicePatchMatrix'); - const heading=node('div','arIODeviceMatrixHeading'); - heading.appendChild(node('strong','','AUDIO I/O · REAL PORT MATRIX')); + const matrixSection=node('details','arIODevicePatchMatrix'); + matrixSection.open=deviceMatrixOpen; + matrixSection.addEventListener('toggle',()=>{ + if(deviceMatrixOpen!==matrixSection.open){ + deviceMatrixOpen=matrixSection.open; + // Expensive crosspoints are constructed on demand, never just hidden + // behind CSS while a 12Hz native readback refreshes the device panel. + lastSignature='';refreshIO(); + } + }); + const heading=node('summary','arIODeviceMatrixHeading'); + heading.appendChild(node('strong','','ADVANCED · HARDWARE PORT MATRIX (OPTIONAL)')); const tabs=node('div','arIODeviceMatrixSwitch'); for(const [value,label] of [['inputs','INPUTS'],['outputs','OUTPUTS']]){ const b=node('button','arIODeviceMatrixTab',label);b.type='button'; @@ -4921,6 +6578,12 @@ tabs.appendChild(b); } heading.appendChild(tabs);matrixSection.appendChild(heading); + if(!deviceMatrixOpen){ + matrixSection.appendChild(node('p','arIODeviceMatrixEmpty', + 'Optional engineering crosspoints. Open only for advanced pin patching.')); + body.appendChild(matrixSection); + return; + } const live=!!d&&deviceSameEndpoint(d)&&a.authorized!==false; const s=route(); if(deviceMatrixWaitEpoch!==null&&s.epoch!==deviceMatrixWaitEpoch&&s.ready&&s.active) @@ -4961,7 +6624,10 @@ }); overlay.dataset.activeTab=ioTab; const matrixInDevice=ioTab==='device'&&deviceSameEndpoint(deviceDraft)&&hardwareReady(s); - overlay.querySelector('[data-mix-apply]').hidden=ioTab==='device'; + overlay.querySelector('[data-mix-apply]').hidden=ioTab==='device'|| + (ioTab==='inputs'&&!advancedMatrixOpen); + overlay.querySelector('[data-mix-apply]').textContent= + ioTab==='outputs'?'APPLY MAIN OUT':'APPLY ADVANCED'; overlay.querySelector('[data-io-revert]').hidden=ioTab==='device'&&!matrixInDevice; overlay.querySelector('[data-io-internal]').hidden=ioTab==='device'; overlay.querySelector('[data-io-device-apply]').hidden=ioTab!=='device'; @@ -4987,6 +6653,8 @@ if(previous)advancedMatrixOpen=previous.open; const previousDirect=body.querySelector('.arIODeviceDirectMatrix'); if(previousDirect)directMatrixOpen=previousDirect.open; + const previousHardware=body.querySelector('.arIODevicePatchMatrix'); + if(previousHardware)deviceMatrixOpen=previousHardware.open; body.replaceChildren(); if(ioTab!=='device'){ const identity=node('div','arIOHardwareHeader'); @@ -5002,10 +6670,43 @@ body.appendChild(makeQuickInputs(s)); const advanced=node('details','arIOAdvancedMatrix'); advanced.open=advancedMatrixOpen; - advanced.appendChild(node('summary','','ADVANCED M / L / R CROSSPOINT · SAME NATIVE ROUTING')); + advanced.addEventListener('toggle',()=>{ + advancedMatrixOpen=advanced.open; + overlay.querySelector('[data-mix-apply]').hidden=!advanced.open; + }); + advanced.appendChild(node('summary','','ADVANCED · MANUAL INPUT CROSSPOINTS')); advanced.appendChild(makeMatrix(s,ioTab)); body.appendChild(advanced); - }else body.appendChild(makeMatrix(s,ioTab)); + }else{ + // MAIN Left/Right must be visible before the engineering matrix. + // The same __arMixStageMainOutputs owns both paths. + const simple=node('section','arIOSimpleMain'); + simple.append(node('strong','','MAIN OUTPUT · STEREO PAIR'), + node('p','','Select two different enabled hardware outputs. APPLY OUTPUT publishes native routing; no browser sound is generated.')); + const outputPorts=matrixPorts(s,'outputs'); + const accepted=s.mainOutputs?.length===2?s.mainOutputs:[]; + const picked=s.draftMainOutputs?.length===2?s.draftMainOutputs:accepted; + const pickers=node('div','arIOSimpleMainRow'); + for(let side=0;side<2;side++){ + const label=node('label','arIOSimpleMainField'); + label.append(node('span','',side===0?'MAIN LEFT':'MAIN RIGHT')); + const select=node('select','arIOMainOutput');select.dataset.side=String(side); + const empty=node('option','','Choose verified output…');empty.value='-1';select.append(empty); + for(const port of outputPorts){ + const opt=node('option','','HW OUT '+(port+1));opt.value=String(port); + opt.selected=port===picked[side];select.appendChild(opt); + } + select.disabled=!hardwareReady(s)||s.pending||outputPorts.length<2; + label.append(select);pickers.append(label); + } + simple.append(pickers); + body.append(simple); + const advanced=node('details','arIOAdvancedMatrix'); + advanced.open=advancedMatrixOpen; + advanced.append(node('summary','','ADVANCED · OUTPUT CROSSPOINTS / MONITOR')); + advanced.append(makeMatrix(s,ioTab)); + body.append(advanced); + } } if(ioTab==='inputs'){ body.appendChild(node('p','arIOHint','MAONO PS22 virtual inputs appear here ONLY if its selected driver enumerates them as capture ports. Configure MAONO Routing Center and select the appropriate PS22 ASIO/recording endpoint in DEVICE / DRIVER. Separate Windows capture endpoints cannot be silently combined into one device. Processing MONO/STEREO is independent of physical source mode.')); @@ -5043,26 +6744,9 @@ body.appendChild(node('p','arIOHint','LIVE MONITOR: '+ (monitorLive.length===2?'HW '+(monitorLive[0]+1)+'/'+(monitorLive[1]+1):'DISABLED')+ ' · Independent POST-fader mix; all changes require MUTE → APPLY → ACK.')); - const details=node('details','arIOQuickMap'); - details.appendChild(node('summary','','QUICK OUTPUT SELECTION · ACCESSIBLE ALTERNATIVE')); - const accepted=s.mainOutputs?.length===2?s.mainOutputs:[]; - const draft=s.draftMainOutputs?.length===2?s.draftMainOutputs:accepted; - const ports=matrixPorts(s,'outputs'); - for(const [i,label] of ['MAIN LEFT','MAIN RIGHT'].entries()){ - const row=node('label','arIOOutputRow'); - const selector=node('select','arIOMainOutput'); - selector.dataset.side=String(i); - selector.setAttribute('aria-label',label+' destination'); - for(const p of ports){ - const option=node('option','','HW OUT '+(p+1)); - option.value=String(p);option.selected=p===draft[i];selector.appendChild(option); - } - selector.disabled=!hardwareReady(s)||ports.length<2; - row.append(node('strong','',label),selector);details.appendChild(row); - } - body.appendChild(details); - body.appendChild(node('p','arIOHint','LIVE MAIN: '+(accepted.length===2?'HW '+(accepted[0]+1)+'/'+(accepted[1]+1):'UNAVAILABLE')+ - ' · Only native-ACKed MAIN/MONITOR pairs can carry sound. AUX1–4 are internal stereo FX returns, not physical output sockets.')); + const acknowledged=s.mainOutputs?.length===2?s.mainOutputs:[]; + body.appendChild(node('p','arIOHint','NATIVE MAIN: '+(acknowledged.length===2?'HW '+(acknowledged[0]+1)+' / '+(acknowledged[1]+1):'UNAVAILABLE')+ + ' · Selection is DRAFT until native APPLY/ACK. AUX1–4 are internal FX returns, not hardware ports.')); }else{ renderCustomDevice(body); } @@ -5111,6 +6795,7 @@ } if(e.target.matches('[data-io-jump]')){ focusedInput=Number(e.target.value); + lastSignature='';refreshIO(); overlay.querySelector('[data-io-quick-row="'+focusedInput+'"]')?.scrollIntoView({block:'nearest'}); return; } @@ -5176,6 +6861,7 @@ if(!route().ready)openIO('device'); else openSourceChooser(index); } else if(step==='fx'){ + // The existing FX-only engineering layer remains an optional inspector. setMode('FX'); if(typeof chooseChannel==='function')chooseChannel(index); strip?.querySelector('.rack')?.scrollIntoView?.({block:'nearest',inline:'nearest'}); @@ -5349,6 +7035,7 @@ e.preventDefault();e.stopImmediatePropagation(); const strip=b.closest('[data-strip]'),channel=Number(strip?.dataset.strip)||0; if(b.dataset.mixPatch==='input')openIO('inputs',channel); + else if(b.dataset.mixPatch==='output')openIO('outputs',channel); else window.__arMixOpenChannelPatch?.(channel,b.dataset.mixPatch); return; } @@ -5536,7 +7223,8 @@ closeSendEditor(); } },true); - setMode('FX'); + // The ACTUAL M4 WebView2 mixer now opens as one integrated operator console. + setMode('CONSOLE'); })(); + diff --git a/docs/workstreams/GUI_FINAL_ENGINE_HANDOFF_20261102.md b/docs/workstreams/GUI_FINAL_ENGINE_HANDOFF_20261102.md new file mode 100644 index 000000000..68f997238 --- /dev/null +++ b/docs/workstreams/GUI_FINAL_ENGINE_HANDOFF_20261102.md @@ -0,0 +1,33 @@ +# ArSonMix — GUI-final engineering handoff (2 November 2026) + +**Product decision: operator UI WORKFLOW LOCKED for ENGINE #266, not audio-runtime certified.** GUI production owner: PR #271. User-approved interaction/geometry north star: PR #278 + published WIRE V36/V37 reference; hardware material V5 supersedes old BTN-180 art. FAT owner: PR #270. Single Console, one WebView2, one native JUCE callback. No JS graph/PCM engine and no imported demo rack/meters. + +## Fixed operator workflow +One dense mixer console shows **IN → M/ST → VST3 inserts → SEND/FX return → PAN/TRIM/CUE/MUTE/SOLO → FADER / genuine L/R meter → OUT**, with one-width pinned MAIN. The permanent section rail collapses I/O, FX and SEND for all strips without changing fader alignment. Source, destination, graph revision and route state must remain inspectable across banks. A WIRE source is a visual selection only; clicking outside releases it, hover affordance and enlarged IN hit target are requirements for the final patch renderer. Never display an imaginary long wire between off-screen banks. Reference WIRE model is NOT executable DSP. + +**Visual lock:** lightweight graphite #0B161E/#14232C/#20313B, approved V5 physical keys with tiny semantic backlight (MUTE red, SOLO amber, PFL cyan), single SVG text knockout, original channel palette/icons where *native metadata explicitly publishes them*; top and bottom use the same accepted color and icon; no CSS blur/hover glow. MAIN and each channel use EXACT shared width at 150/125/105 px for comfort/standard/compact. No CSS-render-driven audio changes. + +## One authoritative native socket +Contract remains `schemaVersion=6` in v8 orchestration. Subscribe `arMixConsoleSubscribe` → native `arMixConsoleSnapshot`, intents `arMixConsoleIntent` → native `arMixConsoleAck` → same-epoch/revision accepted snapshot. Every uint64 ID/revision is a canonical decimal **string**; requestId includes unique per-WebView nonce. GUI never replaces the accepted view with PENDING state or infers LIVE from clicks. Unknown operation, mismatched deviceEpoch/revision, missing hardware mask, unsupported source pin, callback not LIVE => disabled/rejected, original graph retained. The native producer must publish `device.{epoch,backend,captureDevice,playbackDevice,inputEndpoints,outputEndpoints,enabledInputs,enabledOutputs,sampleRate,bufferFrames,outputArmed}`, `graph.{revision,rosterRevision,channels,destinations,capabilities}`, and measured `telemetry`. + +| Final operator action | Intent operation | Existing GUI payload / expected ENGINE behavior | +|---|---|---| +| Select physical input IN | SET_SOURCE | `{portId}` verified enabled endpoint for exact ChannelId; no pseudo-stereo alias | +| Select primary OUT / serial Group | SET_PRIMARY_OUT | `{destinationId}` accepted bus/physical output by role; cycle/feedback rejected | +| MONO/STEREO processing | SET_PROCESSING_FORMAT | `{format}` independent of count of genuine physical pins | +| Add/select native VST3 | ADD_INSERT / PICK_INSERT_FILE | `{pluginId}` from native catalog or native picker; actual lease and CPU voice, never mock | +| Bypass/editor/reorder VST3 | SET_INSERT_BYPASS / OPEN_INSERT_EDITOR / MOVE_INSERT | `{insertId,bypassed}`, `{insertId}`, `{insertId,beforeInsertId}`; native lease preserved | +| SEND/FX-return | ADD_SEND / SET_SEND_TAP / SET_SEND_LEVEL | `{targetId,tap:'POST',levelDb:0}`, `{sendId,tap}`, `{sendId,levelDb}`; PRE/POST real PCM, no dry duplication | +| PAN / TRIM / FADER | SET_PAN / SET_TRIM / SET_FADER | `{value}`, `{valueDb}`, `{valueDb}`; RT smoothing, not graph rebuilt on drag | +| MUTE / SOLO / PFL (Cue) | SET_MUTE / SET_SOLO / SET_CUE | `{value:boolean}`; monitor semantics separate from MAIN summing | +| Link selected faders | SET_LINK_GROUP | `{channelIds,linked}`; controls only, NOT a Group DSP bus | +| Route selected to genuine Group | ROUTE_SELECTED_TO_GROUP | `{channelIds,destinationId}`; *serial exclusive* dry path without doubles | +| Rename / create native channel | RENAME_CHANNEL / CREATE_CHANNEL | `{name}` / `{role}`; native publishes stable ChannelId and rosterRevision | +| WIRE source/plug/replug/unplug, cross-bank navigator | **NOT INSTALLED AS LIVE OP** | Ref PR #278/V37 only. ENGINE+GUI+FAT must define corresponding accepted graph transactions in shared v8 contract BEFORE enabling. Do not simulate sound. | +| Device changes, Show recall/save, independent Monitor outputs | **ENGINE operation contract pending** | Native epoch/pins and full Show/plugin chunks must be published; fail closed until shared contract supports these operations. | + +### Channel identity schema extension: single-owner admission required +GUI now *reads optional* `graph.channels[].color` (#RRGGBB) and `graph.channels[].icon` (short glyph) ONLY from actual accepted native snapshots; missing data gives neutral grey and no icon, never palette-by-index. **ENGINE must add optional metadata and immutable accepted updates through issue #192 with fixture + validator + FAT tests**. Renaming keeps existing native ID; icon/color editing remains blocked until there are specific new supportedOps and ACK. Never advertise an editor that merely updates JS. + +### Release truth +Current PR #271 uses an illustrative Chromium native stub for S1/S2 controls, not real callback/ASIO PCM evidence. S0 producer unready C++ trace is preserved unchanged. Real full-fidelity callback promotion, actual 2-input/2-VST3/CH11/serial Group/wet Return/Monitor/Show, exact unified SHA Windows build and hardware crackle #15 remain mandatory; no public stable installer or user UAT claim before FAT #270. One combined FAT/Windows/Chromium gate, no repeated small CI promotions. diff --git a/docs/workstreams/GUI_WIRE_POT_V35_20261102.md b/docs/workstreams/GUI_WIRE_POT_V35_20261102.md new file mode 100644 index 000000000..8476c7b06 --- /dev/null +++ b/docs/workstreams/GUI_WIRE_POT_V35_20261102.md @@ -0,0 +1,17 @@ +# V35 — Native WIRE-pot SVG / Accepted Send Control + +Scope: GUI #271 (`work/operator-console-v6`) and authoritative SVG from #278 (same user-uploaded `knob-ICON.svg`). The GUI reference alone has **no real DSP**; only accepted native ChannelId sends may color the native knob. + +## Delivered +- Original uploaded SVG path is present at `web/assets/knob-ICON.svg`, with the same silhouette inlined as URL-encoded CSS mask for **offline standalone/WebView2 byte parity**. Old CSS radial knob and separate tick removed from native send control. +- **Dark grey `#4b535b`** whenever no accepted native send exists. A channel name selection, pointer hover, UI demo, or unaccepted pending request cannot light the knob. +- A row representing an accepted ChannelId `sends[]` link becomes `is-connected`. Its fill uses **native destination channel.color**; when native metadata is missing or invalid, grey is deliberately retained, never fabricated. +- Per-link 0.1dB SEND gain uses a pointer-captured, relative SVG encoder. Shift uses fine 14px/dB versus normal 3px/dB; wheel and keyboard remain native range controls, double click requests unity. No idle `pointermove` listener; active pointer handlers are installed on the captured input only and cleared after completion. +- During drag only local readout moves; **one native `SET_SEND_LEVEL` intent on accepted pointerup** with `requestId`, `deviceEpoch`, `baseGraphRevision`. On ACK rejection/timeout/cancel, accepted state remains unchanged, and the native accepted snapshot drives repaint. +- Core audio graph code, VST3 engine, stream callback, ASIO/PCM, UI channel ownership, visual reference PR278, and public Pages remain unaffected. + +## Verification and remaining release boundary +- `tests/operator_console_v6_smoke.py`: Chromium computed CSS mask/fill, idle state, accepted source→destination color, pointer drag one-intent + ACK-rejection rollback, pointercancel no intent, native keyboard step. +- `tests/mixer_shell_geometry_smoke.py`: original strip/meter/fader MAIN geometry; all existing UI tests, JS syntax, v8 fixture and offline embedding gated by `.github/workflows/ui-smoke.yml`. +- `node --check web/mixer-layout.js` and `python scripts/build_ui_css.py --check` required. +- **Stop ship remains:** PR271 is a draft GUI branch. Full WIRE OUT→IN routed audio, unrelated input-channel patch destinations, disconnect/replug and Show/SoF need corresponding accepted native operations from ENGINE #266; cannot be fabricated by changing JS. Commit must be integrated with ENGINE and FAT #270 with one exact-SHA Windows runtime/physical I/O test, and crackle issue #15 still unresolved. diff --git a/scripts/build_ui_css.py b/scripts/build_ui_css.py index 86f81f5f2..0f3b79676 100644 --- a/scripts/build_ui_css.py +++ b/scripts/build_ui_css.py @@ -3,7 +3,7 @@ import argparse ROOT=Path(__file__).resolve().parents[1] SOURCE=ROOT/'web/styles-src' -MODULES=('00-font-and-assets.css','10-console-legacy.css','20-button-180.css','21-navigation-fx-power.css','30-selection-effects.css','40-rail-pan.css','41-mixer-performance.css','42-mixer-premium.css') +MODULES=('00-font-and-assets.css','10-console-legacy.css','20-button-180.css','21-navigation-fx-power.css','30-selection-effects.css','40-rail-pan.css','41-mixer-performance.css','42-mixer-premium.css','43-hardware-backlit.css') CSS=ROOT/'web/styles.css' HTML=ROOT/'AR-MIX-Live-FX-Host-Standalone-v0.3.html' def compile_css(): @@ -41,6 +41,7 @@ def embed_all(page,css): ('style','arsonmix-mixer-layout-css','web/mixer-layout.css'), ('script','arsonmix-mixer-io-js','web/mixer-io.js'), ('script','arsonmix-mixer-layout-js','web/mixer-layout.js'), + ('script','arsonmix-hardware-keys-js','web/hardware-keys.js'), ): built=embed_managed(built,tag,slot,(ROOT/path).read_text(encoding='utf-8')) return built diff --git a/tests/button_asset_test.py b/tests/button_asset_test.py index 26d835420..7e34d1445 100644 --- a/tests/button_asset_test.py +++ b/tests/button_asset_test.py @@ -26,7 +26,9 @@ 'display:inline-flex', 'inset 5px 5px 2px -1px rgba(0,0,0,.18)' ): assert ''.join(rule.split()) in compact,rule -assert '--b180-off:#cbd1d1' in css +# PR#278 V6 owner-approved brighter OFF plastic; keep all original seven shadows. +assert '--b180-off:#E7EFF0' in css +assert '--b180-off:#E7EFF0' in (root/'web/styles-src/20-button-180.css').read_text(encoding='utf8') assert '--b180-edge:#747f7f' in css assert '--b180-off-ink:#172229' in css assert '--b180-ink:var(--b180-off-ink)' in css diff --git a/tests/fader_asset_test.py b/tests/fader_asset_test.py index a148146be..64978bd71 100644 --- a/tests/fader_asset_test.py +++ b/tests/fader_asset_test.py @@ -58,7 +58,8 @@ assert hashlib.sha256(rose).hexdigest()=="a1d0962a25336d88a062263761d22b65ceca85d4b356e7643f1234afd6573913" assert (int.from_bytes(rose[16:20],"big"),int.from_bytes(rose[20:24],"big"))==(36,77) finish=(root/"web/styles-src/42-mixer-premium.css").read_text(encoding="utf-8") -assert css.endswith(finish), "Premium CSS module not compiled last" +hardware=(root/"web/styles-src/43-hardware-backlit.css").read_text(encoding="utf-8") +assert css.endswith(finish+hardware), "Premium fader CSS must precede isolated V5 hardware-key override" marker='--ari-master-cap:url("data:image/png;base64,' assert css.count(marker)==2, "Rose MASTER must override old gold master once" embedded=css.rsplit(marker,1)[1].split('")',1)[0] diff --git a/tests/fixtures/console-v8-native-unready.json b/tests/fixtures/console-v8-native-unready.json new file mode 100644 index 000000000..c4b3d9549 --- /dev/null +++ b/tests/fixtures/console-v8-native-unready.json @@ -0,0 +1 @@ +{"events":[{"event":"arMixConsoleSnapshot","payload":{"schemaVersion":6,"productionCallbackLive":false,"device":{"epoch":"1","backend":"","captureDevice":"","playbackDevice":"","inputEndpoints":[],"outputEndpoints":[],"enabledInputs":[],"enabledOutputs":[],"sampleRate":null,"bufferFrames":null,"outputArmed":false},"graph":{"revision":"0","rosterRevision":"0","channels":[],"destinations":[],"capabilities":{"callbackOwnsChannelIds":false,"fullVendorFxMigration":false,"showAndOutputParity":false,"physicalCaptureMapped":false,"dynamicChannels":false,"groups":false,"fxReturns":false,"monitor":false,"sendsOnFaders":false,"supportedOps":[]}},"telemetry":{"rawCapturePresent":false,"rawCapturePeak":0,"mainPcmPresent":false,"monitorPcmPresent":false,"channelMeterRmsPeak":[]},"legacyM4":{"active":false,"routeAccepted":false,"routingRevision":"0"}}},{"event":"arMixConsoleIntent","payload":{"requestId":"native-fixture-session:1","deviceEpoch":"1","baseGraphRevision":"0","baseRosterRevision":"0","operation":"SET_SOURCE","targetChannelId":null,"payload":{}}},{"event":"arMixConsoleAck","payload":{"requestId":"native-fixture-session:1","status":"REJECTED","deviceEpoch":"1","graphRevision":"0","rosterRevision":"0","errorCode":"UNIVERSAL_CALLBACK_NOT_READY"}},{"event":"arMixConsoleSnapshot","payload":{"schemaVersion":6,"productionCallbackLive":false,"device":{"epoch":"1","backend":"","captureDevice":"","playbackDevice":"","inputEndpoints":[],"outputEndpoints":[],"enabledInputs":[],"enabledOutputs":[],"sampleRate":null,"bufferFrames":null,"outputArmed":false},"graph":{"revision":"0","rosterRevision":"0","channels":[],"destinations":[],"capabilities":{"callbackOwnsChannelIds":false,"fullVendorFxMigration":false,"showAndOutputParity":false,"physicalCaptureMapped":false,"dynamicChannels":false,"groups":false,"fxReturns":false,"monitor":false,"sendsOnFaders":false,"supportedOps":[]}},"telemetry":{"rawCapturePresent":false,"rawCapturePeak":0,"mainPcmPresent":false,"monitorPcmPresent":false,"channelMeterRmsPeak":[]},"legacyM4":{"active":false,"routeAccepted":false,"routingRevision":"0"}}}]} diff --git a/tests/gui_baseline_lock_test.py b/tests/gui_baseline_lock_test.py index 0d7c31983..b0b027bfe 100644 --- a/tests/gui_baseline_lock_test.py +++ b/tests/gui_baseline_lock_test.py @@ -12,8 +12,14 @@ lock=(root/'docs/GUI_BASELINE_LOCK_2026-10-25.md').read_text(encoding='utf8') assert '343692fc9b702661a8455cca30f0ffd108907324' in lock assert 'checkpoint/gui-v0.8-approved-20261025' in lock -assert 'docs/GUI_BASELINE_LOCK_2026-10-25.md' in readme -assert 'docs/GUI_BASELINE_LOCK_2026-10-25.md' in agents +# v6 is the live execution authority; the old GUI baseline remains historic. +# The base/main README now carries the newer PR278-v5.2 console authority; +# keep the old v6 pointer valid on historical branches, but do not reject +# the superseding owner-approved design / production / release handoff. +assert ('docs/EXECUTION_LOCK_UNIVERSAL_LIVE_CONSOLE_V6_20261101.md' in readme or + ('PRIMARY ARSONMIX GUI AUTHORITY' in readme and 'PR #278' in readme and + 'GUI #271' in readme and 'PRD' in readme)) +assert 'docs/EXECUTION_LOCK_UNIVERSAL_LIVE_CONSOLE_V6_20261101.md' in agents assert "ref: fix/fader-thumb-symmetry-polish" not in page assert "branches: [main]" in page and "head_sha" in page assert "branches: [main]" in ui and "pull_request:" in ui diff --git a/tests/gui_workflow_contract_test.mjs b/tests/gui_workflow_contract_test.mjs index b515c27ed..7d638cda7 100644 --- a/tests/gui_workflow_contract_test.mjs +++ b/tests/gui_workflow_contract_test.mjs @@ -88,3 +88,6 @@ test('native 12Hz status uses one capped shared visual meter scheduler',()=>{ import './audio_capture_triage_contract_test.mjs'; // P0 #132: deterministic transactional browser snapshot regression tests. import './ui_snapshot_transaction_test.mjs'; + +// Always run PR#278 V6 production material/identity/parity gate in the existing UI suite. +import './operator_visual_identity_v6_contract_test.mjs'; diff --git a/tests/hardware_key_v5_smoke.py b/tests/hardware_key_v5_smoke.py new file mode 100644 index 000000000..9bfd2f8d0 --- /dev/null +++ b/tests/hardware_key_v5_smoke.py @@ -0,0 +1,141 @@ +"""V5 mixer hardware keys: one masked legend, semantic LEDs, native parity. +Runs against the REAL web/index.html and GENERATED offline standalone. +No DSP/audio claims: this validates UI skin and existing button handlers only. +""" +import asyncio +from pathlib import Path +from playwright.async_api import async_playwright + +ROOT=Path(__file__).resolve().parents[1] + +async def audit(page): + await page.wait_for_function("""() => !!window.ArSonMixHardwareKeys && + !!document.querySelector('[data-mute="0"] svg.mx-hw-face')""") + keys=await page.evaluate("""() => { + const read=q=>{ + const b=document.querySelector(q),s=getComputedStyle(b),p=getComputedStyle(b,'::before'); + const face=b.querySelector('svg.mx-hw-face'); + const text=face?.querySelectorAll('mask text'); + return {className:b.className,pressed:b.getAttribute('aria-pressed'), + oldSkin:b.classList.contains('btn-180'),svg:!!face, + masks:face?.querySelectorAll('mask').length, + textCount:text?.length,visualText:face?.querySelectorAll(':scope > text').length, + led:s.getPropertyValue('--mx-hw-led').trim(),gap:p.opacity, + lamp:face?getComputedStyle(face.querySelector('.mx-hw-lamp')).opacity:null, + filter:s.filter,blur:s.backdropFilter,shadow:s.boxShadow}; + }; + return {mute:read('[data-mute="0"]'),solo:read('[data-solo="0"]'), + master:read('#masterMute'),phase:read('[data-pre="0"]'), + hpf:read('[data-hpf="0"]')}; + }""") + for name,item in keys.items(): + assert not item['oldSkin'],(name,item) + assert item['svg'] and item['masks']==1 and item['textCount']==1,(name,item) + assert item['visualText']==0,(name,item) + assert item['gap']=='0' and item['lamp']=='0',(name,item) + assert item['filter']=='none' and item['blur']=='none',(name,item) + assert keys['mute']['led']=='255,64,85',keys + assert keys['solo']['led']=='255,208,44',keys + assert keys['phase']['led']=='243,164,81',keys + assert keys['hpf']['led']=='87,211,189',keys + mute=page.locator('[data-mute="0"]') + solo=page.locator('[data-solo="0"]') + await mute.hover() + assert await mute.evaluate("(e)=>getComputedStyle(e).filter")=='none' + await mute.click() + await solo.click() + assert await mute.get_attribute('aria-pressed')=='true' + assert await solo.get_attribute('aria-pressed')=='true' + lit=await page.evaluate("""()=>[...document.querySelectorAll('[data-mute="0"],[data-solo="0"]')].map(b=>({ + gap:getComputedStyle(b,'::before').opacity, + lamp:getComputedStyle(b.querySelector('.mx-hw-lamp')).opacity + }))""") + assert lit==[{'gap':'1','lamp':'1'}]*2,lit + # Only native/app JS changes channel state: decorating cannot dispatch audio. + await mute.click() + assert await mute.get_attribute('aria-pressed')=='false' + assert await solo.get_attribute('aria-pressed')=='true' + await solo.click() + # Every MASTER control occupies the same 29px row as regular MUTE/SOLO. + dimensions=await page.evaluate("""()=>{ + const rect=q=>document.querySelector(q).getBoundingClientRect(); + const master=rect('#masterMute'),mono=rect('#masterMode'),channel=rect('[data-mute="0"]'); + return {masterH:master.height,modeH:mono.height,channelH:channel.height, + masterMid:master.top+master.height/2,modeMid:mono.top+mono.height/2, + channelMid:channel.top+channel.height/2}; + }""") + assert all(24<=dimensions[k]<=34 for k in ('masterH','modeH','channelH')),dimensions + assert max(dimensions[k] for k in ('masterH','modeH','channelH'))-min( + dimensions[k] for k in ('masterH','modeH','channelH'))<.3,dimensions + assert max(dimensions[k] for k in ('masterMid','modeMid','channelMid'))-min( + dimensions[k] for k in ('masterMid','modeMid','channelMid'))<1,dimensions + # SVG gradient LED stops are resolved colors, never unsupported CSS var syntax. + stops=await page.evaluate("""()=>[...document.querySelectorAll('[data-mute="0"],[data-solo="0"]')] + .map(b=>getComputedStyle(b.querySelector('.mx-hw-lamp').ownerSVGElement + .querySelector('linearGradient[id^="mx-hw-led"] stop')).stopColor)""") + assert stops==['rgb(255, 64, 85)','rgb(255, 208, 44)'],stops + # Master mode changes textContent; observer reinstalls ONE SVG legend. + mode=page.locator('#masterMode') + await mode.click() + await page.wait_for_function("""()=>document.querySelector('#masterMode') + ?.querySelector('svg.mx-hw-face mask text')?.textContent==='MONO'""") + assert await mode.get_attribute('aria-pressed')=='true' + await mode.click() + await page.wait_for_function("""()=>document.querySelector('#masterMode') + ?.querySelector('svg.mx-hw-face mask text')?.textContent==='STEREO'""") + # Channel redraw does not leave a raw/old BTN-180 switch behind. + await page.evaluate('renderMixer()') + await page.wait_for_function("""()=>[...document.querySelectorAll('#mixer .channel-actions button')] + .every(b=>!!b.querySelector('svg.mx-hw-face'))""") + assert await page.locator('#mixer .channel-actions button').count()==22 + # Added native controls get the SAME renderer without poll/per-meter observer. + await page.evaluate("""()=>{ + const node=document.createElement('section');node.className='arV6Console'; + node.id='v5-native-fixture'; + node.innerHTML='
'+ + ''+ + ''+ + ''+ + ''+ + ''; + document.querySelector('#app').appendChild(node); + }""") + await page.wait_for_function("""()=>document.querySelectorAll('#v5-native-fixture .mx-hw-face').length===6""") + native=await page.evaluate("""()=>[...document.querySelectorAll('#v5-native-fixture button')].map(b=>({ + led:getComputedStyle(b).getPropertyValue('--mx-hw-led').trim(), + lamp:getComputedStyle(b.querySelector('.mx-hw-lamp')).opacity, + gap:getComputedStyle(b,'::before').opacity + }))""") + assert [x['led'] for x in native]==[ + '210,225,234','255,64,85','255,208,44','90,200,231','87,211,189','90,200,231'],native + assert native[0]['lamp']=='0' and native[0]['gap']=='0',native + assert all(x['lamp']=='1' and x['gap']=='1' for x in native[1:]),native + await page.locator('#v5-native-fixture').evaluate('(el)=>el.remove()') + +async def main(): + async with async_playwright() as p: + browser=await p.chromium.launch(headless=True) + for width,height in [(1366,768),(1680,900)]: + page=await browser.new_page(viewport={'width':width,'height':height}) + errors=[] + page.on('pageerror',lambda e:errors.append(str(e))) + await page.goto((ROOT/'web/index.html').as_uri()) + await audit(page) + assert not errors,(width,errors) + if width==1680: + await page.screenshot(path='mixer-backlit-v5-native-1680.png') + await page.locator('[data-mute="0"]').click() + await page.locator('[data-solo="0"]').click() + await page.screenshot(path='mixer-backlit-v5-native-ON-1680.png') + assert await page.locator('[data-mute="0"]').get_attribute('aria-pressed')=='true' + assert await page.locator('[data-solo="0"]').get_attribute('aria-pressed')=='true' + await page.close() + page=await browser.new_page(viewport={'width':1366,'height':768}) + await page.set_content((ROOT/'AR-MIX-Live-FX-Host-Standalone-v0.3.html').read_text()) + await audit(page) + await page.close() + await browser.close() + print('PASS V5: single mask, asymmetric static light, semantic LEDs, native/legacy dynamic renderer, independent toggles, OFF/ON redraw & offline parity') + +if __name__=='__main__': + asyncio.run(main()) diff --git a/tests/mixer_io_operator_contract_test.mjs b/tests/mixer_io_operator_contract_test.mjs index f019319ad..0ca5ded0a 100644 --- a/tests/mixer_io_operator_contract_test.mjs +++ b/tests/mixer_io_operator_contract_test.mjs @@ -26,8 +26,8 @@ test('MS3A MAIN physical output patch stages through existing muted native route assert.match(gui,/s\.outputPorts/); assert.match(gui,/__arMixStageMainOutputs/); assert.match(gui,/\.arIOMainOutput/); - assert.match(gui,/Only native-ACKed MAIN\/MONITOR pairs can carry sound/); - assert.match(gui,/internal stereo FX returns/); + assert.match(gui,/Selection is DRAFT until native APPLY\/ACK/); + assert.match(gui,/AUX1–4 are internal FX returns/); assert.match(monitor,/window\.__arMixStageMainOutputs/); assert.match(monitor,/mainOutputs:draftMainOutputs/); assert.match(monitor,/routingDryApply/); @@ -188,7 +188,7 @@ test('PATCH1 operator-first mono and nonadjacent stereo stage into ONE native tr assert.match(gui,/window\.__arMixOpenAudioIO=openIO/); assert.match(gui,/if\(b\.dataset\.mixPatch==='input'\)openIO\('inputs',channel\)/); assert.match(gui,/matrixPorts\(s,'inputs'\)/); - assert.match(gui,/SAME NATIVE ROUTING/); + assert.match(gui,/ADVANCED · MANUAL INPUT CROSSPOINTS/); assert.match(gui,/A separate Windows capture endpoints cannot be silently combined|Separate Windows capture endpoints cannot be silently combined/); assert.match(css,/\.arIOQuickPatch\{/); assert.match(css,/\.arIOQuickRow\[data-state="draft"\]/); @@ -575,3 +575,25 @@ test('hardware input CH1/CH2/CH10 selectable on the mixer itself without an IO m assert.match(css,/\.arChannelQuickInput\{/); assert.doesNotMatch(css,/backdrop-filter|filter:blur/); }); + +test('Audio Setup first-sound workflow keeps hardware and routing distinct',()=>{ + const css=read('web/mixer-io.css'); + assert.match(gui,/1 · DEVICE/); + assert.match(gui,/2 · INPUT → CHANNEL/); + assert.match(gui,/3 · MAIN OUT/); + assert.match(gui,/focusedInput=0/); + assert.match(gui,/row.hidden=i!==focusedInput/); + assert.match(gui,/pair\[0\]==='STEREO'&&verified.length<2/); + assert.match(gui,/r.left===r.right/); + assert.match(gui,/INVALID STEREO · SELECT DISTINCT L\/R/); + assert.match(gui,/stage.textContent='FIX AS MONO'/); + assert.match(gui,/button.dataset.ioQuickFix==='1'\?'MONO'/); + assert.match(gui,/function stageQuickInput\(button\)/); + assert.match(gui,/commitSourceInOneGesture\(/); + assert.match(gui,/arIOSimpleMain/); + assert.match(gui,/__arMixStageMainOutputs/); + assert.match(gui,/ADVANCED · HARDWARE PORT MATRIX \(OPTIONAL\)/); + assert.match(css,/\.arIOQuickRow\[hidden\]\{display:none!important\}/); + assert.match(css,/\.arIOAdvancedMatrix:not\(\[open\]\)/); + assert.doesNotMatch(gui,/new AudioContext|AudioWorklet|createPluginInstance|processBlock/); +}); diff --git a/tests/mixer_io_smoke.py b/tests/mixer_io_smoke.py index 6f47d8cdb..9e7bfa670 100644 --- a/tests/mixer_io_smoke.py +++ b/tests/mixer_io_smoke.py @@ -22,9 +22,35 @@ async def main(): await page.goto((root/"web/index.html").as_uri()) assert await page.locator("#mixer .rack").count()==10 assert await page.locator("#mixer .arChannelBank").count()==10 + # The REAL M4 host, not the future v6 demo, opens one console: + # actual native selectors, six VST3 slots and four AUX controls + # coexist in every input strip without FX/ROUTE/SENDS switching. + assert await page.locator('#mixer').get_attribute('data-io-mode')=='CONSOLE' + assert await page.locator('[data-mix-mode="CONSOLE"]').get_attribute('aria-pressed')=='true' + assert await page.locator('#mixer .arBankSource:visible').count()==10 + assert await page.locator('#mixer .arBankOutput:visible').count()==10 + assert await page.locator('#mixer .rack .insert-slot').count()==60 + assert await page.locator('#mixer .arSendBank:visible').count()==10 + await page.screenshot(path='mixer-m4-unified-1366.png') + # Main is visually pinned during navigation across the 10 real strips. + # Do not accept a CSS "sticky" label if its pixels are offscreen. + main_geom=await page.evaluate("""() => { + const mixer=document.querySelector('#mixer'); + const master=document.querySelector('#masterLeft'); + const start=master.getBoundingClientRect(); + const frame=mixer.getBoundingClientRect(); + mixer.scrollLeft=99999; + const end=master.getBoundingClientRect(); + mixer.scrollLeft=0; + return {left:start.left,right:start.right,endLeft:end.left,endRight:end.right, + frameRight:frame.right,frameLeft:frame.left}; + }""") + assert main_geom['right']<=main_geom['frameRight']+2,main_geom + assert main_geom['left']>=main_geom['frameLeft']-2,main_geom + assert abs(main_geom['right']-main_geom['endRight'])<2,main_geom assert await page.locator('.arChannelSignalFlow [data-focus-step]').count()==4 assert 'NO NATIVE ACK' in await page.locator('[data-focus-source]').inner_text() - assert await page.locator("[data-mix-mode]").count()==3 + assert await page.locator("[data-mix-mode]").count()==4 status=await page.evaluate("""() => { const ch=Array.from({length:10},()=>({mode:'NONE',left:-1,right:-1,gain:.25,pan:0,main:true,mute:false,solo:false,fxId:''})); const auxes=Array.from({length:4},()=>({enabled:false,gain:1,main:true,mute:false,fxId:''})); @@ -137,7 +163,7 @@ async def main(): await page.locator('#arIOAudioPath [data-io-signal-check]').click() assert await page.locator('#arSignalOverlay').evaluate("(e)=>e.classList.contains('open')") await page.locator('#arSignalClose').click() - assert "LIVE" in await page.locator('[data-strip="0"] .arBankStage').inner_text() + assert "ROUTE ACK" in await page.locator('[data-strip="0"] .arBankStage').inner_text() assert 'Microphone 1' in await page.locator('[data-focus-source]').inner_text() assert 'MAIN' in await page.locator('[data-focus-out]').inner_text() # M2 Studio-style BUS: one existing empty native lane, no phantom @@ -281,6 +307,19 @@ async def main(): assert await page.locator('.arIODeviceDriverButton').count()==2 assert await page.locator('.arIODeviceDriverButton[aria-pressed="true"]').inner_text()=='ASIO' assert await page.locator('.arIODevicePatchMatrix').is_visible() + assert not await page.locator('.arIODevicePatchMatrix').evaluate('(e)=>e.open') + # No large software-input / crosspoint DOM until explicitly requested. + assert await page.locator('.arIODevicePatchMatrix .arIOMatrixCell').count()==0 + assert await page.locator('.arIODevicePins').is_visible() + await page.locator('.arIODevicePatchMatrix > summary').click() + assert await page.locator('.arIODevicePatchMatrix').evaluate('(e)=>e.open') + # Details toggle is asynchronous; rendering the costly matrix only + # AFTER toggle is intentional, not a race to be hidden by time.sleep. + await page.locator('.arIODeviceDirectMatrix > summary').wait_for(state='visible') + # Matrix itself is an opt-in nested inspector; its individual cells + # must be visible only after expanding that native crosspoint layer. + await page.locator('.arIODeviceDirectMatrix > summary').click() + await page.locator('.arIODevicePatchMatrix .arIOMatrixCell').first.wait_for(state='visible') assert await page.locator('.arIODevicePatchMatrix .arIOMatrixCell').count()>0 # FAST3 source one-gesture has already completed an ARM ACK above. # This separate DEVICE APPLY must produce ONE new guarded arm, not @@ -362,6 +401,7 @@ async def main(): assert await page.locator('.arIODeviceDriverButton[aria-pressed="true"]').inner_text()=='ASIO' await page.locator('[data-io-tab="inputs"]').click() assert await page.locator('#arIOBody .arIOQuickRow').count()==10 + assert await page.locator('[data-io-quick-row]:visible').count()==1 # Operator-first mapper is visible; crosspoint is explicitly advanced. assert await page.locator('#arIOQuickPatch, .arIOQuickPatch').count()==1 assert await page.locator('[data-io-quick-row]').count()==10 @@ -381,6 +421,11 @@ async def main(): # Preserve the pre-test accepted route for later AUX negative tests. await page.evaluate('()=>window.__arMixRevertMixerDraft()') await page.locator('[data-io-tab="outputs"]').click() + assert await page.locator('.arIOSimpleMain').is_visible() + assert await page.locator('.arIOMainOutput').count()==2 + assert await page.locator('.arIOAdvancedMatrix').count()==1 + if not await page.locator('.arIOAdvancedMatrix').evaluate('(e)=>e.open'): + await page.locator('.arIOAdvancedMatrix > summary').click() outputs=await page.locator('#arIOBody').inner_text() assert "HW OUT 1" in outputs and "HW OUT 2" in outputs,outputs assert await page.locator('[data-io-matrix-kind="outputs"]').count()==4 @@ -391,7 +436,7 @@ async def main(): assert duplicate['ok'] is False and 'different' in duplicate['error'],duplicate assert (await page.evaluate('()=>window.__arMixRouteView().draftMainOutputs'))==[1,0] await page.evaluate('()=>window.__arMixRevertMixerDraft()') - assert "AUX1" in outputs and "not physical" in outputs,outputs + assert "AUX1–4 are internal FX returns, not hardware ports" in outputs,outputs await page.locator('[data-io-tab="device"]').click() await page.evaluate("""() => window.__armixTestEmit('arMixAudioDeviceInventory',{ types:[{name:'ASIO',active:true,inputs:['Mic 1','Mic 2'],outputs:['Out 1','Out 2']}] @@ -679,7 +724,7 @@ async def main(): window.__armixTestEmit('arMixStatus',status); return status; }""",status) - assert "LIVE" in await page.locator('[data-strip="1"] .arBankStage').inner_text() + assert "ROUTE ACK" in await page.locator('[data-strip="1"] .arBankStage').inner_text() # Accepted source automatically begins the final guarded hardware # ARM. Reject ARM deliberately for this G5 structural/FX fixture: # the new source route remains accepted, output remains safely @@ -810,8 +855,12 @@ async def main(): }""",status) await page.locator('[data-io-open]').click() await page.locator('[data-io-tab="outputs"]').click() - # Exercise actual sparse-pin OUTPUT crosspoints, not hidden fallback dropdowns. + assert await page.locator('.arIOSimpleMain').is_visible() assert await page.locator('.arIOMainOutput').count()==2 + # Crosspoint remains available, but is no longer the normal workflow. + if not await page.locator('.arIOAdvancedMatrix').evaluate('(e)=>e.open'): + await page.locator('.arIOAdvancedMatrix > summary').click() + # Exercise actual sparse-pin OUTPUT crosspoints, not hidden fallback dropdowns. await page.locator('[data-io-matrix-kind="outputs"][data-io-matrix-row="0"][data-io-matrix-pin="4"]').click() await page.locator('[data-io-matrix-kind="outputs"][data-io-matrix-row="1"][data-io-matrix-pin="5"]').click() assert await page.evaluate("""()=>window.__arMixRouteView().draftMainOutputs.join(',')""")=='4,5' @@ -864,6 +913,8 @@ async def main(): await page.locator('[data-io-tab="inputs"]').click() assert await page.locator('.arIOQuickPatch').is_visible() assert await page.locator('[data-io-quick-row]').count()==10 + await page.locator('[data-io-jump]').select_option('2') + assert await page.locator('[data-io-quick-row]:visible').count()==1 assert await page.locator('[data-io-quick-row="2"] [data-io-quick-pin="left"] option').count()==5 # R7: each USE INPUT commits the existing guarded native route # automatically, without a second STAGE/MUTE/APPLY button ritual. @@ -891,7 +942,7 @@ async def main(): window.__armixTestEmit('arMixRoutingLabAck',{ok:true,state:lab}); window.__armixTestEmit('arMixStatus',status);return status; }""",status) - assert 'LIVE' in await ch3.locator('.arIOQuickState').inner_text() + assert 'ROUTE ACK' in await ch3.locator('.arIOQuickState').inner_text() await page.evaluate("""status=>window.__armixTestEmit('arMixAudioArmAck',{ ok:false,armed:false,deviceEpoch:status.dryRoutingLab.epoch, error:'Output kept safely muted during multi-source setup' @@ -900,6 +951,9 @@ async def main(): # Sparse driver pins 5/8 -> CH6 stereo, independent of CH3's # accepted mono processing and with no fabricated adjacent R pin. ch6=page.locator('[data-io-quick-row="5"]') + await page.locator('[data-io-jump]').select_option('5') + assert await ch6.is_visible() + assert await page.locator('[data-io-quick-row]:visible').count()==1 await ch6.locator('[data-io-quick-mode]').select_option('STEREO') await ch6.locator('[data-io-quick-pin="left"]').select_option('4') await ch6.locator('[data-io-quick-pin="right"]').select_option('7') @@ -923,7 +977,7 @@ async def main(): window.__armixTestEmit('arMixRoutingLabAck',{ok:true,state:lab}); window.__armixTestEmit('arMixStatus',status);return status; }""",status) - assert 'LIVE' in await ch6.locator('.arIOQuickState').inner_text() + assert 'ROUTE ACK' in await ch6.locator('.arIOQuickState').inner_text() await page.evaluate("""status=>window.__armixTestEmit('arMixAudioArmAck',{ ok:false,armed:false,deviceEpoch:status.dryRoutingLab.epoch, error:'Output intentionally stays muted in this fixture' @@ -943,6 +997,11 @@ async def main(): # DEVICE4: name one logical stereo INPUT over sparse verified hardware, # then rename and remove it. Metadata must not emit routingDryApply. await page.locator('[data-io-tab="device"]').click() + if not await page.locator('.arIODevicePatchMatrix').evaluate('(e)=>e.open'): + await page.locator('.arIODevicePatchMatrix > summary').click() + # Demand-mounted logical-input matrix is appended on the details + # toggle; wait for real UI state instead of assuming synchronous DOM. + await page.locator('.arIOSoftwareGrid').wait_for(state='visible') assert await page.locator('.arIOSoftwareGrid').is_visible() count_before=await page.evaluate("""()=>window.__armixTestActions.filter(x=> x.name==='arMixAction'&&x.data.action==='routingDryApply').length""") @@ -1159,6 +1218,74 @@ async def main(): assert len(armed)==1 and armed[0]['data']['expectedEpoch']==31,armed assert armed[0]['data']['expectedRevision']==3,armed await qp.close() + + # Field screenshot regression: one enabled VB-Cable/recording pin may + # ONLY be selected as mono. Do not fabricate a second R endpoint. + one=await browser.new_page(viewport={"width":1366,"height":768}) + await one.add_init_script("""(() => { + const listeners={}; + window.__armixTestActions=[]; + window.__JUCE__={backend:{ + addEventListener(name,fn){(listeners[name]??=[]).push(fn)}, + emitEvent(name,data){window.__armixTestActions.push({name,data})} + }}; + window.__armixTestEmit=(name,datum)=>(listeners[name]||[]).forEach(fn=>fn(datum)); + })();""") + await one.goto((root/"web/index.html").as_uri()) + await one.evaluate("""() => { + const channels=Array.from({length:10},()=>({ + mode:'NONE',left:-1,right:-1,gain:.25,pan:0,main:true, + mute:false,solo:false,fxId:''})); + const auxes=Array.from({length:4},()=>({ + enabled:false,gain:1,main:true,mute:false,fxId:''})); + const lab={active:true,ready:true,epoch:51,revision:3, + ports:[{port:0,label:'CABLE Output capture pin 1'}], + outputPorts:[0,1], + acceptedRoute:{deviceEpoch:51,channels,auxes,sends:[]}}; + window.__armixTestEmit('arMixStatus',{ + connected:true,directRouteAuthorized:true,driver:'Windows Audio', + rate:48000,buffer:480,monitor:false,masterMute:false, + chainCount:0,dryRoutingLab:lab}); + window.__armixTestEmit('arMixAudioDeviceInventory',{ + currentType:'Windows Audio', + active:{backend:'Windows Audio', + captureDevice:'CABLE Output (VB-Audio Virtual Cable)', + playbackDevice:'Realtek HD Audio 2nd output',open:true, + authorized:true,deviceGeneration:51,enabledInputs:[0], + enabledOutputs:[0,1],inputNames:['CABLE recording'], + outputNames:['Speakers L','Speakers R']}, + types:[{name:'Windows Audio',active:true,separate:true, + inputs:['CABLE Output (VB-Audio Virtual Cable)'], + outputs:['Realtek HD Audio 2nd output']}]}); + }""") + await one.locator('#audioSetupBtn').click() + # Actual native Windows UI uses a compact right-side hardware drawer, + # not the old centered 920px blocking routing wizard. + drawer=await one.locator('#arIOOverlay .arIOWindow').bounding_box() + assert drawer and drawer['width']<=600,drawer + assert abs(drawer['x']+drawer['width']-1366)<2,drawer + assert await one.locator('.arIODevicePin').count()==3 + assert 'MONO ONLY' in await one.locator('.arIOPinHeading').inner_text() + assert not await one.locator('.arIODevicePatchMatrix').evaluate('(e)=>e.open') + await one.locator('[data-io-tab="inputs"]').click() + assert await one.locator('[data-io-quick-row]:visible').count()==1 + ch1=one.locator('[data-io-quick-row="0"]') + assert await ch1.locator('[data-io-quick-mode] option[value="STEREO"]').is_disabled() + await ch1.locator('[data-io-quick-mode]').select_option('MONO') + await ch1.locator('[data-io-quick-pin="left"]').select_option('0') + await ch1.locator('[data-io-quick-stage]').click() + sent=await one.evaluate("""() => window.__armixTestActions.filter( + x=>x.name==='arMixAction'&&x.data.action==='routingDryApply')""") + assert len(sent)==1,sent + assert sent[0]['data']['value']['channels'][0]['mode']=='MONO',sent + assert sent[0]['data']['value']['channels'][0]['left']==0,sent + assert sent[0]['data']['value']['channels'][0]['right']==-1,sent + # A pending routing command does not claim input PCM, MAIN sound, or + # output ARM. These require native acceptance and capture telemetry. + assert not await one.evaluate("""() => window.__armixTestActions.some( + x=>x.data?.action==='monitor'&&x.data.value===true)""") + await one.screenshot(path='audio-setup-one-pin-1366.png') + await one.close() await browser.close() print("PASS: G1/G2 + G3 real PRE/POST draft, AUX return, 0-gain bypass, native ACK/reject/revert, stable rack and 3 viewports") diff --git a/tests/mixer_shell_geometry_smoke.py b/tests/mixer_shell_geometry_smoke.py index c6725308a..7b22302ad 100644 --- a/tests/mixer_shell_geometry_smoke.py +++ b/tests/mixer_shell_geometry_smoke.py @@ -14,7 +14,7 @@ async def main(): await page.locator('.left-rail [data-mix-mode="FX"]').wait_for() assert await page.locator('.toolbar-actions .nav [data-view]').count()==3 assert await page.locator('.toolbar-actions [data-native-action="audioSetup"]').count()==0 - assert await page.locator('.left-rail [data-mix-mode]').count()==3 + assert await page.locator('.left-rail [data-mix-mode]').count()==4 assert await page.locator('.left-rail [data-my-sounds]').count()==1 assert await page.locator('.left-rail [data-plugin-manager]').count()==1 assert await page.locator('.left-rail #audioSetupBtn').count()==1 @@ -22,6 +22,7 @@ async def main(): assert await page.locator('.workbench > .arMixerBankBar').count()==0 assert await page.locator('.arRailModeSection > .arMixerBankBar').count()==1 assert await page.locator('#mixer > .strip').count()==11 + assert await page.locator('#mixer').get_attribute('data-io-mode')=='CONSOLE' async def geometry(): return await page.evaluate("""() => { @@ -95,6 +96,50 @@ async def assert_linked(mode,width,height): await page.locator('.left-rail [data-mix-mode="FX"]').click() assert abs(await assert_linked('FX RESTORE',width,height)-heights['FX'])<1.1 + # Visual acceptance of the REAL Console (not the isolated #278 source): + # at desktop widths CH01..CH10 and pinned MAIN share a viewport; no + # wrapped identity, no invisible overlapping labels or repeated Add FX. + await page.locator('.left-rail [data-mix-mode="CONSOLE"]').click() + for width,height in [(1366,768),(1440,820),(1680,900),(1024,720)]: + await page.set_viewport_size({"width":width,"height":height}) + await page.evaluate("document.getElementById('mixer').scrollLeft=0") + verdict=await page.evaluate("""() => { + const m=document.querySelector('#mixer').getBoundingClientRect(); + const main=document.querySelector('#masterLeft').getBoundingClientRect(); + const strips=[...document.querySelectorAll('#mixer > .strip[data-strip]')]; + const heads=strips.map(s=>{ + const el=s.querySelector('.ch-id'),nr=el.querySelector('.arChannelNumber'), + btn=el.querySelector('.arChannelTopIdentity'), + mode=el.querySelector('.arFormatBadge'); + const h=el.getBoundingClientRect(),n=nr.getBoundingClientRect(), + b=btn.getBoundingClientRect(),f=mode.getBoundingClientRect(); + return {h:h.height,inside:n.left>=h.left-1&&f.right<=h.right+1&& + b.left>=n.right-2&&b.right<=f.left+2, + single:n.bottom<=h.bottom+1&&b.bottom<=h.bottom+1&&f.bottom<=h.bottom+1, + ellipsis:getComputedStyle(btn.querySelector('.arChannelTopName')).textOverflow}; + }); + return {width:window.innerWidth,mainVisible:main.left>=m.left-2&&main.right<=m.right+2, + lastVisible:strips[9].getBoundingClientRect().right<=main.left+2, + headProblems:heads.filter(x=>!x.inside||!x.single||x.h<27||x.ellipsis!=='ellipsis'), + visibleSources:strips.filter(s=>{const r=s.getBoundingClientRect(); + return r.left>=m.left-2&&r.right<=main.left+2}).length, + repeatedAdd:document.querySelectorAll('#mixer .strip[data-strip="0"] .rack .insert-slot:has(.insert.empty)') + .length, + displayedAdd:[...document.querySelectorAll('#mixer .strip[data-strip="0"] .rack .insert-slot:has(.insert.empty)')] + .filter(el=>getComputedStyle(el).display!=='none').length}; + }""") + assert verdict['mainVisible'],('MAIN obscured',verdict) + assert not verdict['headProblems'],('identity clip/overlap/wrap',verdict) + assert verdict['displayedAdd']<=1,('repeated ADD FX',verdict) + if width>=1366: + assert verdict['lastVisible'],('CH10 clipped by MAIN',verdict) + assert verdict['visibleSources']==10,('not ten visible strips',verdict) + if width in (1366,1440,1680): + await page.screenshot(path=('mixer-shell-compact-1366.png' if width==1366 else + 'mixer-design-review-1440.png' if width==1440 else 'mixer-g1-g2-1680.png')) + await page.set_viewport_size({"width":1024,"height":720}) + await page.locator('.left-rail [data-mix-mode="FX"]').click() + # Parent view changes still work; click rail mode from PATCH to return MIX. await page.locator('[data-view="SIGNAL FLOW"]').click() assert await page.locator('#mixer').evaluate("(e)=>e.classList.contains('hidden')") @@ -104,7 +149,7 @@ async def assert_linked(mode,width,height): # Full repaint must recreate only strip internals, not left-rail controls. await page.evaluate('renderMixer()') - assert await page.locator('.left-rail [data-mix-mode]').count()==3 + assert await page.locator('.left-rail [data-mix-mode]').count()==4 assert await page.locator('#mixer > .strip').count()==11 await assert_linked('RENDER',1024,720) assert not errors,errors @@ -112,4 +157,10 @@ async def assert_linked(mode,width,height): print("PASS: 11 shared fader tracks, 4 viewport sizes, 3 banks, rail navigation and repaint") if __name__=="__main__": - asyncio.run(main()) + # Execute the v8 native-producer fixture replay through real Chromium + # within this existing GUI smoke job; no second workflow/CI matrix. + from operator_console_v6_smoke import main as native_console_smoke + async def run_gui_suite(): + await main() + await native_console_smoke() + asyncio.run(run_gui_suite()) diff --git a/tests/operator_console_v6_smoke.py b/tests/operator_console_v6_smoke.py new file mode 100644 index 000000000..e13bf8c51 --- /dev/null +++ b/tests/operator_console_v6_smoke.py @@ -0,0 +1,1012 @@ +"""V6 native-authority console: Playwright source/FX/send/ACK/geometry gates. + +The native host is deliberately stubbed. This verifies UI-only semantics; +it does NOT certify PCM, ASIO/WASAPI hardware, VST loading or sound. +""" +import asyncio +import json +import hashlib +from pathlib import Path +from playwright.async_api import async_playwright + +ROOT = Path(__file__).resolve().parents[1] +OPS = [ + "SET_SOURCE", "SET_PROCESSING_FORMAT", "SET_PRIMARY_OUT", + "PICK_INSERT_FILE", "SET_INSERT_BYPASS", "OPEN_INSERT_EDITOR", "MOVE_INSERT", + "ADD_SEND", "SET_SEND_TAP", "SET_SEND_LEVEL", "SET_FADER", + "SET_PAN", "SET_MUTE", "SET_SOLO", "SET_TRIM", "SET_CUE", "CREATE_CHANNEL", +] + + +def channel(identity, name, role="INPUT", source=None): + return {"id":identity,"role":role,"name":name, + "processingFormat":"STEREO" if role=="MAIN" else "MONO", + "source":{"portId":source,"physicalPins":[int(source.split(":")[1])]} if source else None, + "primaryOutId":"1000" if role!="MAIN" else None, + "inserts":[],"sends":[], + "controls":{"faderDb":-3,"pan":0,"mute":False,"solo":False, + "trimDb":-2.5,"cue":False}} + + +def snapshot(revision=3, epoch=7, new_channel=False): + channels=[channel(str(i), f"CH {i:02d}") for i in range(1,11)] + channels[1]["source"]={"portId":"in:1","physicalPins":[1]} + channels[6]["inserts"]=[{"id":"fx-07","name":"Vendor VST3","bypassed":False}] + channels[6]["sends"]=[{"id":"send-07","name":"Reverb","targetId":"1001","tap":"POST","levelDb":-6}] + channels[6]["color"]="#cf6b1e" + channels[6]["icon"]="🎙" + if new_channel: channels.append(channel("18446744073709551610","CH 11")) + channels.extend([channel("1001","FX Return","FX_RETURN"), + channel("1002","Vocal Group","GROUP"),channel("1000","MAIN","MAIN")]) + channels[-3]["color"]="#627c96" # Native destination metadata, not browser-assigned color + + return {"schemaVersion":6,"productionCallbackLive":True, + "device":{"epoch":str(epoch),"backend":"ASIO VERIFIED","captureDevice":"TEST IN", + "playbackDevice":"TEST OUT","sampleRate":48000,"bufferFrames":128,"outputArmed":True, + "enabledInputs":[0,1],"enabledOutputs":[0,1], + "inputEndpoints":[{"id":"in:0","port":0,"callback":0,"label":"IN1","active":True}, + {"id":"in:1","port":1,"callback":1,"label":"IN2","active":True}], + "outputEndpoints":[{"id":"out:0","port":0,"callback":0,"label":"OUT1","active":True}, + {"id":"out:1","port":1,"callback":1,"label":"OUT2","active":True}]}, + "graph":{"revision":str(revision),"rosterRevision":str(revision), + "channels":channels,"destinations":[{"id":"1000","name":"MAIN"}, + {"id":"1001","name":"FX Return","acceptsSend":True}, + {"id":"1002","name":"Group"}], + "capabilities":{"callbackOwnsChannelIds":True,"fullVendorFxMigration":True, + "showAndOutputParity":True,"physicalCaptureMapped":True,"dynamicChannels":True, + "groups":True,"fxReturns":True,"monitor":True,"sendsOnFaders":True, + "supportedOps":list(OPS)}}, + "telemetry":{"rawCapturePresent":False,"rawCapturePeak":0, + "mainPcmPresent":False,"monitorPcmPresent":False,"channelMeterRmsPeak":{}}} + + +async def main(): + async with async_playwright() as play: + browser = await play.chromium.launch(headless=True) + page = await browser.new_page(viewport={"width": 1440, "height": 768}) + errors = [] + page.on("pageerror", lambda e: errors.append(str(e))) + await page.add_init_script("""(() => { + const listeners = {}; + const sent = []; + window.__v6Test = { + sent, + publish: (event, payload) => (listeners[event] || []).forEach(cb => cb(payload)), + }; + window.__JUCE__ = { backend: { + emitEvent: (event, payload) => sent.push({event, payload}), + addEventListener: (event, cb) => (listeners[event] ||= []).push(cb), + }}; + })()""") + await page.goto((ROOT / "web/index.html").as_uri()) + assert await page.locator("#arV6Console").is_hidden() + assert await page.locator("#mixer > .strip").count() == 11 + assert await page.evaluate( + "()=>window.__v6Test.sent.some(x=>x.event==='arMixConsoleSubscribe')") + # Exact C++ ENGINE v8 fixture: S0 must remain readback-only. + raw=(ROOT/"tests/fixtures/console-v8-native-unready.json").read_bytes() + assert hashlib.sha256(raw).hexdigest()=="4cbded2c7ada3be511c0e9a09b1949979638eb274c432f89b673a98ce55c7718" + native=json.loads(raw) + trace=native["events"] + assert [x["event"] for x in trace]==[ + "arMixConsoleSnapshot","arMixConsoleIntent", + "arMixConsoleAck","arMixConsoleSnapshot"] + assert trace[0]["payload"]==trace[3]["payload"] + assert trace[1]["payload"]["operation"]=="SET_SOURCE" + assert trace[2]["payload"]["errorCode"]=="UNIVERSAL_CALLBACK_NOT_READY" + # The native C++ producer's real four-event control-plane trace is + # replayed unchanged. The outbound INTENT is inspected, not forged + # as an inbound GUI event. An unrelated ACK cannot grant native LIVE. + for event in (trace[0],trace[2],trace[3]): + await page.evaluate("(x)=>window.__v6Test.publish(x.event,x.payload)",event) + assert await page.locator("#arV6Console").is_hidden() + assert await page.evaluate("()=>window.__arMixV6ReadOnly().visibleChannelIds")==[] + bad=json.loads(raw)["events"][0]["payload"] + del bad["device"]["enabledInputs"] + await page.evaluate("(s)=>window.__v6Test.publish('arMixConsoleSnapshot',s)",bad) + assert await page.locator("#arV6Console").is_hidden() + # Integration's implemented flat graph readback is NOT a live JUCE + # callback. Accept identity but never replace the legacy console. + flat = { + "schemaVersion": 6, "deviceEpoch": "6", "graphRevision": "2", + "rosterRevision": "2", "productionCallbackLive": False, + "capabilities": { + "callbackOwnsChannelIds": False, "addChannel": False, + "group": False, "fxReturn": False, "monitor": False}, + "channels": [{ + "id": "7", "role": "input", "processingFormat": "mono", + "primaryOutId": "13", "sourcePinVerified": False, + "actualPcmPresent": False, "sends": []}] + } + await page.evaluate("(s)=>window.__v6Test.publish('arMixConsoleSnapshot',s)",flat) + assert await page.locator("#arV6Console").is_hidden() + assert await page.locator("#mixer > .strip").count() == 11 + first = snapshot() + # A native publisher must use exact decimal-string ChannelIds, + # including values beyond JavaScript's 53-bit integer precision. + assert all(c["id"].isdigit() for c in first["graph"]["channels"]) + malformed = snapshot(revision=99) + malformed["graph"]["channels"][0]["id"] = "01" + # A leading-zero alias must not be accepted even from the JUCE bridge. + await page.evaluate("(s)=>window.__v6Test.publish('arMixConsoleSnapshot',s)", malformed) + assert await page.locator("#arV6Console").is_hidden() + # A physical source must name an active endpoint that belongs to + # the SAME verified pin set, never a different active IN label. + wrong_pin=snapshot(revision=98) + wrong_pin["graph"]["channels"][1]["source"]={"portId":"in:0","physicalPins":[1]} + await page.evaluate("(s)=>window.__v6Test.publish('arMixConsoleSnapshot',s)",wrong_pin) + assert await page.locator("#arV6Console").is_hidden() + inactive_pin=snapshot(revision=98) + inactive_pin["device"]["inputEndpoints"][1]["active"]=False + await page.evaluate("(s)=>window.__v6Test.publish('arMixConsoleSnapshot',s)",inactive_pin) + assert await page.locator("#arV6Console").is_hidden() + # Native feedback-loop defects must fail closed before UI admission. + cyclic=snapshot(revision=98) + cyclic["graph"]["channels"][-3]["primaryOutId"]="1002" + cyclic["graph"]["channels"][-2]["primaryOutId"]="1001" + await page.evaluate("(s)=>window.__v6Test.publish('arMixConsoleSnapshot',s)",cyclic) + assert await page.locator("#arV6Console").is_hidden() + await page.evaluate("(s)=>window.__v6Test.publish('arMixConsoleSnapshot',s)", first) + await page.locator("#arV6Console").wait_for(state="visible") + # Both positions bind to native-provided color/icon, not a display-index + # palette, and the PCM status stays separately visible. + native_identity=page.locator('[data-channel-id="7"]') + assert await native_identity.get_attribute("data-identity-published")=="true" + assert await native_identity.locator(".arV6IdentityIcon").inner_text()=="🎙" + assert await native_identity.locator(".arV6FootIcon").inner_text()=="🎙" + assert await native_identity.locator(".arV6FootName").inner_text()=="CH 07" + assert await native_identity.evaluate("(n)=>n.style.getPropertyValue('--ch')")=="#cf6b1e" + assert await native_identity.locator(".arV6PcmState").count()==1 + neutral=page.locator('[data-channel-id="8"]') + assert await neutral.get_attribute("data-identity-published")=="false" + assert await neutral.evaluate("(n)=>n.style.getPropertyValue('--ch')")=="#5f9ab1" + assert await page.locator("#arV6Lanes .arV6Strip").count() == 12 + assert await page.locator("#arV6Main .arV6Master").count() == 1 + # The device drawer contains ONLY native-verified physical endpoints, + # and never emits a command or invents a physical signal. + await page.get_by_role("button", name="Verified native audio device inventory").click() + device=page.locator("#arV6DevicePanel") + assert await device.is_visible() + assert "TEST IN" in await device.inner_text() + assert "IN1" in await device.inner_text() and "IN2" in await device.inner_text() + assert "OUT1" in await device.inner_text() and "OUT2" in await device.inner_text() + assert "Read-only" in await device.inner_text() + await page.get_by_role("button",name="Close native device inventory").click() + assert await page.locator('[data-op="SET_PRIMARY_OUT"][data-id="7"] option[value="out:0"]').count()==0 + assert await page.locator('[data-op="SET_PRIMARY_OUT"][data-id="1000"] option[value="out:0"]').count()==1 + assert await page.locator('[data-op="SET_PRIMARY_OUT"][data-id="1000"] option[value="out:1"]').count()==1 + # MAIN can request the verified render pin via the same native socket; + # a browser selecting it does not arm hardware or change PCM. + await page.locator('[data-op="SET_PRIMARY_OUT"][data-id="1000"]').select_option("out:0") + main_intent=await page.evaluate("""()=>window.__v6Test.sent.filter( + x=>x.event==='arMixConsoleIntent').at(-1).payload""") + assert main_intent["operation"]=="SET_PRIMARY_OUT" + assert main_intent["targetChannelId"]=="1000" + assert main_intent["payload"]=={"destinationId":"out:0"} + assert await page.locator('[data-op="SET_PRIMARY_OUT"][data-id="1000"]').input_value()=="" + await page.evaluate("""id=>window.__v6Test.publish('arMixConsoleAck', + {requestId:id,status:'REJECTED',deviceEpoch:'7',graphRevision:'3', + rosterRevision:'3',errorCode:'OUTPUT_NOT_ARMED'})""",main_intent["requestId"]) + assert await page.locator('[data-op="SET_PRIMARY_OUT"][data-id="1000"]').input_value()=="" + assert await page.locator('[data-meter-id="1000"] .arV6MeterLane').count() == 2 + assert await page.locator('[data-meter-id="7"][data-format="MONO"] .arV6MeterLane').count() == 2 + # L/R ladder must never mirror a single maximum to both sides. + stereo = snapshot() + stereo["telemetry"]["channelMeterRmsPeak"] = { + "1000":{"peakLeft":0.5,"peakRight":0.05}} + await page.evaluate("(s)=>window.__v6Test.publish('arMixConsoleSnapshot',s)",stereo) + lit = await page.locator('[data-meter-id="1000"]').evaluate("""el=> + [...el.querySelectorAll('.arV6MeterLane')].map(x=>Number(x.dataset.lit))""") + assert lit[0]>lit[1]>0,lit + # S1: distinct RAW, channel and MAIN truth. MAIN measurements do not + # turn all unpatched/AUX/group strips into invented active PCM. + live_meter=snapshot() + live_meter["graph"]["channels"][6]["source"]={"portId":"in:0","physicalPins":[0]} + live_meter["telemetry"].update({ + "rawCapturePresent":True,"rawCapturePeak":0.4,"mainPcmPresent":True, + "channelMeterRmsPeak":{ + "7":{"peak":0.3},"1000":{"peakLeft":0.4,"peakRight":0.2}}}) + await page.evaluate("(s)=>window.__v6Test.publish('arMixConsoleSnapshot',s)",live_meter) + assert "CHANNEL PCM MEASURED" in await page.locator('[data-status-id="7"]').inner_text() + assert "MAIN PCM VERIFIED" in await page.locator('[data-status-id="1000"]').inner_text() + assert "CHANNEL PCM UNVERIFIED" in await page.locator('[data-status-id="1002"]').inner_text() + assert "SILENT / NO SOURCE" in await page.locator('[data-status-id="3"]').inner_text() + # Continuous telemetry must not mutate faders, reselect controls, + # re-run responsive layout geometry, or remount VST3 editors. + stats_start=await page.evaluate("()=>window.__arMixV6ReadOnly().uiStats") + await page.evaluate("""()=>window.__meterFader= + document.querySelector('[data-channel-id="7"] .arV6Fader')""") + meter_burst=[] + for n in range(80): + s=snapshot() + s["graph"]["channels"][6]["source"]={"portId":"in:0","physicalPins":[0]} + s["telemetry"]["rawCapturePresent"]=True + s["telemetry"]["rawCapturePeak"]=0.4 + s["telemetry"]["mainPcmPresent"]=True + s["telemetry"]["channelMeterRmsPeak"]={ + "7":{"peak":0.1+(n%10)/12},"1000":{"peakLeft":0.2,"peakRight":0.05}} + meter_burst.append(s) + await page.evaluate("""states=>states.forEach(s=> + window.__v6Test.publish('arMixConsoleSnapshot',s))""",meter_burst) + stats_end=await page.evaluate("()=>window.__arMixV6ReadOnly().uiStats") + assert stats_end["telemetryFastFrames"]-stats_start["telemetryFastFrames"]==80 + assert stats_end["controlRefreshes"]==stats_start["controlRefreshes"] + assert stats_end["structureRenders"]==stats_start["structureRenders"] + assert await page.evaluate("""()=>window.__meterFader=== + document.querySelector('[data-channel-id="7"] .arV6Fader')""") + # Repeated identical graph revision can STILL contain newly accepted + # fader controls, so do not mistake a true parameter edit for meters. + changed=snapshot() + changed["graph"]["channels"][6]["controls"]["faderDb"]=-17 + await page.evaluate("(s)=>window.__v6Test.publish('arMixConsoleSnapshot',s)",changed) + assert await page.locator('[data-op="SET_FADER"][data-id="7"]').input_value()=="-17" + assert (await page.evaluate("()=>window.__arMixV6ReadOnly().uiStats"))[ + "controlRefreshes"]>stats_end["controlRefreshes"] + # Invalid PCM data never lights LEDs or replaces an accepted snapshot. + bad_pcm=snapshot(revision=91) + bad_pcm["telemetry"]["channelMeterRmsPeak"]={"7":{"peak":-0.4}} + await page.evaluate("(s)=>window.__v6Test.publish('arMixConsoleSnapshot',s)",bad_pcm) + assert await page.locator('[data-op="SET_FADER"][data-id="7"]').input_value()=="-17" + bogus=snapshot(revision=91) + bogus["telemetry"]["channelMeterRmsPeak"]={"999999":{"peak":0.3}} + await page.evaluate("(s)=>window.__v6Test.publish('arMixConsoleSnapshot',s)",bogus) + assert await page.locator('[data-op="SET_FADER"][data-id="7"]').input_value()=="-17" + # Restore baseline before exercising editing transactions later. + await page.evaluate("(s)=>window.__v6Test.publish('arMixConsoleSnapshot',s)",snapshot()) + # Narrow bank is purely presentational; pinned MAIN and native IDs stay. + before_width=await page.locator('[data-channel-id="7"]').evaluate( + "(el)=>el.getBoundingClientRect().width") + fader_node=await page.locator('[data-channel-id="7"] .arV6Fader').evaluate( + "el=>{window.__faderBeforeNarrow=el;return true}") + await page.get_by_role("button", name="Toggle narrow channel bank").click() + after_width=await page.locator('[data-channel-id="7"]').evaluate( + "(el)=>el.getBoundingClientRect().width") + assert after_widthwindow.__faderBeforeNarrow=== + document.querySelector('[data-channel-id="7"] .arV6Fader')""") + assert await page.locator("#arV6Main .arV6Master").count()==1 + await page.get_by_role("button", name="Toggle narrow channel bank").click() + assert "ARMED" in await page.locator(".arV6State").inner_text() + assert "SILENT / NO SOURCE" in await page.locator( + '[data-status-id="7"]').inner_text() + assert await page.locator('#arV6Console [data-op="CREATE_CHANNEL"]').is_enabled() + + # One PR#278-style synchronized section rail controls ALL strips, + # without remounting native fader nodes or changing accepted DSP. + await page.evaluate("""()=>window.__v6RailFader = + document.querySelector('[data-channel-id="7"] .arV6Fader')""") + async def aligned_sections(): + return await page.evaluate("""() => { + const r=sel=>document.querySelector(sel).getBoundingClientRect(); + const selectors=[['io','.arV6Route'],['fx','.arV6Fx'],['send','.arV6Sends']]; + return selectors.map(([name,section])=>{ + const rail=r('.arV6RailToggle[data-section="'+name+'"]'); + const strip=r('[data-channel-id="7"] '+section); + const master=r('[data-channel-id="1000"] '+section); + return {name,topDelta:Math.abs(rail.top-strip.top), + bottomDelta:Math.abs(rail.bottom-strip.bottom), + mainDelta:Math.abs(master.top-strip.top), + masterBottom:Math.abs(master.bottom-strip.bottom), + height:strip.height}; + }); + }""") + sections=await aligned_sections() + assert all(x["topDelta"]<2 and x["bottomDelta"]<2 and + x["mainDelta"]<2 and x["masterBottom"]<2 + for x in sections),sections + for key in ("fx","send","io"): + before=next(x["height"] for x in sections if x["name"]==key) + rail=page.locator(f'.arV6RailToggle[data-section="{key}"]') + await rail.click() + assert await rail.get_attribute("aria-expanded")=="false" + sections=await aligned_sections() + after=next(x["height"] for x in sections if x["name"]==key) + assert afterwindow.__v6RailFader=== + document.querySelector('[data-channel-id="7"] .arV6Fader')""") + for key in ("io","send","fx"): + await page.locator(f'.arV6RailToggle[data-section="{key}"]').click() + assert all(x["topDelta"]<2 for x in await aligned_sections()) + + # Native stable ID CTRL/SHIFT selection is UI-only; pinned MAIN excluded. + count_start=await page.evaluate("""()=>window.__v6Test.sent.filter( + x=>x.event==='arMixConsoleIntent').length""") + await page.locator('[data-channel-id="2"] .arV6StripHead').click() + await page.locator('[data-channel-id="7"] .arV6StripHead').click(modifiers=["Control"]) + assert await page.evaluate("()=>window.__arMixV6ReadOnly().selectedChannelIds")==["2","7"] + await page.locator('[data-channel-id="9"] .arV6StripHead').click(modifiers=["Shift"]) + assert await page.evaluate("()=>window.__arMixV6ReadOnly().selectedChannelIds")==["7","8","9"] + assert await page.locator('#arV6Main .arV6Master').get_attribute("aria-selected")=="false" + # A hardware key has one engraved SVG and separate screen-reader text. + count=page.locator('.arV6SelectionCount') + assert await count.get_attribute("data-mx-hw-legend")=="3 SEL" + assert await count.locator('.mx-hw-screen-reader').inner_text()=="3 SEL" + assert await count.locator('svg.mx-hw-face').count()==1 + assert await page.evaluate("""()=>window.__v6Test.sent.filter( + x=>x.event==='arMixConsoleIntent').length""")==count_start + + trim=page.locator('[data-op="SET_TRIM"][data-id="7"]') + assert await trim.is_enabled() and await trim.input_value()=="-2.5" + await trim.evaluate("(el)=>{el.value='5';el.dispatchEvent(new Event('change',{bubbles:true}))}") + trim_cmd=await page.evaluate("""()=>window.__v6Test.sent.filter( + x=>x.event==='arMixConsoleIntent').at(-1).payload""") + assert trim_cmd["operation"]=="SET_TRIM" and trim_cmd["payload"]=={"valueDb":5} + assert await trim.input_value()=="-2.5" + await page.evaluate("""id=>window.__v6Test.publish('arMixConsoleAck', + {requestId:id,status:'REJECTED',deviceEpoch:'7',graphRevision:'3', + rosterRevision:'3',errorCode:'TRIM_NOT_READY'})""",trim_cmd["requestId"]) + cue=page.locator('[data-op="SET_CUE"][data-id="7"]') + assert await cue.is_enabled() + await cue.click() + cue_cmd=await page.evaluate("""()=>window.__v6Test.sent.filter( + x=>x.event==='arMixConsoleIntent').at(-1).payload""") + assert cue_cmd["operation"]=="SET_CUE" and cue_cmd["payload"]=={"value":True} + assert await cue.get_attribute("aria-pressed")=="false" + await page.evaluate("""id=>window.__v6Test.publish('arMixConsoleAck', + {requestId:id,status:'REJECTED',deviceEpoch:'7',graphRevision:'3', + rosterRevision:'3',errorCode:'NO_MONITOR'})""",cue_cmd["requestId"]) + assert await cue.get_attribute("aria-pressed")=="false" + + # Role and SOLO filters are UI-only; MAIN remains pinned, original + # numeric ChannelIds survive and no console intent is emitted. + count_before=await page.evaluate("""()=>window.__v6Test.sent.filter( + x=>x.event==='arMixConsoleIntent').length""") + await page.locator('.arV6Filter').select_option("GROUP") + assert await page.locator('#arV6Lanes .arV6Strip:visible').count()==1 + assert await page.locator('#arV6Main .arV6Master:visible').count()==1 + await page.locator('.arV6Filter').select_option("SOLO") + assert await page.locator('#arV6Lanes .arV6Strip:visible').count()==0 + assert await page.locator('#arV6Main .arV6Master:visible').count()==1 + await page.locator('.arV6Filter').select_option("ALL") + assert await page.locator('#arV6Lanes .arV6Strip:visible').count()==12 + assert await page.evaluate("""()=>window.__v6Test.sent.filter( + x=>x.event==='arMixConsoleIntent').length""")==count_before + + # A source selection is one typed intent, not a JS route update. + await page.locator('[data-op="SET_SOURCE"][data-id="7"]').select_option("in:0") + sent = await page.evaluate("""() => window.__v6Test.sent.filter( + x => x.event === 'arMixConsoleIntent').at(-1).payload""") + assert sent["operation"] == "SET_SOURCE" and sent["targetChannelId"] == "7" + assert sent["baseGraphRevision"] == "3" and sent["deviceEpoch"] == "7" + assert sent["baseRosterRevision"] == "3" + ids=await page.evaluate("""()=>window.__v6Test.sent.filter( + x=>x.event==='arMixConsoleIntent').map(x=>x.payload.requestId)""") + assert len(ids)==len(set(ids)) and all( + x.startswith("gui-") and x.rsplit(":",1)[-1].isdigit() for x in ids) + assert ids[-1]==sent["requestId"] + assert sent["payload"] == {"portId":"in:0"} + assert await page.locator('[data-op="SET_SOURCE"][data-id="7"]').input_value() == "" + assert "PENDING" in await page.locator(".arV6Message").inner_text() + + # Malformed native ACK must cancel pending safely, release the lock, + # and preserve the previously accepted SOURCE (no optimistic mutation). + await page.evaluate("""(requestId) => window.__v6Test.publish( + 'arMixConsoleAck',{requestId,status:'ACCEPTED',newRevision:999})""", + sent["requestId"]) + assert "INVALID NATIVE ACK" in await page.locator(".arV6Message").inner_text() + assert not await page.locator('[data-op="SET_SOURCE"][data-id="7"]').is_disabled() + assert await page.locator('[data-op="SET_SOURCE"][data-id="7"]').input_value() == "" + assert await page.evaluate("()=>window.__arMixV6ReadOnly().pendingCount")==0 + + # A late duplicate/rejection for the cancelled request is ignored. + # Failed intent leaves accepted route untouched, with no invented LIVE. + await page.evaluate("""(requestId) => window.__v6Test.publish( + 'arMixConsoleAck',{requestId,status:'REJECTED', + deviceEpoch:'7',graphRevision:'3',rosterRevision:'3',errorCode:'STALE_EPOCH'})""", sent["requestId"]) + assert "INVALID NATIVE ACK" in await page.locator(".arV6Message").inner_text() + assert await page.locator('[data-op="SET_SOURCE"][data-id="2"]').input_value() == "in:1" + assert await page.locator('[data-op="SET_SOURCE"][data-id="7"]').input_value() == "" + + # A second native intent can be accepted; ACK alone cannot change route. + await page.locator('[data-op="SET_SOURCE"][data-id="7"]').select_option("in:0") + accepted_id = await page.evaluate("""() => window.__v6Test.sent.filter( + x=>x.event==='arMixConsoleIntent').at(-1).payload.requestId""") + await page.evaluate("""id=>window.__v6Test.publish('arMixConsoleAck', + {requestId:id,status:'ACCEPTED',deviceEpoch:'7',graphRevision:'4',rosterRevision:'4',errorCode:''})""", accepted_id) + assert await page.locator('[data-op="SET_SOURCE"][data-id="7"]').input_value() == "" + assert await page.locator('[data-op="SET_SOURCE"][data-id="7"]').is_disabled() + next_state = snapshot(revision=4) + next_state["graph"]["channels"][6]["source"] = {"portId":"in:0","physicalPins":[0]} + next_state["graph"]["channels"][6]["inserts"].append( + {"id": "fx-07b", "name": "Second VST3", "bypassed": False}) + await page.evaluate("(s)=>window.__v6Test.publish('arMixConsoleSnapshot',s)", next_state) + assert await page.locator('[data-op="SET_SOURCE"][data-id="7"]').input_value() == "in:0" + assert await page.locator('[data-op="SET_SOURCE"][data-id="7"]').is_enabled() + assert "NO RAW CAPTURE PCM" in await page.locator( + '[data-status-id="7"]').inner_text() + + # Center PAN snap emits only one native SET_PAN; accepted PAN + # stays unchanged until ACK + matching snapshot. + await page.locator('[data-op="SET_PAN"][data-id="7"]').evaluate( + "(el)=>{el.value='3';el.dispatchEvent(new Event('change',{bubbles:true}))}") + pan_intent=await page.evaluate("""()=>window.__v6Test.sent.filter( + x=>x.event==='arMixConsoleIntent').at(-1).payload""") + assert pan_intent["operation"]=="SET_PAN" and pan_intent["payload"]=={"value":0} + assert await page.locator('[data-op="SET_PAN"][data-id="7"]').input_value()=="0" + assert await page.locator('[data-op="SET_PAN"][data-id="7"]').evaluate( + "el=>el.style.getPropertyValue('--v6-pan-start')")=="50%" + await page.evaluate("""id=>window.__v6Test.publish('arMixConsoleAck', + {requestId:id,status:'REJECTED',deviceEpoch:'7',graphRevision:'4', + rosterRevision:'4',errorCode:'CONTROL_BUSY'})""",pan_intent["requestId"]) + + # Direct OUT, native FX open/bypass, SEND tap and Sends on Faders. + await page.locator('[data-op="SET_PRIMARY_OUT"][data-id="7"]').select_option("1002") + op = await page.evaluate("""() => window.__v6Test.sent.filter( + x=>x.event==='arMixConsoleIntent').at(-1).payload""") + assert op["operation"] == "SET_PRIMARY_OUT" and op["payload"] == {"destinationId": "1002"} + await page.evaluate("""id=>window.__v6Test.publish( + 'arMixConsoleAck',{requestId:id,status:'REJECTED',deviceEpoch:'7',graphRevision:'4',rosterRevision:'4',errorCode:'LOOP'})""", op["requestId"]) + assert await page.locator('[data-op="SET_PRIMARY_OUT"][data-id="7"]').input_value() == "1000" + await page.locator('[data-op="OPEN_INSERT_EDITOR"][data-id="7"]').first.click() + editor_debug = await page.evaluate("""() => ({ + intents:window.__v6Test.sent.filter(x=>x.event==='arMixConsoleIntent').slice(-3), + state:window.__arMixV6ReadOnly(), + node:[...document.querySelectorAll('[data-op="OPEN_INSERT_EDITOR"][data-id="7"]')] + .map(el=>({enabled:!el.disabled,html:el.outerHTML.slice(0,250)})), + focus:document.activeElement?.outerHTML?.slice(0,250) + })""") + assert editor_debug["intents"][-1]["payload"]["operation"] == "OPEN_INSERT_EDITOR", editor_debug + current = await page.evaluate("""() => window.__v6Test.sent.filter( + x=>x.event==='arMixConsoleIntent').at(-1).payload.requestId""") + await page.evaluate("""id=>window.__v6Test.publish( + 'arMixConsoleAck',{requestId:id,status:'REJECTED',deviceEpoch:'7',graphRevision:'4',rosterRevision:'4',errorCode:'EDITOR_UNAVAILABLE'})""", current) + fx_rows = page.locator('[data-channel-id="7"] .arV6FxSlot') + await fx_rows.first.drag_to(fx_rows.nth(1)) + move = await page.evaluate("""() => window.__v6Test.sent.filter( + x=>x.event==='arMixConsoleIntent').at(-1).payload""") + assert move["operation"] == "MOVE_INSERT" + assert move["payload"] == {"insertId": "fx-07", "beforeInsertId": "fx-07b"} + await page.evaluate("""id=>window.__v6Test.publish( + 'arMixConsoleAck',{requestId:id,status:'REJECTED',deviceEpoch:'7',graphRevision:'4',rosterRevision:'4',errorCode:'ORDER_UNSAFE'})""", move["requestId"]) + assert await fx_rows.first.get_attribute("data-fx-id") == "fx-07" + await page.locator('[data-op="SET_SEND_TAP"][data-id="7"]').click() + tap = await page.evaluate("""() => window.__v6Test.sent.filter( + x=>x.event==='arMixConsoleIntent').at(-1).payload""") + assert tap["payload"] == {"sendId": "send-07", "tap": "PRE"} + await page.evaluate("""id=>window.__v6Test.publish( + 'arMixConsoleAck',{requestId:id,status:'REJECTED',deviceEpoch:'7',graphRevision:'4',rosterRevision:'4',errorCode:'UNSUPPORTED'})""", tap["requestId"]) + # V35 real WebView SVG: no-send idle stays dark, native accepted + # SEND turns the *actual uploaded silhouette* into the destination + # channel color without leaking FX or meter updates into the control. + empty = page.locator('[data-channel-id="6"] .arV6WirePot.is-idle') + assert await empty.count()==1 + idle = await empty.evaluate("""el=>({ + fill:getComputedStyle(el,'::before').backgroundColor, + mask:getComputedStyle(el,'::before').webkitMaskImage, + tick:getComputedStyle(el,'::after').content})""") + assert idle["fill"]=="rgb(75, 83, 91)" and "data:image/svg+xml" in idle["mask"], idle + colored = page.locator('[data-send-id="send-07"] .arV6WirePot.is-connected') + assert await colored.count()==1 + active = await colored.evaluate("""el=>({ + fill:getComputedStyle(el,'::before').backgroundColor, + target:el.style.getPropertyValue('--v6-wire-fill'), + mask:getComputedStyle(el,'::before').webkitMaskImage})""") + assert active["target"]=="#627c96" and active["fill"]=="rgb(98, 124, 150)",active + # Direct SVG WIRE knob uses the native SET_SEND_LEVEL; no optimistic DSP. + gain=page.locator('[data-op="SET_SEND_LEVEL"][data-id="7"][data-send="send-07"]') + assert await gain.is_enabled() + assert await gain.input_value()=="-6" + await gain.evaluate("(el)=>{el.value='-12';el.dispatchEvent(new Event('change',{bubbles:true}))}") + gain_cmd=await page.evaluate("""()=>window.__v6Test.sent.filter( + x=>x.event==='arMixConsoleIntent').at(-1).payload""") + assert gain_cmd["operation"]=="SET_SEND_LEVEL" + assert gain_cmd["payload"]=={"sendId":"send-07","levelDb":-12} + assert await gain.input_value()=="-6" + await page.evaluate("""id=>window.__v6Test.publish( + 'arMixConsoleAck',{requestId:id,status:'REJECTED',deviceEpoch:'7', + graphRevision:'4',rosterRevision:'4',errorCode:'GAIN_BUSY'})""",gain_cmd["requestId"]) + assert await gain.input_value()=="-6" + assert await page.locator('[data-send-id="send-07"] .arV6SendDb').inner_text()=="-6.0 dB" + # User dragging 30px down = -10dB from the accepted -6dB, with ONE + # intent only on pointerup, not 30 high-frequency graph revisions. + begin=await page.evaluate("""()=>window.__v6Test.sent.filter( + e=>e.event==='arMixConsoleIntent').length""") + box=await colored.bounding_box() + x,y=box["x"]+box["width"]/2,box["y"]+box["height"]/2 + await page.mouse.move(x,y) + await page.mouse.down() + await page.mouse.move(x,y+30,steps=4) + assert await page.evaluate("""()=>window.__v6Test.sent.filter( + e=>e.event==='arMixConsoleIntent').length""")==begin + await page.mouse.up() + pot_intent=await page.evaluate("""()=>window.__v6Test.sent.filter( + e=>e.event==='arMixConsoleIntent').at(-1).payload""") + assert pot_intent["operation"]=="SET_SEND_LEVEL",pot_intent + assert pot_intent["payload"]=={"sendId":"send-07","levelDb":-16},pot_intent + assert await gain.input_value()=="-6" # no optimistic DSP + await page.evaluate("""id=>window.__v6Test.publish('arMixConsoleAck', + {requestId:id,status:'REJECTED',deviceEpoch:'7',graphRevision:'4', + rosterRevision:'4',errorCode:'GAIN_LOCKED'})""",pot_intent["requestId"]) + assert await gain.input_value()=="-6" + # Native gesture cancellation must not send a new graph intent, + # must not alter the accepted gain, and must clear pointer capture. + cancel_before=await page.evaluate("""()=>window.__v6Test.sent.filter( + e=>e.event==='arMixConsoleIntent').length""") + box=await colored.bounding_box() + x,y=box["x"]+box["width"]/2,box["y"]+box["height"]/2 + await page.mouse.move(x,y) + await page.mouse.down() + pointer=await gain.evaluate("el=>({id:el.hasPointerCapture(1),value:el.value})") + await page.mouse.move(x,y-21,steps=4) + await gain.evaluate("""el=>{ + const id=el.onpointermove && el.hasPointerCapture(1)?1:null; + // The actual Chromium pointerId is normally 1 for page.mouse; + // derive it from the browser event if a different ID was assigned. + el.dispatchEvent(new PointerEvent('pointercancel', + {bubbles:true,pointerId:id??1})); + }""") + await page.mouse.up() + assert await page.evaluate("""()=>window.__v6Test.sent.filter( + e=>e.event==='arMixConsoleIntent').length""")==cancel_before + assert await gain.input_value()=="-6" + # Keyboard-native 0.1dB step remains exposed to assistive controls. + assert await gain.get_attribute("step")==".1" + await page.locator(".arV6SendMode").select_option("1001") + await page.locator('[data-op="SET_FADER"][data-id="7"]').evaluate( + "(el)=>{el.value='-12';el.dispatchEvent(new Event('change',{bubbles:true}))}") + send = await page.evaluate("""() => window.__v6Test.sent.filter( + x=>x.event==='arMixConsoleIntent').at(-1).payload""") + assert send["operation"] == "SET_SEND_LEVEL" and send["payload"]["sendId"] == "send-07" + await page.locator(".arV6SendMode").select_option("") + assert await page.locator('[data-op="SET_FADER"][data-id="7"]').input_value() == "-3" + await page.evaluate("""() => window.__v6FaderReference = + document.querySelector('[data-op="SET_FADER"][data-id="7"]')""") + param = snapshot(revision=4) + param["graph"]["channels"][6]["source"] = {"portId":"in:0","physicalPins":[0]} + param["graph"]["channels"][6]["inserts"].append( + {"id": "fx-07b", "name": "Second VST3", "bypassed": False}) + param["graph"]["channels"][6]["controls"]["faderDb"] = -11 + await page.evaluate("(s)=>window.__v6Test.publish('arMixConsoleSnapshot',s)", param) + assert await page.locator('[data-op="SET_FADER"][data-id="7"]').input_value() == "-11" + assert await page.evaluate("""() => window.__v6FaderReference === + document.querySelector('[data-op="SET_FADER"][data-id="7"]')""") + + # A new channel exists only after a full native roster snapshot. + page.on("dialog", lambda d: asyncio.create_task(d.accept("MONO"))) + await page.locator('[data-op="CREATE_CHANNEL"]').click() + create = await page.evaluate("""() => window.__v6Test.sent.filter( + x=>x.event==='arMixConsoleIntent').at(-1).payload""") + assert create["operation"] == "CREATE_CHANNEL" and create["targetChannelId"] is None + await page.evaluate("""id=>window.__v6Test.publish( + 'arMixConsoleAck',{requestId:id,status:'ACCEPTED',deviceEpoch:'7',graphRevision:'5',rosterRevision:'5',errorCode:''})""", create["requestId"]) + assert await page.locator("#arV6Lanes .arV6Strip").count() == 12 + updated = snapshot(revision=5, new_channel=True) + await page.evaluate("(s)=>window.__v6Test.publish('arMixConsoleSnapshot',s)", updated) + assert await page.locator("#arV6Lanes .arV6Strip").count() == 13 + assert await page.locator( + '[data-channel-id="18446744073709551610"]').count() == 1 + + # Device epoch regression is refused; no downgrade or fake readiness. + await page.evaluate("(s)=>window.__v6Test.publish('arMixConsoleSnapshot',s)", snapshot(revision=4)) + await page.evaluate("(s)=>window.__v6Test.publish('arMixConsoleSnapshot',s)", snapshot(revision=99,epoch=6)) + assert await page.locator("#arV6Lanes .arV6Strip").count() == 13 + + # Same device epoch cannot silently remap active pin masks or clock. + # A new native epoch can legitimately publish a ONE-PIN interface. + bad_clock=snapshot(revision=6,new_channel=True) + bad_clock["device"]["sampleRate"]=96000 + await page.evaluate("(s)=>window.__v6Test.publish('arMixConsoleSnapshot',s)", bad_clock) + assert "REJECTED DEVICE READBACK" in await page.locator(".arV6Message").inner_text() + assert "48000 Hz" in await page.locator(".arV6Device").inner_text() + one_pin=snapshot(revision=6,epoch=8,new_channel=True) + one_pin["device"]["enabledInputs"]=[0] + one_pin["device"]["inputEndpoints"]=one_pin["device"]["inputEndpoints"][:1] + one_pin["device"]["enabledOutputs"]=[0] + one_pin["device"]["outputEndpoints"]=one_pin["device"]["outputEndpoints"][:1] + one_pin["graph"]["channels"][1]["source"]=None + one_pin["graph"]["channels"][-1]["primaryOutId"]="out:0" + # The positive browser-host catalog is TEST ONLY. ENGINE must supply + # this exact native-scanned field for any production VST3 availability. + one_pin["graph"]["capabilities"]["supportedOps"]=OPS+[ + "ADD_INSERT","SET_LINK_GROUP","ROUTE_SELECTED_TO_GROUP","RENAME_CHANNEL"] + one_pin["catalog"]={"plugins":[ + {"id":"native:hall-reverb","name":"Hall Reverb","vendor":"Verified Vendor", + "category":"Reverb"}, + {"id":"native:parametric-eq","name":"Parametric EQ","vendor":"Verified Vendor", + "category":"EQ"}]} + await page.evaluate("(s)=>window.__v6Test.publish('arMixConsoleSnapshot',s)",one_pin) + assert await page.locator('[data-op="SET_SOURCE"][data-id="7"] option[value="in:1"]').count()==0 + assert await page.locator('[data-op="SET_SOURCE"][data-id="7"] option[value="in:0"]').count()==1 + assert await page.locator('[data-op="SET_PRIMARY_OUT"][data-id="1000"] option[value="out:1"]').count()==0 + assert await page.locator('[data-op="SET_PRIMARY_OUT"][data-id="1000"]').input_value()=="out:0" + await page.get_by_role("button",name="Verified native audio device inventory").click() + assert "NO VERIFIED ACTIVE PIN" not in await device.inner_text() + assert "IN2" not in await device.inner_text() + assert "OUT2" not in await device.inner_text() + await page.get_by_role("button",name="Close native device inventory").click() + + # PR #278 V5: quick FX is contextual and F8 manager stays separate. + fast=page.locator('[data-channel-id="7"] button[data-ui="OPEN_FX_QUICK"]') + assert await fast.count()==1 + await fast.click() + quick=page.locator("#arV6QuickPanel") + assert await quick.is_visible() + await quick.get_by_role("searchbox",name="Search quick native effects").fill("parametric") + qpick=quick.locator('button[data-quick-fx="native:parametric-eq"]') + assert await qpick.count()==1 and await qpick.is_enabled() + fx_count=await page.locator('[data-channel-id="7"] .arV6FxSlot').count() + await qpick.click() + quick_cmd=await page.evaluate("""()=>window.__v6Test.sent.filter( + x=>x.event==='arMixConsoleIntent').at(-1).payload""") + assert quick_cmd["operation"]=="ADD_INSERT" + assert quick_cmd["targetChannelId"]=="7" + assert quick_cmd["payload"]=={"pluginId":"native:parametric-eq"} + assert await quick.is_hidden() + assert await page.locator('[data-channel-id="7"] .arV6FxSlot').count()==fx_count + await page.evaluate("""id=>window.__v6Test.publish('arMixConsoleAck', + {requestId:id,status:'REJECTED',deviceEpoch:'8', + graphRevision:'6',rosterRevision:'6',errorCode:'PLUGIN_LOAD_FAILED'})""", + quick_cmd["requestId"]) + assert await page.locator('[data-channel-id="7"] .arV6FxSlot').count()==fx_count + + # F8 searches ONLY the native catalog and adds through one typed intent. + # An epoch change clears prior selection; one native ChannelId is required. + assert await page.locator(".arV6SelectionCount").get_attribute( + "data-mx-hw-legend")=="0 SEL" + assert await page.locator(".arV6SelectionCount .mx-hw-screen-reader").inner_text()=="0 SEL" + await page.keyboard.press("F8") + manager=page.locator("#arV6PluginPanel") + assert await manager.is_visible() + assert "Select exactly ONE" in await manager.inner_text() + await page.locator("#arV6PluginPanel .arV6PluginSearch").fill("hall") + assert await manager.locator("button[data-plugin-id]").count()==1 + # Favorites/recent are visual metadata only, never a DSP mutation. + count_before_star=await page.evaluate("""()=>window.__v6Test.sent.filter( + x=>x.event==='arMixConsoleIntent').length""") + await manager.locator('[data-fx-fav="native:hall-reverb"]').click() + assert await page.evaluate("""()=>window.__v6Test.sent.filter( + x=>x.event==='arMixConsoleIntent').length""")==count_before_star + await manager.get_by_role("combobox",name="Native plugin catalog filter").select_option("FAVORITES") + assert await manager.locator('button[data-plugin-id="native:hall-reverb"]').count()==1 + await manager.get_by_role("combobox",name="Native plugin catalog filter").select_option("ALL") + assert await manager.locator("button[data-plugin-id]").first.is_disabled() + await page.locator('[data-channel-id="7"] .arV6StripHead').click() + assert await manager.locator("button[data-plugin-id]").first.is_enabled() + count_fx=await page.locator('[data-channel-id="7"] .arV6FxSlot').count() + await manager.locator('button[data-plugin-id="native:hall-reverb"]').click() + load=await page.evaluate("""()=>window.__v6Test.sent.filter( + x=>x.event==='arMixConsoleIntent').at(-1).payload""") + assert load["operation"]=="ADD_INSERT" + assert load["targetChannelId"]=="7" and load["deviceEpoch"]=="8" + assert load["payload"]=={"pluginId":"native:hall-reverb"} + assert await page.locator('[data-channel-id="7"] .arV6FxSlot').count()==count_fx + assert await manager.is_hidden() + await page.evaluate("""id=>window.__v6Test.publish('arMixConsoleAck', + {requestId:id,status:'REJECTED',deviceEpoch:'8',graphRevision:'6', + rosterRevision:'6',errorCode:'PLUGIN_LOAD_FAILED'})""",load["requestId"]) + assert await page.locator('[data-channel-id="7"] .arV6FxSlot').count()==count_fx + assert "PLUGIN_LOAD_FAILED" in await page.locator(".arV6Message").inner_text() + + # PRD §9 native operator multiselect: LINK FADERS is a control + # grouping transaction, NOT a serial audio GROUP BUS. + await page.locator('[data-channel-id="2"] .arV6StripHead').click() + await page.locator('[data-channel-id="7"] .arV6StripHead').click(modifiers=["Control"]) + await page.get_by_role("button",name="Selected channels and native group actions").click() + operator=page.locator("#arV6SelectionPanel") + assert await operator.is_visible() + link=page.get_by_role("button", + name="Link selected faders using native relative control group",exact=True) + unlink=page.get_by_role("button", + name="Unlink selected faders using native relative control group",exact=True) + assert await link.is_enabled() and await unlink.is_disabled() + await link.click() + cmd=await page.evaluate("""()=>window.__v6Test.sent.filter( + x=>x.event==='arMixConsoleIntent').at(-1).payload""") + assert cmd["operation"]=="SET_LINK_GROUP" + assert cmd["targetChannelId"] is None + assert cmd["payload"]=={"channelIds":["2","7"],"linked":True} + assert await link.is_disabled() + assert "LINK" not in await page.locator('[data-channel-id="7"] .arV6Role').inner_text() + await page.evaluate("""id=>window.__v6Test.publish('arMixConsoleAck', + {requestId:id,status:'ACCEPTED',deviceEpoch:'8', + graphRevision:'7',rosterRevision:'6',errorCode:''})""",cmd["requestId"]) + assert await link.is_disabled() + accepted_link=json.loads(json.dumps(one_pin)) + accepted_link["graph"]["revision"]="7" + accepted_link["graph"]["channels"][1]["linkGroupId"]="A" + accepted_link["graph"]["channels"][6]["linkGroupId"]="A" + await page.evaluate("(s)=>window.__v6Test.publish('arMixConsoleSnapshot',s)",accepted_link) + assert "LINK A" in await page.locator('[data-channel-id="7"] .arV6Role').inner_text() + assert await unlink.is_enabled() + + # Native unlink waits for native ACK + exact snapshot, no browser + # fader-copy simulation and no optimistic sound/control group. + await unlink.click() + unlink_cmd=await page.evaluate("""()=>window.__v6Test.sent.filter( + x=>x.event==='arMixConsoleIntent').at(-1).payload""") + assert unlink_cmd["payload"]=={"channelIds":["2","7"],"linked":False} + await page.evaluate("""id=>window.__v6Test.publish('arMixConsoleAck', + {requestId:id,status:'REJECTED',deviceEpoch:'8', + graphRevision:'7',rosterRevision:'6',errorCode:'LINK_BUSY'})""",unlink_cmd["requestId"]) + assert "LINK A" in await page.locator('[data-channel-id="7"] .arV6Role').inner_text() + assert await unlink.is_enabled() + + # Route selected to native serial summing bus, not relative fader + # link. Failed request must leave both primary output paths intact. + await page.get_by_role("combobox",name="Select actual native summing Group Bus").select_option("1002") + route=page.get_by_role("button",name="Route selected channels to native summing Group Bus") + assert await route.is_enabled() + await route.click() + group_cmd=await page.evaluate("""()=>window.__v6Test.sent.filter( + x=>x.event==='arMixConsoleIntent').at(-1).payload""") + assert group_cmd["operation"]=="ROUTE_SELECTED_TO_GROUP" + assert group_cmd["payload"]=={"channelIds":["2","7"],"destinationId":"1002"} + assert await route.is_disabled() + await page.evaluate("""id=>window.__v6Test.publish('arMixConsoleAck', + {requestId:id,status:'REJECTED',deviceEpoch:'8', + graphRevision:'7',rosterRevision:'6',errorCode:'BUS_BUSY'})""",group_cmd["requestId"]) + assert await page.locator('[data-op="SET_PRIMARY_OUT"][data-id="7"]').input_value()=="1000" + assert await route.is_enabled() + await page.get_by_role("button",name="Close selected channel actions").click() + + # Direct inline rename is a canonical RENAME_CHANNEL intent. + # No optimistic name change; accepted snapshot updates text while + # preserving native fader DOM identity and physical I/O. + await page.evaluate("""()=>window.__renameFader= + document.querySelector('[data-channel-id="7"] .arV6Fader')""") + await page.locator('[data-channel-id="7"] .arV6Name').dblclick() + rename=page.locator('[data-channel-id="7"] .arV6Rename') + assert await rename.is_visible() + await rename.fill("Lead Vox") + await rename.press("Enter") + rename_cmd=await page.evaluate("""()=>window.__v6Test.sent.filter( + x=>x.event==='arMixConsoleIntent').at(-1).payload""") + assert rename_cmd["operation"]=="RENAME_CHANNEL", { + "last_intent":rename_cmd, + "ui":await page.evaluate("()=>window.__arMixV6ReadOnly()"), + "rename_visible":await page.locator('[data-channel-id="7"] .arV6Rename').count(), + "last_five":await page.evaluate("""()=>window.__v6Test.sent.filter( + x=>x.event==='arMixConsoleIntent').slice(-5).map(x=>x.payload.operation)""")} + assert rename_cmd["targetChannelId"]=="7" + assert rename_cmd["payload"]=={"name":"Lead Vox"} + assert await page.locator('[data-channel-id="7"] .arV6Name').inner_text()=="CH 07" + await page.evaluate("""id=>window.__v6Test.publish('arMixConsoleAck', + {requestId:id,status:'ACCEPTED',deviceEpoch:'8', + graphRevision:'8',rosterRevision:'6',errorCode:''})""",rename_cmd["requestId"]) + assert await page.locator('[data-channel-id="7"] .arV6Name').inner_text()=="CH 07" + accepted_name=json.loads(json.dumps(accepted_link)) + accepted_name["graph"]["revision"]="8" + accepted_name["graph"]["channels"][6]["name"]="Lead Vox" + await page.evaluate("(s)=>window.__v6Test.publish('arMixConsoleSnapshot',s)",accepted_name) + assert await page.locator('[data-channel-id="7"] .arV6Name').inner_text()=="Lead Vox" + assert await page.evaluate("""()=>window.__renameFader=== + document.querySelector('[data-channel-id="7"] .arV6Fader')""") + assert await page.locator('[data-op="SET_PRIMARY_OUT"][data-id="7"]').input_value()=="1000" + # Missing native action MUST disable grouping, while UI selection + # remains possible; no fake native operations on old fixtures. + no_group=json.loads(json.dumps(accepted_name)) + no_group["graph"]["revision"]="9" + no_group["graph"]["capabilities"]["supportedOps"]=OPS + await page.evaluate("(s)=>window.__v6Test.publish('arMixConsoleSnapshot',s)",no_group) + await page.get_by_role("button",name="Selected channels and native group actions").click() + assert await link.is_disabled() and await route.is_disabled() + + # 4 desktop widths and 3 heights: meter/fader zones aligned, MAIN pinned. + for width in (1024, 1366, 1440, 1680): + for height in (600, 768, 900): + await page.set_viewport_size({"width": width, "height": height}) + geometry = await page.evaluate("""() => { + const strips=[...document.querySelectorAll('#arV6Lanes .arV6Strip,#arV6Main .arV6Strip')]; + const boxes=strips.map(s=>{ + const a=s.querySelector('.arV6Lower').getBoundingClientRect(); + return {top:a.top,bottom:a.bottom,height:a.height}; + }); + const m=document.querySelector('#arV6Main').getBoundingClientRect(); + const v=document.querySelector('#arV6Console').getBoundingClientRect(); + const a=document.querySelector('#arV6Lanes .arV6Strip'); + return {boxes,mainLeft:m.left,mainRight:m.right,right:v.right, + masterWidth:m.width,channelWidth:a.getBoundingClientRect().width, + density:document.querySelector('#arV6Console').dataset.density}; + }""") + assert len(geometry["boxes"]) == 14 + assert max(b["top"] for b in geometry["boxes"]) - min( + b["top"] for b in geometry["boxes"]) < 1.5, (width,height,geometry) + assert geometry["mainRight"] <= geometry["right"] + 2, geometry + assert abs(geometry["masterWidth"]-geometry["channelWidth"])<1.5,(width,height,geometry) + assert geometry["density"] in ("comfort","standard","compact"),geometry + assert geometry["boxes"][0]["height"] > 65, (width,height,geometry) + if (width,height) in ((1680,900),(1366,768)): + await page.screenshot(path=f"operator-console-v6-{width}-{height}.png") + await page.locator('[data-op="CREATE_CHANNEL"]').click() + # Native support removed on new epoch: dynamic channel creation locked. + no_cap = snapshot(revision=6,epoch=8,new_channel=True) + no_cap["graph"]["capabilities"]["dynamicChannels"] = False + await page.evaluate("(s)=>window.__v6Test.publish('arMixConsoleSnapshot',s)",no_cap) + assert await page.locator('[data-op="CREATE_CHANNEL"]').is_disabled() + assert not errors, errors + # Every new editor session needs a fresh opaque requestId prefix. + # A bare counter '1' may collide with a completed native ACK after a + # WebView reconnect, even if the graph/device revision is unchanged. + first_id = sent["requestId"] + await page.reload() + await page.evaluate("(s)=>window.__v6Test.publish('arMixConsoleSnapshot',s)", snapshot()) + await page.locator('[data-op="SET_SOURCE"][data-id="7"]').select_option("in:0") + reconnected = await page.evaluate("""() => window.__v6Test.sent.filter( + x=>x.event==='arMixConsoleIntent').at(-1).payload.requestId""") + assert reconnected.startswith("gui-") and reconnected.endswith(":1") + assert reconnected != first_id + # Packet C native WIRE consumer fixture: these are synthetic native + # envelopes, NOT evidence that ENGINE #266 has installed the op. + assert await page.evaluate("()=>window.__arMixNativeWire.readAccepted()") is None + assert not await page.evaluate("""() => window.__arMixNativeWire.applyTransaction( + '7','UNPLUG',[{op:'REMOVE',edgeId:'107'}])""") + wire_native = snapshot(revision=9,epoch=9) + wire_native["graph"]["mainChannelId"]="1000" + wire_native["graph"]["capabilities"]["supportedOps"].append("APPLY_WIRE_TRANSACTION") + wire_native["graph"]["edges"]=[ + {"edgeId":str(100+i),"from":str(i),"to":"1000", + "tap":"POST_FADER","gainLinear":1.0,"enabled":True,"signalKind":"AUDIO"} + for i in range(1,11)] + await page.evaluate("(s)=>window.__v6Test.publish('arMixConsoleSnapshot',s)",wire_native) + accepted_wire=await page.evaluate("()=>window.__arMixNativeWire.readAccepted()") + assert accepted_wire["graphRevision"]=="9" and accepted_wire["mainChannelId"]=="1000" + assert len(accepted_wire["edges"])==10 and accepted_wire["edges"][6]["edgeId"]=="107" + # Focus is an exact native EdgeId. One MAIN jack cannot unplug all + # 10 sources; rejected native requests leave the accepted graph intact. + assert await page.evaluate("""() => window.__arMixNativeWire.focusedMainEdge('7').edgeId""")=="107" + assert await page.evaluate("""() => window.__arMixNativeWire.focusedMainEdge('1').edgeId""")=="101" + assert await page.evaluate("""() => window.__arMixNativeWire.focusedMainEdge('0')""") is None + # The existing OUT selector is now the canonical ROUTE_ONLY sender, + # not a second SET_PRIMARY_OUT mutation of legacy routing state. + await page.locator('[data-op="SET_PRIMARY_OUT"][data-id="7"]').select_option("2") + route=await page.evaluate("""() => window.__v6Test.sent.filter( + x=>x.event==='arMixConsoleIntent').at(-1).payload""") + assert route["operation"]=="APPLY_WIRE_TRANSACTION" + assert route["targetChannelId"]=="7" and route["payload"]=={ + "reason":"ROUTE_ONLY","changes":[ + {"op":"REMOVE","edgeId":"107"}, + {"op":"CONNECT","from":"7","to":"2","tap":"POST_FADER","gainLinear":1}]} + assert await page.evaluate("""() => window.__arMixNativeWire.focusedMainEdge('7').edgeId""")=="107" + await page.evaluate("(a)=>window.__v6Test.publish('arMixConsoleAck',a)",{ + "requestId":route["requestId"],"status":"REJECTED","deviceEpoch":"9", + "graphRevision":"9","rosterRevision":"9","errorCode":"REJECTED_CANDIDATE"}) + assert await page.locator('[data-op="SET_PRIMARY_OUT"][data-id="7"]').input_value()=="1000" + assert await page.evaluate("""() => window.__arMixNativeWire.focusedMainEdge('7').edgeId""")=="107" + # ADD_SEND retains MAIN and is also translated to the WIRE intent. + await page.locator('[data-op="ADD_SEND"][data-id="7"]').select_option("2") + send=await page.evaluate("""() => window.__v6Test.sent.filter( + x=>x.event==='arMixConsoleIntent').at(-1).payload""") + assert send["operation"]=="APPLY_WIRE_TRANSACTION" and send["payload"]=={ + "reason":"CONNECT","changes":[ + {"op":"CONNECT","from":"7","to":"2","tap":"POST_FADER","gainLinear":1}]} + await page.evaluate("(a)=>window.__v6Test.publish('arMixConsoleAck',a)",{ + "requestId":send["requestId"],"status":"REJECTED","deviceEpoch":"9", + "graphRevision":"9","rosterRevision":"9","errorCode":"REJECTED_CANDIDATE"}) + assert await page.evaluate("""() => window.__arMixNativeWire.unplugFocusedMain('7')""") + wire_command=await page.evaluate("""() => window.__v6Test.sent.filter( + x=>x.event==='arMixConsoleIntent').at(-1).payload""") + assert wire_command["operation"]=="APPLY_WIRE_TRANSACTION" + assert wire_command["deviceEpoch"]=="9" and wire_command["baseGraphRevision"]=="9" + assert wire_command["targetChannelId"]=="7" + assert wire_command["payload"]=={"reason":"UNPLUG", + "changes":[{"op":"REMOVE","edgeId":"107"}]} + # A malformed ACK with a matching requestId must not strand the + # selected native WIRE plug in PENDING or alter the accepted graph. + await page.evaluate("""(x)=>window.__v6Test.publish('arMixConsoleAck',x)""",{ + "requestId":wire_command["requestId"],"status":"ACCEPTED", + "deviceEpoch":"9","graphRevision":"BAD","rosterRevision":"9","errorCode":""}) + assert await page.evaluate("()=>window.__arMixV6ReadOnly().pendingCount")==0 + assert await page.evaluate( + "()=>window.__arMixNativeWire.focusedMainEdge('7').edgeId")=="107" + assert await page.evaluate("()=>window.__arMixNativeWire.unplugFocusedMain('7')") + wire_command=await page.evaluate("""() => window.__v6Test.sent.filter( + x=>x.event==='arMixConsoleIntent').at(-1).payload""") + # Native graph mutation cannot be committed at its old revision. + await page.evaluate("""(x)=>window.__v6Test.publish('arMixConsoleAck',x)""",{ + "requestId":wire_command["requestId"],"status":"ACCEPTED", + "deviceEpoch":"9","graphRevision":"9","rosterRevision":"9","errorCode":""}) + assert await page.evaluate( + "()=>window.__arMixV6ReadOnly().pendingCount")==0 + assert await page.evaluate( + "()=>window.__arMixNativeWire.focusedMainEdge('7').edgeId")=="107" + assert "INVALID ACK REVISION" in await page.evaluate( + "()=>window.__arMixV6ReadOnly().feedback") + assert await page.evaluate( + "()=>window.__arMixNativeWire.unplugFocusedMain('7')") + wire_command=await page.evaluate("""() => window.__v6Test.sent.filter( + x=>x.event==='arMixConsoleIntent').at(-1).payload""") + assert wire_command["baseGraphRevision"]=="9" + # An ACK alone must NEVER optimistically erase an accepted physical cable. + await page.evaluate("""(x)=>window.__v6Test.publish('arMixConsoleAck',x)""",{ + "requestId":wire_command["requestId"],"status":"ACCEPTED", + "deviceEpoch":"9","graphRevision":"10","rosterRevision":"10","errorCode":""}) + still_old=await page.evaluate("()=>window.__arMixNativeWire.readAccepted()") + assert any(e["edgeId"]=="107" for e in still_old["edges"]) + assert await page.evaluate("()=>window.__arMixV6ReadOnly().pendingCount")==0 + next_wire=snapshot(revision=10,epoch=9) + next_wire["graph"]["mainChannelId"]="1000" + next_wire["graph"]["capabilities"]["supportedOps"].append("APPLY_WIRE_TRANSACTION") + next_wire["graph"]["edges"]=[e for e in wire_native["graph"]["edges"] + if e["edgeId"]!="107"] + await page.evaluate("(s)=>window.__v6Test.publish('arMixConsoleSnapshot',s)",next_wire) + accepted_wire=await page.evaluate("()=>window.__arMixNativeWire.readAccepted()") + assert len(accepted_wire["edges"])==9, ( + "accepted revision",accepted_wire["graphRevision"], + "source edges",len(next_wire["graph"]["edges"])) + assert not any(e["edgeId"]=="107" for e in accepted_wire["edges"]) + # A malformed graph must be denied without destroying the last accepted + # edge inventory, fader, device epoch or native source mapping. + broken_wire=snapshot(revision=11,epoch=9) + broken_wire["graph"]["mainChannelId"]="1000" + broken_wire["graph"]["capabilities"]["supportedOps"].append("APPLY_WIRE_TRANSACTION") + broken_wire["graph"]["edges"]=next_wire["graph"]["edges"]+[next_wire["graph"]["edges"][0]] + await page.evaluate("(s)=>window.__v6Test.publish('arMixConsoleSnapshot',s)",broken_wire) + assert await page.evaluate("()=>window.__arMixNativeWire.readAccepted().graphRevision")=="10" + # Native-only accepted revision creates one outgoing SEND from CH7, + # not a shadow send slot. No redraw or audible claim before readback. + send_snapshot=snapshot(revision=11,epoch=9) + send_snapshot["graph"]["mainChannelId"]="1000" + send_snapshot["graph"]["capabilities"]["supportedOps"].append("APPLY_WIRE_TRANSACTION") + send_edge={"edgeId":"207","from":"7","to":"2","tap":"POST_FADER", + "gainLinear":0.5,"enabled":True,"signalKind":"AUDIO"} + send_snapshot["graph"]["edges"]=next_wire["graph"]["edges"]+[send_edge] + await page.evaluate("(s)=>window.__v6Test.publish('arMixConsoleSnapshot',s)",send_snapshot) + assert await page.evaluate("()=>window.__arMixNativeWire.focusedMainEdge('7')") is None + assert await page.locator('[data-op="SET_PRIMARY_OUT"][data-id="7"]').input_value()=="2" + native_send=page.locator('[data-channel-id="7"] .arV6Send[data-send-id="207"]') + assert await native_send.count()==1 + assert await native_send.locator('[data-op="SET_SEND_LEVEL"]').is_disabled() + assert await native_send.locator('[data-op="SET_SEND_TAP"]').is_disabled() + # MAIN replug uses an exact CONNECT to the real MAIN ChannelId. + assert await page.evaluate("()=>window.__arMixNativeWire.replugFocusedMain('7')") + replug=await page.evaluate("""() => window.__v6Test.sent.filter( + x=>x.event==='arMixConsoleIntent').at(-1).payload""") + assert replug["operation"]=="APPLY_WIRE_TRANSACTION" + assert replug["payload"]=={"reason":"REPLUG","changes":[ + {"op":"CONNECT","from":"7","to":"1000","tap":"POST_FADER","gainLinear":1}]} + assert await page.evaluate("()=>window.__arMixNativeWire.focusedMainEdge('7')") is None + await page.evaluate("(a)=>window.__v6Test.publish('arMixConsoleAck',a)",{ + "requestId":replug["requestId"],"status":"ACCEPTED","deviceEpoch":"9", + "graphRevision":"12","rosterRevision":"12","errorCode":""}) + assert await page.evaluate("()=>window.__arMixNativeWire.focusedMainEdge('7')") is None + replugged=snapshot(revision=12,epoch=9) + replugged["graph"]["mainChannelId"]="1000" + replugged["graph"]["capabilities"]["supportedOps"].append("APPLY_WIRE_TRANSACTION") + replugged["graph"]["edges"]=send_snapshot["graph"]["edges"]+[{ + "edgeId":"307","from":"7","to":"1000","tap":"POST_FADER", + "gainLinear":1.0,"enabled":True,"signalKind":"AUDIO"}] + await page.evaluate("(s)=>window.__v6Test.publish('arMixConsoleSnapshot',s)",replugged) + assert await page.evaluate("()=>window.__arMixNativeWire.focusedMainEdge('7').edgeId")=="307" + assert await page.locator('[data-op="SET_PRIMARY_OUT"][data-id="7"]').input_value()=="1000" + assert await native_send.count()==1 + assert not await page.evaluate("()=>window.__arMixNativeWire.replugFocusedMain('7')") + # A cyclic native snapshot is rejected, retaining all last accepted + # MAIN/SEND edges and fader state; no ghost routing can be painted. + cyclic=snapshot(revision=13,epoch=9) + cyclic["graph"]["mainChannelId"]="1000" + cyclic["graph"]["capabilities"]["supportedOps"].append("APPLY_WIRE_TRANSACTION") + cyclic["graph"]["edges"]=replugged["graph"]["edges"]+[ + {"edgeId":"401","from":"2","to":"7","tap":"POST_FADER", + "gainLinear":1.0,"enabled":True,"signalKind":"AUDIO"}] + await page.evaluate("(s)=>window.__v6Test.publish('arMixConsoleSnapshot',s)",cyclic) + assert await page.evaluate("()=>window.__arMixNativeWire.readAccepted().graphRevision")=="12" + assert await page.evaluate("()=>window.__arMixNativeWire.focusedMainEdge('7').edgeId")=="307" + # The actual legacy mixer from web/app.js retains original fader, + # meters, button materials and bridge.js ownership. Test V5 UX in + # browser preview, NOT as evidence of loaded native VST3. + old=await browser.new_page(viewport={"width":1366,"height":768}) + old_errors=[] + old.on("pageerror",lambda e:old_errors.append(str(e))) + await old.goto((ROOT/"web/index.html").as_uri()) + await old.locator('#mixer [data-insert="0:0"]').click() + legacy_fast=old.locator(".arV5QuickFx") + assert await legacy_fast.is_visible() + await legacy_fast.get_by_role("searchbox",name="Search quick effects").fill("reverb") + assert await legacy_fast.locator('[data-fast-plugin="Studio Reverb"]').count()==1 + await legacy_fast.get_by_role("button",name="Close quick effect picker").click() + assert await legacy_fast.is_hidden() + await old.keyboard.press("F8") + assert await old.locator("#pluginModal").is_visible() + await old.keyboard.press("Escape") + assert await old.locator("#pluginModal").is_hidden() + assert not old_errors,old_errors + await old.close() + await browser.close() + print("PASS V6: PR278 V5 old + native quick FX, F8, catalog preferences, 12 geometries") + + +if __name__ == "__main__": + asyncio.run(main()) diff --git a/tests/operator_visual_identity_v6_contract_test.mjs b/tests/operator_visual_identity_v6_contract_test.mjs new file mode 100644 index 000000000..268411097 --- /dev/null +++ b/tests/operator_visual_identity_v6_contract_test.mjs @@ -0,0 +1,22 @@ +import {readFileSync} from 'node:fs'; +import {strict as assert} from 'node:assert'; +const read=p=>readFileSync(new URL('../'+p,import.meta.url),'utf8'); +const app=read('web/app.js'),layout=read('web/mixer-layout.css'),pager=read('web/mixer-layout.js'); +const button=read('web/styles-src/20-button-180.css'),css=read('web/styles.css'); +const html=read('AR-MIX-Live-FX-Host-Standalone-v0.3.html'); +assert.match(app,/class="arChannelTopIdentity" data-identity-open/); +assert.match(app,/class="arChannelTopIcon"/);assert.match(app,/class="arChannelTopName"/); +assert.match(app,/Channel name already used/); +const renamer=app.slice(app.indexOf('function commitChannelIdentity(){'),app.indexOf("window.addEventListener('resize',positionChannelIdentity)")); +assert.doesNotMatch(renamer,/renderMixer\(/); +assert.match(renamer,/style\.setProperty\('--ch',ch\.color\)/); +for(const token of ['#0B161E','#14232C','#20313B','var(--ch) 43%','.arMainOutSummary','.master-fx-rack'])assert.ok(layout.includes(token),token); +assert.match(button,/--b180-off:#E7EFF0/);assert.match(button,/--b180-shadow-surface/); +assert.match(pager,/M14,17L9,12l5-5V17Z/);assert.match(pager,/M10,17V7l5,5l-5,5Z/); +assert.match(pager,/width="24" height="24"/); +assert.ok(css.includes(button)); +assert.ok(html.includes('')); +assert.ok(html.includes('')); +assert.ok(html.includes('')); +assert.ok(html.includes('')); +console.log('PASS: V6 native Console material, dual identity, guarded inline rename, bank arrows and standalone parity'); diff --git a/tests/ui_smoke.py b/tests/ui_smoke.py index 87934d184..37437307a 100644 --- a/tests/ui_smoke.py +++ b/tests/ui_smoke.py @@ -362,37 +362,39 @@ async def passive_hover_is_inert(selector): p=page.locator(f'[data-pan="{idx}"]') assert await p.get_attribute('aria-orientation')=='horizontal' assert await p.locator('.pan-thumb').count()==1 - # Button 180: SOLID base and exact layered shadow (never PNG/gradient). + # V5 approved physical key: one knockout mask, no duplicate text. for selector in ['[data-mute="0"]','[data-solo="0"]','[data-hpf="0"]']: v=await page.locator(selector).first.evaluate("""e=>{ - const s=getComputedStyle(e);return { - image:s.backgroundImage,shadow:s.boxShadow, - color:s.backgroundColor,transition:s.transitionDuration} + const s=getComputedStyle(e),face=e.querySelector('svg.mx-hw-face'); + return {skin:e.classList.contains('mx-hw-key'),old:e.classList.contains('btn-180'), + bg:s.backgroundImage,shadow:s.boxShadow,filter:s.filter, + masks:face?.querySelectorAll('mask').length, + texts:face?.querySelectorAll('mask text').length, + overlaid:face?.querySelectorAll(':scope > text').length, + gap:getComputedStyle(e,'::before').opacity}; }""") - assert v['image']=='none' and v['color'].startswith('rgb('), (selector,v) - assert v['shadow'].count('rgb')>=6,(selector,v) - assert v['transition'].split(', ')[0]=='0.045s',(selector,v) - style=await page.locator('[data-mute="0"]').evaluate("""e=>{ - const s=getComputedStyle(e);return {dur:s.transitionDuration,border:s.borderTopWidth, - radius:s.borderTopLeftRadius,shadow:s.boxShadow}; - }""") - assert style['border']=='1px' and style['radius']=='3px',style - # Inter is part of the app payload; no network font or fallback is allowed. + assert v['skin'] and not v['old'] and 'gradient' in v['bg'],(selector,v) + assert v['masks']==1 and v['texts']==1 and v['overlaid']==0,(selector,v) + assert v['gap']=='0' and v['filter']=='none',(selector,v) + # Inter remains embedded for unrelated app typography. assert await page.evaluate("""async()=>{ await document.fonts.load('600 12px "ArSonMix Inter"'); return document.fonts.check('600 12px "ArSonMix Inter"')&& getComputedStyle(document.querySelector('.strip-name')).fontFamily.includes('ArSonMix Inter'); }"""),'Embedded Inter font was not applied' - assert [round(float(v.rstrip('s')),3) for v in style['dur'].split(', ')]==[.045,.045,0,0],style - # Hover in production does not create a filter, while diagnostic - # baseline restores brightness to permit same-PC performance A/B. + # No passive GPU filter even under the old diagnostic baseline mode. utility=page.locator('[data-hpf="0"]') await utility.hover() assert await utility.evaluate("(e)=>getComputedStyle(e).filter")=='none' await page.evaluate("document.documentElement.dataset.mixperf='baseline'") - assert 'brightness(1.32)' in await utility.evaluate("(e)=>getComputedStyle(e).filter") - await page.evaluate("delete document.documentElement.dataset.mixperf") assert await utility.evaluate("(e)=>getComputedStyle(e).filter")=='none' + await page.evaluate("delete document.documentElement.dataset.mixperf") + # The unified M4 CONSOLE is tested in mixer_io_smoke.py, including + # a physically visible pinned MAIN, native IN/FX/SEND/OUT controls, + # horizontal banking and deliberately scrollable full 6-slot VST racks. + # This historical geometry test explicitly checks the retained FX-only + # engineering layer, where all six slots still fit without scroll. + await page.locator('[data-mix-mode="FX"]').click() # Visual-architecture regression: four intentionally different hardware # families, FX slots recessed rather than taking on button-cap artwork. # GUI target: MASTER is the 11th strip, not a floating right rail. @@ -446,8 +448,8 @@ async def passive_hover_is_inert(selector): assert await page.locator('.right-rail,.master-tabs,.head').count()==0 assert await page.locator('[data-master-output]').count()==0 assert await page.locator('.master-stereo-badge,.master-route-label,.fader-tools.master-tools').count()==0 - assert await page.locator('#masterMode.btn-180.is-stereo').count()==1 - assert await page.locator('#masterMode').inner_text()=='STEREO' + assert await page.locator('#masterMode.mx-hw-key.is-stereo').count()==1 + assert await page.locator('#masterMode svg.mx-hw-face mask text').text_content()=='STEREO' assert await page.locator('#masterMode').get_attribute('aria-pressed')=='false' # Streaming output panel has only two useful readouts. assert await page.locator('#masterLeft .master-analysis .master-info-row').count()==2 @@ -469,7 +471,7 @@ async def passive_hover_is_inert(selector): assert await page.locator('.left-rail [data-sof-toggle]').count()==1 assert await page.locator('.toolbar-actions .fx-nav,.left-rail .fx-nav').count()==0 assert await page.locator('.left-rail .pushable,.left-rail .front,.left-rail .edge,.left-rail .shadow').count()==0 - assert await page.locator('.left-rail [data-mix-mode]').count()==3 + assert await page.locator('.left-rail [data-mix-mode]').count()==4 assert await page.locator('.left-rail #audioSetupBtn').count()==1 assert await page.locator('.toolbar-actions #audioSetupBtn').count()==0 assert await page.locator('.left-rail [data-my-sounds],.left-rail [data-plugin-manager],.left-rail #arSignalOpen').count()==3 @@ -485,12 +487,14 @@ async def passive_hover_is_inert(selector): mute:grab('[data-mute="0"]'), utility:grab('[data-hpf="0"]')}; }""") - for key in ('rail','mute','utility'): - assert style[key]['face']=='rgb(203, 209, 209)',(key,style) + for key in ('rail',): + assert style[key]['face']=='rgb(231, 239, 240)',(key,style) 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(203, 209, 209)' and style['selected']['face']=='rgb(178, 232, 160)',style + for key in ('mute','utility'): + assert 'gradient' in style[key]['image'] and style[key]['radius']=='5px',(key,style) + assert style['nav']['face']=='rgb(231, 239, 240)' and style['selected']['face']=='rgb(178, 232, 160)',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 @@ -499,7 +503,7 @@ async def passive_hover_is_inert(selector): devOff=await device.evaluate("""e=>{const s=getComputedStyle(e),t=getComputedStyle(e.querySelector('#headerDriver')), r=e.getBoundingClientRect();return {face:s.backgroundColor,ink:t.color,shadow:s.boxShadow,rect:r.toJSON(), pressed:e.classList.contains('on'),backgroundImage:s.backgroundImage}}""") - assert devOff['face']==style['rail']['face']=='rgb(203, 209, 209)',devOff + assert devOff['face']==style['rail']['face']=='rgb(231, 239, 240)',devOff assert devOff['ink']=='rgb(23, 34, 41)' and devOff['backgroundImage']=='none',devOff assert not devOff['pressed'],devOff await device.evaluate("(e)=>e.classList.add('on')") @@ -511,10 +515,10 @@ async def passive_hover_is_inert(selector): assert all(abs(devOff['rect'][k]-devOn['rect'][k])<.2 for k in ('x','y','width','height')),(devOff,devOn) await page.screenshot(path=str(project/'device-green-on-palette-review.png'),full_page=True) await device.evaluate("(e)=>e.classList.remove('on')") - await page.wait_for_function("""()=>getComputedStyle(document.querySelector('.spec-device')).backgroundColor==='rgb(203, 209, 209)'""") + await page.wait_for_function("""()=>getComputedStyle(document.querySelector('.spec-device')).backgroundColor==='rgb(231, 239, 240)'""") assert all(style[key]['spanTransform']=='none' for key in ('nav','rail','selected')),style assert await page.locator('[data-hpf="0"]').evaluate( - "(e)=>getComputedStyle(e).boxShadow.includes('5px 5px 2px -1px')"),style + "(e)=>e.classList.contains('mx-hw-key')&&getComputedStyle(e).boxShadow.includes('inset')"),style # Real 1px tactile travel; no text scaling or width/height changes. preset=page.locator('[data-preset="Clean Vocal"]') pre=await preset.evaluate("(e)=>e.getBoundingClientRect().toJSON()") @@ -536,11 +540,14 @@ async def passive_hover_is_inert(selector): assert active['face']=='rgb(237, 184, 223)' and active['transform']=='matrix(1, 0, 0, 1, 0, 0)',active assert shared_shadow_shape(active['shadow'])==shared_shadow_shape(style['rail']['shadow']),active 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. + # HPF processing: teal lamp inside V5 knockout (not face-color repaint). await page.locator('[data-hpf="0"]').click() - await page.wait_for_timeout(190) - cyan=await page.locator('[data-hpf="0"]').evaluate("(e)=>getComputedStyle(e).backgroundColor") - assert cyan=='rgb(148, 232, 237)',cyan + hpf=await page.locator('[data-hpf="0"]').evaluate("""e=>({ + led:getComputedStyle(e).getPropertyValue('--mx-hw-led').trim(), + gap:getComputedStyle(e,'::before').opacity, + lamp:getComputedStyle(e.querySelector('.mx-hw-lamp')).opacity + })""") + assert hpf=={'led':'87,211,189','gap':'1','lamp':'1'},hpf 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() @@ -549,7 +556,7 @@ async def passive_hover_is_inert(selector): const off=document.querySelector('[data-view="MIX"]'); return on.classList.contains('selected') && !off.classList.contains('selected') && getComputedStyle(on).backgroundColor==='rgb(178, 232, 160)' - && getComputedStyle(off).backgroundColor==='rgb(203, 209, 209)'; + && getComputedStyle(off).backgroundColor==='rgb(231, 239, 240)'; }""") nav=page.locator('[data-view="FX RACK"]') navBefore=await nav.evaluate("(e)=>e.getBoundingClientRect().toJSON()") @@ -598,18 +605,25 @@ async def passive_hover_is_inert(selector): assert not railGeometry['emptyControls'],railGeometry assert all(btn['width']>=40 and btn['height']>=25 for btn in railGeometry['buttons']),railGeometry await page.screenshot(path=str(project/'mixer-master-dual-metric-left-rail.png'),full_page=True) - off_mute=await page.locator('[data-mute="0"]').evaluate("(e)=>getComputedStyle(e).getPropertyValue('--b180-color').trim()") + off_mute=await page.locator('[data-mute="0"]').evaluate("(e)=>getComputedStyle(e,'::before').opacity") + assert off_mute=='0' await page.locator('[data-mute="0"]').click() - mute_on=await page.locator('[data-mute="0"]').evaluate("(e)=>getComputedStyle(e).getPropertyValue('--b180-color').trim()") - assert mute_on!=off_mute and await page.locator('[data-mute="0"]').get_attribute('aria-pressed')=='true' + mute_on=await page.locator('[data-mute="0"]').evaluate("""e=>({ + led:getComputedStyle(e).getPropertyValue('--mx-hw-led').trim(), + gap:getComputedStyle(e,'::before').opacity})""") + assert mute_on=={'led':'255,64,85','gap':'1'} + assert await page.locator('[data-mute="0"]').get_attribute('aria-pressed')=='true' await page.locator('[data-mute="0"]').click() await page.locator('[data-solo="0"]').click() - solo_on=await page.locator('[data-solo="0"]').evaluate("(e)=>getComputedStyle(e).getPropertyValue('--b180-color').trim()") - assert solo_on!=mute_on + solo_on=await page.locator('[data-solo="0"]').evaluate("""e=>({ + led:getComputedStyle(e).getPropertyValue('--mx-hw-led').trim(), + gap:getComputedStyle(e,'::before').opacity})""") + assert solo_on=={'led':'255,208,44','gap':'1'} await page.locator('[data-solo="0"]').click() await page.locator('[data-hpf="0"]').click() - hpf_on=await page.locator('[data-hpf="0"]').evaluate("(e)=>getComputedStyle(e).getPropertyValue('--b180-color').trim()") - assert hpf_on not in (mute_on,solo_on,off_mute) + hpf_on=await page.locator('[data-hpf="0"]').evaluate( + "(e)=>getComputedStyle(e).getPropertyValue('--mx-hw-led').trim()") + assert hpf_on=='87,211,189' await page.locator('[data-hpf="0"]').click() await page.screenshot(path=str(project/'mixer-crystal-candy-review.png'),full_page=True) await page.screenshot(path=str(project/'mixer-crystal-depth-glow-review.png'),full_page=True) @@ -657,7 +671,7 @@ async def passive_hover_is_inert(selector): selection:getComputedStyle(main,'::before').borderTopWidth, masterRows:[...master.children].map(x=>({cls:x.className,height:x.getBoundingClientRect().height}))}; }""") - assert architecture['small']=='none',architecture + assert 'gradient' in architecture['small'],architecture assert abs(architecture['mainFader']['height']-architecture['masterFader']['height'])<=2,architecture assert architecture['nav']=='none',architecture assert architecture['long']=='none',architecture @@ -691,38 +705,27 @@ async def passive_hover_is_inert(selector): assert smallRail['footerBottom']<=smallRail['bottom']+1,smallRail assert all(b['width']>35 for b in smallRail['buttons']),smallRail assert await page.locator('.strip').count()==11 - # The user's requirement: the SAME size/position before, during, and after toggle. - # OFF/ON use the exact same shadow-layer geometry, differing only in palette. + # V5 state changes only internal lamp and 1–2px occluded light. + # Physical key outer geometry is immutable: no old depressed BTN-180 layers. def switch_state(selector): return page.locator(selector).evaluate("""e=>{ - const s=getComputedStyle(e),r=e.getBoundingClientRect(); - return {t:s.transform,shadow:s.boxShadow,color:s.backgroundColor, - ink:s.color,left:r.left,top:r.top,width:r.width,height:r.height, - selected:e.classList.contains('active')||e.classList.contains('selected')}; + const s=getComputedStyle(e),r=e.getBoundingClientRect(),svg=e.querySelector('svg.mx-hw-face'); + return {t:s.transform,shadow:s.boxShadow,gap:getComputedStyle(e,'::before').opacity, + lamp:getComputedStyle(svg.querySelector('.mx-hw-lamp')).opacity, + left:r.left,top:r.top,width:r.width,height:r.height, + selected:e.classList.contains('active')}; }""") def same_rect(a,b): return all(abs(a[k]-b[k])<=.2 for k in ('left','top','width','height')) off=await switch_state('[data-mute="0"]') - assert off['t']=='matrix(1, 0, 0, 1, 0, 0)',off await page.locator('[data-mute="0"]').click() - await page.wait_for_function("""()=>{ - const e=document.querySelector('[data-mute="0"]'); - return e.classList.contains('active')&&getComputedStyle(e).boxShadow.includes('inset'); - }""",timeout=2500) - await page.wait_for_timeout(65) # 45ms palette, immediate pressed displacement on=await switch_state('[data-mute="0"]') - assert on['selected'] and shared_shadow_shape(on['shadow'])==shared_shadow_shape(off['shadow']),(off,on) - assert on['color']!=off['color'],(off,on) - assert on['t']==off['t'] and same_rect(off,on),(off,on) - assert off['color']=='rgb(203, 209, 209)' and off['ink']=='rgb(23, 34, 41)',(off,on) - assert on['ink']!=off['ink'],(off,on) - assert on['shadow'].startswith('rgba(0, 0, 0, 0.18)'),on + assert on['selected'] and off['gap']=='0' and on['gap']=='1',(off,on) + assert off['lamp']=='0' and on['lamp']=='1',(off,on) + assert off['shadow']==on['shadow'] and off['t']==on['t'] and same_rect(off,on),(off,on) await page.locator('[data-mute="0"]').click() - await page.mouse.move(1,1) # OFF after pointer leaves, not the intentional glossy hover state - await page.wait_for_timeout(190) back=await switch_state('[data-mute="0"]') - assert back['t']==off['t'] and same_rect(off,back),(off,back) - assert back['shadow']==off['shadow'],(off,back) + assert back['gap']=='0' and same_rect(off,back),(off,back) # Source A/B controls are gone; fader travel expands into their old space. assert await page.locator('[data-send]').count()==0 assert await page.locator('#mixer > .strip:not(.master-strip) .fader-tools').count()==0 @@ -756,51 +759,28 @@ def same_rect(a,b): and 'linear-gradient' in x['slitPaint'] and x['capWidth']==36 for x in fader_recess),fader_recess - # Both resting states share depth; while pointer is down only, cap sinks 1px - # with a stronger inner shadow and unchanged width/height/layout slot. + # Press travel applies only to the SVG keycap; housing stays stationary. btn=page.locator('[data-mute="0"]') - before=await btn.evaluate("""e=>({ - shadow:getComputedStyle(e).boxShadow, - before:getComputedStyle(e,'::before').content, - after:getComputedStyle(e,'::after').content})""") - assert before['before']=='none' and before['after']=='none',before press_before=await btn.evaluate("(e)=>e.getBoundingClientRect().toJSON()") await btn.hover() await page.mouse.down() - await page.wait_for_timeout(190) during=await btn.evaluate("""e=>({ - t:getComputedStyle(e).transform,rect:e.getBoundingClientRect().toJSON(), - shadow:getComputedStyle(e).boxShadow})""") - assert during['t']=='matrix(1, 0, 0, 1, 0, 1)',during - assert abs(during['rect']['y']-press_before['y']-1)<=.2,during - assert all(abs(during['rect'][k]-press_before[k])<=.2 for k in ('x','width','height')),during - assert during['shadow']!=before['shadow'] and '0.5' in during['shadow'],(before,during) + outer:getComputedStyle(e).transform, + face:getComputedStyle(e.querySelector('svg.mx-hw-face')).transform, + rect:e.getBoundingClientRect().toJSON() + })""") + assert during['outer'] in ('none','matrix(1, 0, 0, 1, 0, 0)'),during + assert during['face']=='matrix(1, 0, 0, 1, 0, 1)',during + assert abs(during['rect']['y']-press_before['y'])<=.2,during await page.mouse.up() - await page.wait_for_timeout(190) assert await btn.get_attribute('aria-pressed')=='true' - released_on=await btn.evaluate("""e=>({ - t:getComputedStyle(e).transform, shadow:getComputedStyle(e).boxShadow, - rect:e.getBoundingClientRect().toJSON() - })""") - assert released_on['t']=='matrix(1, 0, 0, 1, 0, 0)',released_on - assert abs(released_on['rect']['y']-press_before['y'])<=.2,released_on - assert shared_shadow_shape(released_on['shadow'])==shared_shadow_shape(before['shadow']),(before,released_on) - # Re-press while already ON; it must have the same 1px tactile travel. await btn.hover() await page.mouse.down() - await page.wait_for_timeout(120) - pressed_on=await btn.evaluate("""e=>({ - t:getComputedStyle(e).transform,shadow:getComputedStyle(e).boxShadow, - rect:e.getBoundingClientRect().toJSON() - })""") - assert pressed_on['t']=='matrix(1, 0, 0, 1, 0, 1)',pressed_on - assert abs(pressed_on['rect']['y']-press_before['y']-1)<=.2,pressed_on - assert all(abs(pressed_on['rect'][k]-press_before[k])<=.2 for k in ('x','width','height')),pressed_on - assert '0.5' in pressed_on['shadow'],pressed_on + pressed_on=await btn.evaluate( + "(e)=>getComputedStyle(e.querySelector('svg.mx-hw-face')).transform") + assert pressed_on=='matrix(1, 0, 0, 1, 0, 1)',pressed_on await page.mouse.up() - await page.wait_for_timeout(190) assert await btn.get_attribute('aria-pressed')=='false' - assert await btn.evaluate("(e)=>getComputedStyle(e).transform")=='matrix(1, 0, 0, 1, 0, 0)' released_off=await btn.evaluate("(e)=>e.getBoundingClientRect().toJSON()") assert abs(released_off['y']-press_before['y'])<=.2,released_off widths=await page.evaluate("""()=>{ @@ -867,23 +847,24 @@ def same_rect(a,b): await page.locator('[data-view="MIX"]').click() assert await page.locator('[data-fxpower="0:0"]').get_attribute('aria-pressed')=='true' assert await page.evaluate('durableSession().bypassed["0:0"]') is False - # A real two-state BTN-180 control: blue STEREO, red MONO, durable state. + # Master mode is also V5; MONO/STEREO replace only its SINGLE mask legend. mode=page.locator('#masterMode') - blue=await mode.evaluate("(e)=>getComputedStyle(e).getPropertyValue('--b180-color').trim()") - assert blue=='#9dd2f0',blue + assert await mode.evaluate("(e)=>e.classList.contains('mx-hw-key')") await mode.click() - red=await mode.evaluate("(e)=>getComputedStyle(e).getPropertyValue('--b180-color').trim()") - assert await mode.inner_text()=='MONO' and await mode.get_attribute('aria-pressed')=='true' - assert red=='#f99aa4' and red!=blue,red + await page.wait_for_function("""()=>document.querySelector('#masterMode') + .querySelector('svg.mx-hw-face mask text')?.textContent==='MONO'""") + assert await mode.get_attribute('aria-pressed')=='true' assert await page.evaluate('durableSession().masterMono') is True await mode.click() - assert await mode.inner_text()=='STEREO' and await mode.get_attribute('aria-pressed')=='false' + await page.wait_for_function("""()=>document.querySelector('#masterMode') + .querySelector('svg.mx-hw-face mask text')?.textContent==='STEREO'""") + assert await mode.get_attribute('aria-pressed')=='false' assert await page.evaluate('durableSession().masterMono') is False await page.locator('#masterMute').click() - assert await page.locator('#masterMute').inner_text()=='MUTE' assert await page.locator('#masterMute').get_attribute('aria-pressed')=='true' + assert await page.locator('#masterMute svg.mx-hw-face mask text').text_content()=='MUTE' await page.locator('#masterMute').click() - assert await page.locator('#masterMute').inner_text()=='MUTE' + assert await page.locator('#masterMute').get_attribute('aria-pressed')=='false' # Hover and active feedback stays visual and does not change native fader geometry. cap0=page.locator('[data-fader="0"] .cap') await cap0.hover() @@ -970,8 +951,14 @@ def same_rect(a,b): assert await page.evaluate('durableSession().masterBypassed["0"]') is True await page.locator('[data-master-power="0"]').click() assert await page.locator('[data-master-power="0"]').get_attribute('aria-pressed')=='true' - # Master insert selection can open an editor and replace the selected FX. + # PR #278 V5: clicking a real MASTER insert opens the compact + # contextual quick picker; F8 remains the separate full manager. await page.locator('[data-master-insert="0"]').click() + assert await page.locator('.arV5QuickFx').is_visible() + assert 'MAIN' in await page.locator('.arV5QuickHead').inner_text() + await page.locator('.arV5QuickFx [data-fast-close]').click() + assert await page.locator('.arV5QuickFx').is_hidden() + await page.keyboard.press('F8') assert await page.locator('#pluginModal').is_visible() await page.locator('#closeBrowser').click() assert await page.locator('#pluginModal').is_hidden() @@ -1124,11 +1111,14 @@ def same_rect(a,b): assert all(abs(v['unit']-14)<.3 and abs(v['meter']-14)<.3 and abs(v['fill']-10)<.6 and v['clip'] for v in vu_geometry),vu_geometry assert len(set(v['gradient'] for v in vu_geometry))==1, 'VU palette must match across all L/R/mono bars' await page.locator('#masterMode').click() - assert await page.locator('#masterMode').inner_text()=='MONO' - mono_text=await page.locator('#masterMode').evaluate('(e)=>({color:getComputedStyle(e).color,shadow:getComputedStyle(e).textShadow})') - assert mono_text['color']=='rgb(20, 16, 20)' and mono_text['shadow']=='none',mono_text + assert await page.locator('#masterMode svg.mx-hw-face mask text').text_content()=='MONO' + mono_text=await page.locator('#masterMode').evaluate("""e=>({ + led:getComputedStyle(e).getPropertyValue('--mx-hw-led').trim(), + glow:getComputedStyle(e.querySelector('.mx-hw-lamp')).opacity + })""") + assert mono_text=={'led':'210,225,234','glow':'1'},mono_text await page.locator('#masterMode').click() - assert await page.locator('#masterMode').inner_text()=='STEREO' + assert await page.locator('#masterMode svg.mx-hw-face mask text').text_content()=='STEREO' # Manual peak-hold reset must be deterministic: cancel the browser's # unrelated 25Hz demo producer before injecting explicit levels. Without # this, a live demo RAF can repopulate peakHold after RESET and make the @@ -1157,8 +1147,14 @@ def same_rect(a,b): await page.locator('#masterLeft .master-ch-id').click() assert await page.locator('#masterLeft').evaluate('(e)=>e.classList.contains("selected")') assert await page.locator('[data-strip="0"]').evaluate('(e)=>!e.classList.contains("selected")') - await page.locator('[data-strip="0"] .ch-id').click() + # CH number selects the strip; the adjacent name/icon deliberately opens editing. + await page.locator('[data-strip="0"] .arChannelNumber').click() assert await page.locator('#masterLeft').evaluate('(e)=>!e.classList.contains("selected")') + assert await page.locator('#channelIdentity').evaluate('(e)=>e.classList.contains("hidden")') + await page.locator('[data-strip="0"] .arChannelTopIdentity').click() + assert await page.locator('#channelIdentity').is_visible() + await page.locator('#identityCancel').click() + assert await page.locator('#channelIdentity').evaluate('(e)=>e.classList.contains("hidden")') pan=page.locator('[data-pan="0"]') await pan.focus() @@ -1188,28 +1184,24 @@ def same_rect(a,b): assert await pan.get_attribute('aria-valuenow')=='0' assert not await page.locator('#editor').is_visible(),'PAN double click opened editor' - # Same Button 180 construction, distinct solid color for each ON state. - async def image_for(selector): - return await page.locator(selector).first.evaluate( - '(b) => getComputedStyle(b).backgroundColor') - off_mute=await image_for('[data-mute="0"]') - assert off_mute.startswith('rgb(') - assert off_mute == await image_for('[data-solo="0"]') + # Same V5 material on all buttons, independent semantic LED and lamp. + async def led_state(selector): + return await page.locator(selector).first.evaluate("""b=>({ + led:getComputedStyle(b).getPropertyValue('--mx-hw-led').trim(), + gap:getComputedStyle(b,'::before').opacity, + lamp:getComputedStyle(b.querySelector('.mx-hw-lamp')).opacity + })""") + off_mute=await led_state('[data-mute="0"]') + off_solo=await led_state('[data-solo="0"]') + assert off_mute['gap']==off_solo['gap']=='0' await page.locator('[data-mute="0"]').click() - assert await page.locator('[data-mute="0"]').get_attribute('aria-pressed') == 'true' - # 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("""()=>{ - return [...document.querySelectorAll('[data-mute="0"],[data-solo="0"]')].map(e=>({ - cls:e.className,background:getComputedStyle(e).backgroundColor, - token:getComputedStyle(e).getPropertyValue('--b180-color'), - bgImage:getComputedStyle(e).backgroundImage - })) - }""") + assert await page.locator('[data-mute="0"]').get_attribute('aria-pressed')=='true' + mute_on=await led_state('[data-mute="0"]') + assert mute_on=={'led':'255,64,85','gap':'1','lamp':'1'},mute_on await page.locator('[data-solo="0"]').click() - assert await page.locator('[data-solo="0"]').get_attribute('aria-pressed') == 'true' - 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"]') + assert await page.locator('[data-solo="0"]').get_attribute('aria-pressed')=='true' + solo_on=await led_state('[data-solo="0"]') + assert solo_on=={'led':'255,208,44','gap':'1','lamp':'1'},solo_on await page.locator('[data-mute="0"]').click() await page.locator('[data-solo="0"]').click() await page.locator('#masterMute').click() @@ -1543,7 +1535,7 @@ async def image_for(selector): assert 'KEEP IN STUDIO' in manager_hierarchy[0]['captions'],manager_hierarchy assert 'ArSonMix Inter' in ui_polish['font'],ui_polish - assert 'var(--b180-off' in ui_polish['resting'] or ui_polish['resting']=='#cbd1d1',ui_polish + assert 'var(--b180-off' in ui_polish['resting'] or ui_polish['resting']=='#E7EFF0',ui_polish await native.locator('#nativePluginManager [data-close-modal]').click() await native.locator('[data-strip="0"] .rack [data-plugin-picker="1"]').first.click() picker_equal=await native.evaluate("""()=>{ diff --git a/web/app.js b/web/app.js index dfc9ef649..54b9ce586 100644 --- a/web/app.js +++ b/web/app.js @@ -11,7 +11,7 @@ const raw=[ ['Backing','♫',['EQ','Reverb'],-3.6,-25], ['Guitar','♬',['EQ','Compressor','Delay'],-7.9,30], ['Keyboard','▥',['EQ','Reverb'],-14.2,0], - ['FX Return','◎',['Reverb'],-5.1,0] + ['Input 10','♩',['Reverb'],-5.1,0] ]; const channels=raw.map((a,i)=>({id:i+1,name:a[0],icon:a[1],color:colors[i],inserts:[...a[2]],fader:a[3],pan:a[4],trim:0,mute:false,solo:false,pre:false,hpf:i%4!==0,stereo:i>=6})); let currentChannel=0, masterSelected=false, view='MIX', sceneIdx=0, timer=0; @@ -266,19 +266,38 @@ function closeChannelIdentity(){ document.querySelectorAll('.strip.identity-editing').forEach(el=>el.classList.remove('identity-editing')); } function commitChannelIdentity(){ - if(editingChannel<0)return;const index=editingChannel; - const name=$('identityName').value.trim().replace(/\s+/g,' ').slice(0,26); + if(editingChannel<0)return; + const index=editingChannel, name=$('identityName').value.trim().replace(/\s+/g,' ').slice(0,26); if(!name){flash('Enter a channel name');$('identityName').focus();return} - channels[index].name=name;channels[index].icon=channelIcons.includes(editingIcon)?editingIcon:'♩'; - channels[index].color=channelPalette.includes(editingColor)?editingColor:colors[index]; - closeChannelIdentity();currentChannel=index;renderMixer(); + if(channels.some((c,i)=>i!==index&&c.name.trim().toLowerCase()===name.toLowerCase())){ + flash('Channel name already used');$('identityName').focus();return; + } + const ch=channels[index]; + ch.name=name;ch.icon=channelIcons.includes(editingIcon)?editingIcon:'♩'; + ch.color=channelPalette.includes(editingColor)?editingColor:colors[index]; + closeChannelIdentity();currentChannel=index; + // UI identity is not a native graph change. Do not remount any live FX/fader node. + const strip=document.querySelector('#mixer [data-strip="'+index+'"]'); + if(strip){ + strip.style.setProperty('--ch',ch.color); + for(const [sel,val] of [['.arChannelTopName',ch.name],['.arChannelTopIcon',ch.icon], + ['.strip-name .strip-caption',ch.name],['.strip-name .track-icon',ch.icon]]){ + const item=strip.querySelector(sel);if(item)item.textContent=val; + } + strip.querySelector('[data-identity-open]')?.setAttribute('aria-label','Edit '+ch.name+' name, icon and color'); + strip.querySelector('[data-editstrip]')?.setAttribute('aria-label','Double-click to edit '+ch.name+' name, icon and color'); + strip.querySelector('[data-fader]')?.setAttribute('aria-label',ch.name+' fader'); + const meter=strip.querySelector('.vu-bank'); + if(meter)meter.setAttribute('aria-label',ch.name+(ch.stereo?' stereo left and right meters':' mono meter')); + } + createSide(); if(view==='FX RACK')renderRackWorkspace(); - persistSession();flash('Channel identity updated'); + persistSession();flash('Channel label updated · native audio route unchanged'); } window.addEventListener('resize',positionChannelIdentity); $('mixer').addEventListener('scroll',positionChannelIdentity,{passive:true}); function makeStrip(ch,i){let inserts=ch.inserts.slice(0,6);while(inserts.length<6) inserts.push('');return `
-
${i+1}
${inserts.map((n,j)=>`
${n?``:''}
`).join('')}
+
CH ${String(i+1).padStart(2,'0')}
${inserts.map((n,j)=>`
${n?``:''}
`).join('')}
TRIM
dB
${fmt(ch.trim)}
${knobMarkup('trim',i,ch.trim,'Trim')}
${panMarkup(ch,i)}
${panText(ch.pan)}
${fmt(ch.fader)}
${ch.stereo?meterUnit(String(i)+'L','L')+meterUnit(String(i)+'R','R'):meterUnit(String(i),'')}${meterScaleMarkup()}
${faderScaleMarkup()}
@@ -305,7 +324,7 @@ function syncStripFormat(i,format){ window.__arMixSyncAcceptedChannelFormat=syncStripFormat; function renderMixer(){ const x=$('mixer'),scroll=x.scrollLeft; - x.innerHTML=channels.map(makeStrip).join('')+'
'; + x.innerHTML=channels.map(makeStrip).join('')+'
'; renderMaster();x.scrollLeft=scroll;createSide(); } let masterGain=-.1,masterPan=0,masterMute=false,masterMono=false,phones=-12,masterInserts=['Studio EQ','Brickwall Limiter'],masterBypassed={},pendingMasterSlot=null; @@ -327,7 +346,7 @@ const meterPercentToDbfs=p=>clamp(p,0,100)*.6-60; function meterUnit(key,label){return `
`} function renderMaster(){ const host=$('masterLeft');if(!host)return; - host.innerHTML=`
MASTER
+ host.innerHTML=`
MAIN
${masterFxRows()}
@@ -449,6 +468,11 @@ document.addEventListener('click',e=>{const b=e.target.closest('button,[data-cho if(b.dataset.pluginManager!==undefined){flash('Plugin Manager is available in the Windows desktop app');return} if(b.dataset.mySounds!==undefined){flash('Native VST3 presets are available in the Windows desktop app');return} if(b.dataset.choose!==undefined){chooseChannel(+b.dataset.choose);return} + if(b.dataset.identityOpen!==undefined){ + const index=Number(b.dataset.identityOpen); + if(Number.isInteger(index)&&index>=0&&index=channels.length)return; @@ -464,11 +488,11 @@ document.addEventListener('click',e=>{const b=e.target.closest('button,[data-cho if(b.dataset.mute!==undefined){toggleState(+b.dataset.mute,'mute');return}if(b.dataset.solo!==undefined){toggleState(+b.dataset.solo,'solo');return} if(b.dataset.pre!==undefined){let i=+b.dataset.pre;channels[i].pre=!channels[i].pre;b.classList.toggle('active');send('phase',channels[i].pre,i);return} if(b.dataset.hpf!==undefined){let i=+b.dataset.hpf;channels[i].hpf=!channels[i].hpf;b.classList.toggle('active');send('hpf',channels[i].hpf,i);return} - if(b.dataset.masterInsert!==undefined){pendingMasterSlot=+b.dataset.masterInsert;openPluginBrowser(currentChannel,true);return} + if(b.dataset.masterInsert!==undefined){pendingMasterSlot=+b.dataset.masterInsert;if(!window.__JUCE__?.backend?.emitEvent)openQuickFx(currentChannel,pendingMasterSlot,b,true);return} if(b.dataset.masterPower!==undefined){const slot=+b.dataset.masterPower;masterBypassed[slot]=!masterBypassed[slot];renderMaster();persistSession();send('masterFxBypass',{slot,bypass:masterBypassed[slot]},-1);return} if(b.dataset.clip!==undefined){resetClip(b.dataset.clip);return} if(b.dataset.fxpower!==undefined){const [i,j]=b.dataset.fxpower.split(':').map(Number);setFxBypass(i,j,!bypassed[fxKey(i,j)]);return} - if(b.dataset.insert){let [i,j]=b.dataset.insert.split(':').map(Number);currentChannel=i;pendingSlot=j;openPluginBrowser(i);return} + if(b.dataset.insert){let [i,j]=b.dataset.insert.split(':').map(Number);if(!window.__JUCE__?.backend?.emitEvent)openQuickFx(i,j,b);return} if(b.dataset.deleteScene!==undefined){deleteMixerSnapshot(b.dataset.deleteScene);return} if(b.dataset.scene!==undefined){loadSnapshotByIndex(+b.dataset.scene);return} if(b.dataset.preset){applyQuickPreset(b.dataset.preset);return} @@ -758,8 +782,74 @@ function renderSignalFlow(){ return; } $('rackWorkspace').innerHTML=`
NO TECHNICAL PATCHBAY REQUIRED

Signal Flow — See where your voice goes

A beginner-first view of the real-time audio path. Select your audio device in Setup.

01 · INPUTMicrophoneAudio Interface
ASIO or WASAPI
➜
02 · FX CHAINVST3 PluginsEQ · Dynamics
Reverb · Delay
➜
03 · MIXERMix & MonitorFader · Pan
Master · Meters
➜
04 · OUTPUTSpeakers / StreamAudio Device
Streaming bridge later
⚠ In this trial the audio flow is a visual concept; no microphone is captured and no audio is sent to a livestream.
`} + +// Adopt PR #278 V5 contextual quick-insert on the ORIGINAL mixer. +// Desktop native operations remain owned by bridge.js; this uses preview +// catalog ONLY when JUCE is absent, never as a fabricated VST3 instance. +const arV5Quick=document.createElement('section'); +arV5Quick.className='arV5QuickFx';arV5Quick.hidden=true; +arV5Quick.setAttribute('role','dialog'); +arV5Quick.setAttribute('aria-label','Quick add effect'); +arV5Quick.innerHTML='
ADD FX
'+ + ''+ + '
'+ + '
Enter: insert · Esc: close
'; +document.querySelector('#app .workbench')?.append(arV5Quick); +const arV5Search=arV5Quick.querySelector('.arV5QuickSearch'), + arV5Results=arV5Quick.querySelector('.arV5QuickResults'); +let arV5Anchor=null; +function closeQuickFx(focus=false){ + if(arV5Quick.hidden)return; + arV5Quick.hidden=true; + if(focus&&arV5Anchor?.isConnected)arV5Anchor.focus(); + arV5Anchor=null; +} +function renderQuickFx(){ + if(arV5Quick.hidden)return; + arV5Results.replaceChildren(); + const q=arV5Search.value.trim().toLocaleLowerCase(); + const found=pluginCatalog.filter(p=> + (p.name+' '+p.type+' '+(p.hint||'')).toLocaleLowerCase().includes(q)); + for(const fx of found.slice(0,64)){ + const b=document.createElement('button');b.type='button'; + b.className='arV5QuickResult';b.dataset.fastPlugin=fx.name; + const title=document.createElement('span');title.textContent=fx.name; + const kind=document.createElement('small');kind.textContent=fx.type; + b.append(title,kind);arV5Results.append(b); + } + if(!found.length){const p=document.createElement('p');p.textContent='No matching demo effects';arV5Results.append(p);} +} +function openQuickFx(channel,slot,anchor,isMaster=false){ + if(window.__JUCE__?.backend?.emitEvent)return false; + if(!isMaster){currentChannel=channel;pendingMasterSlot=null;pendingSlot=slot;} + else pendingMasterSlot=slot; + arV5Anchor=anchor; + arV5Quick.querySelector('.arV5QuickHead strong').textContent= + (isMaster?'MAIN':channels[channel]?.name||'CHANNEL')+' · FX '+(slot+1)+' · UI PREVIEW'; + const host=arV5Quick.parentElement,r=anchor?.getBoundingClientRect(),p=host?.getBoundingClientRect(); + if(r&&p){arV5Quick.style.left=Math.max(6,Math.min(r.left-p.left,p.width-320))+'px'; + arV5Quick.style.top=Math.max(6,Math.min(r.bottom-p.top+4,p.height-360))+'px';} + arV5Quick.hidden=false;arV5Search.value='';renderQuickFx();arV5Search.focus();return true; +} +arV5Search.addEventListener('input',renderQuickFx); +arV5Quick.addEventListener('click',e=>{ + if(e.target.closest('[data-fast-close]')){closeQuickFx(true);return;} + if(e.target.closest('[data-fast-manager]')){ + closeQuickFx();openPluginBrowser(currentChannel,pendingMasterSlot!==null);return;} + const b=e.target.closest('[data-fast-plugin]');if(!b)return; + if(!pluginCatalog.some(p=>p.name===b.dataset.fastPlugin))return; + closeQuickFx();insertPlugin(b.dataset.fastPlugin); +}); +arV5Quick.addEventListener('keydown',e=>{ + if(e.key==='Escape'){e.preventDefault();e.stopPropagation();closeQuickFx(true);} + if(e.key==='Enter'&&e.target===arV5Search){ + const first=arV5Results.querySelector('[data-fast-plugin]'); + if(first){e.preventDefault();first.click();} + } +}); + function openPluginBrowser(idx,isMaster=false){if(!isMaster){currentChannel=idx;pendingMasterSlot=null}activeCategory='All';$('pluginModal').classList.remove('hidden');$('pluginTarget').textContent=isMaster?'Adding to MASTER bus · demo FX catalog':'Adding to '+channels[idx].name+' · virtual effects catalog';$('pluginSearch').value='';renderPluginBrowser();$('pluginSearch').focus()} -function closePluginBrowser(){$('pluginModal').classList.add('hidden')} +function closePluginBrowser(){closeQuickFx();$('pluginModal').classList.add('hidden')} function renderPluginBrowser(){document.querySelectorAll('[data-category]').forEach(b=>b.classList.toggle('active',b.dataset.category===activeCategory));const q=$('pluginSearch').value.trim().toLowerCase();let pool=pluginCatalog.filter(p=>(activeCategory==='All'||p.type===activeCategory)&&`${p.name} ${p.type} ${p.hint}`.toLowerCase().includes(q));$('pluginResults').innerHTML=pool.map(p=>``).join('')||'

No matching demo effects.

'} function insertPlugin(name){ if(pendingMasterSlot!==null){ @@ -979,7 +1069,7 @@ document.addEventListener('input',e=>{const el=e.target;if(!el.dataset.fxparam)r $('pluginModal').addEventListener('click',e=>{if(e.target===$('pluginModal'))closePluginBrowser()}); $('channelIdentity').addEventListener('click',e=>{if(e.target===$('channelIdentity'))closeChannelIdentity()}); $('identityName').addEventListener('keydown',e=>{if(e.key==='Enter'){e.preventDefault();commitChannelIdentity()}}); -document.addEventListener('keydown',e=>{if(e.key==='Escape'){closePluginBrowser();closeChannelIdentity()}if((e.key==='Enter'||e.key===' ')&&e.target.matches('[data-editstrip]')){e.preventDefault();openChannelIdentity(+e.target.dataset.editstrip)}}); +document.addEventListener('keydown',e=>{if(e.key==='F8'&&!e.repeat&&!document.documentElement.classList.contains('ar-v6-active')){e.preventDefault();if(window.__JUCE__?.backend?.emitEvent)document.querySelector('[data-plugin-manager]')?.click();else{closeQuickFx();openPluginBrowser(currentChannel,pendingMasterSlot!==null)}return;}if(e.key==='Escape'){closeQuickFx();closePluginBrowser();closeChannelIdentity()}if((e.key==='Enter'||e.key===' ')&&e.target.matches('[data-editstrip]')){e.preventDefault();openChannelIdentity(+e.target.dataset.editstrip)}}); document.addEventListener('change',e=>{if(e.target.id==='rackChannel')chooseChannel(+e.target.value)}); document.addEventListener('click',e=>{const id=e.target.closest('button')?.id;if(id==='saveFxFromRack')saveFxChainPreset();else if(id==='recallFxPreset')recallFxChain();else if(id==='openSetupFromFlow')$('audioSetupBtn')?.click();else if(id==='flowFxButton')setView('FX RACK');else if(id==='backMixer')setView('MIX')}); // The UI-only envelope remains one atomic storage transaction, never a 5s diff --git a/web/assets/knob-ICON.svg b/web/assets/knob-ICON.svg new file mode 100644 index 000000000..ef56513c6 --- /dev/null +++ b/web/assets/knob-ICON.svg @@ -0,0 +1,12 @@ + + + + + + + + + + diff --git a/web/bridge.js b/web/bridge.js index 2d376d804..f14ee87bc 100644 --- a/web/bridge.js +++ b/web/bridge.js @@ -832,8 +832,16 @@ ''+ ''; fxContext.hidden=false; - fxContext.style.left=Math.max(4,Math.min(x,window.innerWidth-fxContext.offsetWidth-4))+'px'; - fxContext.style.top=Math.max(4,Math.min(y,window.innerHeight-fxContext.offsetHeight-4))+'px'; + // The menu may never cover its own FX trigger: the user must be able + // to right-click a newly loaded vendor FX without closing another menu + // via a blind click. Use the adjacent side of the actual strip/slot. + const rect=anchor?.getBoundingClientRect?.(); + const width=fxContext.offsetWidth,height=fxContext.offsetHeight; + const after=rect?rect.right+7:x+7; + const before=rect?rect.left-width-7:x-width-7; + const left=after+width<=window.innerWidth-4?after:Math.max(4,before); + fxContext.style.left=Math.max(4,Math.min(left,window.innerWidth-width-4))+'px'; + fxContext.style.top=Math.max(4,Math.min(rect?rect.top:y,window.innerHeight-height-4))+'px'; fxContext.querySelector("button")?.focus({preventScroll:true}); } document.addEventListener("contextmenu",e=>{ diff --git a/web/hardware-keys.js b/web/hardware-keys.js new file mode 100644 index 000000000..54170f3c2 --- /dev/null +++ b/web/hardware-keys.js @@ -0,0 +1,189 @@ +/* ArSonMix hardware backlit keys — approved owner V5 geometry/occluded light. + UI-only decoration: existing data-*, click handlers and native ACK remain + the sole authority. No audio state is inferred or dispatched here. */ +(function(){ + 'use strict'; + const RULES=[ + ['#mixer .channel-actions [data-mute],#masterMute','mute','MUTE'], + ['#mixer .channel-actions [data-solo]','solo','SOLO'], + ['#mixer .utility-row [data-pre]','phase','Ø'], + ['#mixer .utility-row [data-hpf]','processing','HPF'], + ['#mixer [data-channel-format-toggle]','neutral',null], + ['#masterMode','neutral',null], + ['#mixer [data-fxpower],#masterLeft [data-master-power]','processing','FX'], + // Native top commands share the approved V5 key material; navigation + // chevrons retain their plain icon affordance. Decoration alone never + // dispatches or activates a native operation. + ['#app .arV6Console .arV6Top .arV6Button','neutral',null], + ['#app .arV6Console [data-op="SET_MUTE"]','mute','M'], + ['#app .arV6Console [data-op="SET_SOLO"]','solo','S'], + ['#app .arV6Console [data-op="SET_CUE"]','cue','C'], + ['#app .arV6Console [data-op="SET_INSERT_BYPASS"]','processing','FX'], + ['#app .arV6Console [data-op="SET_SEND_TAP"]','cue',null], + ['#app [data-sof-toggle]','cue','SEND'], + ['#app [data-chainbypass]','processing','FX'] + ]; + const PALETTE={ + mute:'255,64,85',solo:'255,208,44',cue:'90,200,231', + processing:'87,211,189',phase:'243,164,81', + link:'163,141,235',neutral:'210,225,234' + }; + const TARGET=RULES.map(rule=>rule[0]).join(','); + const instances=new WeakMap(); + let serial=0; + let observer=null; + const escapeXml=(value)=>String(value).replace(/&/g,'&').replace(//g,'>').replace(/"/g,'"').replace(/'/g,'''); + function source(button){ + for(const [selector,semantic,label] of RULES) { + if(button.matches(selector))return {semantic,label}; + } + return null; + } + function rawLabel(button){ + // Native accepted values can change PRE ↔ POST, MONO ↔ STEREO, etc. + return (button.textContent||'').trim().replace(/\s+/g,' '); + } + function classifyOn(button,legend){ + const pressed=button.getAttribute('aria-pressed'); + if(pressed!==null)return pressed==='true'; + if(button.dataset.op==='SET_SEND_TAP')return legend==='PRE'; + return button.classList.contains('active')||button.classList.contains('selected')|| + button.classList.contains('power-on')||button.classList.contains('on'); + } + function svgMarkup(legend,w,h,id,led){ + // V5: a SINGLE SVG mask text cut-out; never overlay duplicate text paints. + // ViewBox follows actual key size, preventing distorted glyphs in 28px strips. + const safe=escapeXml(legend); + const rx=Math.min(6,Math.max(2.5,h*.135)); + const fontSize=Math.max(8,Math.min(15,h*.46,(w-7)/(Math.max(1,legend.length)*.70))); + const x=w/2,y=h*.615,capW=Math.max(1,w-3),capH=Math.max(1,h-3); + const left=Math.max(3,w*.07),right=w-left,shineY=2.65; + const r=n=>Number(n.toFixed(2)); + return ''; + } + function render(button,force){ + if(!button.isConnected)return; + const record=instances.get(button); + if(!record)return; + const rect=button.getBoundingClientRect(); + const w=Math.max(16,rect.width-4),h=Math.max(16,rect.height-4); + const legend=button.dataset.mxHwLegend||record.legend; + const size=w.toFixed(1)+'x'+h.toFixed(1)+'/'+legend; + if(!force&&record.size===size&&button.querySelector(':scope > svg.mx-hw-face'))return; + record.size=size; + button.innerHTML=''+escapeXml(legend)+''+svgMarkup(legend,w,h,record.id,PALETTE[record.semantic]); + } + function upgrade(button){ + if(!(button instanceof HTMLButtonElement))return; + const rule=source(button); + if(!rule)return; + const existing=instances.get(button); + if(existing&&button.querySelector(':scope > svg.mx-hw-face')){resizer?.observe(button);return;} + const original=rawLabel(button); + let legend=rule.label||original||'ON'; + // A source text replacement (e.g. native PRE/POST) is authoritative. + if(existing&&original&&original!==existing.legend&&original!=='')legend=original; + if(!/^[\wØ/+\- ]{1,10}$/.test(legend))return; + if(!existing){ + // Drop the broken BTN-180 visual skin, retaining functionality/data hooks. + button.classList.remove('btn-180','candy'); + button.classList.add('mx-hw-key','mx-hw-'+rule.semantic); + if(!button.hasAttribute('aria-label'))button.setAttribute('aria-label',original||legend); + button.style.setProperty('--mx-hw-led',PALETTE[rule.semantic]); + instances.set(button,{id:++serial,legend,size:'',semantic:rule.semantic}); + if(resizer)resizer.observe(button); + }else{ + existing.legend=legend; + } + if(button.dataset.op==='SET_SEND_TAP')button.dataset.mxHwOn=String(classifyOn(button,legend)); + button.dataset.mxHwLegend=legend; + render(button,true); + } + function scan(root){ + if(!root||root.nodeType!==1)return; + if(root.matches('button.mx-hw-key')&&!root.querySelector('svg.mx-hw-face')){ + // An existing app handler replaced the button's textContent. + const prev=instances.get(root),changed=rawLabel(root); + if(prev&&changed&&changed!==prev.legend){ + root.dataset.mxHwLegend=changed; + prev.legend=changed; + } + upgrade(root); + }else if(root.matches(TARGET))upgrade(root); + for(const button of root.querySelectorAll(TARGET))upgrade(button); + } + const resizer=typeof ResizeObserver==='function'?new ResizeObserver(entries=>{ + for(const entry of entries)render(entry.target,false); + }):null; + const pending=new Set(); + let scheduled=false; + function flush(){ + scheduled=false; + for(const node of pending)scan(node); + pending.clear(); + } + function schedule(node){ + if(!node||node.nodeType!==1)return; + pending.add(node); + if(!scheduled){scheduled=true;queueMicrotask(flush)} + } + function install(){ + if(observer)return; + scan(document.body); + observer=new MutationObserver(records=>{ + for(const record of records){ + if(record.target instanceof HTMLButtonElement&&record.target.classList.contains('mx-hw-key') && + !record.target.querySelector('svg.mx-hw-face'))schedule(record.target); + for(const node of record.removedNodes)if(node.nodeType===1){ + if(node.matches?.('button.mx-hw-key')&&!node.isConnected)resizer?.unobserve(node); + for(const button of node.querySelectorAll?.('button.mx-hw-key')||[]) + if(!button.isConnected)resizer?.unobserve(button); + } + for(const node of record.addedNodes)if(node.nodeType===1&& + (node.matches?.(TARGET)||node.querySelector?.(TARGET)))schedule(node); + } + }); + // Watch DOM replacement only, not high-frequency meter/style attributes. + observer.observe(document.body,{childList:true,subtree:true}); + } + // Update only the engraved control, without tearing down its SVG. + function setLegend(button,legend){ + if(!(button instanceof HTMLButtonElement)||!button.isConnected|| + typeof legend!=='string'||!(/^[A-Za-z0-9_Ø/+ -]{1,10}$/).test(legend))return false; + const record=instances.get(button); + if(!record)return false; + if(button.dataset.mxHwLegend===legend)return true; + record.legend=legend;button.dataset.mxHwLegend=legend; + render(button,true); + return true; + } + window.ArSonMixHardwareKeys=Object.freeze({install,upgrade,scan,setLegend,PALETTE}); + if(document.readyState==='loading')document.addEventListener('DOMContentLoaded',install,{once:true}); + else install(); +})(); \ No newline at end of file diff --git a/web/index.html b/web/index.html index 4b3852300..069ec9cf1 100644 --- a/web/index.html +++ b/web/index.html @@ -47,5 +47,5 @@
UI PREVIEW · Native audio engine is not connectedFader · PAN · VST3 FXPREVIEWArSonMix · Live VST3 Host
- + diff --git a/web/mixer-io.css b/web/mixer-io.css index d9565f2bd..982f1fe27 100644 --- a/web/mixer-io.css +++ b/web/mixer-io.css @@ -635,3 +635,167 @@ #app #mixer .arChannelQuickInput:disabled{color:#78949f;cursor:default} #app #mixer .arChannelQuickInput:focus-visible{outline:1px solid #7ad2e9;outline-offset:0} #app #mixer .arFormatBadge{top:0;height:15px;line-height:13px} + + +/* DEVICE/ROUTING 2026-11-01: one primary decision at a time. + Advanced crosspoints are never necessary for ordinary mono input routing. + No blur, glow filters, animated layout, large cards or second GUI router. */ +#arIOOverlay .arIOWindow{ + width:min(920px,calc(100vw - 28px)); + max-height:min(700px,calc(100dvh - 28px)); + border-radius:5px; + background:#15232d; +} +#arIOOverlay .arIOWindow>header{padding:8px 13px;min-height:42px} +#arIOOverlay .arIOWindow>header small{font-size:9px;letter-spacing:.6px} +#arIOOverlay .arIOWindow>header h2{font-size:15px;font-weight:500} +#arIOOverlay .arIOTop{padding:5px 13px;font-size:10px} +#arIOOverlay .arIOWindow nav{ + padding:6px 10px;gap:0;border-bottom:1px solid #3c5663;background:#172933; +} +#arIOOverlay .arIOWindow nav .btn-180{ + flex:1 1 0;min-width:0;height:30px;min-height:30px;border-radius:0; + font-size:10px;letter-spacing:.1px; +} +#arIOOverlay .arIOBody{padding:9px 12px;scrollbar-width:thin} +#arIOOverlay .arIOAudioPath{padding:5px 11px;gap:4px} +#arIOOverlay .arIOAudioPath>span{font-size:9px;padding:4px 6px} +#arIOOverlay .arIOAudioPath>small{font-size:10px} +#arIOOverlay .arIOWindow>footer{gap:6px;padding:7px 10px} +#arIOOverlay .arIOWindow>footer .btn-180{height:28px;min-height:28px;padding:0 9px} +#arIOOverlay .arIOWindow>footer [data-io-internal]{margin-left:0} +#arIOOverlay .arIODevicePatchMatrix{ + display:block;margin:9px 0 0;background:#162731;border:1px solid #355566; +} +#arIOOverlay .arIODevicePatchMatrix>.arIODeviceMatrixHeading{ + display:flex;list-style:none;cursor:pointer;min-height:32px;align-items:center; + padding:6px 10px;color:#adc7d3;font-weight:500; +} +#arIOOverlay .arIODevicePatchMatrix>.arIODeviceMatrixHeading::-webkit-details-marker{display:none} +#arIOOverlay .arIODevicePatchMatrix>.arIODeviceMatrixHeading:before{ + content:'▸';margin-right:8px;color:#80b5c9; +} +#arIOOverlay .arIODevicePatchMatrix[open]>.arIODeviceMatrixHeading:before{content:'▾'} +#arIOOverlay .arIODevicePatchMatrix:not([open])>:not(summary){display:none!important} +#arIOOverlay .arIOQuickPatch{max-width:100%;overflow:visible} +#arIOOverlay .arIOQuickColumns{display:none} +#arIOOverlay .arIOQuickHeader{min-height:47px;padding:7px 10px} +#arIOOverlay .arIOQuickGuide{ + padding:9px 10px;font-size:11px;color:#a7d3df;background:#1c303b; +} +#arIOOverlay .arIOQuickRow{ + grid-template-columns:minmax(100px,1fr) minmax(105px,1fr) minmax(135px,1.6fr) + minmax(135px,1.6fr) minmax(113px,1.2fr); + min-height:64px;padding:8px 11px;background:#172b36; + gap:8px;border-bottom:1px solid #3c5764; +} +#arIOOverlay .arIOQuickRow[hidden]{display:none!important} +#arIOOverlay .arIOQuickRow[data-state="invalid"]{ + box-shadow:inset 3px 0 #da9965;background:#302b27; +} +#arIOOverlay .arIOQuickRow[data-state="invalid"] .arIOQuickState{color:#ffcb9a} +#arIOOverlay .arIOQuickRow .arIOQuickState{font-size:10px;line-height:1.25} +#arIOOverlay .arIOQuickRow .arIOQuickStage{min-height:28px} +#arIOOverlay .arIOQuickFooter{ + background:#13242d;padding:9px 11px;margin:0;line-height:1.4; + font-size:10px;color:#9ec4d0; +} +#arIOOverlay .arIOJump{max-width:235px;width:235px} +#arIOOverlay .arIOSimpleMain{ + background:#162a35;border:1px solid #496675;padding:12px 13px;margin:0 0 9px; + color:#cfe3ec; +} +#arIOOverlay .arIOSimpleMain>strong{ + color:#d7edf5;font:600 12px/1.3 "Segoe UI",sans-serif; +} +#arIOOverlay .arIOSimpleMain p{ + margin:5px 0 11px;color:#9dbac9;line-height:1.35;font-size:10px; +} +#arIOOverlay .arIOSimpleMainRow{ + display:grid;grid-template-columns:1fr 1fr;gap:12px; +} +#arIOOverlay .arIOSimpleMainField{display:flex;flex-direction:column;gap:6px} +#arIOOverlay .arIOSimpleMainField>span{color:#84c8d8;font:600 10px/1.1 "Segoe UI",sans-serif} +#arIOOverlay .arIOSimpleMainField>select{ + width:100%;height:33px;min-width:0;padding:5px 8px; + background:#091c26;color:#deedf3;border:1px solid #548091;border-radius:3px; + font:11px/1.3 "Segoe UI",sans-serif; +} +#arIOOverlay .arIOSimpleMainField>select:disabled{opacity:.45} +#arIOOverlay .arIOAdvancedMatrix{margin:7px 0} +#arIOOverlay .arIOAdvancedMatrix>summary{ + cursor:pointer;color:#95b5c3;background:#172a35;border:1px solid #415a66; + padding:8px 10px;font-size:10px; +} +#arIOOverlay .arIOAdvancedMatrix:not([open])>*:not(summary){display:none!important} +@media(max-width:780px){ + #arIOOverlay .arIOWindow nav .btn-180{font-size:9px} + #arIOOverlay .arIOQuickRow{ + grid-template-columns:repeat(2,minmax(0,1fr));gap:7px; + } + #arIOOverlay .arIOQuickRow .arIOQuickAction{grid-column:span 2} + #arIOOverlay .arIOJump{width:180px;max-width:48%} +} +@media(max-height:700px){ + #arIOOverlay .arIOWindow{max-height:calc(100dvh - 12px)} + #arIOOverlay .arIOBody{padding:6px 10px} + #arIOOverlay .arIOAudioPath{grid-template-columns:repeat(4,minmax(0,1fr))} + #arIOOverlay .arIOAudioPath>button{grid-column:span 2} +} + + +/* v7 G1 operator hardware drawer. Unlike the former 920x700 blocking + wizard, device management is a narrow edge drawer; channel controls and + MAIN remain visible behind a light scrim, without new routing ownership. */ +#arIOOverlay{ + padding:0;justify-content:flex-end;align-items:stretch; + background:rgba(4,10,16,.48); +} +#arIOOverlay .arIOWindow{ + width:min(760px,100vw);height:100dvh;max-height:100dvh; + border:0;border-left:1px solid #5b7785;border-radius:0; + background:#13232c;box-shadow:-9px 0 22px #0005; +} +#arIOOverlay[data-active-tab="device"] .arIOWindow{ + width:min(594px,100vw); +} +#arIOOverlay .arIOWindow>header{ + min-height:43px;padding:7px 11px;gap:5px; +} +#arIOOverlay .arIOWindow>header h2{font-size:13px;font-weight:550;margin:0} +#arIOOverlay .arIOWindow>header small{font-size:9px} +#arIOOverlay .arIOTop{padding:5px 11px;font-size:10px} +#arIOOverlay .arIOWindow nav{ + padding:5px 8px;gap:0;background:#142934; +} +#arIOOverlay .arIOWindow nav .btn-180{ + flex:1 1 0;min-width:0;height:29px;min-height:29px; + padding:0 5px;font-size:9px;letter-spacing:0; +} +#arIOOverlay .arIOBody{ + padding:8px 10px;overflow-y:auto;min-height:0;overscroll-behavior:contain; +} +#arIOOverlay .arIOWindow>footer{padding:7px 10px;min-height:43px;gap:5px} +#arIOOverlay .arIOWindow>footer .btn-180{height:28px;min-height:28px} +.arIODevicePinGroup .arIODevicePinRow{ + min-height:27px; +} +.arIODevicePatchMatrix:not([open]) > :not(summary){ + display:none!important; +} +#app #mixer .arBankStage[data-state="invalid"]{ + color:#ffb38a!important; +} +#app #mixer .arBankStage[data-state="ack"]{ + color:#a5d0de!important; +} +@media(max-width:640px){ + #arIOOverlay .arIOWindow,#arIOOverlay[data-active-tab="device"] .arIOWindow{ + width:100vw; + } +} +@media(max-height:640px){ + #arIOOverlay .arIOBody{padding:6px 9px} + #arIOOverlay .arIOTop{padding:3px 9px} + #arIOOverlay .arIOWindow nav{padding:3px 8px} +} diff --git a/web/mixer-io.js b/web/mixer-io.js index bf34032b4..bf836fcf6 100644 --- a/web/mixer-io.js +++ b/web/mixer-io.js @@ -6,11 +6,11 @@ const mixer=document.getElementById('mixer'); const host=document.querySelector('.workbench'); if(!mixer||!host)return; - let mode='FX', lastStatus={}, deviceInventory=null, ioTab='device', lastSignature='', focusedInput=2; + let mode='CONSOLE', lastStatus={}, deviceInventory=null, ioTab='device', lastSignature='', focusedInput=0; let monitorSendsExpanded=false; // DEVICE1: staged selections are UI-only; only positive native ACK changes active hardware. let deviceDraft=null,deviceBusy=false,deviceNote='',deviceRequest='',deviceRequestSeq=0,lastDeviceRefresh=0,lastDeviceRescan=0,applyMutePending=false,applyAfterDevice=null,applyBaseEpoch=0; - let deviceMatrixView='inputs',deviceMatrixWaitEpoch=null; // Never display old hardware pins after an APPLY ACK. + let deviceMatrixView='inputs',deviceMatrixWaitEpoch=null,deviceMatrixOpen=false; // Never display old hardware pins after an APPLY ACK. // Pending SOURCE ACK is a UI projection only; monitor.js owns the native route. let quickSourcePending=null; const el=id=>document.getElementById(id); @@ -248,13 +248,19 @@ return section; } + // Only an ACKed physical MAIN pair is a MAIN route. Available output pins + // are merely inventory, never proof that a route has been selected. const outputLabel=s=>{ - const out=s.mainOutputs?.length===2?s.mainOutputs:s.outputPorts||[]; - return s.ready&&Number.isInteger(out[0])&&Number.isInteger(out[1])? - 'MAIN → HW '+(out[0]+1)+'/'+(out[1]+1):'MAIN → NO HW OUTPUT'; + const out=s.mainOutputs,enabled=new Set(s.outputPorts||[]); + if(!s.ready)return 'MAIN → NO DEVICE'; + if(!Array.isArray(out)||out.length!==2)return 'MAIN → UNPATCHED'; + if(!Number.isInteger(out[0])||!Number.isInteger(out[1])|| + out[0]===out[1]||!enabled.has(out[0])||!enabled.has(out[1])) + return 'MAIN → INVALID L/R'; + return 'MAIN → HW '+(out[0]+1)+'/'+(out[1]+1); }; const toolbar=node('div','arMixerBankBar'); - toolbar.innerHTML='
NO HARDWARE · PREVIEW
'; + toolbar.innerHTML='
NO HARDWARE · PREVIEW
'; host.insertBefore(toolbar,mixer); // One genuinely selected-channel journey, NOT another DSP or source registry. // Four compact steps show ACKNOWLEDGED state, never stage a hidden graph. @@ -453,7 +459,7 @@ sofControls.hidden=true;toolbar.appendChild(sofControls); const overlay=node('div','arIOOverlay'); overlay.id='arIOOverlay';overlay.hidden=true; - overlay.innerHTML=''; + overlay.innerHTML=''; document.body.appendChild(overlay); const audioPath=node('div','arIOAudioPath');audioPath.id='arIOAudioPath'; audioPath.innerHTML='CAPTURE · WAITROUTE · WAITMIXER · WAITOUTPUT · WAIT'; @@ -769,7 +775,7 @@ window.__arMixOpenAudioIO=openIO; function closeIO(){overlay.hidden=true;matrixDraft.clear();matrixSide.clear();matrixMessage='';} function setMode(next){ - if(!['FX','ROUTE','SENDS'].includes(next))return; + if(!['CONSOLE','FX','ROUTE','SENDS'].includes(next))return; if(next!=='SENDS'&&sofBus>=0)leaveSof(); mode=next;mixer.dataset.ioMode=mode; toolbar.querySelectorAll('[data-mix-mode]').forEach(b=>{const selected=b.dataset.mixMode===mode;b.classList.toggle('active',selected);b.setAttribute('aria-pressed',String(selected));}); @@ -788,7 +794,7 @@ } if(strip.querySelector('.arChannelBank'))continue; const bank=node('div','arChannelBank'); - bank.innerHTML='
INPUT SOURCE · NATIVEOUTPUT DESTINATIONMAIN · UNKNOWN
NATIVE PATCH REQUIRED
AUX SENDS · PRE / POST
'; + bank.innerHTML='
INPUT SOURCE · NATIVEOUTPUT DESTINATION
NATIVE PATCH REQUIRED
AUX SENDS · PRE / POST
'; strip.querySelector('.rack')?.insertAdjacentElement('afterend',bank); } } @@ -828,8 +834,22 @@ const dirty=current!==valueFor(accepted)||channelFormat(r)!==channelFormat(accepted); const stage=strip.querySelector('.arBankStage'); const sourcePending=quickSourcePending?.channel===i&&quickSourcePending.epoch===s.epoch; - stage.textContent=!s.ready?'NO LIVE DEVICE':sourcePending?'PENDING · NATIVE ACK':dirty?'DRAFT · NOT APPLIED':r.mode==='NONE'?'UNPATCHED · SILENT':'LIVE · NATIVE ACK'; - stage.dataset.state=!s.ready?'offline':sourcePending?'draft':dirty?'draft':r.mode==='NONE'?'offline':'live'; + const verified=new Set(portList(s).map(p=>p.port)); + const validInput=r.mode==='NONE'|| + (r.mode==='MONO'&&verified.has(r.left)&&r.right===-1)|| + (r.mode==='STEREO'&&r.left!==r.right&&verified.has(r.left)&&verified.has(r.right)); + const acceptedValid=!accepted||accepted.mode==='NONE'|| + (accepted.mode==='MONO'&&verified.has(accepted.left)&&accepted.right===-1)|| + (accepted.mode==='STEREO'&&accepted.left!==accepted.right&&verified.has(accepted.left)&&verified.has(accepted.right)); + // Source is real hardware, processing M/ST is independent. A restored + // invalid legacy alias is NEVER 'ACK/LIVE', even after a native route ACK. + stage.textContent=!s.ready?'NO VERIFIED DEVICE': + sourcePending?'PENDING · NATIVE ACK': + (!validInput||!acceptedValid)?'INVALID PHYSICAL INPUT · RE-PATCH': + dirty?'DRAFT · NOT APPLIED':r.mode==='NONE'?'UNPATCHED · NO INPUT': + 'ROUTE ACK · PCM UNVERIFIED'; + stage.dataset.state=!s.ready?'offline':sourcePending||dirty?'draft': + (!validInput||!acceptedValid)?'invalid':r.mode==='NONE'?'offline':'ack'; // Four native AUX destinations are always visible, even when empty. // Render only after a topology change, never on meter telemetry. const slots=Array.from({length:4},(_,bus)=>{ @@ -869,6 +889,28 @@ if(info.textContent!==caption)info.textContent=caption; toolbar.querySelector('[data-mix-apply]').disabled=!isNative()||!s.ready||!!s.pending||(!overlay.hidden&&matrixDraft.size>0); for(const strip of mixer.querySelectorAll('.strip[data-strip]'))refreshStrip(strip,s); + // Read-only pinned MAIN route. Reattach on master DOM regeneration but + // do not alter its fader, meters, FX, callback or native router. + const master=mixer.querySelector('#masterLeft'); + if(master){ + let summary=master.querySelector('.arMainOutSummary'); + if(!summary){ + summary=node('div','arMainOutSummary'); + summary.setAttribute('aria-label','Accepted physical MAIN routing'); + const heading=node('span','arMainOutHeading','MAIN OUT · NATIVE'); + const output=node('button','arMainOutAction'); + output.type='button';output.dataset.mixPatch='output'; + output.dataset.master='1';output.title='Configure physical MAIN L/R (native ACK)'; + summary.append(heading,output); + master.querySelector('.master-ch-id')?.insertAdjacentElement('afterend',summary); + } + const output=summary.querySelector('.arMainOutAction'); + if(output){ + const next=outputLabel(s); + if(output.textContent!==next)output.textContent=next; + output.disabled=!isNative()||!s.ready; + } + } if(!overlay.hidden)refreshIO(); if(!sendEditor.hidden)drawSendEditor(); sofRefresh(s); @@ -916,7 +958,7 @@ const title=node('header','arIOQuickHeader'); const words=node('div',''); words.append(node('strong','','1 · INTERFACE INPUT → MIXER CHANNEL'), - node('small','','Choose a channel, mono/stereo source and actual driver input(s). STAGE → MUTE → APPLY.')); + node('small','','Choose one channel and one or two distinct verified capture pins. USE INPUT commits through native ACK.')); const jump=node('select','arIOJump'); jump.dataset.ioJump='1';jump.setAttribute('aria-label','Find mixer channel'); for(let i=0;i<10;i++){ @@ -944,15 +986,20 @@ for(let i=0;i<10;i++){ const r=channelState(s,i),accepted=s.acceptedRoute?.channels?.[i]; const row=node('div','arIOQuickRow');row.dataset.ioQuickRow=String(i); + row.hidden=i!==focusedInput; row.dataset.state=!s.ready?'offline':valueFor(r)!==valueFor(accepted)?'draft': r.mode==='NONE'?'empty':'live'; const identity=node('div','arIOQuickIdentity'); identity.append(node('strong','','CH '+String(i+1).padStart(2,'0')),node('small','',matrixLogicalName(i))); const mode=node('select','arIOQuickMode');mode.dataset.ioQuickMode='1'; mode.setAttribute('aria-label','CH '+(i+1)+' physical input type'); - for(const pair of [['NONE','NO INPUT'],['MONO','MONO'],['STEREO','STEREO'], + for(const pair of [['NONE','NO INPUT'],['MONO','MONO'],['STEREO','STEREO · 2 PINS'], ...(r.mode==='BUS'?[['BUS','INTERNAL BUS']]:[])]){ - const option=node('option','',pair[1]);option.value=pair[0];option.selected=r.mode===pair[0];mode.appendChild(option); + const option=node('option','',pair[1]);option.value=pair[0];option.selected=r.mode===pair[0]; + // An accepted legacy invalid stereo route must remain inspectable, + // but new STEREO selection requires two distinct enabled driver pins. + if(pair[0]==='STEREO'&&verified.length<2&&r.mode!=='STEREO')option.disabled=true; + mode.appendChild(option); } const left=sourceSelect(i,'left',r.left),right=sourceSelect(i,'right',r.right); left.disabled=!hardwareReady(s)||r.mode==='NONE'||r.mode==='BUS'; @@ -962,12 +1009,23 @@ const stage=node('button','btn-180 arIOQuickStage','USE INPUT'); stage.dataset.ioQuickStage='1';stage.type='button'; stage.disabled=!hardwareReady(s)||r.mode==='BUS'; - action.append(stage,node('small','arIOQuickState',r.mode==='BUS'?'INTERNAL BUS': + const stereoInvalid=r.mode==='STEREO'&&(!verified.some(p=>p.port===r.left)|| + !verified.some(p=>p.port===r.right)||r.left===r.right); + if(stereoInvalid){ + row.dataset.state='invalid'; + // On a one-pin device, the accepted legacy stereo L=R route cannot + // be usable stereo. Offer ONE explicit native-safe MONO correction. + if(verified.length===1&&verified[0].port===r.left){ + stage.textContent='FIX AS MONO';stage.dataset.ioQuickFix='1'; + } + } + action.append(stage,node('small','arIOQuickState',stereoInvalid? + 'INVALID STEREO · SELECT DISTINCT L/R':r.mode==='BUS'?'INTERNAL BUS': !s.ready?'NO DEVICE':row.dataset.state==='draft'?'DRAFT · NOT LIVE': - row.dataset.state==='live'?'LIVE · ACK':'UNPATCHED')); + row.dataset.state==='live'?'ROUTE ACK · CHECK PCM':'UNPATCHED')); row.append(identity,mode,left,right,action);section.appendChild(row); } - section.appendChild(node('p','arIOQuickFooter','Select verified inputs, click USE INPUT. Native routing handles any required safe mute, ACK and re-arm automatically.')); + section.appendChild(node('p','arIOQuickFooter','ONE ACTION: USE INPUT → native safe route/ACK. No input PCM? Send playback into the selected recording endpoint, then check SIGNAL CHECK.')); return section; } function stageQuickInput(button){ @@ -975,7 +1033,8 @@ const s=route(),pins=new Set(matrixPorts(s,'inputs')); if(!row||!Number.isInteger(channel)||channel<0||channel>=10||!hardwareReady(s)) return matrixSay('Choose an active driver and wait for any previous APPLY.'); - const mode=row.querySelector('[data-io-quick-mode]').value, + const mode=button.dataset.ioQuickFix==='1'?'MONO': + row.querySelector('[data-io-quick-mode]').value, left=Number(row.querySelector('[data-io-quick-pin="left"]').value), right=Number(row.querySelector('[data-io-quick-pin="right"]').value); if(mode==='MONO'&&!pins.has(left))return matrixSay('CH '+(channel+1)+' · choose a valid mono input.'); @@ -1397,7 +1456,7 @@ hidden.value=d.backend;panel.appendChild(hidden); } const same=deviceSameEndpoint(d),advanced=node('details','arIODeviceAdvanced'); - advanced.appendChild(node('summary','','BUFFER / SAMPLE RATE / HARDWARE PIN ENABLE')); + advanced.appendChild(node('summary','','ADVANCED · BUFFER / SAMPLE RATE')); const fields=node('div','arIODeviceFields'); const rateOpts=[[0,'AUTO · driver default']],bufferOpts=[[0,'AUTO · driver default']]; if(same){ @@ -1412,6 +1471,12 @@ deviceSelect('arIODeviceBuffer',d.bufferSize,bufferOpts,deviceBusy||!isNative()))); advanced.appendChild(fields); const pins=node('div','arIODevicePins'); + const pinHeading=node('div','arIOPinHeading'); + const enabledCount=Array.isArray(d.enabledInputs)?d.enabledInputs.length:0; + pinHeading.append(node('strong','','HARDWARE PORTS · ENABLE INPUTS / OUTPUTS'), + node('span','',enabledCount+' capture pin(s) selected · '+(enabledCount<2? + 'MONO ONLY until a second distinct input is enabled':'MONO / STEREO PAIRS POSSIBLE'))); + panel.appendChild(pinHeading); for(const [direction,names,selectedPins] of [ ['INPUT',same?a.inputNames:[],d.enabledInputs], ['OUTPUT',same?a.outputNames:[],d.enabledOutputs]]){ @@ -1431,7 +1496,9 @@ }); pins.appendChild(side); } - advanced.appendChild(pins);panel.appendChild(advanced); + // Input/output pin enabling is a BASIC step, not an advanced matrix. + // The original native device draft/ACK path remains unchanged. + panel.appendChild(pins);panel.appendChild(advanced); } const actions=node('div','arIODeviceActions'); const refresh=node('button','btn-180 arIODeviceRefresh','REFRESH DEVICES'); @@ -1451,9 +1518,18 @@ devicePinNextStep())); panel.appendChild(actions);body.appendChild(panel); - const matrixSection=node('section','arIODevicePatchMatrix'); - const heading=node('div','arIODeviceMatrixHeading'); - heading.appendChild(node('strong','','AUDIO I/O · REAL PORT MATRIX')); + const matrixSection=node('details','arIODevicePatchMatrix'); + matrixSection.open=deviceMatrixOpen; + matrixSection.addEventListener('toggle',()=>{ + if(deviceMatrixOpen!==matrixSection.open){ + deviceMatrixOpen=matrixSection.open; + // Expensive crosspoints are constructed on demand, never just hidden + // behind CSS while a 12Hz native readback refreshes the device panel. + lastSignature='';refreshIO(); + } + }); + const heading=node('summary','arIODeviceMatrixHeading'); + heading.appendChild(node('strong','','ADVANCED · HARDWARE PORT MATRIX (OPTIONAL)')); const tabs=node('div','arIODeviceMatrixSwitch'); for(const [value,label] of [['inputs','INPUTS'],['outputs','OUTPUTS']]){ const b=node('button','arIODeviceMatrixTab',label);b.type='button'; @@ -1462,6 +1538,12 @@ tabs.appendChild(b); } heading.appendChild(tabs);matrixSection.appendChild(heading); + if(!deviceMatrixOpen){ + matrixSection.appendChild(node('p','arIODeviceMatrixEmpty', + 'Optional engineering crosspoints. Open only for advanced pin patching.')); + body.appendChild(matrixSection); + return; + } const live=!!d&&deviceSameEndpoint(d)&&a.authorized!==false; const s=route(); if(deviceMatrixWaitEpoch!==null&&s.epoch!==deviceMatrixWaitEpoch&&s.ready&&s.active) @@ -1502,7 +1584,10 @@ }); overlay.dataset.activeTab=ioTab; const matrixInDevice=ioTab==='device'&&deviceSameEndpoint(deviceDraft)&&hardwareReady(s); - overlay.querySelector('[data-mix-apply]').hidden=ioTab==='device'; + overlay.querySelector('[data-mix-apply]').hidden=ioTab==='device'|| + (ioTab==='inputs'&&!advancedMatrixOpen); + overlay.querySelector('[data-mix-apply]').textContent= + ioTab==='outputs'?'APPLY MAIN OUT':'APPLY ADVANCED'; overlay.querySelector('[data-io-revert]').hidden=ioTab==='device'&&!matrixInDevice; overlay.querySelector('[data-io-internal]').hidden=ioTab==='device'; overlay.querySelector('[data-io-device-apply]').hidden=ioTab!=='device'; @@ -1528,6 +1613,8 @@ if(previous)advancedMatrixOpen=previous.open; const previousDirect=body.querySelector('.arIODeviceDirectMatrix'); if(previousDirect)directMatrixOpen=previousDirect.open; + const previousHardware=body.querySelector('.arIODevicePatchMatrix'); + if(previousHardware)deviceMatrixOpen=previousHardware.open; body.replaceChildren(); if(ioTab!=='device'){ const identity=node('div','arIOHardwareHeader'); @@ -1543,10 +1630,43 @@ body.appendChild(makeQuickInputs(s)); const advanced=node('details','arIOAdvancedMatrix'); advanced.open=advancedMatrixOpen; - advanced.appendChild(node('summary','','ADVANCED M / L / R CROSSPOINT · SAME NATIVE ROUTING')); + advanced.addEventListener('toggle',()=>{ + advancedMatrixOpen=advanced.open; + overlay.querySelector('[data-mix-apply]').hidden=!advanced.open; + }); + advanced.appendChild(node('summary','','ADVANCED · MANUAL INPUT CROSSPOINTS')); advanced.appendChild(makeMatrix(s,ioTab)); body.appendChild(advanced); - }else body.appendChild(makeMatrix(s,ioTab)); + }else{ + // MAIN Left/Right must be visible before the engineering matrix. + // The same __arMixStageMainOutputs owns both paths. + const simple=node('section','arIOSimpleMain'); + simple.append(node('strong','','MAIN OUTPUT · STEREO PAIR'), + node('p','','Select two different enabled hardware outputs. APPLY OUTPUT publishes native routing; no browser sound is generated.')); + const outputPorts=matrixPorts(s,'outputs'); + const accepted=s.mainOutputs?.length===2?s.mainOutputs:[]; + const picked=s.draftMainOutputs?.length===2?s.draftMainOutputs:accepted; + const pickers=node('div','arIOSimpleMainRow'); + for(let side=0;side<2;side++){ + const label=node('label','arIOSimpleMainField'); + label.append(node('span','',side===0?'MAIN LEFT':'MAIN RIGHT')); + const select=node('select','arIOMainOutput');select.dataset.side=String(side); + const empty=node('option','','Choose verified output…');empty.value='-1';select.append(empty); + for(const port of outputPorts){ + const opt=node('option','','HW OUT '+(port+1));opt.value=String(port); + opt.selected=port===picked[side];select.appendChild(opt); + } + select.disabled=!hardwareReady(s)||s.pending||outputPorts.length<2; + label.append(select);pickers.append(label); + } + simple.append(pickers); + body.append(simple); + const advanced=node('details','arIOAdvancedMatrix'); + advanced.open=advancedMatrixOpen; + advanced.append(node('summary','','ADVANCED · OUTPUT CROSSPOINTS / MONITOR')); + advanced.append(makeMatrix(s,ioTab)); + body.append(advanced); + } } if(ioTab==='inputs'){ body.appendChild(node('p','arIOHint','MAONO PS22 virtual inputs appear here ONLY if its selected driver enumerates them as capture ports. Configure MAONO Routing Center and select the appropriate PS22 ASIO/recording endpoint in DEVICE / DRIVER. Separate Windows capture endpoints cannot be silently combined into one device. Processing MONO/STEREO is independent of physical source mode.')); @@ -1584,26 +1704,9 @@ body.appendChild(node('p','arIOHint','LIVE MONITOR: '+ (monitorLive.length===2?'HW '+(monitorLive[0]+1)+'/'+(monitorLive[1]+1):'DISABLED')+ ' · Independent POST-fader mix; all changes require MUTE → APPLY → ACK.')); - const details=node('details','arIOQuickMap'); - details.appendChild(node('summary','','QUICK OUTPUT SELECTION · ACCESSIBLE ALTERNATIVE')); - const accepted=s.mainOutputs?.length===2?s.mainOutputs:[]; - const draft=s.draftMainOutputs?.length===2?s.draftMainOutputs:accepted; - const ports=matrixPorts(s,'outputs'); - for(const [i,label] of ['MAIN LEFT','MAIN RIGHT'].entries()){ - const row=node('label','arIOOutputRow'); - const selector=node('select','arIOMainOutput'); - selector.dataset.side=String(i); - selector.setAttribute('aria-label',label+' destination'); - for(const p of ports){ - const option=node('option','','HW OUT '+(p+1)); - option.value=String(p);option.selected=p===draft[i];selector.appendChild(option); - } - selector.disabled=!hardwareReady(s)||ports.length<2; - row.append(node('strong','',label),selector);details.appendChild(row); - } - body.appendChild(details); - body.appendChild(node('p','arIOHint','LIVE MAIN: '+(accepted.length===2?'HW '+(accepted[0]+1)+'/'+(accepted[1]+1):'UNAVAILABLE')+ - ' · Only native-ACKed MAIN/MONITOR pairs can carry sound. AUX1–4 are internal stereo FX returns, not physical output sockets.')); + const acknowledged=s.mainOutputs?.length===2?s.mainOutputs:[]; + body.appendChild(node('p','arIOHint','NATIVE MAIN: '+(acknowledged.length===2?'HW '+(acknowledged[0]+1)+' / '+(acknowledged[1]+1):'UNAVAILABLE')+ + ' · Selection is DRAFT until native APPLY/ACK. AUX1–4 are internal FX returns, not hardware ports.')); }else{ renderCustomDevice(body); } @@ -1652,6 +1755,7 @@ } if(e.target.matches('[data-io-jump]')){ focusedInput=Number(e.target.value); + lastSignature='';refreshIO(); overlay.querySelector('[data-io-quick-row="'+focusedInput+'"]')?.scrollIntoView({block:'nearest'}); return; } @@ -1717,6 +1821,7 @@ if(!route().ready)openIO('device'); else openSourceChooser(index); } else if(step==='fx'){ + // The existing FX-only engineering layer remains an optional inspector. setMode('FX'); if(typeof chooseChannel==='function')chooseChannel(index); strip?.querySelector('.rack')?.scrollIntoView?.({block:'nearest',inline:'nearest'}); @@ -1890,6 +1995,7 @@ e.preventDefault();e.stopImmediatePropagation(); const strip=b.closest('[data-strip]'),channel=Number(strip?.dataset.strip)||0; if(b.dataset.mixPatch==='input')openIO('inputs',channel); + else if(b.dataset.mixPatch==='output')openIO('outputs',channel); else window.__arMixOpenChannelPatch?.(channel,b.dataset.mixPatch); return; } @@ -2077,5 +2183,6 @@ closeSendEditor(); } },true); - setMode('FX'); + // The ACTUAL M4 WebView2 mixer now opens as one integrated operator console. + setMode('CONSOLE'); })(); diff --git a/web/mixer-layout.css b/web/mixer-layout.css index 7a9ecf2b4..c9eac0d14 100644 --- a/web/mixer-layout.css +++ b/web/mixer-layout.css @@ -251,3 +251,1173 @@ @media(max-width:1366px){ #app .toolbar .project{max-width:130px;flex-basis:130px} } + + +/* ARSONMIX V6 PREMIUM LIVE CONSOLE — low-compositor-cost fixed strip grid. + Browser demo and native capability-gated shell share exactly the same DOM. */ +#app #arV6Console{display:none} +.ar-v6-active #app .left-rail{display:none!important} +.ar-v6-active #app .workbench{display:flex!important;flex:1 1 0;min-width:0;min-height:0;overflow:hidden} +.ar-v6-active #app #mixer, +.ar-v6-active #app #rackWorkspace{display:none!important} +.ar-v6-active #app .toolbar-actions.arSegmentedToolbar .nav, +.ar-v6-active #app .arMixerChannelPager{display:none!important} +#app .arV6Console, #app .arV6Console *{box-sizing:border-box} +.ar-v6-active #app #arV6Console{ + display:grid;grid-template-rows:51px auto minmax(0,1fr); + width:100%;height:100%;min-width:0;min-height:0;overflow:hidden; + background:linear-gradient(180deg,#23313a,#111b23 90px,#0c151c 100%); + color:#d3e0e6;font:11px/1.35 "ArSonMix Inter","Segoe UI",sans-serif; +} +#app .arV6Top{ + display:flex;justify-content:space-between;align-items:center; + gap:12px;padding:6px 13px;border-bottom:1px solid #435967; + background:linear-gradient(180deg,#33444e,#192833); + min-width:0; +} +#app .arV6Identification{display:flex;align-items:center;gap:11px;min-width:0;overflow:hidden} +#app .arV6Kicker{font:600 10px/1.2 "Segoe UI",sans-serif;letter-spacing:1.1px;white-space:nowrap;color:#d3e4ec} +#app .arV6Device{color:#92b3c1;font:10px/1.25 "Segoe UI",sans-serif;overflow:hidden;white-space:nowrap;text-overflow:ellipsis} +#app .arV6State{padding:4px 7px;border:1px solid #607782;border-radius:3px;white-space:nowrap;color:#e0dbad;font:600 9px/1 "Segoe UI",sans-serif} +#app .arV6Console[data-armed="true"] .arV6State{color:#a8e6cd;border-color:#396c62} +#app .arV6Tools{display:flex;align-items:center;gap:6px;flex:none} +#app .arV6Button,#app .arV6Select{ + font:500 10px/1.2 "Segoe UI",sans-serif; + color:#d5e5eb;background:linear-gradient(180deg,#354956,#1c303b); + border:1px solid #526e7a;border-radius:3px;min-height:25px; + padding:4px 7px;min-width:0; +} +#app .arV6Button{cursor:pointer} +#app .arV6Button:focus-visible,#app .arV6Select:focus-visible, +#app .arV6Fader:focus-visible,#app .arV6PanRange:focus-visible{ + outline:2px solid #62cce8;outline-offset:1px; +} +#app .arV6Button:disabled,#app .arV6Select:disabled, +#app .arV6Fader:disabled,#app .arV6PanRange:disabled{opacity:.48;cursor:not-allowed} +#app .arV6BankLabel{min-width:72px;text-align:center;color:#abc3cf;font:10px Consolas,monospace;white-space:nowrap} +#app .arV6SendMode{max-width:126px} +#app .arV6Message{ + font:10px/1.3 "Segoe UI",sans-serif; + padding:5px 12px;color:#e2caaa;background:#28333a; + border-bottom:1px solid #46535a;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; +} +#app .arV6Message[hidden]{display:none} +#app .arV6Body{display:flex;min-width:0;min-height:0;overflow:hidden} +#app .arV6Lanes{ + display:flex;flex:1 1 0;min-width:0;min-height:0; + overflow-x:auto;overflow-y:hidden;scrollbar-width:thin; + scrollbar-color:#486171 #0e1b25;scroll-snap-type:x proximity; +} +#app .arV6Main{ + display:flex;flex:0 0 178px;max-width:178px;min-height:0; + border-left:2px solid #6b8993; + background:#22313c;z-index:1; +} +#app .arV6NoMaster{padding:15px;color:#e2ae97;font-size:11px} +#app .arV6Strip{ + --v6-strip-color:#5f9ab1; + display:grid;grid-template-rows:37px 235px 52px minmax(105px,1fr) 26px; + flex:0 0 167px;width:167px;min-height:0;height:100%; + padding:0 7px 5px;border-right:1px solid #354955; + background:linear-gradient(90deg,#1b2b35 0%,#263741 14%,#263741 87%,#15252e); + scroll-snap-align:start;overflow:hidden; +} +#app .arV6Strip.arV6Master{ + flex:1 0 0;width:100%; + background:linear-gradient(90deg,#2a414b,#283b47 88%,#172934); +} +#app .arV6StripHead{ + display:flex;flex-direction:column;justify-content:center;gap:3px; + min-width:0;border-bottom:1px solid #496473; +} +#app .arV6Role{font:600 9px/1 "Segoe UI",sans-serif;letter-spacing:.9px;color:#88adbc} +#app .arV6Name{font:600 12px/1.2 "Segoe UI",sans-serif;color:#ecf1f3; + white-space:nowrap;overflow:hidden;text-overflow:ellipsis} +#app .arV6Upper{ + display:grid;grid-template-rows:31px 31px minmax(83px,1fr) minmax(54px,auto) 31px; + min-height:0;overflow:hidden;padding:6px 0 4px; + border-bottom:1px solid #3b4d57; +} +#app .arV6Field{display:flex;align-items:center;gap:5px;min-width:0} +#app .arV6FixedField{color:#91afbb;white-space:nowrap;font:9px Consolas,monospace} +#app .arV6FieldName{flex:0 0 27px;font:600 9px/1 "Segoe UI",sans-serif;color:#8faebc} +#app .arV6Field .arV6Select{flex:1 1 0;width:100%;max-width:116px;min-height:23px;padding:2px 3px} +#app .arV6Fx,#app .arV6Sends{ + min-height:0;overflow-x:hidden;overflow-y:auto;scrollbar-width:thin; + display:flex;flex-direction:column;gap:3px; + border-top:1px solid #354b57;padding-top:5px; +} +#app .arV6SectionTitle{font:600 9px/1.2 "Segoe UI",sans-serif;letter-spacing:.6px;color:#83aaba} +#app .arV6FxSlot,#app .arV6Send{display:flex;gap:3px;align-items:center;min-width:0} +#app .arV6FxSlot .arV6Button:first-child{ + flex:1 1 0;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; + background:#172b35;border-color:#476270;color:#c9dfe7; +} +#app .arV6FxSlot .arV6Button:last-child{flex:0 0 29px;width:29px;padding:3px 0;color:#9ee0bb} +#app .arV6FxSlot .arV6Button.isOff{color:#95a1a9} +#app .arV6AddFx{width:100%;min-height:23px!important;padding:3px!important;text-align:left;color:#90c9d8!important} +#app .arV6SendName{ + flex:1 1 0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#bfd2dc; + font:10px/1.1 "Segoe UI",sans-serif; +} +#app .arV6Send .arV6Button{min-height:20px;padding:2px 5px} +#app .arV6Controls{display:grid;grid-template-columns:minmax(0,1fr) 28px 28px;align-items:center; + gap:5px;border-bottom:1px solid #445863} +#app .arV6Controls .arV6Button{width:28px;min-height:28px;padding:0;font-size:11px} +#app .arV6Controls .arV6Button[aria-pressed="true"]{border-color:#bba35d;background:#61532b;color:#fff0ac} +#app .arV6Pan{display:flex;flex-direction:column;gap:2px;min-width:0;color:#86abb9;font-size:9px} +#app .arV6PanRange{ + width:100%;min-width:0;height:14px;margin:0;cursor:ew-resize; + appearance:none;-webkit-appearance:none;background:transparent; +} +/* Browser engines reject an entire selector list if either vendor + pseudo-element is unknown. Keep both tracks separate and identical. */ +#app .arV6PanRange::-webkit-slider-runnable-track{ + height:5px;border:1px solid #47616e;border-radius:1px; + background:linear-gradient(to right,#1c303a 0%,#1c303a var(--v6-pan-start,50%), + #55c0d5 var(--v6-pan-start,50%),#55c0d5 var(--v6-pan-end,50%), + #1c303a var(--v6-pan-end,50%),#1c303a 100%); +} +#app .arV6PanRange::-moz-range-track{ + height:5px;border:1px solid #47616e;border-radius:1px; + background:linear-gradient(to right,#1c303a 0%,#1c303a var(--v6-pan-start,50%), + #55c0d5 var(--v6-pan-start,50%),#55c0d5 var(--v6-pan-end,50%), + #1c303a var(--v6-pan-end,50%),#1c303a 100%); +} +#app .arV6PanRange::-webkit-slider-thumb{ + -webkit-appearance:none;appearance:none;width:10px;height:13px;margin-top:-5px; + border:1px solid #101c26;border-radius:2px;background:#abc5d0; +} +#app .arV6PanRange::-moz-range-thumb{ + width:10px;height:13px;border:1px solid #101c26;border-radius:2px;background:#abc5d0; +} +#app .arV6Lower{display:flex;gap:16px;align-items:center;justify-content:center; + padding:7px 5px 2px;min-height:0;position:relative} +#app .arV6Meter{ + display:flex;flex-direction:row;justify-content:center;gap:2px; + width:24px;height:100%;max-height:100%;min-height:70px;padding:2px; + border:1px solid #15242c;background:#02080d;box-shadow:inset 1px 0 #516673; +} +#app .arV6MeterLane{ + display:flex;flex:1 1 0;flex-direction:column-reverse; + justify-content:space-between;gap:1px;min-width:0;min-height:0; +} +#app .arV6Meter[data-format="MONO"] .arV6MeterLane[data-side="R"]{display:none} +#app .arV6Led{display:block;flex:1 1 0;min-height:2px;background:#172b30} +#app .arV6Led.lit{background:#29b277} +#app .arV6Led:nth-child(n+15).lit{background:#d8ac44} +#app .arV6Led:nth-child(n+20).lit{background:#dc6148} +#app .arV6Fader{ + writing-mode:vertical-lr;direction:rtl; + height:100%;min-height:75px;width:46px;min-width:46px;margin:0; + cursor:pointer;appearance:none;-webkit-appearance:none;background:transparent; +} +#app .arV6Fader::-webkit-slider-runnable-track{ + width:11px;min-height:100%;border:1px solid #02080d;border-radius:3px; + background:linear-gradient(90deg,#050a0f 0%,#182c36 45%,#061018 100%); + box-shadow:inset 1px 0 #58737d,inset -1px 0 #050b10; +} +#app .arV6Fader::-webkit-slider-thumb{ + -webkit-appearance:none;appearance:none; + width:44px;height:24px;border:0;border-radius:2px; + background:transparent url("assets/fader-silver2.png") center/contain no-repeat; +} +#app .arV6Fader::-moz-range-thumb{ + width:43px;height:23px;border:0;border-radius:2px; + background:transparent url("assets/fader-silver2.png") center/contain no-repeat; +} +#app .arV6Readout{ + position:absolute;bottom:3px;right:3px; + font:10px Consolas,monospace;color:#b7cbd5; +} +#app .arV6StripStatus{ + display:flex;align-items:center;min-width:0;overflow:hidden; + font:600 9px/1.2 "Segoe UI",sans-serif;letter-spacing:.15px; + color:#91b6c3;white-space:nowrap;text-overflow:ellipsis; +} +#app .arV6Console[data-demo="true"] .arV6StripStatus{color:#d9b98a} +#app .arV6Console[data-demo="true"] .arV6State{color:#e6bf8e;border-color:#986d46} +#app #arV6Return{min-height:29px;flex:0 0 auto} +#app #arV6Return[hidden]{display:none!important} +@media(max-width:1366px){ + #app .arV6Kicker{max-width:176px;overflow:hidden;text-overflow:ellipsis} + #app .arV6Strip{flex-basis:155px;width:155px;padding-left:6px;padding-right:6px} + #app .arV6Main{flex-basis:166px;max-width:166px} + #app .arV6Tools{gap:3px} +} +@media(max-width:1100px){ + #app .arV6Top{padding:5px 7px} + #app .arV6Kicker{display:none} + #app .arV6SendMode{max-width:105px} +} +@media(max-height:790px){ + #app .arV6Strip{grid-template-rows:32px 197px 45px minmax(85px,1fr) 22px} + #app .arV6Upper{grid-template-rows:27px 27px minmax(74px,1fr) minmax(43px,auto) 27px;padding-top:3px} + #app .arV6Top{min-height:44px} + #app .arV6Console .arV6Button{min-height:22px} +} +@media(max-height:690px){ + #app .arV6Strip{grid-template-rows:28px 160px 40px minmax(75px,1fr) 18px} + #app .arV6Upper{grid-template-rows:24px 24px minmax(54px,1fr) minmax(34px,auto) 24px} + #app .arV6SectionTitle{font-size:8px} + #app .arV6FxSlot .arV6Button{min-height:18px} + #app .arV6Device{font-size:9px} +} + +#app .arV6RoleSelect{width:78px;max-width:78px} +#app .arV6FxSlot[draggable="true"]{cursor:grab} +#app .arV6FxSlot[draggable="true"]:active{cursor:grabbing} +#app .arV6PluginChoice{width:100%;max-width:100%;min-height:23px} + + +/* ARSONMIX M4 UNIFIED OPERATOR CONSOLE — real WebView2 / JUCE path. + Single native-source view: IN -> M/ST -> FX -> AUX SEND -> MAIN -> FADER. + The existing mixer-io.js + monitor.js keep exclusive routing authority. + Zero CSS filter blur, large glow, transformed hover layers or extra canvas. */ +#app #mixer[data-io-mode="CONSOLE"]{ + align-items:stretch; + background:#0c1720; + scroll-snap-type:x proximity; +} +#app #mixer[data-io-mode="CONSOLE"] > .strip[data-strip]{ + flex:0 0 146px;min-width:146px;max-width:146px; + display:flex;min-height:0;height:100%; + border-right:1px solid #334b58; + background:linear-gradient(90deg,#162631,#263741 8%,#22313c 88%,#152630); + box-shadow:inset 1px 0 #718a9938; + scroll-snap-align:start; +} +#app #mixer[data-io-mode="CONSOLE"] > .strip[data-strip].selected{ + background:linear-gradient(90deg,#233e4b,#29424f 8%,#233845 88%,#152f3b); + box-shadow:inset 2px 0 #52d4ee; +} +#app #mixer[data-io-mode="CONSOLE"] > .strip[data-strip] > .ch-id{ + order:0;height:32px;min-height:32px;flex:0 0 32px; + font:600 13px/1 "Segoe UI",sans-serif; + justify-content:space-between;padding:0 9px; + background:linear-gradient(180deg,color-mix(in srgb,var(--ch) 34%,#2d404c),#172a35); + border-top:2px solid var(--ch);border-bottom:1px solid #3d5662; + text-shadow:none; +} +#app #mixer[data-io-mode="CONSOLE"] > .strip[data-strip] .arChannelQuickInput{ + display:none!important; +} +#app #mixer[data-io-mode="CONSOLE"] > .strip[data-strip] > .arChannelBank{ + order:1;display:flex!important;flex-direction:column; + flex:0 0 148px;height:148px;min-height:148px; + padding:5px 7px 4px;gap:4px; + background:linear-gradient(#142631,#152934); + border-bottom:1px solid #3b5460;overflow:hidden; +} +#app #mixer[data-io-mode="CONSOLE"] .arChannelBank .arRouteBank{ + display:grid!important;flex:0 0 79px;min-height:79px; + grid-template-columns:26px minmax(0,1fr); + grid-template-rows:24px 24px 24px; + gap:2px 4px;align-items:center;min-width:0; +} +#app #mixer[data-io-mode="CONSOLE"] .arChannelBank .arRouteBank > .arBankTitle{ + display:block;min-width:0;margin:0;line-height:1.1; + white-space:nowrap;overflow:hidden; + font:600 9px/1 "Segoe UI",sans-serif;color:#84b2c4; +} +#app #mixer[data-io-mode="CONSOLE"] .arChannelBank .arRouteBank > .arBankTitle:first-child{ + grid-column:1;grid-row:1;font-size:0; +} +#app #mixer[data-io-mode="CONSOLE"] .arChannelBank .arRouteBank > .arBankTitle:first-child::before{ + content:"IN";font:600 9px "Segoe UI",sans-serif; +} +#app #mixer[data-io-mode="CONSOLE"] .arChannelBank .arRouteBank > .arBankTitle:nth-of-type(2){ + grid-column:1;grid-row:2;font-size:0; +} +#app #mixer[data-io-mode="CONSOLE"] .arChannelBank .arRouteBank > .arBankTitle:nth-of-type(2)::before{ + content:"OUT";font:600 9px "Segoe UI",sans-serif; +} +#app #mixer[data-io-mode="CONSOLE"] .arChannelBank .arBankSource{ + grid-column:2;grid-row:1; + height:23px;min-height:23px;width:100%; + padding:2px 4px;font:10px/1.1 "Segoe UI",sans-serif; + border:1px solid #4e7282;border-radius:2px; + background:#091d28;color:#d0e6ef; +} +#app #mixer[data-io-mode="CONSOLE"] .arChannelBank .arBankOutput{ + grid-column:2;grid-row:2; + display:block;height:23px;min-height:23px;width:100%; + padding:3px 5px;text-align:left;white-space:nowrap;text-overflow:ellipsis; + border:1px solid #3c6271;border-radius:2px; + background:#142d39;color:#afd3df; + font:10px/1.1 "Segoe UI",sans-serif;cursor:pointer; +} +#app #mixer[data-io-mode="CONSOLE"] .arChannelBank .arBankOutput:hover{ + background:#1c3b4b; +} +#app #mixer[data-io-mode="CONSOLE"] .arChannelBank .arBankFormatRow{ + grid-column:1/-1;grid-row:3; + height:24px;min-height:24px;display:flex;align-items:center;gap:5px; + justify-content:space-between;overflow:hidden; +} +#app #mixer[data-io-mode="CONSOLE"] .arChannelBank .arBankChannelFormat{ + flex:0 0 60px;width:60px;max-width:60px;min-width:0; + min-height:21px;height:21px;padding:1px 3px; + background:#0c222e;border:1px solid #436777;color:#bcdbe5; + font:9px "Segoe UI",sans-serif; +} +#app #mixer[data-io-mode="CONSOLE"] .arChannelBank .arBankStage{ + display:block;min-width:0;flex:1 1 auto; + font:8px/1.1 "Segoe UI",sans-serif;white-space:nowrap; + text-align:right;overflow:hidden;text-overflow:ellipsis; +} +#app #mixer[data-io-mode="CONSOLE"] .arChannelBank .arRouteBank > .arBankPatch{ + display:none!important; +} +#app #mixer[data-io-mode="CONSOLE"] .arChannelBank .arSendBank{ + display:flex!important;flex:1 1 0;min-height:0; + flex-direction:column;gap:3px;overflow:hidden; + border-top:1px solid #355361;padding-top:4px; +} +#app #mixer[data-io-mode="CONSOLE"] .arChannelBank .arSendBank > .arBankTitle{ + flex:0 0 10px;display:block;font:600 9px/1 "Segoe UI",sans-serif; + color:#8ebccd; +} +#app #mixer[data-io-mode="CONSOLE"] .arChannelBank .arSendSummary{ + display:grid;grid-template-columns:repeat(2,minmax(0,1fr)); + grid-template-rows:repeat(2,20px);gap:2px;min-width:0;min-height:42px; +} +#app #mixer[data-io-mode="CONSOLE"] .arChannelBank .arSendChip{ + display:flex;align-items:center;gap:3px;min-width:0; + width:100%;height:20px;min-height:20px; + padding:2px 3px;border:1px solid #426474; + background:#152c37;border-radius:2px;font:9px/1 "Segoe UI",sans-serif; + overflow:hidden;text-overflow:ellipsis;white-space:nowrap; +} +#app #mixer[data-io-mode="CONSOLE"] .arChannelBank .arSendChip .arSendDest{ + font:600 8px/1 "Segoe UI",sans-serif;min-width:0;flex:none; +} +#app #mixer[data-io-mode="CONSOLE"] .arChannelBank .arSendBank > .arBankPatch{ + display:none!important; +} +#app #mixer[data-io-mode="CONSOLE"] > .strip[data-strip] > .rack{ + order:2;display:flex!important;flex:0 0 112px;height:112px;min-height:112px; + flex-direction:column;gap:3px;padding:6px 5px 4px; + overflow-x:hidden;overflow-y:auto;scrollbar-width:thin; + scrollbar-color:#456b7b #11242e; + border-bottom:1px solid #385460;background:#0f202b; +} +#app #mixer[data-io-mode="CONSOLE"] .rack .insert-slot{ + height:23px;min-height:23px;flex:0 0 23px; +} +#app #mixer[data-io-mode="CONSOLE"] .rack .insert{ + height:23px;min-height:23px; + font:10px/1 "Segoe UI",sans-serif; + border-color:#304b5b;box-shadow:none; + background:linear-gradient(#263c49,#122833); +} +#app #mixer[data-io-mode="CONSOLE"] .rack .insert.empty{ + border:1px dashed #315365;color:#70bdd1; +} +#app #mixer[data-io-mode="CONSOLE"] .rack .fx-power{ + width:23px;min-width:23px;height:23px;min-height:23px; + box-shadow:none;text-shadow:none;transition:none; +} +#app #mixer[data-io-mode="CONSOLE"] > .strip[data-strip] > .strip-controls{ + order:3;flex:0 0 78px;height:78px;min-height:78px; + padding:0;border-bottom:1px solid #324e5a; + background:#223440; +} +#app #mixer[data-io-mode="CONSOLE"] .strip-controls > .trim-row, +#app #mixer[data-io-mode="CONSOLE"] .strip-controls > .knob{ + display:none!important; +} +#app #mixer[data-io-mode="CONSOLE"] .strip-controls .pan-control{ + height:37px;min-height:37px;flex:0 0 37px; +} +#app #mixer[data-io-mode="CONSOLE"] .strip-controls .utility-row{ + height:31px;min-height:31px;flex:0 0 31px; + margin:0!important;padding:2px 6px; +} +#app #mixer[data-io-mode="CONSOLE"] > .strip[data-strip] > .channel-actions{ + order:4;height:35px;flex:0 0 35px;min-height:35px; + padding:3px 6px;gap:4px; +} +#app #mixer[data-io-mode="CONSOLE"] .channel-actions > button{ + height:27px!important;min-height:27px!important; +} +#app #mixer[data-io-mode="CONSOLE"] > .strip[data-strip] > .db-display{ + order:5;height:24px;flex:0 0 24px; + font:600 11px/1 Consolas,monospace;text-shadow:none; + color:#75cce4;background:#152934; +} +#app #mixer[data-io-mode="CONSOLE"] > .strip[data-strip] > .fader-zone{ + order:6;flex:1 1 auto;min-height:100px;overflow:hidden; +} +#app #mixer[data-io-mode="CONSOLE"] > .strip[data-strip] > .strip-name{ + order:7;height:44px;flex:0 0 44px;gap:3px; + font:600 11px/1 "Segoe UI",sans-serif;text-shadow:none; + background:linear-gradient(110deg,color-mix(in srgb,var(--ch) 45%,#101d26),#142936); +} +#app #mixer[data-io-mode="CONSOLE"] > .strip[data-strip] > .strip-name .track-icon{ + font-size:13px;line-height:14px; +} +#app #mixer[data-io-mode="CONSOLE"] > #masterLeft{ + flex:0 0 155px;min-width:155px;max-width:155px; + height:100%;position:sticky;right:0;z-index:3; + background:#293845;border-left:2px solid #a17f8b; + box-shadow:-5px 0 12px #06131a; +} +#app #mixer[data-io-mode="CONSOLE"] #masterLeft .master-ch-id{ + height:32px;flex:0 0 32px;min-height:32px; + font:600 12px "Segoe UI",sans-serif; +} +#app #mixer[data-io-mode="CONSOLE"] #masterLeft .arMainOutSummary{ + height:80px;min-height:80px;flex:0 0 80px; + display:flex;flex-direction:column;gap:8px;align-items:stretch; + padding:10px 8px;background:#19303c; + border-bottom:1px solid #3e6171; +} +#app #mixer[data-io-mode="CONSOLE"] #masterLeft .arMainOutHeading{ + font:600 9px/1 "Segoe UI",sans-serif;color:#a1c5d1; +} +#app #mixer[data-io-mode="CONSOLE"] #masterLeft .arMainOutAction{ + height:31px;min-height:31px;max-width:100%;overflow:hidden; + white-space:nowrap;text-overflow:ellipsis; + padding:3px 5px;border-radius:3px;border:1px solid #567583; + background:#203d4b;color:#e3ecf1; + font:10px/1.2 "Segoe UI",sans-serif;text-align:left; +} +#app #mixer[data-io-mode="CONSOLE"] #masterLeft .arMainOutAction:disabled{opacity:.48} +#app #mixer[data-io-mode="CONSOLE"] #masterLeft .master-fx-rack{ + flex:0 0 180px;height:180px;min-height:180px; + background:#152832; +} +#app #mixer[data-io-mode="CONSOLE"] #masterLeft .master-fx-slot{ + height:23px;min-height:23px;flex:0 0 23px; +} +#app #mixer[data-io-mode="CONSOLE"] #masterLeft .master-controls-zone{ + flex:0 0 78px;height:78px;min-height:78px; +} +#app #mixer[data-io-mode="CONSOLE"] #masterLeft .master-analysis{ + height:33px;min-height:33px;flex:0 0 33px;margin:2px 0; + overflow:hidden;padding:2px 5px; +} +#app #mixer[data-io-mode="CONSOLE"] #masterLeft .master-analysis .master-info-kicker{display:none} +#app #mixer[data-io-mode="CONSOLE"] #masterLeft .master-analysis .master-info-row{ + margin:0;font-size:8px;line-height:12px; +} +#app #mixer[data-io-mode="CONSOLE"] #masterLeft .master-pan-wrap{ + height:40px;min-height:40px;flex:0 0 40px; +} +#app #mixer[data-io-mode="CONSOLE"] #masterLeft .master-actions{ + height:35px;min-height:35px;flex:0 0 35px; +} +#app #mixer[data-io-mode="CONSOLE"] #masterLeft .master-db-display{ + height:24px;min-height:24px;flex:0 0 24px; +} +#app #mixer[data-io-mode="CONSOLE"] #masterLeft .master-fader-zone{ + flex:1 1 0;min-height:100px; +} +#app #mixer[data-io-mode="CONSOLE"] #masterLeft .master-strip-name{ + height:44px;min-height:44px;flex:0 0 44px; +} +#app .arRailModeSection .arMixerBankBar{ + height:auto;min-height:0;padding:5px;display:flex;flex-direction:column; + gap:5px;background:#14242d; +} +#app .arRailModeSection .arMixerBankModes{ + display:grid;grid-template-columns:1fr repeat(3,minmax(0,25px)); + width:100%;gap:2px; +} +#app .arRailModeSection .arMixerBankModes [data-mix-mode="CONSOLE"]{ + min-width:0;width:100%;background:#25495b;color:#d7eff7; + border-color:#547c8c;font-size:9px;padding:0 3px;letter-spacing:0; +} +#app .arRailModeSection .arMixerBankModes [data-mix-mode="CONSOLE"].active{ + background:#3b8695;color:#fff;border-color:#68b1bb; +} +#app .arRailModeSection .arMixerBankModes [data-mix-mode]:not([data-mix-mode="CONSOLE"]){ + width:25px;min-width:25px;padding:0; + font:600 8px "Segoe UI",sans-serif;letter-spacing:-.15px; +} +#app .arRailModeSection .arMixerBankBar .arMixApply{display:none} +#app .arRailModeSection .arMixerBankBar .arMixIoOpen{ + width:100%;height:30px;flex:none; +} +#app .arChannelSignalFlow{height:29px;min-height:29px;flex:0 0 29px} +#app .arChannelSignalFlow [data-focus-step]{ + font-size:9px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; +} +/* Four-layer engineering modes are retained for exact regression and + advanced work; the one-console mode is the M4 first-sound default. */ +@media(max-height:770px){ + #app #mixer[data-io-mode="CONSOLE"] > .strip[data-strip] > .arChannelBank{ + flex-basis:132px;height:132px;min-height:132px;padding-top:3px; + } + #app #mixer[data-io-mode="CONSOLE"] .arChannelBank .arRouteBank{ + flex-basis:70px;min-height:70px;grid-template-rows:21px 21px 22px; + } + #app #mixer[data-io-mode="CONSOLE"] .arChannelBank .arSendSummary{ + grid-template-rows:repeat(2,18px);min-height:38px; + } + #app #mixer[data-io-mode="CONSOLE"] .arChannelBank .arSendChip{ + height:18px;min-height:18px; + } + #app #mixer[data-io-mode="CONSOLE"] > .strip[data-strip] > .rack{ + flex-basis:96px;height:96px;min-height:96px; + } + #app #mixer[data-io-mode="CONSOLE"] #masterLeft .arMainOutSummary{ + flex-basis:73px;height:73px;min-height:73px; + } + #app #mixer[data-io-mode="CONSOLE"] #masterLeft .master-fx-rack{ + flex-basis:155px;height:155px;min-height:155px; + } +} +@media(max-width:1250px){ + #app #mixer[data-io-mode="CONSOLE"] > .strip[data-strip]{ + flex-basis:136px;min-width:136px;max-width:136px; + } + #app #mixer[data-io-mode="CONSOLE"] > #masterLeft{ + flex-basis:148px;min-width:148px;max-width:148px; + } +} + + +/* Main dock geometry is measured by a ResizeObserver on the single mixer + viewport. Unlike position:sticky on the final flex child, this is always + visible at scrollLeft=0 and after any bank navigation. */ +#app #mixer[data-io-mode="CONSOLE"]{ + padding-right:155px; + scroll-padding-right:155px; +} +#app #mixer[data-io-mode="CONSOLE"] > #masterLeft{ + position:fixed!important; + right:auto!important; + left:var(--ar-main-dock-left,calc(100vw - 161px))!important; + top:var(--ar-main-dock-top,92px)!important; + height:var(--ar-main-dock-height,calc(100dvh - 122px))!important; + z-index:7; +} +@media(max-width:1250px){ + #app #mixer[data-io-mode="CONSOLE"]{padding-right:148px;scroll-padding-right:148px} +} + +/* Engineering bank parity: the extra accepted MAIN output line belongs to + unified CONSOLE only, so legacy FX/ROUTE/SENDS fader rows remain aligned. */ +#app #mixer:not([data-io-mode="CONSOLE"]) #masterLeft .arMainOutSummary{display:none!important} + +/* v5.2 operator-approved narrow console: UI-only banking, never a DSP switch. */ +#app .arV6Console[data-narrow="true"] .arV6Strip{ + flex:0 0 127px;width:127px;padding-left:4px;padding-right:4px; +} +#app .arV6Console[data-narrow="true"] .arV6Main{ + flex:0 0 143px;max-width:143px; +} +#app .arV6Console[data-narrow="true"] .arV6Strip.arV6Master{width:100%;flex:1 0 0} +#app .arV6Console[data-narrow="true"] .arV6Controls{ + grid-template-columns:minmax(0,1fr) 25px 25px;gap:2px; +} +#app .arV6Console[data-narrow="true"] .arV6Controls .arV6Button{width:25px} +@media(max-width:1100px){ + #app .arV6Tools{gap:2px} + #app .arV6Console .arV6Button,#app .arV6Console .arV6Select{padding-left:3px;padding-right:3px} +} + + +/* V5.2 PR#278 operator console: one shared row system for all strips and + section rail. Collapse changes only CSS, never DSP or accepted channel order. + FX/SEND inner scrolling cannot change neighboring fader alignment. */ +#app .arV6Console{ + --v6-head-h:37px;--v6-io-h:89px;--v6-fx-h:91px;--v6-send-h:55px; + --v6-pan-h:52px;--v6-status-h:26px; +} +#app .arV6Console[data-collapseio="true"]{--v6-io-h:24px} +#app .arV6Console[data-collapsefx="true"]{--v6-fx-h:23px} +#app .arV6Console[data-collapsesend="true"]{--v6-send-h:23px} +#app .arV6Console .arV6Strip{ + grid-template-rows:var(--v6-head-h) + calc(var(--v6-io-h) + var(--v6-fx-h) + var(--v6-send-h)) + var(--v6-pan-h) minmax(105px,1fr) var(--v6-status-h); +} +#app .arV6Console .arV6Upper{ + display:grid;grid-template-rows:var(--v6-io-h) var(--v6-fx-h) var(--v6-send-h); + padding:0;min-height:0;overflow:hidden; +} +#app .arV6Console .arV6Route{ + display:grid;grid-template-rows:repeat(3,minmax(0,1fr)); + gap:1px;min-height:0;overflow:hidden;padding:2px 0; + border-bottom:1px solid #405360; +} +#app .arV6Console .arV6Fx,#app .arV6Console .arV6Sends{ + overflow-y:auto;overflow-x:hidden;min-height:0;min-width:0; + padding:3px 0 2px;gap:2px;border-top:0;border-bottom:1px solid #3b4d59; +} +#app .arV6Console[data-collapseio="true"] .arV6Route>.arV6Field, +#app .arV6Console[data-collapsefx="true"] .arV6Fx>:not(.arV6SectionTitle), +#app .arV6Console[data-collapsesend="true"] .arV6Sends>:not(.arV6SectionTitle){display:none!important} +#app .arV6Console[data-collapseio="true"] .arV6Route::before{ + content:"IN / OUT";font:600 9px/18px "Segoe UI",sans-serif;color:#83aaba; +} +#app .arV6Console .arV6SectionRail{ + display:grid;flex:0 0 32px;width:32px;min-width:32px;min-height:0; + grid-template-rows:var(--v6-head-h) var(--v6-io-h) var(--v6-fx-h) + var(--v6-send-h) var(--v6-pan-h) minmax(105px,1fr) var(--v6-status-h); + background:#1c2931;border-right:1px solid #4a626f; +} +#app .arV6Console .arV6RailCell{ + min-width:0;min-height:0;display:flex;justify-content:center;align-items:flex-start; + padding:5px 1px 0;overflow:hidden; + border:0;border-bottom:1px solid #344a56;background:transparent; + color:#8fa9b6;font:600 9px/1.2 "Segoe UI",sans-serif; +} +#app .arV6Console .arV6RailToggle{ + width:100%;cursor:pointer;color:#add7e2;appearance:none; + border-radius:0;text-align:center; +} +#app .arV6Console .arV6RailToggle:hover, +#app .arV6Console .arV6RailToggle:focus-visible{ + background:#2c4552;outline:1px solid #6fc7df;outline-offset:-2px; +} +#app .arV6Console .arV6RailToggle.isCollapsed{color:#708b99;background:#26333c} +#app .arV6Console .arV6RailFader{align-items:center;padding:0;writing-mode:vertical-lr;letter-spacing:2px} +#app .arV6Console .arV6RailHeader{align-items:center;padding:0} +#app .arV6Console .arV6Strip[hidden]{display:none!important} +#app .arV6Console .arV6Filter{max-width:77px;width:77px} +@media(max-height:790px){ + #app .arV6Console{ + --v6-head-h:32px;--v6-io-h:76px;--v6-fx-h:74px;--v6-send-h:47px; + --v6-pan-h:45px;--v6-status-h:22px; + } + #app .arV6Console[data-collapseio="true"]{--v6-io-h:22px} + #app .arV6Console[data-collapsefx="true"]{--v6-fx-h:21px} + #app .arV6Console[data-collapsesend="true"]{--v6-send-h:21px} +} +@media(max-height:690px){ + #app .arV6Console{ + --v6-head-h:28px;--v6-io-h:67px;--v6-fx-h:57px;--v6-send-h:36px; + --v6-pan-h:40px;--v6-status-h:18px; + } + #app .arV6Console[data-collapseio="true"]{--v6-io-h:20px} + #app .arV6Console[data-collapsefx="true"]{--v6-fx-h:19px} + #app .arV6Console[data-collapsesend="true"]{--v6-send-h:19px} + #app .arV6Console .arV6RailCell{font-size:8px;padding-top:3px} +} + + +/* Native direct SEND gain in the same strip, not a separate FX workspace. + Two fixed rows per send preserve rail/fader geometry; inner scroll only. */ +#app .arV6Console .arV6Send{ + display:grid;grid-template-columns:minmax(0,1fr) 36px; + grid-template-rows:20px 18px;gap:0 3px; + flex:0 0 auto;min-height:38px;min-width:0;align-items:center; + border-bottom:1px solid #344c58; +} +#app .arV6Console .arV6SendName{ + grid-column:1;grid-row:1;min-width:0;overflow:hidden; + text-overflow:ellipsis;white-space:nowrap; +} +#app .arV6Console .arV6Send>.arV6Button{ + grid-column:2;grid-row:1;width:36px;min-width:0;max-width:36px; + height:18px;min-height:18px;padding:1px; +} +#app .arV6Console .arV6SendGain{ + display:flex;grid-column:1 / -1;grid-row:2; + align-items:center;gap:4px;min-width:0;min-height:18px; +} +#app .arV6Console .arV6SendLevel{ + min-width:0;flex:1 1 0;width:100%;height:13px;margin:0; + accent-color:#58b5ce;cursor:pointer; +} +#app .arV6Console .arV6SendLevel:disabled{opacity:.45;cursor:not-allowed} +#app .arV6Console .arV6SendDb{ + flex:0 0 39px;min-width:39px;color:#b6cbd5; + text-align:right;white-space:nowrap;font:9px/1 Consolas,monospace; +} +#app .arV6Console{--v6-fx-h:80px;--v6-send-h:82px} +@media(max-height:790px){ + #app .arV6Console{--v6-fx-h:70px;--v6-send-h:72px} +} +@media(max-height:690px){ + #app .arV6Console{--v6-fx-h:56px;--v6-send-h:55px} +} + + +/* User-approved PRD v5.2: native-only digital TRIM/CUE and lightweight + ChannelId-based multiselect. No RT animation or DSP graph duplication. */ +#app .arV6Console .arV6SelectionCount{ + flex:0 0 auto;white-space:nowrap;color:#9ebbc7;font:10px/1 Consolas,monospace; +} +#app .arV6Console .arV6StripHead{cursor:pointer} +#app .arV6Console .arV6Strip.isSelected{ + background:linear-gradient(90deg,#254454,#304958 14%,#304958 87%,#1a3441); + box-shadow:inset 0 0 0 1px #70b6d1; +} +#app .arV6Console .arV6Strip.isSelected .arV6StripHead{border-bottom-color:#79b9cb} +#app .arV6Console .arV6Controls{ + display:grid;grid-template-columns:minmax(0,1fr) repeat(3,26px); + grid-template-rows:minmax(0,1fr) 20px;gap:1px 3px; + padding:1px 0 2px;align-items:center; +} +#app .arV6Console .arV6Controls .arV6Pan{grid-row:1;grid-column:1} +#app .arV6Console .arV6Controls .arV6Button{ + min-height:24px;width:26px;padding:0;font-size:11px; +} +#app .arV6Console .arV6Trim{ + display:flex;grid-column:1/-1;grid-row:2;align-items:center; + gap:4px;min-width:0;height:19px;border-top:1px solid #324854; + color:#8cafc0;font:600 9px/1 "Segoe UI",sans-serif; +} +#app .arV6Console .arV6TrimLevel{ + min-width:0;flex:1 1 0;width:100%;margin:0;height:14px; + cursor:ew-resize;accent-color:#60b4ca; +} +#app .arV6Console .arV6TrimDb{ + min-width:28px;text-align:right;white-space:nowrap; + font:9px/1 Consolas,monospace;color:#bdd0d9; +} +#app .arV6Console .arV6TrimLevel:disabled{opacity:.45;cursor:not-allowed} +#app .arV6Console[data-narrow="true"] .arV6Controls{ + grid-template-columns:minmax(0,1fr) repeat(3,23px);gap:1px; +} +#app .arV6Console[data-narrow="true"] .arV6Controls .arV6Button{width:23px} +@media(max-height:690px){ + #app .arV6Console .arV6Controls{grid-template-rows:minmax(0,1fr) 17px;padding:0} + #app .arV6Console .arV6Controls .arV6Button{min-height:19px} + #app .arV6Console .arV6Trim{height:16px;font-size:8px;gap:2px} + #app .arV6Console .arV6TrimLevel{height:12px} +} + + +/* v5.2 one-Console DEVICE drawer: native hardware inventory only, no + fake setup wizard, no full-window modal and no fader DOM reflow. */ +#app .arV6Console{position:relative} +#app .arV6Console .arV6DevicePanel{ + position:absolute;z-index:20;top:52px;right:8px; + display:flex;flex-direction:column; + width:min(420px,calc(100% - 16px));max-height:min(72vh,530px); + overflow:hidden;background:#1a2a34;color:#d4e5eb; + border:1px solid #668693;border-radius:4px; + box-shadow:0 8px 25px #071019aa; +} +#app .arV6Console .arV6DevicePanel[hidden]{display:none!important} +#app .arV6Console .arV6DevicePanelHead{ + display:flex;justify-content:space-between;align-items:center; + gap:6px;min-height:35px;padding:5px 10px;background:#304651; + border-bottom:1px solid #456370; + font:600 10px/1.2 "Segoe UI",sans-serif; +} +#app .arV6Console .arV6DevicePanelHead .arV6Button{min-height:23px;min-width:26px;padding:2px} +#app .arV6Console .arV6DeviceRows{padding:5px 10px 10px;overflow-y:auto} +#app .arV6Console .arV6DeviceRow{ + display:grid;grid-template-columns:95px minmax(0,1fr);gap:8px; + padding:5px 0;border-bottom:1px solid #324954;font:10px/1.45 "Segoe UI",sans-serif; +} +#app .arV6Console .arV6DeviceRow span{color:#8fb5c4} +#app .arV6Console .arV6DeviceRow strong{font-weight:500;overflow-wrap:anywhere} +#app .arV6Console .arV6DeviceNote{margin:9px 0 2px;color:#c5ad86;font:10px/1.5 "Segoe UI",sans-serif} +@media(max-width:1100px){#app .arV6Console .arV6DevicePanel{top:45px}} + + +/* F8 native VST3 catalog: search-only until native ADD_INSERT capability + and a verified catalog are present. Floating inspector, zero fader reflow. */ +#app .arV6Console .arV6PluginPanel{ + position:absolute;z-index:21;top:52px;right:8px; + display:flex;flex-direction:column; + width:min(410px,calc(100% - 16px));max-height:min(72vh,540px); + overflow:hidden;background:#1a2a34;color:#d4e5eb; + border:1px solid #668693;border-radius:4px; + box-shadow:0 8px 25px #071019aa; +} +#app .arV6Console .arV6PluginPanel[hidden]{display:none!important} +#app .arV6Console .arV6PluginTarget{ + padding:7px 10px;color:#b4d2dc;font:10px/1.35 "Segoe UI",sans-serif; +} +#app .arV6Console .arV6PluginSearch{ + margin:0 10px 8px;min-height:30px;padding:6px 9px; + color:#e5eff4;background:#102633;border:1px solid #527a88; + border-radius:3px;font:11px "Segoe UI",sans-serif; +} +#app .arV6Console .arV6PluginResults{ + overflow:auto;display:flex;flex-direction:column; + min-height:65px;padding:0 9px 9px;gap:3px;scrollbar-width:thin; +} +#app .arV6Console .arV6PluginResult{ + text-align:left;min-height:28px;width:100%;padding:5px 8px; + background:#243d4a;color:#d6ebf0;border-color:#426879; +} +#app .arV6Console .arV6PluginResult:disabled{opacity:.46;cursor:not-allowed} +@media(max-width:1100px){#app .arV6Console .arV6PluginPanel{top:45px}} + + +/* PRD v5.2 operator milestone: one compact native multi-channel drawer, + separate relative LINK from serial GROUP BUS. No browser DSP or fake link. */ +#app .arV6Console .arV6SelectionCount{flex:0 0 auto;padding:3px 6px} +#app .arV6Console .arV6SelectionPanel{ + position:absolute;z-index:22;top:52px;right:8px; + width:min(350px,calc(100% - 16px));max-height:min(72vh,420px); + display:flex;flex-direction:column;gap:0;min-width:0; + background:#1a2a34;color:#d4e5eb;border:1px solid #668693; + border-radius:4px;box-shadow:0 8px 25px #071019aa; +} +#app .arV6Console .arV6SelectionPanel[hidden]{display:none!important} +#app .arV6Console .arV6SelectionSummary{ + padding:8px 10px;min-height:32px;max-height:78px;overflow-y:auto; + font:10px/1.5 "Segoe UI",sans-serif;color:#b9d1da; +} +#app .arV6Console .arV6SelectionActions{display:grid;gap:8px;padding:2px 10px 4px} +#app .arV6Console .arV6LinkActions{display:grid;grid-template-columns:1fr auto;gap:6px} +#app .arV6Console .arV6BusActions{display:grid;grid-template-columns:1fr auto;gap:6px} +#app .arV6Console .arV6GroupTarget{min-width:0;width:100%} +#app .arV6Console .arV6SelectionPanel .arV6DeviceNote{padding:0 10px 8px} +#app .arV6Console .arV6Rename{ + width:100%;min-height:23px;min-width:0;padding:2px 4px; + color:#eaf7f8;background:#16303d;border:1px solid #77b8c6; + font:500 12px/1.2 "Segoe UI",sans-serif; +} +@media(max-width:1100px){#app .arV6Console .arV6SelectionPanel{top:46px}} + + +/* PR #278 V5 contextual FX picker on existing old UI. Preserve all six + fixed-height native slots until engine/bridge support a variable rack; avoid + breaking the six-slot layout contract while keeping original BTN-180 art. */ + + +#app .workbench{position:relative} +#app .arV5QuickFx{ + position:absolute;z-index:46;top:80px;left:8px; + display:flex;flex-direction:column;width:min(316px,calc(100% - 16px)); + max-height:min(63vh,410px);background:#182b35;color:#dfedf2; + border:1px solid #628594;border-radius:4px;box-shadow:0 8px 23px #061018aa; +} +#app .arV5QuickFx[hidden]{display:none!important} +#app .arV5QuickHead{min-height:32px;display:flex;justify-content:space-between;align-items:center; + padding:5px 8px;border-bottom:1px solid #3e5964;font:500 11px/1.2 "Segoe UI",sans-serif} +#app .arV5QuickHead strong{font-weight:500;overflow:hidden;white-space:nowrap;text-overflow:ellipsis} +#app .arV5QuickHead button{background:transparent;border:0;color:#dceff4;font-size:18px;cursor:pointer} +#app .arV5QuickSearch{min-height:29px;margin:7px;padding:4px 7px; + background:#0d1c25;border:1px solid #506b7a;border-radius:2px;color:#e8f2f5} +#app .arV5QuickResults{display:flex;flex-direction:column;gap:2px;padding:2px 7px 8px; + overflow:auto;min-height:45px} +#app .arV5QuickResult{display:flex;justify-content:space-between;align-items:center;gap:6px; + min-height:28px;text-align:left;padding:5px 7px;color:#ddedf2;background:#25414d; + border:1px solid #3c5c69;border-radius:2px;cursor:pointer} +#app .arV5QuickResult:hover,#app .arV5QuickResult:focus-visible{background:#345967;border-color:#78afbe} +#app .arV5QuickResult span{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap} +#app .arV5QuickResult small{color:#aac4cd;white-space:nowrap} +#app .arV5QuickFoot{display:flex;justify-content:space-between;align-items:center;gap:5px; + padding:7px 8px;border-top:1px solid #3e5964;color:#9cb8c3;font-size:10px} +#app .arV5QuickFoot button{background:transparent;border:0;color:#88d0e6;cursor:pointer} + +/* V5 uses only the user's original ArSonMix material bitmaps: + 29x62 fader cap (aspect 36:77), ROSEGOLD MASTER, PAN-SLIDER 15:33. + Dark graphite well, never bright cyan above the fader cap. */ +#app .arV6Console .arV6Fader::-webkit-slider-thumb{ + background:transparent url("assets/faders/FADER-ARI-SILVER.png") center/29px 62px no-repeat; + width:29px;height:62px;border:0;border-radius:0;box-shadow:none; +} +#app .arV6Console .arV6Fader::-moz-range-thumb{ + background:transparent url("assets/faders/FADER-ARI-SILVER.png") center/29px 62px no-repeat; + width:29px;height:62px;border:0;border-radius:0;box-shadow:none; +} +#app .arV6Console #arV6Main .arV6Fader::-webkit-slider-thumb{ + background-image:url("assets/faders/FADER-ARI-ROSEGOLD.png"); +} +#app .arV6Console #arV6Main .arV6Fader::-moz-range-thumb{ + background-image:url("assets/faders/FADER-ARI-ROSEGOLD.png"); +} +#app .arV6Console .arV6PanRange::-webkit-slider-thumb{ + background:transparent url("assets/pan/PAN-SLIDER.png") center/15px 33px no-repeat; + width:15px;height:33px;border:0;border-radius:0;box-shadow:none; +} +#app .arV6Console .arV6PanRange::-moz-range-thumb{ + background:transparent url("assets/pan/PAN-SLIDER.png") center/15px 33px no-repeat; + width:15px;height:33px;border:0;border-radius:0;box-shadow:none; +} +#app .arV6Console .arV6Fader::-webkit-slider-runnable-track{ + background:linear-gradient(90deg,#020507,#142029 25%,#05090d 80%,#010406); + border-color:#050e14;box-shadow:inset 1px 0 #3c505c,inset -1px 0 #05090c; +} +/* Keep compact V5 popup separate from F8 floating Plugin Manager. */ +#app .arV6Console .arV6QuickPanel{ + display:flex;flex-direction:column;position:absolute;z-index:24; + width:min(310px,calc(100% - 14px));max-height:min(66vh,410px); + min-height:125px;overflow:hidden;background:#192b35;border:1px solid #678b96; + border-radius:4px;box-shadow:0 8px 23px #061018ab; +} +#app .arV6Console .arV6QuickPanel[hidden]{display:none!important} +#app .arV6Console .arV6QuickPanel .arV6PluginSearch{margin-top:7px} +#app .arV6Console .arV6QuickFoot{display:flex;align-items:center;justify-content:space-between; + gap:5px;border-top:1px solid #3e5964;padding:5px 8px;color:#a6bdc6;font-size:10px} +#app .arV6Console .arV6QuickFoot .arV6Button{ + min-height:23px;font-size:10px;color:#a9dce8} +#app .arV6Console .arV6CatalogFilters{display:grid;grid-template-columns:1fr 1fr; + gap:6px;padding:0 10px 8px} +#app .arV6Console .arV6CatalogRow{display:flex;align-items:center;gap:5px} +#app .arV6Console .arV6CatalogRow .arV6PluginResult{flex:1;min-width:0} +#app .arV6Console .arV6CatalogStar{flex:none;width:26px;min-width:26px; + min-height:26px;padding:0;font-size:16px;color:#e4ca8a} +@media(max-width:1100px){ + #app .arV6Console .arV6QuickPanel{max-height:62vh} + #app .arV6Console .arV6CatalogFilters{gap:3px} +} + + +/* PR#278 V6 theme authority ported to actual WebView M4. No native DSP changes. */ +#app{--am-metal-base:#0B161E;--am-metal-panel:#14232C;--am-metal-raised:#20313B; + --am-metal-edge:#334956;--am-metal-inset:#030A0F;--am-text-primary:#DAE9EF; + --am-text-muted:#94B1BD;--am-accent:#66CBDD;--am-crystal:#E7EFF0} +#app .toolbar{background:linear-gradient(#253741,#17252e)!important;border-bottom:1px solid var(--am-metal-edge)} +#app .toolbar-actions.arSegmentedToolbar .nav .btn-180, +#app .toolbar .spec-device,#app .arMixerChannelPager .btn-180{ + height:29px;min-height:29px;max-height:29px;display:inline-flex; + align-items:center;justify-content:center;line-height:1;text-align:center;box-sizing:border-box} +#app .arMixerChannelPager .btn-180{width:29px;min-width:29px;padding:0;--b180-ink:#1f1f1f} +#app .arMixerChannelPager svg{display:block;flex:none;width:24px;height:24px;fill:currentColor} +#app .left-rail{background:var(--am-metal-base)} +#app .left-rail :is(.arRailModeSection,.arRailUtilities){background:var(--am-metal-panel)} +#app .left-rail :is(.arRailHeading,.rail-section-title){background:var(--am-metal-raised);border-color:var(--am-metal-edge)} +#app #mixer[data-io-mode="CONSOLE"]{background:var(--am-metal-base)} +#app #mixer[data-io-mode="CONSOLE"] > .strip[data-strip]{ + background:linear-gradient(90deg,#0e1b23,var(--am-metal-panel) 8%,#172832 92%,#0e1b23); + border-right:1px solid var(--am-metal-edge);box-shadow:inset 1px 0 #aecbd012} +#app #mixer[data-io-mode="CONSOLE"] > .strip[data-strip].selected{ + background:linear-gradient(90deg,#172b35,var(--am-metal-raised) 9%,#1a303b 93%,#122630); + box-shadow:inset 2px 0 var(--am-accent)} +/* Both identity nameplates use the SAME stable --ch source (no second palette). */ +#app #mixer[data-io-mode="CONSOLE"] > .strip[data-strip] > :is(.ch-id,.strip-name), +#app #mixer[data-io-mode="CONSOLE"] #masterLeft > :is(.master-ch-id,.master-strip-name){ + background:color-mix(in srgb,var(--ch) 43%,#101e27)!important; + color:#f0f7fa;border-top:2px solid var(--ch); + border-bottom:1px solid color-mix(in srgb,var(--ch) 49%,#0c1820);text-shadow:0 1px #02080a} +#app #mixer[data-io-mode="CONSOLE"] > .strip[data-strip] > .ch-id{ + display:flex;align-items:center;gap:3px;padding:0 31px 0 5px; + font:500 10px/1.1 "Segoe UI",sans-serif} +#app #mixer[data-io-mode="CONSOLE"] .arChannelNumber{flex:0 0 30px;white-space:nowrap; + color:#e0edf1;font:600 9px/1 Consolas,monospace} +#app #mixer[data-io-mode="CONSOLE"] .arChannelTopIdentity{ + display:flex;align-items:center;gap:3px;flex:1;min-width:0;max-width:100%; + padding:3px 1px;margin:0;border:0;border-radius:2px;background:transparent; + font:500 10px/1.1 "Segoe UI",sans-serif;color:#f2f8fa;cursor:pointer;text-align:left} +#app #mixer[data-io-mode="CONSOLE"] .arChannelTopIdentity:focus-visible{ + outline:1px solid #d7f5f9;outline-offset:0} +#app #mixer[data-io-mode="CONSOLE"] .arChannelTopIcon{flex:none;font-size:13px;line-height:1} +#app #mixer[data-io-mode="CONSOLE"] .arChannelTopName{min-width:0;overflow:hidden; + white-space:nowrap;text-overflow:ellipsis} +#app #mixer[data-io-mode="CONSOLE"] .arFormatBadge{ + right:4px;top:6px;min-height:19px;height:19px; + background:var(--am-metal-inset);border-color:#638594;color:#e4f5f8} +#app #mixer[data-io-mode="CONSOLE"] > .strip[data-strip] > .strip-name{ + display:flex;flex-direction:row;align-items:center;justify-content:center; + gap:5px;padding:3px 6px;overflow:hidden;font:500 10px/1.1 "Segoe UI",sans-serif} +#app #mixer[data-io-mode="CONSOLE"] .strip-name .strip-caption{ + min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap} +#app #mixer[data-io-mode="CONSOLE"] .strip-name .track-icon{flex:none;font-size:14px;line-height:1} +#app #mixer[data-io-mode="CONSOLE"] #masterLeft > .master-ch-id{ + display:flex;justify-content:space-between;align-items:center;padding:0 8px; + color:#f9f0f3;font:500 11px/1 "Segoe UI",sans-serif} +#app #mixer[data-io-mode="CONSOLE"] .arMasterTopIdentity{ + display:inline-flex;align-items:center;gap:4px;font-size:10px} +#app #mixer[data-io-mode="CONSOLE"] > .strip[data-strip] > .arChannelBank, +#app #mixer[data-io-mode="CONSOLE"] > .strip[data-strip] > .rack, +#app #mixer[data-io-mode="CONSOLE"] #masterLeft .master-fx-rack, +#app #mixer[data-io-mode="CONSOLE"] #masterLeft .arMainOutSummary, +#app #mixer[data-io-mode="CONSOLE"] > .strip[data-strip] > .strip-controls{ + background:var(--am-metal-panel);border-color:var(--am-metal-edge)} +#app #mixer[data-io-mode="CONSOLE"] .arChannelBank :is(.arBankSource,.arBankOutput,.arBankChannelFormat){ + background:var(--am-metal-inset);border:1px solid #425d6a; + color:var(--am-text-primary);box-shadow:inset 0 1px 2px #0006} +#app #mixer[data-io-mode="CONSOLE"] .arChannelBank .arSendBank{border-top-color:var(--am-metal-edge)} +#app #mixer[data-io-mode="CONSOLE"] .arChannelBank .arSendChip{ + background:var(--am-metal-raised);border-color:var(--am-metal-edge);color:var(--am-text-primary)} +#app #mixer[data-io-mode="CONSOLE"] .rack .insert, +#app #mixer[data-io-mode="CONSOLE"] #masterLeft .master-insert{ + background:linear-gradient(#283b46,#192b35);border:1px solid #39515c;color:var(--am-text-primary)} +#app #mixer[data-io-mode="CONSOLE"] .rack .insert.empty{ + border:1px dashed #3c5967;color:#a3c8d2} +#app #mixer[data-io-mode="CONSOLE"] #masterLeft .master-controls-zone{ + background:var(--am-metal-panel);border-color:var(--am-metal-edge)} +#app #mixer[data-io-mode="CONSOLE"] .channel-actions{ + background:var(--am-metal-raised);border-color:var(--am-metal-edge)} +#app #mixer[data-io-mode="CONSOLE"] .db-display{ + background:var(--am-metal-panel);color:var(--am-accent)} +#app #mixer[data-io-mode="CONSOLE"] > #masterLeft{ + background:var(--am-metal-panel);border-left-color:#997888} +#app #mixer[data-io-mode="CONSOLE"] #masterLeft .arMainOutAction{ + background:var(--am-metal-inset);color:var(--am-text-primary);border-color:var(--am-metal-edge)} +/* Real fader PNG, RAIL3 well, meter geometry and seven-shadow BTN-180 preserved. */ + + +/* PR#278 visual correction G-V7: 10 source strips + MAIN at desktop widths. + Geometry is measured from the actual mixer viewport, not a separate mock + component. Narrow windows use adaptive banks; the fader travel remains owned + by existing native controls. */ +#app #mixer[data-io-mode="CONSOLE"]{ + --ar-visible-channels:10; + --ar-master-dock-width:128px; + padding-right:var(--ar-master-dock-width); + scroll-padding-right:var(--ar-master-dock-width); +} +#app #mixer[data-io-mode="CONSOLE"] > .strip[data-strip]{ + flex:0 0 calc((100% - var(--ar-master-dock-width))/var(--ar-visible-channels)); + width:calc((100% - var(--ar-master-dock-width))/var(--ar-visible-channels)); + min-width:102px;max-width:none; +} +#app #mixer[data-io-mode="CONSOLE"] > #masterLeft{ + flex:0 0 128px;width:128px;min-width:128px;max-width:128px; + box-shadow:-2px 0 7px #02080c66; +} +/* No accidental 2-line CH number/name or wrap over FX on the real WebView. + 30px high, all three parts in a SINGLE bounded grid row. */ +#app #mixer[data-io-mode="CONSOLE"] > .strip[data-strip] > .ch-id{ + display:grid!important; + grid-template-columns:30px minmax(0,1fr) 22px!important; + grid-template-rows:minmax(0,1fr)!important; + gap:2px!important; + align-items:center!important;justify-content:normal!important; + padding:0 3px!important; + overflow:hidden!important; + white-space:nowrap!important; + line-height:1!important; +} +#app #mixer[data-io-mode="CONSOLE"] .ch-id .arChannelNumber{ + display:block!important;width:30px;min-width:0;max-width:30px; + white-space:nowrap!important; + overflow:hidden;text-overflow:clip; + font:600 9px/1 Consolas,monospace!important; +} +#app #mixer[data-io-mode="CONSOLE"] .ch-id .arChannelTopIdentity{ + display:flex!important;grid-column:2;grid-row:1; + align-items:center!important;justify-content:flex-start!important; + min-width:0!important;width:100%!important;height:28px!important; + max-width:100%;padding:0 1px!important;margin:0!important; + overflow:hidden!important;white-space:nowrap!important;flex-wrap:nowrap!important; + font:500 10px/1 "Segoe UI",sans-serif!important;text-align:left!important; +} +#app #mixer[data-io-mode="CONSOLE"] .ch-id .arChannelTopIcon{ + flex:none!important;white-space:nowrap!important;line-height:1!important; + font-size:12px!important; +} +#app #mixer[data-io-mode="CONSOLE"] .ch-id .arChannelTopName{ + display:block!important;flex:1 1 auto!important;min-width:0!important; + max-width:100%!important;overflow:hidden!important; + text-overflow:ellipsis!important;white-space:nowrap!important; + line-height:1.25!important; +} +#app #mixer[data-io-mode="CONSOLE"] .ch-id .arFormatBadge{ + position:static!important;grid-column:3;grid-row:1; + width:21px!important;min-width:21px!important;height:20px!important; + margin:0!important;padding:0!important; + font:500 9px/18px "Segoe UI",sans-serif!important; + text-align:center!important;white-space:nowrap!important; +} +#app #mixer[data-io-mode="CONSOLE"] > .strip[data-strip] > .strip-name{ + min-width:0!important;white-space:nowrap!important; + border-top-color:var(--ch); +} +/* PR278: exactly ONE Add FX affordance in each existing 6-slot rack. + All six native slot nodes remain mounted for bridge/ACK and VST state. */ +html:not(.native-engine) #app #mixer[data-io-mode="CONSOLE"] .rack .insert-slot:has(.insert.empty) ~ .insert-slot:has(.insert.empty){ + display:none!important; +} +html:not(.native-engine) #app #mixer[data-io-mode="CONSOLE"] #masterLeft .master-fx-slot:has(.master-insert.empty) ~ .master-fx-slot:has(.master-insert.empty){ + display:none!important; +} +@media(max-width:1339px){ + #app #mixer[data-io-mode="CONSOLE"]{--ar-visible-channels:8} +} +@media(max-width:1099px){ + #app #mixer[data-io-mode="CONSOLE"]{--ar-visible-channels:6} +} + + +/* Native WIRE-pot — byte-for-byte uploaded SVG silhouette, inline-masked so + portable standalone and installed WebView render identically offline. + Realtime meters never trigger CSS painting; mask is static and compositor-light. */ +#app .arV6Console .arV6WirePot{ + position:relative;display:inline-flex;align-items:center;justify-content:center; + flex:0 0 22px;width:22px;height:22px;min-width:22px;min-height:22px; + vertical-align:middle;background:none;border:0;box-shadow:none; + --v6-wire-fill:#4b535b;--v6-wire-deg:0deg; +} +#app .arV6Console .arV6WirePot::before{ + content:"";position:absolute;inset:1px;width:20px;height:20px; + background:var(--v6-wire-fill,#4b535b); + -webkit-mask-image:url("data:image/svg+xml,%3Csvg%20version%3D%221.2%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20800%20800%22%20width%3D%22800%22%20height%3D%22800%22%3E%0A%09%3Cstyle%3E%0A%09%09.s0%20%7B%20fill%3A%20%23000000%20%7D%20%0A%09%3C%2Fstyle%3E%0A%09%3Cg%3E%0A%09%09%3Cg%3E%0A%09%09%09%3Cg%3E%0A%09%09%09%09%3Cpath%20class%3D%22s0%22%20d%3D%22m436.84%20436.84c-10.09%2010.09-23.34%2015.16-36.59%2015.16-13.25%200-26.49-5.07-36.59-15.16-20.23-20.24-20.23-52.94%200-73.18l253.11-253.11c-60.49-45.33-135.27-72.55-216.52-72.55-199.7%200-362.25%20162.5-362.25%20362.25%200%20199.75%20162.55%20362.25%20362.25%20362.25%20199.71%200%20362.25-162.5%20362.25-362.25%200-81.25-27.22-156.03-72.55-216.53z%22%2F%3E%0A%09%09%09%3C%2Fg%3E%0A%09%09%3C%2Fg%3E%0A%09%3C%2Fg%3E%0A%3C%2Fsvg%3E%0A"); + mask-image:url("data:image/svg+xml,%3Csvg%20version%3D%221.2%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20800%20800%22%20width%3D%22800%22%20height%3D%22800%22%3E%0A%09%3Cstyle%3E%0A%09%09.s0%20%7B%20fill%3A%20%23000000%20%7D%20%0A%09%3C%2Fstyle%3E%0A%09%3Cg%3E%0A%09%09%3Cg%3E%0A%09%09%09%3Cg%3E%0A%09%09%09%09%3Cpath%20class%3D%22s0%22%20d%3D%22m436.84%20436.84c-10.09%2010.09-23.34%2015.16-36.59%2015.16-13.25%200-26.49-5.07-36.59-15.16-20.23-20.24-20.23-52.94%200-73.18l253.11-253.11c-60.49-45.33-135.27-72.55-216.52-72.55-199.7%200-362.25%20162.5-362.25%20362.25%200%20199.75%20162.55%20362.25%20362.25%20362.25%20199.71%200%20362.25-162.5%20362.25-362.25%200-81.25-27.22-156.03-72.55-216.53z%22%2F%3E%0A%09%09%09%3C%2Fg%3E%0A%09%09%3C%2Fg%3E%0A%09%3C%2Fg%3E%0A%3C%2Fsvg%3E%0A"); + -webkit-mask-repeat:no-repeat;mask-repeat:no-repeat; + -webkit-mask-position:center;mask-position:center; + -webkit-mask-size:contain;mask-size:contain; + transform:rotate(var(--v6-wire-deg,0deg)); + pointer-events:none; +} +#app .arV6Console .arV6WirePot.is-idle{opacity:1;pointer-events:none} +#app .arV6Console .arV6WirePot.is-connected:focus-within{outline:1px solid #70bed2;outline-offset:1px} +#app .arV6Console .arV6SendEmpty{ + grid-template-columns:minmax(0,1fr) 24px; + grid-template-rows:20px;min-height:21px; +} +#app .arV6Console .arV6SendEmpty .arV6SendName{color:#849ba6;font-size:9px} +#app .arV6Console .arV6SendEmpty .arV6WirePot{grid-column:2;grid-row:1} +#app .arV6Console .arV6SendGain{gap:8px;min-height:22px} +#app .arV6Console .arV6WirePot .arV6SendLevel{ + position:absolute;inset:0;width:100%;height:100%;margin:0; + opacity:0;cursor:ns-resize;touch-action:none;appearance:none; + -webkit-appearance:none; +} +#app .arV6Console .arV6WirePot .arV6SendLevel:disabled{cursor:not-allowed} +#app .arV6Console .arV6SendDb{flex:1 1 auto;min-width:43px;text-align:left} +@media(prefers-reduced-motion:reduce){ + #app .arV6Console .arV6WirePot::before{transition:none!important} +} + + +/* GUI FINAL -> ENGINE V8: 1 accepted identity, 1 channel width, 1 graphite + chassis. No new DSP, paint animation or browser-inferred LIVE controls. */ +#app #arV6Console{ + --v6-channel-w:150px; + --v6-status-h:34px; +} +#app .arV6Console .arV6Main, +#app .arV6Console[data-narrow="true"] .arV6Main{ + flex:0 0 var(--v6-channel-w);width:var(--v6-channel-w); + max-width:var(--v6-channel-w);min-width:var(--v6-channel-w); + border-left:0;box-shadow:-2px 0 0 #63808b; + background:var(--am-metal-panel); +} +#app .arV6Console .arV6Strip, +#app .arV6Console[data-narrow="true"] .arV6Strip{ + flex:0 0 var(--v6-channel-w);width:var(--v6-channel-w); + min-width:var(--v6-channel-w);max-width:var(--v6-channel-w); + background:var(--am-metal-panel); +} +#app .arV6Console .arV6Strip.arV6Master, +#app .arV6Console[data-narrow="true"] .arV6Strip.arV6Master{ + flex:0 0 var(--v6-channel-w);width:var(--v6-channel-w); + min-width:var(--v6-channel-w);max-width:var(--v6-channel-w); + background:var(--am-metal-panel); +} +#app .arV6Console .arV6Top{ + background:linear-gradient(180deg,var(--am-metal-raised),var(--am-metal-panel)); +} +#app .arV6Console .arV6StripHead{ + display:flex;flex-direction:row;align-items:center;gap:3px; + min-width:0;border-bottom:2px solid var(--ch,#5f9ab1); + background:color-mix(in srgb,var(--ch,#5f9ab1) 15%,var(--am-metal-panel)); +} +#app .arV6Console .arV6Role{flex:none;max-width:42%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font:500 8px/1 "Segoe UI",sans-serif;letter-spacing:.15px} +#app .arV6Console .arV6IdentityIcon{flex:none;font-size:13px;line-height:1} +#app .arV6Console .arV6Name{flex:1;min-width:0;font-size:10px;font-weight:550} +#app .arV6Console .arV6StripStatus{ + display:flex;flex-direction:column;align-items:stretch;justify-content:center; + gap:1px;padding:2px 3px; + border-top:2px solid var(--ch,#5f9ab1); + background:color-mix(in srgb,var(--ch,#5f9ab1) 28%,var(--am-metal-panel)); + min-width:0; +} +#app .arV6Console .arV6FootIdentity{ + display:flex;gap:4px;align-items:center;min-width:0; + color:#ebf2f5;font:500 9px/1 "Segoe UI",sans-serif; +} +#app .arV6Console .arV6FootIcon{flex:none;font-size:11px;line-height:1} +#app .arV6Console .arV6FootName{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap} +#app .arV6Console .arV6PcmState{ + color:#b7c8ce;font:500 8px/1.05 "Segoe UI",sans-serif; + letter-spacing:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; +} +#app .arV6Console[data-demo="true"] .arV6PcmState{color:#e3bb82} diff --git a/web/mixer-layout.js b/web/mixer-layout.js index 9e1ac306b..84358d62b 100644 --- a/web/mixer-layout.js +++ b/web/mixer-layout.js @@ -73,10 +73,10 @@ const mixer=document.getElementById('mixer'); if(mixer&&!document.getElementById('arMixChannelPager')){ const pager=document.createElement('div');pager.id='arMixChannelPager';pager.className='arMixerChannelPager'; - const prev=document.createElement('button');prev.type='button';prev.className='btn-180';prev.textContent='‹'; + const prev=document.createElement('button');prev.type='button';prev.className='btn-180';prev.innerHTML=''; prev.setAttribute('aria-label','Previous mixer channel bank'); const label=document.createElement('span');label.className='arMixerPagerLabel'; - const next=document.createElement('button');next.type='button';next.className='btn-180';next.textContent='›'; + const next=document.createElement('button');next.type='button';next.className='btn-180';next.innerHTML=''; next.setAttribute('aria-label','Next mixer channel bank'); pager.append(prev,label,next);nav.parentElement?.append(pager); const strips=()=>[...mixer.querySelectorAll('[data-strip]')]; @@ -103,6 +103,25 @@ if(typeof ResizeObserver==='function')new ResizeObserver(refresh).observe(mixer); refresh(); } + // MAIN lives in the original #mixer DOM (app.js still owns its native + // meter/FX/fader). In CONSOLE it is viewport-fixed, not a false sticky + // child at the end of a horizontally scrolling 10-strip flex track. + // Geometry is recomputed ONLY on resize, not on pointer/meter/scroll. + if(mixer){ + const syncMainDock=()=>{ + const rect=mixer.getBoundingClientRect(); + // Actual MASTER includes the original 2px rail edge and padding; + // do not assume its CSS flex-basis equals its rendered outer width. + const width=mixer.querySelector('#masterLeft')?.getBoundingClientRect().width|| + (window.innerWidth<=1250?148:155); + mixer.style.setProperty('--ar-main-dock-left',Math.round(rect.right-width)+'px'); + mixer.style.setProperty('--ar-main-dock-top',Math.round(rect.top)+'px'); + mixer.style.setProperty('--ar-main-dock-height',Math.round(rect.height)+'px'); + }; + if(typeof ResizeObserver==='function')new ResizeObserver(syncMainDock).observe(mixer); + window.addEventListener('resize',syncMainDock,{passive:true}); + syncMainDock(); + } // Studio-like channel selection and FX navigation are presentation-only. const channelList=rail.querySelector('#channelList'); channelList?.addEventListener('keydown',event=>{ @@ -142,3 +161,1745 @@ } document.documentElement.dataset.arMixerShell='rail-modes'; })(); + + +/* ARSONMIX V6 OPERATOR CONSOLE — native accepted projection only. + The legacy M4 console remains available until the native v6 publisher exists. + No WebAudio, DSP, routing solver, or fabricated ACK lives in this module. */ +(() => { + 'use strict'; + const mount=document.querySelector('#app .workbench'); + const backend=window.__JUCE__?.backend; + if(!mount||!document.getElementById('mixer')||document.getElementById('arV6Console'))return; + const native=!!(backend&&typeof backend.emitEvent==='function'&&typeof backend.addEventListener==='function'); + const h=(tag,cls,text)=>{ + const n=document.createElement(tag); + if(cls)n.className=cls; + if(text!==undefined)n.textContent=String(text); + return n; + }; + const button=(label,attrs={})=>{ + const n=h('button','arV6Button',label);n.type='button'; + for(const [key,value] of Object.entries(attrs))n.setAttribute(key,String(value)); + return n; + }; + const clamp=(n,a,b)=>Math.max(a,Math.min(b,n)); + function paintPan(slider,value){ + const n=clamp(Number(value)||0,-100,100),pos=(n+100)/2; + slider.style.setProperty('--v6-pan-start',Math.min(50,pos)+'%'); + slider.style.setProperty('--v6-pan-end',Math.max(50,pos)+'%'); + slider.setAttribute('aria-valuetext',n===0?'Center':n<0?'L '+Math.abs(n):'R '+n); + } + const clean=s=>String(s==null?'—':s); + const byId=new Map(); + // Selection is display state only, with immutable native ChannelId keys. + const selectedIds=new Set();let selectionAnchor=null; + const pending=new Map(); + const pendingTargets=new Set(); + const awaitingSnapshot=new Map(); + let snapshotSerial=0; + const operationCaps={ + SET_SOURCE:'SET_SOURCE',SET_PROCESSING_FORMAT:'SET_PROCESSING_FORMAT', + SET_PRIMARY_OUT:'SET_PRIMARY_OUT',ADD_INSERT:'ADD_INSERT', + PICK_INSERT_FILE:'PICK_INSERT_FILE',SET_INSERT_BYPASS:'SET_INSERT_BYPASS', + OPEN_INSERT_EDITOR:'OPEN_INSERT_EDITOR',MOVE_INSERT:'MOVE_INSERT', + ADD_SEND:'ADD_SEND',SET_SEND_TAP:'SET_SEND_TAP',SET_SEND_LEVEL:'SET_SEND_LEVEL', + SET_FADER:'SET_FADER',SET_PAN:'SET_PAN',SET_MUTE:'SET_MUTE', + SET_SOLO:'SET_SOLO',SET_TRIM:'SET_TRIM',SET_CUE:'SET_CUE', + SET_LINK_GROUP:'SET_LINK_GROUP',ROUTE_SELECTED_TO_GROUP:'ROUTE_SELECTED_TO_GROUP', + RENAME_CHANNEL:'RENAME_CHANNEL',CREATE_CHANNEL:'CREATE_CHANNEL', + APPLY_WIRE_TRANSACTION:'APPLY_WIRE_TRANSACTION' + }; + let accepted=null,acceptedNative=false,modeSend='',lastStructure='',requestSeq=0; + let lastControlProjection='',lastHeaderProjection=''; + // Stable indexed meters avoid re-querying every strip/LED on native PCM ticks. + const meterNodes=new Map(),statusNodes=new Map(); + const uiStats={structureRenders:0,controlRefreshes:0,telemetryFastFrames:0}; + let meterReadings=new Map(); + let draggingFx=null; + // Local pointer preview only. The accepted send stays native-owned until ACK. + let wirePotGesture=null; + const wirePotFill=id=>{ + const c=byId.get(id)?.color; + return typeof c==='string'&&/^#[0-9a-fA-F]{6}$/.test(c)?c:'#4b535b'; + }; + const wirePotAngle=db=>(-135+((clamp(db,-60,12)+60)/72)*270).toFixed(1)+'deg'; + function paintWirePot(pot,db){ + if(pot)pot.style.setProperty('--v6-wire-deg',wirePotAngle(db)); + } + function acceptedWireLevel(id,sendId){ + const channel=byId.get(id); + const send=channel?.sends?.find(s=>String(s.id)===sendId); + const db=send&&typeof send.levelDb==='number'?send.levelDb:NaN; + return Number.isFinite(db)?clamp(db,-60,12):null; + } + // Numeric decimal wire identifiers are required by integration/ConsoleNativeContractV6.h. + // Never downcast native 64-bit ChannelId, device epoch, or graph revision. + // Wire uint64 identities are canonical decimal STRINGS, not JS numbers. + // Reject overflow and noncanonical aliases before BigInt comparisons. + const decimal=v=>typeof v==='string'&&/^(0|[1-9][0-9]*)$/.test(v)&& + BigInt(v)<=18446744073709551615n?v:null; + const ge=(a,b)=>a!==null&&b!==null&&BigInt(a)>=BigInt(b); + // A reconnect must not replay the prior editor's request IDs. Retain a + // single session prefix for this WebView lifetime; each new WebView gets + // a cryptographically random prefix when secure randomness is available. + const instance=(()=>{ + const bytes=new Uint8Array(16); + try{ + window.crypto.getRandomValues(bytes); + return 'gui-'+Array.from(bytes,b=>b.toString(16).padStart(2,'0')).join(''); + }catch{ + return 'gui-'+Date.now().toString(36)+'-'+ + Math.random().toString(36).slice(2,14); + } + })(); + let feedback=''; + const root=h('section','arV6Console');root.id='arV6Console'; + root.setAttribute('aria-label','ArSonMix universal operator console'); + const top=h('div','arV6Top'); + const identification=h('div','arV6Identification'); + const kicker=h('span','arV6Kicker','ARSONMIX / UNIVERSAL LIVE CONSOLE'); + const deviceText=h('span','arV6Device','NO NATIVE CONSOLE SNAPSHOT'); + const modeBadge=h('span','arV6State','WAITING FOR NATIVE'); + identification.append(kicker,deviceText,modeBadge); + const tools=h('div','arV6Tools'); + const bankPrev=button('‹',{'aria-label':'Previous channel bank'}); + const bankLabel=h('span','arV6BankLabel','—'); + const bankNext=button('›',{'aria-label':'Next channel bank'}); + const sendMode=h('select','arV6Select arV6SendMode');sendMode.setAttribute('aria-label','Sends on faders target'); + const roleSelect=h('select','arV6Select arV6RoleSelect'); + roleSelect.setAttribute('aria-label','Native new channel type'); + for(const type of ['MONO','STEREO','GROUP','FX_RETURN','MONITOR']){ + const option=h('option','',type);option.value=type;roleSelect.append(option); + } + const add=button('+ CHANNEL',{'data-op':'CREATE_CHANNEL'}); + const deviceButton=button('DEVICE',{'aria-expanded':'false','aria-controls':'arV6DevicePanel', + 'aria-label':'Verified native audio device inventory'}); + const pluginsButton=button('VST3 F8',{'aria-expanded':'false', + 'aria-controls':'arV6PluginPanel','aria-label':'Native Plugin Manager F8'}); + const patch=button('PATCH',{'aria-label':'Open advanced patch'}); + const narrow=button('NARROW',{'aria-pressed':'false','aria-label':'Toggle narrow channel bank'}); + const roleFilter=h('select','arV6Select arV6Filter'); + roleFilter.setAttribute('aria-label','Filter visible mixer channels'); + const selectionCount=button('0 SEL',{'aria-label':'Selected channels and native group actions', + 'aria-controls':'arV6SelectionPanel','aria-expanded':'false'}); + selectionCount.classList.add('arV6SelectionCount'); + for(const [value,label] of [['ALL','ALL'],['INPUT','INPUT'],['GROUP','BUS'], + ['FX_RETURN','FX RTN'],['AUX','AUX'],['MONITOR','MON'],['SOLO','SOLO']]){ + const option=h('option','',label);option.value=value;roleFilter.append(option); + } + const back=button('V6 CONSOLE',{'aria-label':'Return to operator console'}); + back.id='arV6Return';back.hidden=true; + tools.append(bankPrev,bankLabel,bankNext,roleFilter,selectionCount, + sendMode,roleSelect,add,deviceButton,pluginsButton,narrow,patch); + top.append(identification,tools); + const message=h('div','arV6Message');message.setAttribute('role','status'); + const devicePanel=h('section','arV6DevicePanel'); + devicePanel.id='arV6DevicePanel';devicePanel.hidden=true; + devicePanel.setAttribute('aria-label','Read-only native audio device inventory'); + const deviceHead=h('div','arV6DevicePanelHead'); + const deviceClose=button('×',{'aria-label':'Close native device inventory'}); + deviceHead.append(h('span','','VERIFIED DEVICE · NATIVE READBACK'),deviceClose); + const deviceRows=h('div','arV6DeviceRows'); + devicePanel.append(deviceHead,deviceRows); + const pluginPanel=h('section','arV6PluginPanel'); + pluginPanel.id='arV6PluginPanel';pluginPanel.hidden=true; + pluginPanel.setAttribute('aria-label','Native scanned VST3 catalog'); + const pluginHead=h('div','arV6DevicePanelHead'); + const pluginClose=button('×',{'aria-label':'Close native Plugin Manager'}); + pluginHead.append(h('span','','NATIVE VST3 · PLUGIN MANAGER'),pluginClose); + const pluginTarget=h('div','arV6PluginTarget'); + const pluginSearch=h('input','arV6PluginSearch');pluginSearch.type='search'; + pluginSearch.placeholder='Search native scanned plugins...'; + pluginSearch.setAttribute('aria-label','Search native scanned VST3 catalog'); + const pluginResults=h('div','arV6PluginResults'); + const managerFilters=h('div','arV6CatalogFilters'); + const managerView=h('select','arV6Select'); + managerView.setAttribute('aria-label','Native plugin catalog filter'); + for(const [val,text] of [['ALL','All effects'],['FAVORITES','Favorites'],['RECENT','Recent']]){ + const opt=h('option','',text);opt.value=val;managerView.append(opt); + } + const managerCategory=h('select','arV6Select'); + managerCategory.setAttribute('aria-label','Native plugin category'); + managerFilters.append(managerView,managerCategory); + pluginPanel.append(pluginHead,pluginTarget,pluginSearch,managerFilters,pluginResults); + // Contextual V5 Add FX picker anchored to the exact strip, independent of F8. + const quickPanel=h('section','arV6QuickPanel'); + quickPanel.id='arV6QuickPanel';quickPanel.hidden=true; + quickPanel.setAttribute('role','dialog');quickPanel.setAttribute('aria-label','Quick native VST3 picker'); + const quickHead=h('div','arV6DevicePanelHead'); + const quickTitle=h('span','','QUICK ADD FX'); + const quickClose=button('×',{'aria-label':'Close quick native FX picker'}); + quickHead.append(quickTitle,quickClose); + const quickSearch=h('input','arV6PluginSearch');quickSearch.type='search'; + quickSearch.setAttribute('aria-label','Search quick native effects'); + quickSearch.placeholder='Search native VST3 effects…'; + const quickResults=h('div','arV6PluginResults'); + const quickManager=button('PLUGIN MANAGER · F8'); + quickManager.setAttribute('aria-label','Open full Plugin Manager from quick picker'); + const quickFoot=h('div','arV6QuickFoot'); + quickFoot.append(h('span','','Enter: load · Esc: close'),quickManager); + quickPanel.append(quickHead,quickSearch,quickResults,quickFoot); + // A small operator drawer differentiates relative fader links from actual + // serial Group-Bus summing. Both are SINGLE native graph transactions. + const selectionPanel=h('section','arV6SelectionPanel'); + selectionPanel.id='arV6SelectionPanel';selectionPanel.hidden=true; + selectionPanel.setAttribute('aria-label','Native multi-channel operator actions'); + const selectionHead=h('div','arV6DevicePanelHead'); + const selectionClose=button('×',{'aria-label':'Close selected channel actions'}); + selectionHead.append(h('span','','SELECTED · LIVE MIXING'),selectionClose); + const selectionSummary=h('div','arV6SelectionSummary'); + const selectionActions=h('div','arV6SelectionActions'); + const linkFaders=button('LINK FADERS',{'data-op':'SET_LINK_GROUP', + 'aria-label':'Link selected faders using native relative control group'}); + const unlinkFaders=button('UNLINK',{'data-op':'SET_LINK_GROUP', + 'aria-label':'Unlink selected faders using native relative control group'}); + const routeBus=h('select','arV6Select arV6GroupTarget'); + routeBus.setAttribute('aria-label','Select actual native summing Group Bus'); + const routeSelected=button('ROUTE TO GROUP BUS',{'data-op':'ROUTE_SELECTED_TO_GROUP', + 'aria-label':'Route selected channels to native summing Group Bus'}); + const linkRow=h('div','arV6LinkActions');linkRow.append(linkFaders,unlinkFaders); + const busRow=h('div','arV6BusActions');busRow.append(routeBus,routeSelected); + selectionActions.append(linkRow,busRow); + const selectionNote=h('p','arV6DeviceNote', + 'LINK FADERS moves controls relatively. GROUP BUS sums audio serially. These are different native operations; UI never mixes or reroutes PCM.'); + selectionPanel.append(selectionHead,selectionSummary,selectionActions,selectionNote); + const body=h('div','arV6Body'); + const sectionRail=h('aside','arV6SectionRail'); + sectionRail.setAttribute('aria-label','Synchronized mixer section collapse'); + sectionRail.append(h('span','arV6RailCell arV6RailHeader','▦')); + for(const [section,text,label] of [ + ['io','I/O','Collapse or expand native input and output rows'], + ['fx','FX','Collapse or expand VST3 insert section'], + ['send','SND','Collapse or expand send section']]){ + const control=button(text,{'data-section':section,'aria-expanded':'true','aria-label':label}); + control.classList.add('arV6RailCell','arV6RailToggle'); + sectionRail.append(control); + } + sectionRail.append(h('span','arV6RailCell arV6RailPan','PAN')); + sectionRail.append(h('span','arV6RailCell arV6RailFader','dB')); + sectionRail.append(h('span','arV6RailCell arV6RailStatus','•')); + const lanes=h('div','arV6Lanes');lanes.id='arV6Lanes';lanes.setAttribute('aria-label','Channel banks'); + const main=h('div','arV6Main');main.id='arV6Main';main.setAttribute('aria-label','Pinned main output'); + body.append(sectionRail,lanes,main); + root.append(top,message,devicePanel,pluginPanel,selectionPanel,quickPanel,body); + mount.append(root); + sectionRail.addEventListener('click',event=>{ + const control=event.target.closest('[data-section]'); + if(!control)return; + const key='collapse'+control.dataset.section; + const collapsed=root.dataset[key]!=='true'; + root.dataset[key]=String(collapsed); + control.setAttribute('aria-expanded',String(!collapsed)); + control.classList.toggle('isCollapsed',collapsed); + // Shared CSS variables resize every strip and rail atomically. + // No channel topology change and no fader/meter DOM remount. + refreshBanks(); + }); + roleFilter.addEventListener('change',()=>applyPresentation()); + selectionCount.addEventListener('click',()=>{ + selectionPanel.hidden=!selectionPanel.hidden; + selectionCount.setAttribute('aria-expanded',String(!selectionPanel.hidden)); + if(!selectionPanel.hidden)refreshSelectionActions(); + }); + selectionClose.addEventListener('click',()=>{ + selectionPanel.hidden=true;selectionCount.setAttribute('aria-expanded','false'); + }); + function selectedNativeIds(){ + return [...selectedIds].filter(id=>byId.has(id)&&byId.get(id).role!=='MAIN'); + } + function refreshSelectionActions(){ + const legend=selectedIds.size+' SEL'; + if(!window.ArSonMixHardwareKeys?.setLegend?.(selectionCount,legend)&& + selectionCount.textContent!==legend)selectionCount.textContent=legend; + if(selectionPanel.hidden)return; + const ids=selectedNativeIds(),channels=ids.map(id=>byId.get(id)); + const names=channels.map(c=>c.name).join(' · '); + selectionSummary.textContent=names||'Select channel headers using Ctrl / Shift'; + const ready=ids.length>=2&&ids.length<=64&&!pendingTargets.has('@selection')&& + ids.every(id=>can('SET_LINK_GROUP',id)); + linkFaders.disabled=!ready||!can('SET_LINK_GROUP',null); + const current=channels[0]?.linkGroupId; + unlinkFaders.disabled=!ready||typeof current!=='string'||!current|| + !channels.every(c=>c.linkGroupId===current); + const buses=(accepted?.graph?.channels||[]).filter(ch=> + ch.role==='GROUP'&&!selectedIds.has(ch.id)&& + (accepted.graph.destinations||[]).some(dst=>dst.id===ch.id&& + dst.acceptsPrimary!==false)); + const signature=buses.map(ch=>ch.id+'|'+ch.name).join(','); + if(routeBus.dataset.signature!==signature){ + const value=routeBus.value; + routeBus.replaceChildren(); + const prompt=h('option','','SELECT NATIVE BUS');prompt.value='';routeBus.append(prompt); + for(const bus of buses){ + const option=h('option','',bus.name);option.value=bus.id;routeBus.append(option); + } + routeBus.value=buses.some(ch=>ch.id===value)?value:''; + routeBus.dataset.signature=signature; + } + const canRoute=ids.length>0&&ids.length<=64&& + (accepted?.graph?.capabilities?.groups===true)&& + channels.every(c=>['INPUT','AUX','FX_RETURN'].includes(c.role)&& + can('ROUTE_SELECTED_TO_GROUP',c.id))&& + can('ROUTE_SELECTED_TO_GROUP',null); + routeBus.disabled=!canRoute||!buses.length; + routeSelected.disabled=!canRoute||!buses.some(ch=>ch.id===routeBus.value); + } + routeBus.addEventListener('change',refreshSelectionActions); + const sendSelectionAction=linked=>{ + const ids=selectedNativeIds(); + if(ids.length<2||ids.length>64||linkFaders.disabled&&linked|| + unlinkFaders.disabled&&!linked)return; + sendIntent('SET_LINK_GROUP',null,{channelIds:ids,linked},ids); + }; + linkFaders.addEventListener('click',()=>sendSelectionAction(true)); + unlinkFaders.addEventListener('click',()=>sendSelectionAction(false)); + routeSelected.addEventListener('click',()=>{ + const ids=selectedNativeIds(),destinationId=routeBus.value; + if(routeSelected.disabled||!ids.length||ids.length>64|| + !byId.has(destinationId)||byId.get(destinationId).role!=='GROUP')return; + sendIntent('ROUTE_SELECTED_TO_GROUP',null, + {channelIds:ids,destinationId},ids); + }); + deviceButton.addEventListener('click',()=>{ + devicePanel.hidden=!devicePanel.hidden; + deviceButton.setAttribute('aria-expanded',String(!devicePanel.hidden)); + if(!devicePanel.hidden)refreshDevicePanel(); + }); + deviceClose.addEventListener('click',()=>{ + devicePanel.hidden=true;deviceButton.setAttribute('aria-expanded','false'); + }); + function closePluginManager(){ + pluginPanel.hidden=true;pluginsButton.setAttribute('aria-expanded','false'); + } + // UI-only preferences store stable native catalog IDs, never plugin state. + const pluginFavorites=new Set(),pluginRecent=[]; + try{ + const p=JSON.parse(localStorage.getItem('armix.v6.fx-ux.v5')||'{}'); + if(Array.isArray(p.favorites))for(const id of p.favorites.slice(0,300)) + if(typeof id==='string')pluginFavorites.add(id); + if(Array.isArray(p.recent))for(const id of p.recent.slice(0,20)) + if(typeof id==='string')pluginRecent.push(id); + }catch{} + function saveFxPrefs(){ + try{localStorage.setItem('armix.v6.fx-ux.v5',JSON.stringify({ + favorites:[...pluginFavorites].slice(0,300),recent:pluginRecent.slice(0,20)}));}catch{} + } + let quickTarget=null,quickAnchor=null; + const nativeCatalog=()=>acceptedNative&&Array.isArray(accepted?.catalog?.plugins)? + accepted.catalog.plugins.filter(p=>p&&typeof p.id==='string'&&p.id&& + typeof p.name==='string'&&p.name):[]; + function closeQuickFx(focus=false){ + quickPanel.hidden=true; + if(focus&&quickAnchor?.isConnected)quickAnchor.focus(); + quickAnchor=null; + } + function commitNativeFx(pluginId,id){ + if(!nativeCatalog().some(p=>p.id===pluginId)||!can('ADD_INSERT',id))return false; + if(!sendIntent('ADD_INSERT',id,{pluginId}))return false; + const n=pluginRecent.indexOf(pluginId);if(n!==-1)pluginRecent.splice(n,1); + pluginRecent.unshift(pluginId);if(pluginRecent.length>20)pluginRecent.length=20; + saveFxPrefs();return true; + } + function refreshQuickFx(){ + if(quickPanel.hidden)return; + quickResults.replaceChildren(); + const target=byId.get(quickTarget); + quickTitle.textContent=(target?.name||'CHANNEL')+' · ADD FX · NATIVE'; + const q=quickSearch.value.trim().toLocaleLowerCase(); + const results=nativeCatalog().filter(p=> + (p.name+' '+(p.vendor||'')+' '+(p.category||'')).toLocaleLowerCase().includes(q)) + .sort((a,b)=>Number(pluginFavorites.has(b.id))-Number(pluginFavorites.has(a.id))|| + a.name.localeCompare(b.name)); + if(!results.length)quickResults.append(h('p','arV6DeviceNote', + 'No verified VST3 catalog. Use Plugin Manager F8 after native scan.')); + for(const fx of results.slice(0,64)){ + const b=button((pluginFavorites.has(fx.id)?'★ ':'')+fx.name+' · '+(fx.category||'Effect'), + {'data-quick-fx':fx.id}); + b.classList.add('arV6PluginResult');b.disabled=!can('ADD_INSERT',quickTarget); + quickResults.append(b); + } + } + function openQuickFx(id,anchor){ + if(!byId.has(id))return; + quickTarget=id;quickAnchor=anchor||null; + closePluginManager(); + const area=root.getBoundingClientRect(),r=anchor?.getBoundingClientRect(); + if(r){ + quickPanel.style.left=Math.max(7,Math.min(r.left-area.left,area.width-320))+'px'; + quickPanel.style.top=Math.max(44,Math.min(r.bottom-area.top+3,area.height-340))+'px'; + } + quickPanel.hidden=false;quickSearch.value='';refreshQuickFx();quickSearch.focus(); + } + quickClose.addEventListener('click',()=>closeQuickFx(true)); + quickSearch.addEventListener('input',refreshQuickFx); + quickSearch.addEventListener('keydown',event=>{ + if(event.key==='Enter'){ + const first=quickResults.querySelector('button[data-quick-fx]:not([disabled])'); + if(first){event.preventDefault();first.click();} + } + }); + quickResults.addEventListener('click',event=>{ + const b=event.target.closest('button[data-quick-fx]'); + if(b&&!b.disabled&&commitNativeFx(b.dataset.quickFx,quickTarget))closeQuickFx(); + }); + quickManager.addEventListener('click',()=>{const id=quickTarget;closeQuickFx();openPluginManager(id)}); + managerView.addEventListener('change',refreshPluginCatalog); + managerCategory.addEventListener('change',refreshPluginCatalog); + function openPluginManager(id){ + if(id&&byId.has(id)&&byId.get(id).role!=='MAIN'){ + selectedIds.clear();selectedIds.add(id);selectionAnchor=id; + updateSelection(); + } + devicePanel.hidden=true;deviceButton.setAttribute('aria-expanded','false'); + closeQuickFx(); + pluginPanel.hidden=false;pluginsButton.setAttribute('aria-expanded','true'); + refreshPluginCatalog();pluginSearch.focus(); + } + pluginsButton.addEventListener('click',()=>{ + if(pluginPanel.hidden)openPluginManager(); + else closePluginManager(); + }); + pluginClose.addEventListener('click',closePluginManager); + pluginSearch.addEventListener('input',refreshPluginCatalog); + pluginResults.addEventListener('click',event=>{ + const fav=event.target.closest('button[data-fx-fav]'); + if(fav){ + const id=fav.dataset.fxFav; + if(!nativeCatalog().some(p=>p.id===id))return; + if(pluginFavorites.has(id))pluginFavorites.delete(id);else pluginFavorites.add(id); + saveFxPrefs();refreshPluginCatalog();refreshQuickFx();return; + } + const node=event.target.closest('button[data-plugin-id]'); + if(!node||node.disabled||selectedIds.size!==1)return; + if(commitNativeFx(node.dataset.pluginId,[...selectedIds][0]))closePluginManager(); + }); + document.addEventListener('keydown',event=>{ + if(!document.documentElement.classList.contains('ar-v6-active'))return; + if(event.key==='Escape'&&!quickPanel.hidden){ + event.preventDefault();closeQuickFx(true); + }else if(event.key==='Escape'&&!selectionPanel.hidden){ + event.preventDefault();selectionPanel.hidden=true; + selectionCount.setAttribute('aria-expanded','false'); + }else if(event.key==='Escape'&&!pluginPanel.hidden){ + event.preventDefault();closePluginManager(); + }else if(event.key==='F8'&&!event.repeat){ + event.preventDefault();openPluginManager(); + } + }); + narrow.addEventListener('click',()=>{ + const compact=root.dataset.narrow!=='true'; + root.dataset.narrow=String(compact); + narrow.setAttribute('aria-pressed',String(compact)); + narrow.textContent=compact?'WIDE':'NARROW'; + refreshBanks(); // Resize only; never create a native channel or remount faders. + }); + document.querySelector('.toolbar-actions')?.append(back); + const setVisible=v=>{ + document.documentElement.classList.toggle('ar-v6-active',!!v); + back.hidden=!!v; + }; + patch.addEventListener('click',()=>{ + setVisible(false); + document.querySelector('[data-view="SIGNAL FLOW"]')?.click(); + }); + back.addEventListener('click',()=>{ + document.querySelector('[data-view="MIX"]')?.click();setVisible(true); + }); + function refreshDevicePanel(){ + if(devicePanel.hidden)return; + deviceRows.replaceChildren(); + const d=acceptedNative?accepted?.device:null; + if(!d){deviceRows.append(h('p','','No verified native device published.'));return;} + const addRow=(label,value)=>{ + const row=h('div','arV6DeviceRow'); + row.append(h('span','',label),h('strong','',value));deviceRows.append(row); + }; + addRow('BACKEND',d.backend||'—'); + addRow('INPUT DEVICE',d.captureDevice||'NONE'); + addRow('OUTPUT DEVICE',d.playbackDevice||'NONE'); + addRow('CLOCK',Number.isFinite(d.sampleRate)?d.sampleRate+' Hz / '+ + d.bufferFrames+' frames':'UNVERIFIED'); + addRow('OUTPUT ARM',d.outputArmed?'ARMED · acoustics unverified':'DISARMED'); + for(const [label,ports,mask] of [ + ['INPUT PINS',d.inputEndpoints,d.enabledInputs], + ['OUTPUT PINS',d.outputEndpoints,d.enabledOutputs]]){ + const verified=ports.filter(p=>p.active===true&&mask.includes(p.port)); + addRow(label,verified.length?verified.map(p=>p.label+' (port '+p.port+ + ', callback '+p.callback+')').join(', '):'NO VERIFIED ACTIVE PIN'); + } + deviceRows.append(h('p','arV6DeviceNote', + 'Read-only: device changes require a genuine native SET_DEVICE transaction; no guessed hardware pin or automatic audio reroute.')); + } + function refreshPluginCatalog(){ + if(pluginPanel.hidden)return; + pluginResults.replaceChildren(); + const ids=[...selectedIds].filter(id=>byId.has(id)); + const id=ids.length===1?ids[0]:null; + pluginTarget.textContent=id? + 'TARGET · '+byId.get(id).name+' · '+(can('ADD_INSERT',id)? + 'NATIVE LOAD AVAILABLE':'NATIVE LOAD NOT AVAILABLE'): + 'Select exactly ONE channel header to load a VST3'; + const catalog=nativeCatalog(); + const categories=[...new Set(catalog.map(p=>p.category||'Effect'))].sort(); + const previous=managerCategory.value; + managerCategory.replaceChildren(); + const any=h('option','','All categories');any.value='ALL';managerCategory.append(any); + for(const category of categories){ + const opt=h('option','',category);opt.value=category;managerCategory.append(opt); + } + managerCategory.value=categories.includes(previous)?previous:'ALL'; + const q=pluginSearch.value.trim().toLocaleLowerCase(),mode=managerView.value; + const results=catalog.filter(p=> + (p.name+' '+(p.vendor||'')+' '+(p.category||'')).toLocaleLowerCase().includes(q)&& + (managerCategory.value==='ALL'||(p.category||'Effect')===managerCategory.value)&& + (mode!=='FAVORITES'||pluginFavorites.has(p.id))&& + (mode!=='RECENT'||pluginRecent.includes(p.id))) + .sort((a,b)=>mode==='RECENT'? + pluginRecent.indexOf(a.id)-pluginRecent.indexOf(b.id):a.name.localeCompare(b.name)); + if(!results.length)pluginResults.append(h('p','arV6DeviceNote', + catalog.length?'No native plugins match the filter': + 'Native catalog not published · no simulated plugins available.')); + for(const p of results.slice(0,100)){ + const row=h('div','arV6CatalogRow'); + const star=button(pluginFavorites.has(p.id)?'★':'☆', + {'data-fx-fav':p.id,'aria-label':'Toggle favorite '+p.name}); + star.classList.add('arV6CatalogStar'); + const add=button(p.name+' · '+(p.vendor||'VST3'),{'data-plugin-id':p.id}); + add.classList.add('arV6PluginResult');add.disabled=!id||!can('ADD_INSERT',id); + row.append(star,add);pluginResults.append(row); + } + } + function supported(op){ + const caps=accepted?.graph?.capabilities||{}; + // Absence of explicit native advertised operation support means disabled. + return acceptedNative && accepted?.productionCallbackLive===true && + Array.isArray(caps.supportedOps) && caps.supportedOps.includes(operationCaps[op]); + } + function can(op,id){ + const ch=id?byId.get(id):null; + // A native WIRE-capable ordinary channel cannot write a second legacy + // SET_PRIMARY_OUT state; the OUT control uses the same WIRE intent path. + const wireInstalled=supported('APPLY_WIRE_TRANSACTION'); + if(wireInstalled&&['SET_SEND_LEVEL','SET_SEND_TAP'].includes(op))return false; + const wireOut=op==='SET_PRIMARY_OUT'&&ch&& + !['MAIN','MONITOR'].includes(ch.role)&&wireInstalled; + const effective=wireInstalled&&(wireOut||op==='ADD_SEND')? + 'APPLY_WIRE_TRANSACTION':op; + if(!supported(effective))return false; + if(op==='CREATE_CHANNEL')return !!accepted.graph.capabilities.dynamicChannels && !pendingTargets.has('@roster'); + if(op==='ADD_INSERT'&&!accepted?.catalog?.plugins?.length)return false; + if(!id)return !pendingTargets.has('@selection'); + return !!ch && !pendingTargets.has(id) && + (!Array.isArray(ch.allowedOps)||ch.allowedOps.includes(effective)); + } + function showFeedback(text){ + feedback=clean(text);message.textContent=feedback; + message.hidden=!feedback; + } + function requestSnapshot(){ + if(native)backend.emitEvent('arMixConsoleSubscribe',{protocol:'v6',requester:instance}); + } + function sendIntent(op,id,payload,affectedIds=[]){ + if(!can(op,id)||affectedIds.length>64|| + affectedIds.some(channelId=>!can(op,channelId))){ + showFeedback('UNAVAILABLE · Native capability, selection lock or channel authorization missing'); + return false; + } + const requestId=instance+':'+String(++requestSeq); + const command={requestId,deviceEpoch:accepted.device.epoch, + baseGraphRevision:accepted.graph.revision, + baseRosterRevision:accepted.graph.rosterRevision, + operation:op,targetChannelId:id||null,payload:payload||{}}; + const targets=id?[id]:affectedIds.length?['@selection',...affectedIds]: + op==='CREATE_CHANNEL'?['@roster']:[]; + pending.set(requestId,{op,id,targets,baseRevision:command.baseGraphRevision, + baseRosterRevision:command.baseRosterRevision,epoch:command.deviceEpoch,snapshotSerial}); + for(const target of targets)pendingTargets.add(target); + showFeedback('PENDING · '+op+' · awaiting native ACK'); + refreshDisabled(); + backend.emitEvent('arMixConsoleIntent',command); + return true; + } + /* Packet C additive WIRE consumer. This is NOT a browser-owned audio + graph: every edge is read fresh from the accepted native snapshot. + A request never paints a cable as accepted until ACK + matching snapshot. */ + function acceptedWireGraph(){ + const graph=accepted?.graph; + if(!supported('APPLY_WIRE_TRANSACTION')|| + !Array.isArray(graph?.edges)||decimal(graph.mainChannelId)===null)return null; + return { + deviceEpoch:accepted.device.epoch,graphRevision:graph.revision, + rosterRevision:graph.rosterRevision,mainChannelId:graph.mainChannelId, + edges:graph.edges.map(e=>({edgeId:e.edgeId,from:e.from,to:e.to, + tap:e.tap,gainLinear:e.gainLinear,enabled:e.enabled,signalKind:e.signalKind})) + }; + } + function nativeGraphMode(id){ + const ch=byId.get(id); + return !!ch&&!['MAIN','MONITOR'].includes(ch.role)&& + acceptedWireGraph()!==null; + } + function projectedChannelSends(ch){ + const graph=acceptedWireGraph(); + if(!graph)return Array.isArray(ch.sends)?ch.sends:[]; + // A displayed SEND is only a read-only projection of an accepted AUDIO + // edge. The legacy ch.sends array cannot invent a second signal path. + return graph.edges.filter(e=>e.enabled&&e.from===ch.id&& + e.to!==graph.mainChannelId).map(e=>{ + const target=byId.get(e.to),linear=e.gainLinear; + return {id:e.edgeId,targetId:e.to,name:target?.name||e.to, + tap:e.tap==='POST_FADER'?'POST':'PRE', + levelDb:linear>0?Math.max(-60,Math.min(12,20*Math.log10(linear))):-60, + wireNative:true}; + }); + } + function physicalMainEdge(sourceId){ + const graph=acceptedWireGraph(); + if(!graph||decimal(sourceId)===null||sourceId===graph.mainChannelId)return null; + return graph.edges.find(e=>e.enabled&&e.from===sourceId&& + e.to===graph.mainChannelId)||null; + } + function nativeRouteSelection(ch){ + if(!nativeGraphMode(ch.id))return ch.primaryOutId||ch.primaryOut?.id|| + (typeof ch.primaryOut==='string'?ch.primaryOut:''); + const graph=acceptedWireGraph(); + const outgoing=graph.edges.filter(e=>e.enabled&&e.from===ch.id); + return outgoing.some(e=>e.to===graph.mainChannelId)?graph.mainChannelId: + outgoing.length===1?outgoing[0].to:''; + } + function unplugNativeMain(sourceId){ + const edge=physicalMainEdge(sourceId); + return !!edge&&applyNativeWireTransaction(sourceId,'UNPLUG',[ + {op:'REMOVE',edgeId:edge.edgeId}]); + } + function replugNativeMain(sourceId){ + const graph=acceptedWireGraph(); + if(!nativeGraphMode(sourceId)||physicalMainEdge(sourceId))return false; + return applyNativeWireTransaction(sourceId,'REPLUG',[ + {op:'CONNECT',from:sourceId,to:graph.mainChannelId, + tap:'POST_FADER',gainLinear:1}]); + } + function routeOnlyNative(sourceId,targetId){ + const graph=acceptedWireGraph(); + if(!nativeGraphMode(sourceId)||decimal(targetId)===null|| + !byId.has(targetId)||targetId===sourceId)return false; + const enabled=graph.edges.filter(e=>e.enabled&&e.from===sourceId); + const main=enabled.find(e=>e.to===graph.mainChannelId); + const target=enabled.find(e=>e.to===targetId); + if(target)return targetId===graph.mainChannelId||!main? + true:applyNativeWireTransaction(sourceId,'ROUTE_ONLY',[ + {op:'REMOVE',edgeId:main.edgeId}]); + const changes=[]; + if(main&&targetId!==graph.mainChannelId) + changes.push({op:'REMOVE',edgeId:main.edgeId}); + changes.push({op:'CONNECT',from:sourceId,to:targetId, + tap:'POST_FADER',gainLinear:1}); + return applyNativeWireTransaction(sourceId,'ROUTE_ONLY',changes); + } + function applyNativeWireTransaction(sourceId,reason,changes){ + const graph=acceptedWireGraph(); + if(!graph||decimal(sourceId)===null||sourceId==='0'|| + !can('APPLY_WIRE_TRANSACTION',sourceId)|| + !['CONNECT','UNPLUG','REPLUG','ROUTE_ONLY','MATRIX','NAVIGATOR'].includes(reason)|| + !Array.isArray(changes)||!changes.length||changes.length>64){ + showFeedback('WIRE UNAVAILABLE · native accepted graph/operation not installed'); + return false; + } + const own=graph.edges.filter(e=>e.from===sourceId); + for(const change of changes){ + if(!change||!['CONNECT','REMOVE','RETARGET'].includes(change.op))return false; + if(change.op==='CONNECT'){ + if(change.from!==sourceId||decimal(change.to)===null|| + change.to===sourceId||!byId.has(change.to)|| + change.tap!=='POST_FADER'||!Number.isFinite(change.gainLinear)|| + change.gainLinear<0)return false; + }else{ + if(decimal(change.edgeId)===null|| + !own.some(e=>e.edgeId===change.edgeId))return false; + if(change.op==='RETARGET'&&(decimal(change.to)===null|| + !byId.has(change.to)||change.to===sourceId))return false; + } + } + // Reuse the SAME v8 requestId/epoch/revisions, existing pending locks, + // native ACK and accepted same-revision snapshot fencing. + return sendIntent('APPLY_WIRE_TRANSACTION',sourceId,{reason,changes}); + } + function receiveAck(data){ + const a=data?.ack||data; + if(!a||typeof a.requestId!=='string')return; + const task=pending.get(a.requestId);if(!task)return; + const unlock=()=>{for(const target of task.targets||[])pendingTargets.delete(target)}; + const epoch=decimal(a.deviceEpoch),rev=decimal(a.graphRevision),roster=decimal(a.rosterRevision); + if(!['ACCEPTED','REJECTED','REQUIRES_DEVICE_CHANGE'].includes(a.status)|| + epoch===null||rev===null||roster===null||epoch!==task.epoch|| + typeof a.errorCode!=='string'){ + // A malformed ACK with a matching outstanding requestId is terminal. + // Release its UI lock, retain the LAST accepted native graph and + // resubscribe rather than leaving the physical MAIN plug stuck pending. + pending.delete(a.requestId); + unlock(); + showFeedback('INVALID NATIVE ACK · accepted route unchanged'); + requestSnapshot();refreshAcceptedControls();refreshDisabled(); + return; + } + pending.delete(a.requestId); + if(a.status==='ACCEPTED'){ + // A WIRE transaction changes topology. An ACK at the request's old + // graph revision cannot authorize a cable repaint or an accepted edit. + // Fail closed even if a native producer erroneously reports ACCEPTED. + if((task.op==='APPLY_WIRE_TRANSACTION'&& + BigInt(rev)<=BigInt(task.baseRevision))|| + BigInt(rev)wait.snapshotSerial&& + accepted?.device?.epoch===wait.epoch&& + accepted?.graph?.revision===wait.requiredRevision&& + accepted?.graph?.rosterRevision===wait.requiredRoster; + } + function validSnapshot(s){ + // Mirror the required v8 producer wire: never infer physical masks, + // capabilities, PCM or accepted ChannelIds from browser/M4 fallback. + if(!s||s.schemaVersion!==6||typeof s.productionCallbackLive!=='boolean'|| + !s.device||!s.graph||!s.telemetry)return false; + const d=s.device,g=s.graph,c=g.capabilities,t=s.telemetry; + if(decimal(d.epoch)===null||decimal(g.revision)===null|| + decimal(g.rosterRevision)===null||typeof d.backend!=='string'|| + typeof d.captureDevice!=='string'||typeof d.playbackDevice!=='string'|| + typeof d.outputArmed!=='boolean'||!Array.isArray(d.inputEndpoints)|| + !Array.isArray(d.outputEndpoints)||!Array.isArray(d.enabledInputs)|| + !Array.isArray(d.enabledOutputs)||!Array.isArray(g.channels)|| + !Array.isArray(g.destinations)||!c||!Array.isArray(c.supportedOps)) + return false; + const pins=a=>a.every(v=>Number.isSafeInteger(v)&&v>=0&&v<=255)&& + new Set(a).size===a.length; + if(!pins(d.enabledInputs)||!pins(d.enabledOutputs))return false; + for(const [type,endpoints,mask] of [['in',d.inputEndpoints,d.enabledInputs], + ['out',d.outputEndpoints,d.enabledOutputs]]){ + const ids=new Set(),cb=new Set(); + for(const e of endpoints){ + if(!e||!mask.includes(e.port)||e.id!==type+':'+e.port|| + !Number.isSafeInteger(e.callback)||e.callback<0|| + typeof e.label!=='string'||!e.label||typeof e.active!=='boolean'|| + ids.has(e.id)||cb.has(e.callback))return false; + ids.add(e.id);cb.add(e.callback); + } + } + for(const key of ['callbackOwnsChannelIds','fullVendorFxMigration','showAndOutputParity', + 'physicalCaptureMapped','dynamicChannels','groups','fxReturns','monitor','sendsOnFaders']) + if(typeof c[key]!=='boolean')return false; + if(c.supportedOps.some(op=>typeof op!=='string'||!/^[A-Z_]+$/.test(op))|| + new Set(c.supportedOps).size!==c.supportedOps.length)return false; + if(s.productionCallbackLive){ + if(d.epoch==='0'||!c.callbackOwnsChannelIds||!c.fullVendorFxMigration|| + !c.showAndOutputParity||!c.physicalCaptureMapped)return false; + }else if(g.channels.length||c.supportedOps.length)return false; + const ids=new Set(),roles=['INPUT','GROUP','FX_RETURN','MONITOR','MAIN','AUX']; + for(const ch of g.channels){ + if(!ch||decimal(ch.id)===null||ch.id==='0'||ids.has(ch.id)|| + !roles.includes(ch.role)||!['MONO','STEREO'].includes(ch.processingFormat)|| + typeof ch.name!=='string'||!Array.isArray(ch.inserts)||!Array.isArray(ch.sends))return false; + ids.add(ch.id); + } + // The optional WIRE graph is authoritative only when the installed + // native callback explicitly advertises its additive v8 operation. + if(c.supportedOps.includes('APPLY_WIRE_TRANSACTION')){ + if(!Array.isArray(g.edges)||decimal(g.mainChannelId)===null|| + !ids.has(g.mainChannelId)|| + !g.channels.some(ch=>ch.id===g.mainChannelId&&ch.role==='MAIN')) + return false; + const wireIds=new Set(),pairs=new Set(); + for(const edge of g.edges){ + if(!edge||decimal(edge.edgeId)===null||edge.edgeId==='0'|| + decimal(edge.from)===null||decimal(edge.to)===null|| + !ids.has(edge.from)||!ids.has(edge.to)||edge.from===g.mainChannelId|| + edge.from===edge.to||wireIds.has(edge.edgeId)|| + !['POST_FADER','PRE_FADER','PRE_FX'].includes(edge.tap)|| + !Number.isFinite(edge.gainLinear)||edge.gainLinear<0|| + typeof edge.enabled!=='boolean'||edge.signalKind!=='AUDIO') + return false; + if(edge.to===g.mainChannelId&&edge.enabled&& + (edge.tap!=='POST_FADER'||edge.gainLinear!==1))return false; + const pair=edge.from+':'+edge.to; + // The MVP forbids duplicate *enabled* audible pairs, but a native + // accepted inventory may retain a disabled edge for later recall. + if(edge.enabled&&pairs.has(pair))return false; + if(edge.enabled)pairs.add(pair); + wireIds.add(edge.edgeId); + } + // A malformed accepted graph must not paint ghost routes. This is a + // readback validation only, never a second browser-owned audio graph. + const adjacency=new Map(); + for(const edge of g.edges)if(edge.enabled){ + if(!adjacency.has(edge.from))adjacency.set(edge.from,[]); + adjacency.get(edge.from).push(edge.to); + } + const state=new Map(); + function visit(id){ + if(state.get(id)===1)return false; + if(state.get(id)===2)return true; + state.set(id,1); + for(const to of adjacency.get(id)||[])if(!visit(to))return false; + state.set(id,2);return true; + } + for(const id of ids)if(!visit(id))return false; + } + for(const ch of g.channels){ + if(ch.primaryOutId!==undefined&&ch.primaryOutId!==null){ + const to=ch.primaryOutId; + const physical=d.outputEndpoints.some(p=>p.id===to&&p.active===true&& + d.enabledOutputs.includes(p.port)); + if(to===ch.id||!ids.has(to)&&!(physical&&['MAIN','MONITOR'].includes(ch.role))) + return false; + } + if(ch.source){ + const x=ch.source; + if(ch.role!=='INPUT'||typeof x.portId!=='string'|| + !Array.isArray(x.physicalPins)||!pins(x.physicalPins)|| + ![1,2].includes(x.physicalPins.length)|| + !x.physicalPins.every(p=>d.enabledInputs.includes(p)&& + d.inputEndpoints.some(e=>e.port===p&&e.active))|| + !d.inputEndpoints.some(p=>p.id===x.portId&&p.active&& + x.physicalPins.includes(p.port)))return false; + } + for(const send of ch.sends) + if(!ids.has(send.targetId)||send.targetId===ch.id|| + !['PRE','POST'].includes(send.tap))return false; + if(ch.role==='GROUP'&&!c.groups||ch.role==='FX_RETURN'&&!c.fxReturns|| + ch.role==='MONITOR'&&!c.monitor)return false; + } + if(s.productionCallbackLive&&g.channels.filter(ch=>ch.role==='MAIN').length!==1)return false; + // Reject source/primary bus cycles before allowing the operator to act. + const graphIds=new Map(g.channels.map(ch=>[ch.id,ch])); + for(const ch of g.channels){ + let current=ch,visited=new Set(); + while(current?.primaryOutId){ + if(visited.has(current.id))return false; + visited.add(current.id); + current=graphIds.get(current.primaryOutId); + } + } + if(g.destinations.some(dst=>!dst||!ids.has(dst.id)))return false; + if(typeof t.rawCapturePresent!=='boolean'||typeof t.mainPcmPresent!=='boolean'|| + typeof t.monitorPcmPresent!=='boolean'||typeof t.rawCapturePeak!=='number'|| + !Number.isFinite(t.rawCapturePeak)||t.rawCapturePeak<0)return false; + // Actual native meter fields are optional until the installed callback + // publishes them. When present, reject forged IDs/invalid PCM numbers. + // Keep peaks linear (values >1 indicate genuine clipping, not an error). + const raw=t.channelMeterRmsPeak; + if(raw!==undefined&&raw!==null){ + if(!Array.isArray(raw)&&(typeof raw!=='object'||Object.getPrototypeOf(raw)!==Object.prototype)) + return false; + const samples=Array.isArray(raw)?raw.map(x=>[x?.channelId,x]):Object.entries(raw); + const seen=new Set(); + for(const [key,m] of samples){ + if(!ids.has(key)||seen.has(key)||!m||typeof m!=='object')return false; + seen.add(key); + for(const prop of ['peak','peakLeft','peakRight','rmsLeft','rmsRight']){ + if(m[prop]!==undefined&&(typeof m[prop]!=='number'|| + !Number.isFinite(m[prop])||m[prop]<0))return false; + } + if(!['peak','peakLeft','peakRight','rmsLeft','rmsRight'] + .some(prop=>typeof m[prop]==='number'))return false; + } + } + return true; + } + function normalizeSnapshot(payload){ + const raw=payload?.snapshot||payload; + // Flat M4 readback is not the universal v8 device inventory. + return raw&&typeof raw==='object'&&raw.schemaVersion===6?raw:null; + } + function receiveSnapshot(data,fromNative){ + const s=normalizeSnapshot(data); + if(!validSnapshot(s)){ + if(fromNative)showFeedback('REJECTED SNAPSHOT · Invalid native epoch, revision or ChannelId'); + return false; + } + if(acceptedNative&&!fromNative)return false; + if(fromNative&&acceptedNative&&accepted&& + BigInt(s.device.epoch)JSON.stringify([d.backend,d.captureDevice,d.playbackDevice, + d.sampleRate,d.bufferFrames,d.inputEndpoints,d.outputEndpoints, + d.enabledInputs,d.enabledOutputs]); + if(hardware(s.device)!==hardware(accepted.device)){ + showFeedback('REJECTED DEVICE READBACK · epoch unchanged; retained verified pins'); + return false; + } + } + const priorEpoch=acceptedNative?accepted?.device?.epoch:null; + const structure=s.device.epoch+':'+s.graph.rosterRevision+':'+ + s.graph.channels.map(c=>[c.id,c.role,c.processingFormat,c.primaryOutId, + (c.inserts||[]).map(f=>f.id).join(','),(c.sends||[]).map(x=>x.id).join(',')].join(':')).join('|')+ + ':'+s.graph.capabilities.supportedOps.join('|')+ + // A newly accepted topology changes SEND/OUT controls once. Telemetry + // frames with the same edge inventory never re-mount fader/meter DOM. + (s.graph.capabilities.supportedOps.includes('APPLY_WIRE_TRANSACTION')? + ':'+s.graph.edges.filter(e=>e.enabled).map(e=> + e.edgeId+':'+e.from+':'+e.to).join('|'):''); + // Full snapshots remain authoritative; a telemetry-only message must + // still pass the same epoch/graph/roster validation and ACK fences. + const controlProjection=JSON.stringify([ + s.graph.channels,s.graph.destinations,s.graph.capabilities, + s.graph.mainChannelId||null,s.graph.edges||null,s.catalog||null]); + const headerProjection=JSON.stringify([ + s.device.backend,s.device.sampleRate,s.device.bufferFrames, + s.device.outputArmed,s.device.epoch,s.graph.revision,s.productionCallbackLive,!!fromNative]); + accepted=s;acceptedNative=!!fromNative; + if(s.graph.capabilities.supportedOps.includes('APPLY_WIRE_TRANSACTION')) + modeSend=''; // No native WIRE gain-plane operation is installed yet. + snapshotSerial++; + byId.clear(); + for(const c of s.graph.channels)byId.set(c.id,c); + if(fromNative&&priorEpoch!==null&&priorEpoch!==s.device.epoch){ + // Device replacement invalidates all old intents and controls; never + // replay them into an unrelated callback/port inventory. + pending.clear();pendingTargets.clear();awaitingSnapshot.clear(); + selectedIds.clear();selectionAnchor=null; + showFeedback('DEVICE CHANGED · native source and destination inventory refreshed'); + } + for(const [requestId,task] of awaitingSnapshot){ + if(ackMatches(task)){ + awaitingSnapshot.delete(requestId); + for(const target of task.targets||[])pendingTargets.delete(target); + } + } + const newStructure=structure!==lastStructure|| + root.dataset.demo!==String(!fromNative); + const newControls=controlProjection!==lastControlProjection; + const newHeader=headerProjection!==lastHeaderProjection; + lastStructure=structure; + lastControlProjection=controlProjection; + lastHeaderProjection=headerProjection; + if(newStructure){ + render(); + }else if(newControls){ + refreshAcceptedControls();refreshDisabled(); + }else{ + // High-frequency native meter snapshots only: no select.value writes, + // role filters, getBoundingClientRect, FX catalog DOM or fader remount. + uiStats.telemetryFastFrames++; + refreshMeters(); + } + if(newHeader&&!newStructure)updateHeader(); + root.dataset.demo=String(!fromNative); + if(newStructure||newControls){refreshDevicePanel();refreshPluginCatalog();refreshQuickFx();} + // Integration readback is intentionally not a production callback. + // It must never replace the working M4 console until callback cutover. + if(!fromNative||s.productionCallbackLive===true)setVisible(true); + return true; + } + const makeDemo=()=>{ + const names=['Lead Vocal','Guest Mic','Music L','Music R','Speech','Stream','Backing','Guitar','Keys','Talkback']; + const channels=names.map((name,i)=>({ + id:'DEMO:'+String(i+1),role:'INPUT',name,color:'#4e8ba4',processingFormat:i===2||i===3?'STEREO':'MONO', + source:null,primaryOut:null,inserts:[],sends:[],controls:{faderDb:0,pan:0,mute:false,solo:false} + })); + channels.push({id:'DEMO:MAIN',role:'MAIN',name:'MAIN',processingFormat:'STEREO', + inserts:[],sends:[],controls:{faderDb:0,pan:0,mute:false,solo:false}}); + return {schemaVersion:6,productionCallbackLive:false, + device:{epoch:'0',backend:'BROWSER DEMO',sampleRate:null,bufferFrames:null,outputArmed:false, + inputEndpoints:[],outputEndpoints:[]},graph:{revision:'0',rosterRevision:'0',channels,destinations:[], + capabilities:{dynamicChannels:false,groups:false,fxReturns:false,sendsOnFaders:false,supportedOps:[]}}, + telemetry:{rawCapturePresent:false,channelMeterRmsPeak:{}}}; + }; + function options(select,items,current,emptyLabel){ + select.replaceChildren(); + const zero=h('option','',emptyLabel);zero.value='';select.append(zero); + let found=!current; + for(const item of items){ + if(!item||typeof item.id!=='string'||!item.id)continue; + const opt=h('option','',item.name||item.label||item.id); + opt.value=item.id;opt.disabled=item.available===false||item.active===false; + if(current===item.id){opt.selected=true;found=true} + select.append(opt); + } + if(!found){ + const missing=h('option','','MISSING · '+current);missing.value=current; + missing.selected=true;missing.disabled=true;select.append(missing); + } + if(!current)select.value=''; + return select; + } + function legalOutputs(ch){ + // In WIRE mode any non-terminal universal channel is a legal destination. + // Native Guardian ultimately decides whether the candidate is admissible. + if(nativeGraphMode(ch.id))return accepted.graph.channels + .filter(dst=>dst.id!==ch.id&&dst.role!=='MONITOR') + .map(dst=>({id:dst.id,name:dst.name})); + const destinations=(accepted.graph.destinations||[]).filter(dst=>{ + const target=byId.get(dst.id); + return target&&target.id!==ch.id&&['MAIN','GROUP'].includes(target.role)&& + dst.acceptsPrimary!==false; + }); + // SOURCE channels may only route through native buses, not skip to a + // physical output. The MAIN/MONITOR roles can select verified render pins. + if(ch.role==='MAIN'||ch.role==='MONITOR') + return (accepted.device.outputEndpoints||[]).filter(p=> + p.active===true&&accepted.device.enabledOutputs.includes(p.port)); + return destinations; + } + function selectField(label,op,id,items,current,placeholder,extra){ + const row=h('label','arV6Field'); + row.append(h('span','arV6FieldName',label)); + const sel=options(h('select','arV6Select'),items,current,placeholder); + sel.dataset.op=op;sel.dataset.id=id; + if(extra)for(const [key,val] of Object.entries(extra))sel.dataset[key]=val; + sel.disabled=!can(op,id); + row.append(sel);return row; + } + function fxSection(ch){ + const section=h('div','arV6Fx'); + section.append(h('span','arV6SectionTitle','VST3 INSERTS')); + const list=Array.isArray(ch.inserts)?ch.inserts:[]; + for(const fx of list){ + const row=h('div','arV6FxSlot'); + row.dataset.fxId=clean(fx.id);row.dataset.id=ch.id; + row.draggable=can('MOVE_INSERT',ch.id); + row.append(button(fx.name||fx.pluginName||'VST3',{'data-op':'OPEN_INSERT_EDITOR', + 'data-id':ch.id,'data-native-insert-id':clean(fx.id)})); + const bypass=button(fx.bypassed?'OFF':'ON',{'data-op':'SET_INSERT_BYPASS', + 'data-id':ch.id,'data-native-insert-id':clean(fx.id),'aria-pressed':String(!fx.bypassed)}); + bypass.classList.toggle('isOff',!!fx.bypassed);row.append(bypass); + section.append(row); + } + const catalogReady=supported('ADD_INSERT')&&nativeCatalog().length>0; + const filePicker=supported('PICK_INSERT_FILE'); + const addFx=button(catalogReady?'+ ADD FX':filePicker?'+ OPEN VST3 FILE':'+ ADD FX', + catalogReady?{'data-ui':'OPEN_FX_QUICK','data-id':ch.id}: + filePicker?{'data-op':'PICK_INSERT_FILE','data-id':ch.id}: + {'data-ui':'OPEN_FX_QUICK','data-id':ch.id}); + addFx.classList.add('arV6AddFx');section.append(addFx); + return section; + } + function sendSection(ch){ + const section=h('div','arV6Sends'); + section.append(h('span','arV6SectionTitle','SEND · NATIVE')); + const sends=projectedChannelSends(ch); + const targets=nativeGraphMode(ch.id)?accepted.graph.channels + .filter(dst=>dst.id!==ch.id&&dst.role!=='MAIN'&&dst.role!=='MONITOR') + .map(dst=>({id:dst.id,name:dst.name})): + (accepted.graph.destinations||[]).filter(x=>x.acceptsSend===true); + // A silent dark knob has no keyboard/pointer action, cannot invent a route. + if(!sends.length){ + const zero=h('div','arV6Send arV6SendEmpty'); + zero.append(h('span','arV6SendName','NO PATCHED WIRE'), + h('span','arV6WirePot is-idle')); + section.append(zero); + } + for(const send of sends){ + const line=h('div','arV6Send');line.dataset.sendId=clean(send.id); + line.append(h('span','arV6SendName',clean(send.name||send.targetId))); + const toggle=button(send.tap==='PRE'?'PRE':'POST',{'data-op':'SET_SEND_TAP', + 'data-id':ch.id,'data-send':clean(send.id)}); + toggle.dataset.wireNative=String(!!send.wireNative); + line.append(toggle); + const gain=h('label','arV6SendGain'); + const db=typeof send.levelDb==='number'?send.levelDb:NaN; + const verified=Number.isFinite(db); + const connected=acceptedNative&&accepted?.productionCallbackLive===true&& + !!byId.get(send.targetId)&&!!clean(send.id); + const knob=h('span','arV6WirePot '+(connected?'is-connected':'is-idle')); + knob.dataset.wireSourceId=ch.id;knob.dataset.sendId=clean(send.id); + // A missing native channel color stays neutral; never invent an identity. + knob.style.setProperty('--v6-wire-fill',connected?wirePotFill(send.targetId):'#4b535b'); + paintWirePot(knob,verified?db:0); + const slider=h('input','arV6SendLevel'); + slider.type='range';slider.min='-60';slider.max='12';slider.step='.1'; + slider.value=String(verified?clamp(db,-60,12):0); + slider.dataset.op='SET_SEND_LEVEL';slider.dataset.id=ch.id; + slider.dataset.send=clean(send.id); + slider.dataset.hasAcceptedLevel=String(verified); + slider.dataset.wireNative=String(!!send.wireNative); + slider.setAttribute('aria-label',(ch.name||ch.id)+' '+(send.name||send.targetId)+' native SEND gain dB'); + slider.disabled=!!send.wireNative||!can('SET_SEND_LEVEL',ch.id)||!verified; + knob.append(slider); + const out=h('output','arV6SendDb',verified?db.toFixed(1)+' dB':'—'); + gain.append(knob,out); + line.append(gain);section.append(line); + } + const select=selectField('+ TO','ADD_SEND',ch.id,targets,'','NO NATIVE SEND BUS'); + section.append(select);return section; + } + // Metadata comes ONLY from the native accepted ChannelId roster. An + // unpublished/malformed identity gets a neutral non-role color, never + // a browser-assigned palette position or synthetic state. + const nativeIdentity=ch=>{ + const published=typeof ch.color==='string'&&/^#[0-9a-fA-F]{6}$/.test(ch.color); + const icon=typeof ch.icon==='string'&&Array.from(ch.icon).length<=4&& + Array.from(ch.icon).every(c=>c.codePointAt(0)>=32&&c.codePointAt(0)!==127)?ch.icon:''; + return {color:published?ch.color:'#5f9ab1',icon,published}; + }; + const roleLabel=ch=>clean(ch.role).toUpperCase()+ + (typeof ch.linkGroupId==='string'&&ch.linkGroupId? + ' · LINK '+ch.linkGroupId.slice(0,6):''); + function strip(ch,pinned=false){ + const role=clean(ch.role).toUpperCase(); + const elStrip=h('article','arV6Strip'+(pinned?' arV6Master':'')); + elStrip.dataset.channelId=ch.id; + const identity=nativeIdentity(ch); + elStrip.style.setProperty('--ch',identity.color); + elStrip.style.setProperty('--v6-strip-color',identity.color); + elStrip.dataset.identityPublished=String(identity.published); + const head=h('div','arV6StripHead'); + const roleName=h('span','arV6Role',roleLabel(ch)); + const name=h('strong','arV6Name',ch.name||ch.id);name.title=ch.id; + if(identity.icon)head.append(h('span','arV6IdentityIcon',identity.icon)); + head.append(roleName,name);elStrip.append(head); + elStrip.setAttribute('aria-selected',String(selectedIds.has(ch.id))); + const sourceSection=h('div','arV6Upper'); + const routeSection=h('div','arV6Route'); + const sources=(accepted.device.inputEndpoints||[]).filter(p=>p.active===true && accepted.device.enabledInputs.includes(p.port)); + if(role==='INPUT')routeSection.append(selectField('IN','SET_SOURCE',ch.id,sources, + ch.source?.portId||ch.source?.id||'','NO VERIFIED INPUT')); + else routeSection.append(h('div','arV6Field arV6FixedField','IN · '+role)); + const outs=legalOutputs(ch); + routeSection.append(selectField('OUT','SET_PRIMARY_OUT',ch.id,outs, + nativeRouteSelection(ch),'NO VERIFIED OUT')); + const formats=['MONO','STEREO'].map(s=>({id:s,name:s})); + routeSection.append(selectField('M/ST','SET_PROCESSING_FORMAT',ch.id,formats, + ch.processingFormat||'','NATIVE FORMAT')); + sourceSection.append(routeSection,fxSection(ch),sendSection(ch)); + elStrip.append(sourceSection); + const controls=h('div','arV6Controls'); + const pan=h('label','arV6Pan');pan.append(h('span','','PAN')); + const panRange=h('input','arV6PanRange');panRange.type='range'; + panRange.min='-100';panRange.max='100';panRange.step='1'; + panRange.value=String(Number(ch.controls?.pan)||0); + paintPan(panRange,panRange.value); + panRange.dataset.op='SET_PAN';panRange.dataset.id=ch.id; + pan.append(panRange);controls.append(pan); + controls.append(button('M',{'data-op':'SET_MUTE','data-id':ch.id, + 'aria-pressed':String(!!ch.controls?.mute)})); + controls.append(button('S',{'data-op':'SET_SOLO','data-id':ch.id, + 'aria-pressed':String(!!ch.controls?.solo)})); + const cueKnown=typeof ch.controls?.cue==='boolean'&&role!=='MAIN'; + const cue=button('C',{'data-op':'SET_CUE','data-id':ch.id, + 'aria-pressed':String(ch.controls?.cue===true), + 'aria-label':(ch.name||ch.id)+' native monitor Cue/PFL'}); + cue.dataset.acceptedKnown=String(cueKnown);cue.disabled=!cueKnown||!can('SET_CUE',ch.id); + controls.append(cue); + const trimKnown=typeof ch.controls?.trimDb==='number'&&Number.isFinite(ch.controls.trimDb); + const trimRow=h('label','arV6Trim');trimRow.append(h('span','','TRIM')); + const trim=h('input','arV6TrimLevel');trim.type='range'; + trim.min='-24';trim.max='24';trim.step='.5'; + trim.value=String(trimKnown?clamp(ch.controls.trimDb,-24,24):0); + trim.dataset.op='SET_TRIM';trim.dataset.id=ch.id; + trim.dataset.acceptedKnown=String(trimKnown); + trim.setAttribute('aria-label',(ch.name||ch.id)+' digital input trim dB'); + trim.disabled=!trimKnown||!can('SET_TRIM',ch.id); + trimRow.append(trim,h('output','arV6TrimDb', + trimKnown?ch.controls.trimDb.toFixed(1):'—')); + controls.append(trimRow);elStrip.append(controls); + const lower=h('div','arV6Lower'); + const meter=h('div','arV6Meter');meter.dataset.meterId=ch.id; + meter.dataset.format=ch.processingFormat||'MONO'; + meter.setAttribute('aria-label','Native L/R PCM meter: '+(ch.name||ch.id)); + for(const side of ['L','R']){ + const lane=h('div','arV6MeterLane'); + lane.dataset.side=side; + for(let n=0;n<22;n++)lane.append(h('i','arV6Led')); + meter.append(lane); + } + const range=h('input','arV6Fader'); + range.type='range';range.min='-60';range.max='12';range.step='.1'; + const faderVal=Number(ch.controls?.faderDb); + range.value=String(Number.isFinite(faderVal)?clamp(faderVal,-60,12):0); + range.dataset.op='SET_FADER';range.dataset.id=ch.id; + range.setAttribute('aria-label',(ch.name||ch.id)+' fader dB'); + const lowerLabel=h('span','arV6Readout',(Number.isFinite(faderVal)?faderVal.toFixed(1):'—')+' dB'); + lower.append(meter,range,lowerLabel);elStrip.append(lower); + meterNodes.set(ch.id,{element:meter,lanes:[...meter.children]}); + const status=h('div','arV6StripStatus'); + status.dataset.statusId=ch.id; + const foot=h('div','arV6FootIdentity'); + if(identity.icon)foot.append(h('span','arV6FootIcon',identity.icon)); + foot.append(h('span','arV6FootName',ch.name||ch.id)); + const pcm=h('span','arV6PcmState',channelState(ch)); + status.append(foot,pcm); + statusNodes.set(ch.id,pcm);elStrip.append(status); + return elStrip; + } + function channelState(ch){ + if(!acceptedNative)return 'DEMO / NO AUDIO'; + if(accepted?.productionCallbackLive!==true)return 'NATIVE READBACK / NOT LIVE'; + if(ch.controls?.mute)return 'MUTED'; + const role=ch.role,t=accepted.telemetry||{}; + if(role==='INPUT'&&!ch.source)return 'SILENT / NO SOURCE'; + if(!accepted.device.outputArmed)return 'OUTPUT DISARMED'; + if(role==='MAIN')return t.mainPcmPresent===true? + 'MAIN PCM VERIFIED · ARMED':'MAIN PCM UNVERIFIED'; + if(role==='MONITOR')return t.monitorPcmPresent===true? + 'MONITOR PCM VERIFIED':'MONITOR PCM UNVERIFIED'; + if(role==='INPUT'&&t.rawCapturePresent!==true)return 'NO RAW CAPTURE PCM'; + const m=meterReadings.get(ch.id); + if(!m)return 'CHANNEL PCM UNVERIFIED'; + // An all-zero peak is silence/available measurement, not audible PCM. + const peaks=[m.peak,m.peakLeft,m.peakRight].filter(Number.isFinite); + const observed=peaks.some(p=>p>0); + if(!observed)return 'CHANNEL METER · SILENCE'; + return t.mainPcmPresent===true? + 'CHANNEL PCM MEASURED · MAIN OK':'CHANNEL PCM · MAIN UNVERIFIED'; + } + function updateHeader(){ + const d=accepted?.device||{},g=accepted?.graph||{}; + deviceText.textContent=(d.backend||'NO DEVICE')+' · '+ + (d.sampleRate?Math.round(d.sampleRate)+' Hz':'— Hz')+' / '+ + (d.bufferFrames||'—')+' frames · GRAPH '+(g.revision??'—'); + modeBadge.textContent=!acceptedNative?'DEMO · NOT CONNECTED': + accepted?.productionCallbackLive!==true?'NATIVE READBACK · NOT LIVE': + d.outputArmed?'NATIVE ACCEPTED · ARMED':'NATIVE ACCEPTED · OUTPUT DISARMED'; + root.dataset.demo=String(!acceptedNative); + root.dataset.armed=String(acceptedNative&&accepted?.productionCallbackLive===true&&!!d.outputArmed); + } + function updateSelection(){ + for(const strip of root.querySelectorAll('[data-channel-id]')){ + const selected=selectedIds.has(strip.dataset.channelId); + strip.classList.toggle('isSelected',selected); + strip.setAttribute('aria-selected',String(selected)); + } + refreshSelectionActions(); + refreshPluginCatalog(); + } + function selectChannel(id,event){ + const channel=byId.get(id); + if(!channel||channel.role==='MAIN')return; + const visible=[...lanes.querySelectorAll('.arV6Strip:not([hidden])')] + .map(strip=>strip.dataset.channelId); + if(!visible.includes(id))return; + if(event.shiftKey&&selectionAnchor&&visible.includes(selectionAnchor)){ + if(!event.ctrlKey&&!event.metaKey)selectedIds.clear(); + const a=visible.indexOf(selectionAnchor),b=visible.indexOf(id); + for(const x of visible.slice(Math.min(a,b),Math.max(a,b)+1))selectedIds.add(x); + }else if(event.ctrlKey||event.metaKey){ + if(selectedIds.has(id))selectedIds.delete(id);else selectedIds.add(id); + selectionAnchor=id; + }else{ + selectedIds.clear();selectedIds.add(id);selectionAnchor=id; + } + updateSelection(); // No DSP or ConsoleIntent involved. + } + function applyPresentation(){ + const value=roleFilter.value; + for(const strip of lanes.querySelectorAll('.arV6Strip')){ + const ch=byId.get(strip.dataset.channelId); + const match=ch&&(value==='ALL'||value==='SOLO'&&ch.controls?.solo===true|| + ch.role===value); + strip.hidden=!match; + } + // Presentational filters cannot alter native roster nor hide pinned MAIN. + if(lanes.querySelector('.arV6Strip:not([hidden])')===null)lanes.scrollLeft=0; + updateSelection();refreshBanks(); + } + function render(){ + if(!accepted)return; + uiStats.structureRenders++; + updateHeader(); + meterNodes.clear();statusNodes.clear();meterReadings.clear(); + lanes.replaceChildren();main.replaceChildren(); + const channels=accepted.graph.channels; + for(const id of selectedIds)if(!byId.has(id))selectedIds.delete(id); + if(selectionAnchor&&!byId.has(selectionAnchor))selectionAnchor=null; + for(const ch of channels){ + if(clean(ch.role).toUpperCase()==='MAIN')main.append(strip(ch,true)); + else lanes.append(strip(ch)); + } + if(!main.children.length){ + main.append(h('div','arV6NoMaster','MAIN NOT PUBLISHED BY NATIVE')); + } + const destinations=(accepted.graph.destinations||[]).filter(x=>x.acceptsSend===true); + options(sendMode,destinations,modeSend,'MAIN FADERS'); + const cap=accepted.graph.capabilities||{}; + sendMode.disabled=!acceptedNative||!cap.sendsOnFaders|| + supported('APPLY_WIRE_TRANSACTION'); + add.disabled=!can('CREATE_CHANNEL'); + refreshDisabled();syncFaderMode();refreshMeters();applyPresentation(); + } + function refreshDisabled(){ + if(!accepted)return; + for(const node of root.querySelectorAll('[data-op]')){ + const op=node.dataset.op,id=node.dataset.id||null; + node.disabled=!can(op,id)|| + (node.dataset.wireNative==='true')|| + (op==='SET_SEND_LEVEL'&&node.dataset.hasAcceptedLevel!=='true')|| + ((op==='SET_TRIM'||op==='SET_CUE')&&node.dataset.acceptedKnown!=='true'); + } + add.disabled=!can('CREATE_CHANNEL'); + refreshSelectionActions(); + const caps=accepted.graph.capabilities||{}; + roleSelect.disabled=!can('CREATE_CHANNEL'); + for(const option of roleSelect.options){ + option.disabled=(option.value==='GROUP'&&!caps.groups)|| + (option.value==='FX_RETURN'&&!caps.fxReturns)|| + (option.value==='MONITOR'&&!caps.monitor); + } + sendMode.disabled=!acceptedNative||!caps.sendsOnFaders|| + supported('APPLY_WIRE_TRANSACTION'); + for(const n of root.querySelectorAll('.arV6Fader')){ + if(modeSend){ + const ch=byId.get(n.dataset.id); + const hasSend=ch&&projectedChannelSends(ch).some(s=>s.targetId===modeSend); + n.disabled=!hasSend||!can('SET_SEND_LEVEL',n.dataset.id); + } + } + } + function refreshAcceptedControls(){ + uiStats.controlRefreshes++; + for(const strip of root.querySelectorAll('[data-channel-id]')){ + const ch=byId.get(strip.dataset.channelId); + if(!ch)continue; + const identity=nativeIdentity(ch); + if(strip.style.getPropertyValue('--ch')!==identity.color){ + strip.style.setProperty('--ch',identity.color); + strip.style.setProperty('--v6-strip-color',identity.color); + } + strip.dataset.identityPublished=String(identity.published); + const nameNode=strip.querySelector('.arV6Name'); + if(nameNode&&nameNode.textContent!==ch.name)nameNode.textContent=ch.name; + const footName=strip.querySelector('.arV6FootName'); + if(footName&&footName.textContent!==ch.name)footName.textContent=ch.name; + for(const [container,selector] of [ + [strip.querySelector('.arV6StripHead'),'.arV6IdentityIcon'], + [strip.querySelector('.arV6FootIdentity'),'.arV6FootIcon']]){ + if(!container)continue; + let icon=container.querySelector(selector); + if(identity.icon){ + if(!icon){icon=h('span',selector.slice(1));container.prepend(icon);} + if(icon.textContent!==identity.icon)icon.textContent=identity.icon; + }else icon?.remove(); + } + const roleNode=strip.querySelector('.arV6Role'); + if(roleNode&&roleNode.textContent!==roleLabel(ch)) + roleNode.textContent=roleLabel(ch); + const choose=(op,value)=>{ + const field=strip.querySelector('select[data-op="'+op+'"]'); + if(!field)return; + const actual=typeof value==='string'?value:''; + if([...field.options].some(o=>o.value===actual))field.value=actual; + }; + choose('SET_SOURCE',ch.source?.portId||ch.source?.id||''); + choose('SET_PROCESSING_FORMAT',ch.processingFormat||''); + choose('SET_PRIMARY_OUT',nativeRouteSelection(ch)); + choose('ADD_SEND',''); + const pan=strip.querySelector('[data-op="SET_PAN"]'); + if(pan){ + pan.value=String(Number(ch.controls?.pan)||0); + paintPan(pan,pan.value); + } + const meter=strip.querySelector('[data-meter-id]'); + if(meter)meter.dataset.format=ch.processingFormat||'MONO'; + for(const op of ['SET_MUTE','SET_SOLO','SET_CUE']){ + const n=strip.querySelector('button[data-op="'+op+'"]'); + if(n)n.setAttribute('aria-pressed',String(!!ch.controls?.[ + op==='SET_MUTE'?'mute':op==='SET_SOLO'?'solo':'cue'])); + if(n&&op==='SET_CUE')n.dataset.acceptedKnown=String( + typeof ch.controls?.cue==='boolean'&&ch.role!=='MAIN'); + } + const trim=strip.querySelector('[data-op="SET_TRIM"]'); + if(trim){ + const known=typeof ch.controls?.trimDb==='number'&&Number.isFinite(ch.controls.trimDb); + trim.dataset.acceptedKnown=String(known); + trim.value=String(known?clamp(ch.controls.trimDb,-24,24):0); + const readout=strip.querySelector('.arV6TrimDb'); + if(readout)readout.textContent=known?ch.controls.trimDb.toFixed(1):'—'; + } + for(const node of strip.querySelectorAll('.arV6FxSlot')){ + const fx=(ch.inserts||[]).find(x=>String(x.id)===node.dataset.fxId); + const power=node.querySelector('[data-op="SET_INSERT_BYPASS"]'); + if(fx&&power){ + power.textContent=fx.bypassed?'OFF':'ON'; + power.classList.toggle('isOff',!!fx.bypassed); + power.setAttribute('aria-pressed',String(!fx.bypassed)); + } + } + for(const node of strip.querySelectorAll('.arV6Send')){ + const send=projectedChannelSends(ch).find(x=>String(x.id)===node.dataset.sendId); + const tap=node.querySelector('[data-op="SET_SEND_TAP"]'); + if(send&&tap)tap.textContent=send.tap==='PRE'?'PRE':'POST'; + const gain=node.querySelector('.arV6SendLevel'); + if(gain){ + const db=Number(send?.levelDb),verified=!!send&&Number.isFinite(db); + gain.dataset.hasAcceptedLevel=String(verified); + gain.value=String(verified?clamp(db,-60,12):0); + const out=node.querySelector('.arV6SendDb'); + if(out)out.textContent=verified?db.toFixed(1)+' dB':'—'; + const knob=node.querySelector('.arV6WirePot'); + if(knob){ + const connected=acceptedNative&&accepted?.productionCallbackLive===true&& + !!byId.get(send?.targetId)&&!!clean(send?.id); + knob.classList.toggle('is-connected',connected); + knob.classList.toggle('is-idle',!connected); + knob.style.setProperty('--v6-wire-fill',connected?wirePotFill(send.targetId):'#4b535b'); + paintWirePot(knob,verified?db:0); + } + } + } + } + syncFaderMode();refreshMeters();applyPresentation(); + } + function syncFaderMode(){ + for(const range of root.querySelectorAll('.arV6Fader')){ + const ch=byId.get(range.dataset.id); + const send=modeSend&&ch?projectedChannelSends(ch) + .find(s=>s.targetId===modeSend):null; + const db=Number(modeSend?send?.levelDb:ch?.controls?.faderDb); + range.value=String(Number.isFinite(db)?clamp(db,-60,12):0); + const text=range.parentElement?.querySelector('.arV6Readout'); + if(text)text.textContent=(Number.isFinite(db)?db.toFixed(1):'—')+' dB'; + } + } + function refreshMeters(){ + if(!accepted)return; + const incoming=acceptedNative?accepted.telemetry?.channelMeterRmsPeak:null; + meterReadings=Array.isArray(incoming)? + new Map(incoming.map(m=>[m.channelId,m])): + incoming&&typeof incoming==='object'?new Map(Object.entries(incoming)):new Map(); + const ledsForPeak=peak=>{ + if(typeof peak!=='number'||!Number.isFinite(peak)||peak<=0)return 0; + // Native linear PCM peak: fixed -60..0 dBFS 22-LED ladder; values >1 + // saturate red, never change the green/yellow/red reference positions. + return clamp(Math.ceil(22*(60+Math.max(-60,20*Math.log10(peak)))/60),0,22); + }; + for(const [id,view] of meterNodes){ + const ch=byId.get(id),m=meterReadings.get(id); + if(!ch)continue; + const mono=ch.processingFormat==='MONO'; + const expected=mono?'MONO':'STEREO'; + if(view.element.dataset.format!==expected)view.element.dataset.format=expected; + for(const lane of view.lanes){ + const side=lane.dataset.side; + // No invented stereo copy: an absent right peak stays dark. + const value=m?(side==='L'?(m.peakLeft??(mono?m.peak:0)):m.peakRight):0; + const lit=mono&&side==='R'?0:ledsForPeak(value); + if(lane.dataset.lit===String(lit))continue; + lane.dataset.lit=String(lit); + for(let i=0;i=total; + } + function jump(dir){ + const first=lanes.querySelector('.arV6Strip:not([hidden])'); + if(!first)return; + const perPage=Math.max(1,Math.floor(lanes.clientWidth/first.getBoundingClientRect().width)); + lanes.scrollBy({left:dir*perPage*first.getBoundingClientRect().width,behavior:'auto'}); + refreshBanks(); + } + bankPrev.addEventListener('click',()=>jump(-1)); + bankNext.addEventListener('click',()=>jump(1)); + lanes.addEventListener('scroll',refreshBanks,{passive:true}); + if(typeof ResizeObserver==='function')new ResizeObserver(refreshBanks).observe(lanes); + sendMode.addEventListener('change',()=>{modeSend=sendMode.value; + syncFaderMode();refreshDisabled(); + showFeedback(modeSend? + 'SENDS ON FADERS · native sends only · select MAIN FADERS to return':'MAIN FADERS · source gains unchanged'); + }); + // Reorder is one native structural intent; DOM/PCM order never changes on drop. + root.addEventListener('dragstart',event=>{ + const node=event.target.closest?.('.arV6FxSlot'); + if(!node||!node.draggable||!can('MOVE_INSERT',node.dataset.id)){ + event.preventDefault();return; + } + draggingFx={id:node.dataset.id,insertId:node.dataset.fxId}; + event.dataTransfer?.setData('text/plain',draggingFx.insertId); + if(event.dataTransfer)event.dataTransfer.effectAllowed='move'; + }); + root.addEventListener('dragover',event=>{ + const node=event.target.closest?.('.arV6FxSlot'); + if(draggingFx&&node&&draggingFx.id===node.dataset.id&& + draggingFx.insertId!==node.dataset.fxId)event.preventDefault(); + }); + root.addEventListener('drop',event=>{ + const node=event.target.closest?.('.arV6FxSlot'),source=draggingFx; + draggingFx=null; + if(!source||!node||source.id!==node.dataset.id|| + source.insertId===node.dataset.fxId)return; + event.preventDefault(); + sendIntent('MOVE_INSERT',source.id, + {insertId:source.insertId,beforeInsertId:node.dataset.fxId}); + }); + root.addEventListener('dragend',()=>{draggingFx=null}); + root.addEventListener('click',event=>{ + const n=event.target.closest('button[data-op]'); + if(!n||n.disabled)return; + const op=n.dataset.op,id=n.dataset.id||null,ch=byId.get(id); + if(op==='CREATE_CHANNEL'){ + // Native must allocate ChannelId; never append a fake strip on ACK. + const role=roleSelect.value; + const caps=accepted.graph.capabilities||{}; + if(!['MONO','STEREO','GROUP','FX_RETURN','MONITOR'].includes(role))return; + if(role==='GROUP'&&!caps.groups||role==='FX_RETURN'&&!caps.fxReturns|| + role==='MONITOR'&&!caps.monitor){showFeedback('UNAVAILABLE · Native role not accepted');return} + sendIntent(op,null,{role});return; + } + if(!ch)return; + if(op==='SET_MUTE')sendIntent(op,id,{value:!ch.controls?.mute}); + else if(op==='SET_SOLO')sendIntent(op,id,{value:!ch.controls?.solo}); + else if(op==='SET_CUE'&&typeof ch.controls?.cue==='boolean') + sendIntent(op,id,{value:!ch.controls.cue}); + else if(op==='SET_INSERT_BYPASS'){ + const fx=(ch.inserts||[]).find(x=>String(x.id)===n.dataset.nativeInsertId); + if(fx)sendIntent(op,id,{insertId:fx.id,bypassed:!fx.bypassed}); + } + else if(op==='OPEN_INSERT_EDITOR')sendIntent(op,id,{insertId:n.dataset.nativeInsertId}); + else if(op==='SET_SEND_TAP'){ + const send=(ch.sends||[]).find(x=>String(x.id)===n.dataset.send); + if(send)sendIntent(op,id,{sendId:send.id,tap:send.tap==='PRE'?'POST':'PRE'}); + } + else if(op==='PICK_INSERT_FILE')sendIntent(op,id,{}); + else if(op==='ADD_INSERT') + showFeedback('Native plugin selection requires the verified Plugin Manager'); + }); + root.addEventListener('click',event=>{ + const launcher=event.target.closest('button[data-ui="OPEN_PLUGIN_MANAGER"]'); + if(launcher){openPluginManager(launcher.dataset.id);return;} + const fast=event.target.closest('button[data-ui="OPEN_FX_QUICK"]'); + if(fast){openQuickFx(fast.dataset.id,fast);return;} + const strip=event.target.closest('.arV6Strip'); + if(!strip||event.target.closest('button,input,select,[draggable]'))return; + selectChannel(strip.dataset.channelId,event); + }); + // Inline rename never mutates accepted name. Only native ACK + matching + // snapshot changes the channel header; Escape/blur only cancels local input. + function beginRename(nameNode){ + const strip=nameNode?.closest('.arV6Strip'),id=strip?.dataset.channelId; + const ch=byId.get(id); + if(!ch||!can('RENAME_CHANNEL',id)){ + showFeedback('RENAME UNAVAILABLE · native RENAME_CHANNEL not installed');return; + } + if(strip.querySelector('.arV6Rename'))return; + const input=h('input','arV6Rename'); + input.type='text';input.maxLength=40;input.value=ch.name; + input.setAttribute('aria-label','Rename '+ch.name+' using native ChannelId'); + let finished=false; + const finish=commit=>{ + if(finished)return; + finished=true; // DOM replacement emits blur synchronously in WebView. + const newName=input.value.trim(); + const valid=commit&&newName&&newName.length<=40&&newName!==ch.name&& + !Array.from(newName).some(c=>c.charCodeAt(0)<32||c.charCodeAt(0)===127); + // Dispatch once while the editor is stable. Only native accepted + // snapshot may change the actual channel name. + if(valid)sendIntent('RENAME_CHANNEL',id,{name:newName}); + input.replaceWith(nameNode); + }; + input.addEventListener('keydown',event=>{ + if(event.key==='Enter'){event.preventDefault();finish(true)} + if(event.key==='Escape'){event.preventDefault();finish(false)} + }); + input.addEventListener('blur',()=>finish(false),{once:true}); + nameNode.replaceWith(input);input.focus();input.select(); + } + root.addEventListener('dblclick',event=>{ + const pot=event.target.closest('.arV6WirePot.is-connected'); + if(pot){ + const slider=pot.querySelector('.arV6SendLevel'); + if(slider&&!slider.disabled){ + const id=slider.dataset.id,sendId=slider.dataset.send; + const current=acceptedWireLevel(id,sendId); + if(current!==null&¤t!==0) + sendIntent('SET_SEND_LEVEL',id,{sendId,levelDb:0}); + refreshAcceptedControls();refreshDisabled(); + } + event.preventDefault();return; + } + const n=event.target.closest('.arV6PanRange'); + if(n&&!n.disabled){sendIntent('SET_PAN',n.dataset.id,{value:0});return;} + const name=event.target.closest('.arV6Name'); + if(name)beginRename(name); + }); + // Wire-pot is a compact SVG silhouette with full mouse-relative travel. + // During a drag only its local readout changes; exactly ONE native intent + // is submitted on pointerup. ACK + matching snapshot remain authoritative. + root.addEventListener('pointerdown',event=>{ + if(event.button!==0||wirePotGesture)return; + const knob=event.target.closest?.('.arV6WirePot.is-connected'); + const input=knob?.querySelector('.arV6SendLevel'); + if(!knob||!input||input.disabled||!can('SET_SEND_LEVEL',input.dataset.id))return; + const original=acceptedWireLevel(input.dataset.id,input.dataset.send); + if(original===null)return; + wirePotGesture={pointerId:event.pointerId,knob,input,original, + id:input.dataset.id,sendId:input.dataset.send, + x:event.clientX,y:event.clientY,preview:original}; + // Capture on the actual input: remains focused and keyboard accessible. + input.setPointerCapture?.(event.pointerId); + // ZERO idle pointermove listeners. Install a capture-local handler + // exclusively for the duration of this one edit. + input.onpointermove=moveWirePot; + event.preventDefault(); + }); + function moveWirePot(event){ + const g=wirePotGesture; + if(!g||event.pointerId!==g.pointerId)return; + const displacement=(event.clientX-g.x)-(event.clientY-g.y); + const db=Math.round(clamp(g.original+displacement/(event.shiftKey?14:3),-60,12)*10)/10; + if(db!==g.preview){ + g.preview=db;g.input.value=String(db); + paintWirePot(g.knob,db); + const label=g.knob.parentElement?.querySelector('.arV6SendDb'); + if(label)label.textContent=db.toFixed(1)+' dB'; + } + event.preventDefault(); + } + function finishWirePot(event,cancelled=false){ + const g=wirePotGesture; + if(!g||event.pointerId!==g.pointerId)return; + wirePotGesture=null; + g.input.onpointermove=null; + g.input.releasePointerCapture?.(event.pointerId); + const delta=g.preview!==g.original; + // Do not stage an edit when pointercancel/blur/Escape rejects the gesture. + if(!cancelled&&delta){ + sendIntent('SET_SEND_LEVEL',g.id,{sendId:g.sendId,levelDb:g.preview}); + } + if(cancelled)showFeedback('SEND CANCELLED · native accepted gain unchanged'); + refreshAcceptedControls();refreshDisabled(); + event.preventDefault(); + } + root.addEventListener('pointerup',event=>finishWirePot(event)); + root.addEventListener('pointercancel',event=>finishWirePot(event,true)); + root.addEventListener('keydown',event=>{ + if(event.key==='Escape'&&wirePotGesture){ + finishWirePot({pointerId:wirePotGesture.pointerId, + preventDefault:()=>{}},true); + event.preventDefault(); + } + }); + root.addEventListener('change',event=>{ + const n=event.target.closest('[data-op]'); + if(!n||n.disabled)return; + const id=n.dataset.id,op=n.dataset.op,ch=byId.get(id); + if(!ch)return; + if(op==='SET_SOURCE'&&n.value){ + const endpoint=(accepted.device.inputEndpoints||[]).find(e=>e.id===n.value&&e.available!==false&&e.active!==false); + if(endpoint)sendIntent(op,id,{portId:endpoint.id}); + }else if(op==='SET_PRIMARY_OUT'&&n.value){ + if(legalOutputs(ch).some(p=>p.id===n.value)){ + if(nativeGraphMode(id))routeOnlyNative(id,n.value); + else sendIntent(op,id,{destinationId:n.value}); + } + } + else if(op==='SET_PROCESSING_FORMAT')sendIntent(op,id,{format:n.value}); + else if(op==='ADD_SEND'&&n.value){ + if(nativeGraphMode(id)){ + const graph=acceptedWireGraph(); + if(!graph.edges.some(e=>e.enabled&&e.from===id&&e.to===n.value)) + applyNativeWireTransaction(id,'CONNECT',[{op:'CONNECT',from:id,to:n.value, + tap:'POST_FADER',gainLinear:1}]); + }else sendIntent(op,id,{targetId:n.value,tap:'POST',levelDb:0}); + } + else if(op==='SET_PAN'){ + const value=Number(n.value),snapped=Math.abs(value)<=4?0:value; + sendIntent(op,id,{value:snapped}); // ACK/snapshot, no optimistic PAN. + } + else if(op==='SET_TRIM'){ + const db=Number(n.value); + if(typeof ch.controls?.trimDb==='number'&&Number.isFinite(db)) + sendIntent(op,id,{valueDb:clamp(db,-24,24)}); + } + else if(op==='SET_SEND_LEVEL'){ + const send=(ch.sends||[]).find(s=>String(s.id)===n.dataset.send); + const value=Number(n.value); + if(send&&typeof send.levelDb==='number'&&Number.isFinite(send.levelDb)&&Number.isFinite(value)) + sendIntent('SET_SEND_LEVEL',id,{sendId:send.id, + levelDb:Math.round(clamp(value,-60,12)*10)/10}); + } + else if(op==='SET_FADER'){ + if(modeSend){ + const send=(ch.sends||[]).find(s=>s.targetId===modeSend); + if(send)sendIntent('SET_SEND_LEVEL',id,{sendId:send.id,levelDb:Number(n.value)}); + else showFeedback('UNAVAILABLE · No native send on this channel'); + }else sendIntent(op,id,{valueDb:Number(n.value)}); + } + // Restore only accepted controls without remounting meters or fader nodes. + if(accepted){refreshAcceptedControls();refreshDisabled();} + }); + if(native){ + backend.addEventListener('arMixConsoleSnapshot',s=>receiveSnapshot(s,true)); + backend.addEventListener('arMixConsoleAck',receiveAck); + requestSnapshot(); + }else if(new URLSearchParams(location.search).get('console')==='v6'){ + // The opt-in browser preview is visibly DEMO with every mutation disabled. + // Existing baseline preview without ?console=v6 remains backward compatible. + receiveSnapshot(makeDemo(),false); + showFeedback('BROWSER DEMO · UI layout only · no PCM, hardware, installed VST3 or LIVE routes'); + } + // Host/browser acceptance harness: dispatch a native envelope explicitly; + // no public function may forge a native acceptance in a real JUCE session. + if(!native){ + window.addEventListener('arMixV6Fixture',e=>receiveSnapshot(e.detail?.snapshot||e.detail,false)); + } + // GUI #271 physical plugs/Matrix use this capability-gated native + // adapter; it has no independent graph, timer, audio route or mock PCM. + window.__arMixNativeWire=Object.freeze({ + readAccepted:acceptedWireGraph, + focusedMainEdge:physicalMainEdge, + unplugFocusedMain:unplugNativeMain, + replugFocusedMain:replugNativeMain, + routeOnly:routeOnlyNative, + applyTransaction:applyNativeWireTransaction + }); + window.__arMixV6ReadOnly=()=>({ + nativePublisher:acceptedNative,revision:accepted?.graph?.revision??null, + epoch:accepted?.device?.epoch??null,visibleChannelIds:[...byId.keys()], + pendingCount:pending.size,selectedChannelIds:[...selectedIds],feedback, + uiStats:{...uiStats} + }); +})(); diff --git a/web/styles-src/20-button-180.css b/web/styles-src/20-button-180.css index c217cfe70..a82dd60a3 100644 --- a/web/styles-src/20-button-180.css +++ b/web/styles-src/20-button-180.css @@ -3,7 +3,7 @@ Semantic colors alone define the latched state; only the transient :active pointer press moves the cap inward by 1px without changing its layout slot. */ :root{ - --b180-off:#cbd1d1;--b180-edge:#747f7f;--b180-off-ink:#172229; + --b180-off:#E7EFF0;--b180-edge:#747f7f;--b180-off-ink:#172229; --b180-color:var(--b180-off);--b180-border:var(--b180-edge); --b180-ink:var(--b180-off-ink); --b180-on-cyan:#94e8ed;--b180-on-green:#91edac; diff --git a/web/styles-src/43-hardware-backlit.css b/web/styles-src/43-hardware-backlit.css new file mode 100644 index 000000000..72d741113 --- /dev/null +++ b/web/styles-src/43-hardware-backlit.css @@ -0,0 +1,157 @@ +/* Owner-approved V5 graphite hardware keys, production native/legacy console. + ONE SVG cutout legend, ONE white edge shine, asymmetric occluded leakage. + No hover repaint, SVG filters, blur, infinite animation, or fake audio state. + This module is LAST in the deterministic CSS build, replacing BTN-180 only + on opt-in tactile mixer buttons. Navigation, routing pins, meters, faders, + editor launchers, dropdowns and ordinary dialog actions are NOT backlit. */ +#app button.mx-hw-key { + --mx-hw-led:210,225,234; + position:relative!important; + display:inline-block!important; + box-sizing:border-box!important; + min-width:0!important; + padding:2px!important; + overflow:hidden!important; + isolation:isolate!important; + border:1px solid #0c151b!important; + border-radius:5px!important; + background:linear-gradient(180deg,#0b141b,#25343d)!important; + box-shadow:inset 0 2px 4px #03080db5!important; + color:transparent!important; + text-shadow:none!important; + letter-spacing:0!important; + line-height:normal!important; + filter:none!important; + backdrop-filter:none!important; + -webkit-backdrop-filter:none!important; + transform:none!important; + transition:none!important; + text-align:center!important; + cursor:pointer; + touch-action:manipulation; +} +#app button.mx-hw-key.mx-hw-mute {--mx-hw-led:255,64,85} +#app button.mx-hw-key.mx-hw-solo {--mx-hw-led:255,208,44} +#app button.mx-hw-key.mx-hw-cue {--mx-hw-led:90,200,231} +#app button.mx-hw-key.mx-hw-processing {--mx-hw-led:87,211,189} +#app button.mx-hw-key.mx-hw-phase {--mx-hw-led:243,164,81} +#app button.mx-hw-key.mx-hw-link {--mx-hw-led:163,141,235} +#app button.mx-hw-key.mx-hw-neutral {--mx-hw-led:210,225,234} +/* V5 leakage strategy: four tiny STATIC gradients only in the closest + 1–2px gap, unequal sides, lower-center stronger; top almost occluded. */ +#app button.mx-hw-key::before { + content:""!important; + display:block!important; + position:absolute!important; + inset:1px!important; + border:0!important; + border-radius:4px!important; + width:auto!important;height:auto!important; + transform:none!important; + pointer-events:none!important; + z-index:2!important; + opacity:0!important; + box-shadow:none!important; + background: + linear-gradient(90deg,transparent 0%,rgba(var(--mx-hw-led),.035) 18%, + rgba(var(--mx-hw-led),.16) 33%,rgba(var(--mx-hw-led),.46) 49%, + rgba(var(--mx-hw-led),.27) 63%,rgba(var(--mx-hw-led),.07) 80%,transparent 100%) + center bottom / calc(100% - 12px) 2px no-repeat, + linear-gradient(180deg,transparent 0%,transparent 30%, + rgba(var(--mx-hw-led),.045) 50%,rgba(var(--mx-hw-led),.21) 75%, + rgba(var(--mx-hw-led),.1) 88%,transparent 100%) + left bottom / 2px 100% no-repeat, + linear-gradient(180deg,transparent 0%,transparent 44%, + rgba(var(--mx-hw-led),.075) 65%,rgba(var(--mx-hw-led),.17) 85%, + transparent 100%) + right bottom / 2px 100% no-repeat, + linear-gradient(90deg,transparent 0%,transparent 34%, + rgba(var(--mx-hw-led),.055) 50%,transparent 67%,transparent 100%) + center top / calc(100% - 18px) 1px no-repeat!important; +} +#app button.mx-hw-key::after{content:none!important;display:none!important} +#app button.mx-hw-key[aria-pressed="true"]::before, +#app button.mx-hw-key.active::before, +#app button.mx-hw-key.selected::before, +#app button.mx-hw-key.power-on::before, +#app button.mx-hw-key[data-mx-hw-on="true"]::before {opacity:1!important} +#app button.mx-hw-key > svg.mx-hw-face { + position:absolute!important; + z-index:1!important; + top:2px!important;right:2px!important;bottom:2px!important;left:2px!important; + width:calc(100% - 4px)!important; + height:calc(100% - 4px)!important; + display:block!important; + min-height:0!important; + overflow:hidden!important; + pointer-events:none!important; + transform:translateY(0)!important; + transition:none!important; + filter:none!important; +} +#app button.mx-hw-key svg .mx-hw-lamp {opacity:0!important} +#app button.mx-hw-key[aria-pressed="true"] svg .mx-hw-lamp, +#app button.mx-hw-key.active svg .mx-hw-lamp, +#app button.mx-hw-key.selected svg .mx-hw-lamp, +#app button.mx-hw-key.power-on svg .mx-hw-lamp, +#app button.mx-hw-key[data-mx-hw-on="true"] svg .mx-hw-lamp {opacity:1!important} +#app button.mx-hw-key[aria-pressed="true"] > svg.mx-hw-face, +#app button.mx-hw-key.active > svg.mx-hw-face, +#app button.mx-hw-key[data-mx-hw-on="true"] > svg.mx-hw-face { + transform:translateY(1px)!important; +} +#app button.mx-hw-key > .mx-hw-screen-reader{ + position:absolute!important; + width:1px!important;height:1px!important; + margin:-1px!important;padding:0!important; + border:0!important;overflow:hidden!important; + clip-path:inset(50%)!important; + white-space:nowrap!important; +} +#app button.mx-hw-key:hover:not(:disabled){ + filter:none!important; + background:linear-gradient(180deg,#0b141b,#25343d)!important; + box-shadow:inset 0 2px 4px #03080db5!important; +} +#app button.mx-hw-key:active:not(:disabled){ + transform:none!important; + background:linear-gradient(180deg,#0b141b,#25343d)!important; + box-shadow:inset 0 2px 4px #03080db5!important; +} +#app button.mx-hw-key:active:not(:disabled) > svg.mx-hw-face{ + transform:translateY(1px)!important; +} +#app button.mx-hw-key:focus-visible{ + outline:2px solid #9bbecd!important; + outline-offset:2px!important; +} +#app button.mx-hw-key:disabled { + cursor:not-allowed!important; + opacity:.47!important; + filter:none!important; +} +#app button.mx-hw-key:disabled::before{opacity:0!important} +#app button.mx-hw-key:disabled svg .mx-hw-lamp{opacity:0!important} +/* Keep target strip geometry intact, bypassing the legacy BTN-180 face. */ +#app #mixer .channel-actions button.mx-hw-key, +#app #mixer .utility-row button.mx-hw-key { + flex:1 1 0; +} +/* The legacy MASTER MUTE was sized only by .candy. Own its 29px geometry + explicitly after replacing that obsolete class, matching every strip. */ +#app #masterLeft .master-actions button.mx-hw-key, +#app #masterMute.mx-hw-key{ + height:29px!important; + min-height:29px!important; + max-height:29px!important; + align-self:center!important; +} +#app #mixer [data-channel-format-toggle].mx-hw-key{ + min-width:20px!important; +} +#app .arV6Controls button.mx-hw-key{width:28px!important;height:28px!important;padding:2px!important} +#app .arV6FxSlot button.mx-hw-key{min-width:27px!important;min-height:22px!important;padding:2px!important} +#app .arV6Send button.mx-hw-key{min-width:34px!important;min-height:20px!important;padding:2px!important} +@media(prefers-reduced-motion:reduce){ + #app button.mx-hw-key,#app button.mx-hw-key > svg.mx-hw-face{transition:none!important} +} diff --git a/web/styles.css b/web/styles.css index 74a63fe13..eb5955b00 100644 --- a/web/styles.css +++ b/web/styles.css @@ -611,7 +611,7 @@ html[data-mixperf="baseline"] .toolbar .spec-device:hover{border-color:#3586a2} Semantic colors alone define the latched state; only the transient :active pointer press moves the cap inward by 1px without changing its layout slot. */ :root{ - --b180-off:#cbd1d1;--b180-edge:#747f7f;--b180-off-ink:#172229; + --b180-off:#E7EFF0;--b180-edge:#747f7f;--b180-off-ink:#172229; --b180-color:var(--b180-off);--b180-border:var(--b180-edge); --b180-ink:var(--b180-off-ink); --b180-on-cyan:#94e8ed;--b180-on-green:#91edac; @@ -1447,3 +1447,160 @@ html:not([data-mixperf="baseline"]):not([data-mixperf="layers-off"]):not([data-m background-clip:content-box;border:0;box-shadow:none; } #app #mixer .meter .clip-led.latched{box-shadow:none!important} +/* Owner-approved V5 graphite hardware keys, production native/legacy console. + ONE SVG cutout legend, ONE white edge shine, asymmetric occluded leakage. + No hover repaint, SVG filters, blur, infinite animation, or fake audio state. + This module is LAST in the deterministic CSS build, replacing BTN-180 only + on opt-in tactile mixer buttons. Navigation, routing pins, meters, faders, + editor launchers, dropdowns and ordinary dialog actions are NOT backlit. */ +#app button.mx-hw-key { + --mx-hw-led:210,225,234; + position:relative!important; + display:inline-block!important; + box-sizing:border-box!important; + min-width:0!important; + padding:2px!important; + overflow:hidden!important; + isolation:isolate!important; + border:1px solid #0c151b!important; + border-radius:5px!important; + background:linear-gradient(180deg,#0b141b,#25343d)!important; + box-shadow:inset 0 2px 4px #03080db5!important; + color:transparent!important; + text-shadow:none!important; + letter-spacing:0!important; + line-height:normal!important; + filter:none!important; + backdrop-filter:none!important; + -webkit-backdrop-filter:none!important; + transform:none!important; + transition:none!important; + text-align:center!important; + cursor:pointer; + touch-action:manipulation; +} +#app button.mx-hw-key.mx-hw-mute {--mx-hw-led:255,64,85} +#app button.mx-hw-key.mx-hw-solo {--mx-hw-led:255,208,44} +#app button.mx-hw-key.mx-hw-cue {--mx-hw-led:90,200,231} +#app button.mx-hw-key.mx-hw-processing {--mx-hw-led:87,211,189} +#app button.mx-hw-key.mx-hw-phase {--mx-hw-led:243,164,81} +#app button.mx-hw-key.mx-hw-link {--mx-hw-led:163,141,235} +#app button.mx-hw-key.mx-hw-neutral {--mx-hw-led:210,225,234} +/* V5 leakage strategy: four tiny STATIC gradients only in the closest + 1–2px gap, unequal sides, lower-center stronger; top almost occluded. */ +#app button.mx-hw-key::before { + content:""!important; + display:block!important; + position:absolute!important; + inset:1px!important; + border:0!important; + border-radius:4px!important; + width:auto!important;height:auto!important; + transform:none!important; + pointer-events:none!important; + z-index:2!important; + opacity:0!important; + box-shadow:none!important; + background: + linear-gradient(90deg,transparent 0%,rgba(var(--mx-hw-led),.035) 18%, + rgba(var(--mx-hw-led),.16) 33%,rgba(var(--mx-hw-led),.46) 49%, + rgba(var(--mx-hw-led),.27) 63%,rgba(var(--mx-hw-led),.07) 80%,transparent 100%) + center bottom / calc(100% - 12px) 2px no-repeat, + linear-gradient(180deg,transparent 0%,transparent 30%, + rgba(var(--mx-hw-led),.045) 50%,rgba(var(--mx-hw-led),.21) 75%, + rgba(var(--mx-hw-led),.1) 88%,transparent 100%) + left bottom / 2px 100% no-repeat, + linear-gradient(180deg,transparent 0%,transparent 44%, + rgba(var(--mx-hw-led),.075) 65%,rgba(var(--mx-hw-led),.17) 85%, + transparent 100%) + right bottom / 2px 100% no-repeat, + linear-gradient(90deg,transparent 0%,transparent 34%, + rgba(var(--mx-hw-led),.055) 50%,transparent 67%,transparent 100%) + center top / calc(100% - 18px) 1px no-repeat!important; +} +#app button.mx-hw-key::after{content:none!important;display:none!important} +#app button.mx-hw-key[aria-pressed="true"]::before, +#app button.mx-hw-key.active::before, +#app button.mx-hw-key.selected::before, +#app button.mx-hw-key.power-on::before, +#app button.mx-hw-key[data-mx-hw-on="true"]::before {opacity:1!important} +#app button.mx-hw-key > svg.mx-hw-face { + position:absolute!important; + z-index:1!important; + top:2px!important;right:2px!important;bottom:2px!important;left:2px!important; + width:calc(100% - 4px)!important; + height:calc(100% - 4px)!important; + display:block!important; + min-height:0!important; + overflow:hidden!important; + pointer-events:none!important; + transform:translateY(0)!important; + transition:none!important; + filter:none!important; +} +#app button.mx-hw-key svg .mx-hw-lamp {opacity:0!important} +#app button.mx-hw-key[aria-pressed="true"] svg .mx-hw-lamp, +#app button.mx-hw-key.active svg .mx-hw-lamp, +#app button.mx-hw-key.selected svg .mx-hw-lamp, +#app button.mx-hw-key.power-on svg .mx-hw-lamp, +#app button.mx-hw-key[data-mx-hw-on="true"] svg .mx-hw-lamp {opacity:1!important} +#app button.mx-hw-key[aria-pressed="true"] > svg.mx-hw-face, +#app button.mx-hw-key.active > svg.mx-hw-face, +#app button.mx-hw-key[data-mx-hw-on="true"] > svg.mx-hw-face { + transform:translateY(1px)!important; +} +#app button.mx-hw-key > .mx-hw-screen-reader{ + position:absolute!important; + width:1px!important;height:1px!important; + margin:-1px!important;padding:0!important; + border:0!important;overflow:hidden!important; + clip-path:inset(50%)!important; + white-space:nowrap!important; +} +#app button.mx-hw-key:hover:not(:disabled){ + filter:none!important; + background:linear-gradient(180deg,#0b141b,#25343d)!important; + box-shadow:inset 0 2px 4px #03080db5!important; +} +#app button.mx-hw-key:active:not(:disabled){ + transform:none!important; + background:linear-gradient(180deg,#0b141b,#25343d)!important; + box-shadow:inset 0 2px 4px #03080db5!important; +} +#app button.mx-hw-key:active:not(:disabled) > svg.mx-hw-face{ + transform:translateY(1px)!important; +} +#app button.mx-hw-key:focus-visible{ + outline:2px solid #9bbecd!important; + outline-offset:2px!important; +} +#app button.mx-hw-key:disabled { + cursor:not-allowed!important; + opacity:.47!important; + filter:none!important; +} +#app button.mx-hw-key:disabled::before{opacity:0!important} +#app button.mx-hw-key:disabled svg .mx-hw-lamp{opacity:0!important} +/* Keep target strip geometry intact, bypassing the legacy BTN-180 face. */ +#app #mixer .channel-actions button.mx-hw-key, +#app #mixer .utility-row button.mx-hw-key { + flex:1 1 0; +} +/* The legacy MASTER MUTE was sized only by .candy. Own its 29px geometry + explicitly after replacing that obsolete class, matching every strip. */ +#app #masterLeft .master-actions button.mx-hw-key, +#app #masterMute.mx-hw-key{ + height:29px!important; + min-height:29px!important; + max-height:29px!important; + align-self:center!important; +} +#app #mixer [data-channel-format-toggle].mx-hw-key{ + min-width:20px!important; +} +#app .arV6Controls button.mx-hw-key{width:28px!important;height:28px!important;padding:2px!important} +#app .arV6FxSlot button.mx-hw-key{min-width:27px!important;min-height:22px!important;padding:2px!important} +#app .arV6Send button.mx-hw-key{min-width:34px!important;min-height:20px!important;padding:2px!important} +@media(prefers-reduced-motion:reduce){ + #app button.mx-hw-key,#app button.mx-hw-key > svg.mx-hw-face{transition:none!important} +}