ROUTE TO BUS
Choose whether the original Main feed should remain.
@@ -3952,7 +4032,7 @@
const id=nextId++;
return {id,name,kind,color,icon:kind==='master'?'◎':kind==='bus'?'⊞':kind==='fx'?'◉':'♩',group:null,safe:false,format:'stereo',input:'None',output:kind==='master'?'Default Output':'Master',fx:Array(8).fill('None'),slotBypass:Array(8).fill(false),fxOn:true,send:'None',sendOn:false,pre:false,sendLevel:-6,sendPan:0,activeSend:0,sendSlots:Array.from({length:16},()=>({send:'None',sendOn:false,pre:false,sendLevel:-6,sendPan:0})),eq:true,pan:0,trim:0,mute:false,solo:false,cue:false,mon:false,phase:false,level:0,meterL:0,meterR:0,clip:false,selected:false};
};
-function init(){nextId=1;nextGroup=1;wireSourceId=1;wireEdges=[];nextWireId=1;wireMode='send';wireView='focus';wireSourcePinned=false;wireIntent=false;document.getElementById('wireView').value='focus';wireAnchorId=null;wireHoverId=null;wireGesture=null;wireSuppressClick=false;pendingBusRoute=null;const choice=document.getElementById('routeChoice');if(choice)choice.hidden=true;document.getElementById('wireMode').value='send';tracks=INIT.map((name,i)=>{const channel=make(name,'audio',COLORS[i]);channel.icon=DEFAULT_ICONS[i]||'♩';if(/^(Host|Interview|Vocal|Guitar)/.test(name)){channel.format='mono';}return channel;});tracks.push(make('Bus A','bus','#7140b5'));master=make('Master','master','#a04b65');tracks[0].fx[0]='Parametric Equalizer';tracks[1].fx[0]='Dynamics Processing';tracks[3].fx[0]='Studio Reverb';tracks[0].send='Bus A';tracks[0].sendOn=true;tracks[1].send='Bus A';tracks[1].sendOn=true;tracks[0].selected=true;render();}
+function init(){wireWsOpen=false;wireWsInspect=null;wireWsRemoveConfirm=null;wireWsHistory=[];wireWsPendingBefore=null;wireWsEditBefore=null;const ws=document.getElementById('wireWorkspace');if(ws)ws.hidden=true;nextId=1;nextGroup=1;wireSourceId=1;wireEdges=[];nextWireId=1;wireMode='send';wireView='focus';wireSourcePinned=false;wireIntent=false;document.getElementById('wireView').value='focus';wireAnchorId=null;wireHoverId=null;wireGesture=null;wireSuppressClick=false;pendingBusRoute=null;const choice=document.getElementById('routeChoice');if(choice)choice.hidden=true;document.getElementById('wireMode').value='send';tracks=INIT.map((name,i)=>{const channel=make(name,'audio',COLORS[i]);channel.icon=DEFAULT_ICONS[i]||'♩';if(/^(Host|Interview|Vocal|Guitar)/.test(name)){channel.format='mono';}return channel;});tracks.push(make('Bus A','bus','#7140b5'));master=make('Master','master','#a04b65');tracks[0].fx[0]='Parametric Equalizer';tracks[1].fx[0]='Dynamics Processing';tracks[3].fx[0]='Studio Reverb';tracks[0].send='Bus A';tracks[0].sendOn=true;tracks[1].send='Bus A';tracks[1].sendOn=true;tracks[0].selected=true;render();}
const escapeHtml=s=>String(s).replace(/[&<>"']/g,c=>({'&':'&','<':'<','>':'>','"':'"',"'":'''}[c]));
/* Google Material Icons SVG paths, Apache-2.0. Inline/zero font or network requests. */
const MATERIAL_PATH=Object.freeze({
@@ -4056,7 +4136,7 @@
render();say('SOURCE '+t.name+' · drag solid OUT → hollow IN, or click an IN jack · GUI DEMO');
return true;
}
-function closeRouteChoice(){pendingBusRoute=null;const p=document.getElementById('routeChoice');if(p)p.hidden=true;}
+function closeRouteChoice(){pendingBusRoute=null;wireWsPendingBefore=null;const p=document.getElementById('routeChoice');if(p)p.hidden=true;}
function showRouteChoice(source,dest,anchor){
if(!source||!dest||dest.kind!=='bus')return false;
if(hasLegacySendTo(source,dest)){say('BUS ROUTE BLOCKED: hidden legacy SEND to '+dest.name+' · migrate legacy path first');return false;}
@@ -4075,6 +4155,7 @@
return true;
}
function commitRouteChoice(kind){
+ const wireWsBefore=wireWsPendingBefore;wireWsPendingBefore=null;
const p=pendingBusRoute;if(!p)return false;
const source=wireSourceTrack(p.sourceId),dest=tracks.find(t=>t.id===p.destId&&t.kind==='bus');
if(!source||!dest||wireIsCycle(source.id,dest.id)||hasLegacySendTo(source,dest)){
@@ -4091,7 +4172,7 @@
if(old?.kind==='primary'&&source.output===dest.name)source.output='Master';
wireEdges.push({id:nextWireId++,sourceId:source.id,destId:dest.id,kind:'send',mode:'send',levelDb:0,enabled:true});
}else return false;
- closeRouteChoice();render();kickWireSpring(source.id,dest.id);
+ closeRouteChoice();render();kickWireSpring(source.id,dest.id);wireWsRecord(wireWsBefore);
say(source.name+' → '+dest.name+' · '+(kind==='only'?'VIA BUS ONLY · no direct MAIN':'PARALLEL SEND · original primary output preserved')+' · GUI DEMO ONLY');
return true;
}
@@ -4509,29 +4590,33 @@
return wirePathData(x0,y0,x1,y1,limit,wireMotion.key===key?wireMotion.offset:0);
}
function kickWireSpring(sourceId,destId){
- if(!sourceId||!destId||window.matchMedia?.('(prefers-reduced-motion: reduce)')?.matches)return;
- const key=sourceId+'-'+destId,token=++wireMotion.token;
- wireMotion.key=key;wireMotion.offset=0;
- let frame=0;
- function paint(offset){
- const geometry=wireMotionGeometry.get(key);if(!geometry)return;
- const d=wirePathData(...geometry,offset);
- for(const path of document.querySelectorAll('#wireLayer path[data-cable-key="'+key+'"]'))
- if(path.getAttribute('d')!==d)path.setAttribute('d',d);
- }
- function step(){
- if(token!==wireMotion.token)return;
- frame++;
- // 2.8px maximum, one gentle settling motion instead of rigid bounces.
- // Small, non-bouncing fabric-like damped sag: 1.7px opening movement,
- // then monotonic relaxation. Only this cable's SVG paths are repainted.
- wireMotion.offset=1.7*Math.exp(-frame*.28);
- paint(wireMotion.offset);
- if(frame<14&&Math.abs(wireMotion.offset)>.06)requestAnimationFrame(step);
- else{wireMotion.offset=0;wireMotion.key=null;paint(0);}
+ if(!sourceId||!destId||window.matchMedia?.('(prefers-reduced-motion: reduce)')?.matches)return;
+ const key=sourceId+'-'+destId;
+ // A cable may be hidden by a bank change; never animate imaginary geometry.
+ if(!wireMotionGeometry.has(key))return;
+ const token=++wireMotion.token;
+ wireMotion.key=key;wireMotion.offset=3.8;
+ let frame=0;
+ function paint(offset){
+ const geometry=wireMotionGeometry.get(key);if(!geometry)return;
+ const d=wirePathData(...geometry,offset);
+ for(const path of document.querySelectorAll('#wireLayer path[data-cable-key="'+key+'"]'))
+ if(path.getAttribute('d')!==d)path.setAttribute('d',d);
+ }
+ // The cable hangs 3.8px into the patch bay, then gently relaxes
+ // with one subpixel return. There is no whole-mixer repaint or bouncing keycap.
+ // Immediately paint the committed wire so the change is visually perceptible.
+ paint(3.8);
+ function step(){
+ if(token!==wireMotion.token)return;
+ frame++;
+ wireMotion.offset=3.8*Math.exp(-frame*.15)*Math.cos(frame*.23);
+ paint(wireMotion.offset);
+ if(frame<20)requestAnimationFrame(step);
+ else{wireMotion.offset=0;wireMotion.key=null;paint(0);}
+ }
+ requestAnimationFrame(step);
}
- requestAnimationFrame(step);
-}
/* V23 Smart Wire: visible lit socket means preview is center-snapped and
mouseup accepts that exact candidate. Moving away releases attraction;
the underlying graph changes ONLY on mouseup. No whole-bay snap. */
@@ -4567,6 +4652,243 @@
/* V26 Focus Signal Flow — one read-only display graph for both directions.
Keep legacy Send, Split and Bus primary paths visible without changing the
underlying audio topology or introducing duplicate wire edges. */
+
+/* V34 Smart WIRE Navigator / Matrix.
+ View-only channel/bank discovery and existing route admission are separate.
+ No new route graph or global SVG animation loop is created. */
+let wireWsOpen=false,wireWsMode='find',wireWsQuery='',wireWsBusId=null,
+ wireWsInspect=null,wireWsRemoveConfirm=null,wireWsHistory=[],wireWsPendingBefore=null,wireWsEditBefore=null;
+
+/* Scoped WIRE-only undo. Never rewinds fader, FX, mute, mixer bank or meters.
+ Refuse stale replay after another graph/scene mutation. */
+function wireWsSnapshot(){
+ return {edges:clone(wireEdges),nextId:nextWireId,
+ outputs:tracks.map(t=>[t.id,t.output]),trackIds:tracks.map(t=>t.id)};
+}
+function wireWsSignature(state){return JSON.stringify(state);}
+function wireWsRecord(before){
+ if(!before)return;
+ const after=wireWsSnapshot();
+ if(wireWsSignature(before)===wireWsSignature(after))return;
+ wireWsHistory.push({before,afterSig:wireWsSignature(after)});
+ if(wireWsHistory.length>10)wireWsHistory.shift();
+ const btn=document.getElementById('wireWsUndo');if(btn)btn.disabled=false;
+}
+function wireWsUndo(){
+ const entry=wireWsHistory[wireWsHistory.length-1];
+ if(!entry){say('WIRE: no routing change to undo');return false;}
+ if(wireWsSignature(wireWsSnapshot())!==entry.afterSig){
+ wireWsHistory=[];wireWsPendingBefore=null;
+ say('WIRE UNDO canceled: graph changed outside Navigator · current routes preserved');
+ renderWireWorkspace();return false;
+ }
+ wireWsHistory.pop();wireEdges=clone(entry.before.edges);nextWireId=entry.before.nextId;
+ const outputs=new Map(entry.before.outputs);
+ tracks.forEach(t=>{if(outputs.has(t.id))t.output=outputs.get(t.id);});
+ wireWsInspect=null;wireWsRemoveConfirm=null;
+ render();renderWireWorkspace();
+ say('WIRE UNDO · previous routing restored · unrelated mixer settings kept');
+ return true;
+}
+function wireWsId(id){return 'CH'+String(id).padStart(2,'0');}
+function wireWsLabel(id){
+ const t=tracks.find(x=>x.id===id);return t?wireWsId(id)+' · '+t.name:wireWsId(id);
+}
+function wireWsBank(id){
+ const filter=document.getElementById('viewFilter')?.value||'all';
+ const shown=tracks.filter(t=>filter==='all'||(filter==='solo'?t.solo:t.kind===filter));
+ const index=shown.findIndex(t=>t.id===id);
+ return index<0?'Hidden by filter':'Bank '+(Math.floor(index/Math.max(1,bankCapacity()))+1);
+}
+function wireWsRoutes(){return wireDisplayRoutes();}
+function wireWsFindEdge(src,dst){return wireEdges.find(e=>e.enabled&&e.sourceId===src&&e.destId===dst);}
+function wireWsRouteKind(src,dst,routes){
+ const edge=wireWsFindEdge(src,dst);
+ if(edge)return {kind:'wire',edge};
+ const linked=routes.find(e=>e.sourceId===src&&e.destId===dst);
+ return linked?{kind:linked.kind,edge:null}:null;
+}
+function wireWsMatches(t){
+ const q=wireWsQuery.trim().toLowerCase();
+ return !q||('ch'+String(t.id).padStart(2,'0')+' '+t.id+' '+t.name+' '+t.kind).toLowerCase().includes(q);
+}
+function wireWsCanJoin(src,dst){
+ const a=wireSourceTrack(src),b=wireSourceTrack(dst);
+ return !!(a&&b&&a.id!==b.id&&!wireIsCycle(src,dst));
+}
+function wireWsChooseMode(mode){
+ const previous=wireWsMode;
+ wireWsMode=['find','routes','bus','matrix'].includes(mode)?mode:'find';
+ wireWsInspect=null;wireWsRemoveConfirm=null;
+ if(previous!==wireWsMode){wireWsQuery='';const search=document.getElementById('wireWsSearch');if(search)search.value='';}
+ const panel=document.getElementById('wireWorkspace');
+ if(panel)panel.classList.toggle('is-matrix',wireWsMode==='matrix');
+ renderWireWorkspace();
+}
+function wireWsToggle(mode){
+ const panel=document.getElementById('wireWorkspace');
+ if(!panel)return;
+ if(wireWsOpen&&wireWsMode===mode){wireWsOpen=false;panel.hidden=true;}
+ else {wireWsOpen=true;panel.hidden=false;wireWsChooseMode(mode);}
+ for(const id of ['wireNavigatorToggle','wireMatrixToggle']){
+ const el=document.getElementById(id);if(el)
+ el.setAttribute('aria-expanded',String(wireWsOpen&&
+ (id==='wireMatrixToggle'?wireWsMode==='matrix':wireWsMode!=='matrix')));
+ }
+ if(wireWsOpen&&wireWsMode==='find')document.getElementById('wireWsSearch')?.focus?.();
+}
+function wireWsJump(id){
+ const target=wireSourceTrack(id);if(!target)return;
+ const filter=document.getElementById('viewFilter');
+ let list=tracks.filter(t=>filter.value==='all'||(filter.value==='solo'?t.solo:t.kind===filter.value));
+ if(!list.some(t=>t.id===id)){filter.value='all';list=tracks;}
+ const idx=list.findIndex(t=>t.id===id);
+ render(Math.floor(Math.max(0,idx)/Math.max(1,bankCapacity())));
+ say('WIRE NAVIGATOR · showing '+wireWsLabel(id)+' · patch source unchanged');
+}
+function wireWsListRow(t,source,routes,mode){
+ const connected=source?wireWsRouteKind(source.id,t.id,routes):null;
+ const href=source?source.id+':'+t.id:null;
+ const possible=source&&t.id!==source.id&&wireWsCanJoin(source.id,t.id);
+ const linked=!!connected;
+ const action=linked?
+ '
':
+ possible?'
':
+ '
';
+ return '
'+
+ ''+
+ ''+wireWsId(t.id)+' · '+escapeHtml(t.name)+''+
+ ''+escapeHtml(wireWsBank(t.id))+''+
+ (linked?''+(connected.kind==='wire'?'● WIRE':'● '+escapeHtml(connected.kind.toUpperCase()))+'':'')+
+ action+'
';
+}
+function wireWsRouteRow(route,direction){
+ const src=tracks.find(t=>t.id===route.sourceId),dst=tracks.find(t=>t.id===route.destId);
+ if(!src||!dst)return '';
+ const other=direction==='out'?dst:src;
+ const info=wireWsRouteKind(src.id,dst.id,wireWsRoutes());
+ return '
'+
+ ''+
+ (direction==='out'?'→ ':'← ')+escapeHtml(wireWsLabel(other.id))+''+
+ ''+escapeHtml(wireWsBank(other.id))+''+
+ escapeHtml(info?.kind||route.kind)+''+
+ ''+
+ '
';
+}
+function wireWsMatrixMarkup(source,routes){
+ const all=tracks.filter(t=>t.kind!=='master');
+ const targets=all.filter(wireWsMatches);
+ // Matrix is deliberately capped; the search exposes all stable IDs without
+ // creating a huge DOM for 100+ strips or slowing audio UI interactions.
+ const rows=(source?[source,...all.filter(t=>t.id!==source.id)]:all).slice(0,16);
+ const columns=targets.slice(0,22);
+ if(!columns.length)return '
No matching channel. Search CH number or track name.
';
+ const cols=columns.map(t=>'
'+wireWsId(t.id)+' | ').join('');
+ const matrix=rows.map(src=>{
+ const cells=columns.map(dst=>{
+ const key=src.id+':'+dst.id,info=wireWsRouteKind(src.id,dst.id,routes),self=src.id===dst.id,
+ permitted=!self&&wireWsCanJoin(src.id,dst.id),cls=info?(info.edge?'is-linked':'is-legacy'):'',
+ action=info?'data-ws-inspect':'data-ws-join',
+ symbol=info?(info.edge?'●':'◆'):(permitted?'+':'–');
+ return '
| ';
+ }).join('');
+ return '
| '+wireWsId(src.id)+' · '+escapeHtml(src.name)+' | '+cells+'
';
+ }).join('');
+ return '
'+
+ (all.length>16||targets.length>22?'':'');
+}
+function renderWireWsInspector(){
+ if(!wireWsOpen)return;
+ const panel=document.getElementById('wireWsInspector');
+ if(!panel)return;
+ const p=wireWsInspect,info=p&&wireWsRouteKind(p.src,p.dst,wireWsRoutes());
+ if(!info){panel.hidden=true;return;}
+ panel.hidden=false;
+ const src=tracks.find(t=>t.id===p.src),dst=tracks.find(t=>t.id===p.dst);
+ if(!src||!dst){panel.hidden=true;return;}
+ const edge=info.edge,key=p.src+':'+p.dst;
+ const controls=edge?
+ '
'+
+ ''+
+ ''+edge.levelDb+' dB'+
+ ''+
+ ''+
+ '
':
+ '
Managed by existing '+escapeHtml(info.kind.toUpperCase())+' routing. No duplicate WIRE edge.
';
+ panel.innerHTML='
'+escapeHtml(wireWsLabel(p.src))+' → '+escapeHtml(wireWsLabel(p.dst))+''+
+ '
'+escapeHtml(info.kind.toUpperCase())+''+controls+
+ '
'+
+ '
';
+}
+function renderWireWorkspace(){
+ if(!wireWsOpen)return;
+ const panel=document.getElementById('wireWorkspace');
+ if(!panel||panel.hidden)return;
+ panel.classList.toggle('is-matrix',wireWsMode==='matrix');
+ const source=armedWireSource(),routes=wireWsRoutes();
+ document.getElementById('wireWsSource').textContent=source?wireWsLabel(source.id)+' OUT':'Choose source OUT';
+ for(const tab of panel.querySelectorAll('[data-ws-mode]'))
+ tab.setAttribute('aria-selected',String(tab.dataset.wsMode===wireWsMode));
+ const sel=document.getElementById('wireWsSourceSelect'),selected=source?.id||0;
+ const options='
'+tracks.map(t=>
+ '
').join('');
+ if(sel.innerHTML!==options)sel.innerHTML=options;
+ sel.value=String(selected||'');
+ const busSel=document.getElementById('wireWsBus'),buses=tracks.filter(t=>t.kind==='bus');
+ busSel.hidden=wireWsMode!=='bus';
+ const busOpt=buses.map(t=>'
').join('');
+ if(busSel.innerHTML!==busOpt)busSel.innerHTML=busOpt;
+ if(!buses.some(t=>t.id===wireWsBusId))wireWsBusId=buses[0]?.id||null;
+ busSel.value=String(wireWsBusId||'');
+ const list=document.getElementById('wireWsList');
+ const foot=document.getElementById('wireWsFoot');
+ if(wireWsMode==='find'){
+ const matches=tracks.filter(t=>t.kind!=='master'&&t.id!==source?.id&&wireWsMatches(t));
+ list.innerHTML=matches.slice(0,75).map(t=>wireWsListRow(t,source,routes,'find')).join('')||
+ '
No destination matches your search.
';
+ foot.textContent=(source?'SOURCE '+wireWsId(source.id)+' retained · ':'Select an OUT source · ')+
+ matches.length+' matching destinations, across all banks';
+ }else if(wireWsMode==='routes'){
+ const inbound=source?routes.filter(e=>e.destId===source.id):[];
+ const outbound=source?routes.filter(e=>e.sourceId===source.id):[];
+ list.innerHTML=source?
+ '
OUTGOING · '+outbound.length+'
'+
+ (outbound.map(e=>wireWsRouteRow(e,'out')).join('')||'
No outgoing routes
')+
+ '
INCOMING · '+inbound.length+'
'+
+ (inbound.map(e=>wireWsRouteRow(e,'in')).join('')||'
No incoming routes
'):
+ '
Select source OUT above to see all incoming and outgoing routes.
';
+ foot.textContent='Jump ↗ preserves source selection · only real WIRE edges are editable';
+ }else if(wireWsMode==='bus'){
+ const bus=tracks.find(t=>t.id===wireWsBusId&&t.kind==='bus');
+ const sources=tracks.filter(t=>t.id!==bus?.id&&t.kind!=='master'&&wireWsMatches(t));
+ list.innerHTML='
Choose a Bus to build its send mix.
';
+ // Destination-first rows need a dedicated model-aware control, not a reversed wire.
+ if(bus)list.innerHTML=sources.slice(0,75).map(t=>{
+ const info=wireWsRouteKind(t.id,bus.id,routes),can=wireWsCanJoin(t.id,bus.id);
+ return '
'+escapeHtml(wireWsLabel(t.id))+''+
+ ''+escapeHtml(wireWsBank(t.id))+''+
+ (info?'● '+escapeHtml(info.kind.toUpperCase())+'':'')+
+ (info?'':
+ '')+
+ '
';
+ }).join('')||'
No source matches.
';
+ foot.textContent='MIX TO '+(bus?wireWsLabel(bus.id):'Bus')+
+ ' · choose sources across banks · Bus decision remains explicit';
+ }else{
+ list.innerHTML=wireWsMatrixMarkup(source,routes);
+ foot.textContent='Crosspoint ● WIRE / ◆ existing legacy · routes are never bank-specific';
+ }
+ renderWireWsInspector();
+ const undo=document.getElementById('wireWsUndo');if(undo)undo.disabled=wireWsHistory.length===0;
+}
+
function wireDisplayRoutes(){
const routes=[],seen=new Set(),byName=new Map(tracks.map(t=>[t.name,t]));
const add=(sourceId,destId,kind)=>{
@@ -4617,6 +4939,7 @@
'
OUT'+badges(outRoutes,false)+'';
}
function renderWireRouting(){
+ if(wireWsOpen&&!wireGesture?.active)renderWireWorkspace();
document.querySelector('.console-body')?.classList.toggle('wire-intent',!!wireIntent);
const svg=document.getElementById('wireLayer'),viewport=document.getElementById('viewport');
const dragging=!!(wireGesture?.active&&wireGesture.point);
@@ -5273,6 +5596,94 @@
}
/* V33 persistent source + universal cross-bank destination. Semantic routing graph
uses stable channel IDs: never infer patch identity from bank position. */
+
+/* V34 operator events: delegated inside one modeless WIRE workspace. */
+document.getElementById('wireNavigatorToggle').addEventListener('click',()=>wireWsToggle('find'));
+document.getElementById('wireMatrixToggle').addEventListener('click',()=>wireWsToggle('matrix'));
+document.getElementById('wireWsUndo').addEventListener('click',wireWsUndo);
+document.getElementById('wireWsClose').addEventListener('click',()=>{
+ wireWsOpen=false;document.getElementById('wireWorkspace').hidden=true;
+ document.getElementById('wireNavigatorToggle').setAttribute('aria-expanded','false');
+ document.getElementById('wireMatrixToggle').setAttribute('aria-expanded','false');
+});
+document.getElementById('wireWorkspace').addEventListener('keydown',e=>{
+ if(e.key==='Escape'){e.stopPropagation?.();document.getElementById('wireWsClose').click();}
+});
+document.getElementById('wireWorkspace').addEventListener('click',e=>{
+ const tab=e.target.closest?.('[data-ws-mode]');
+ if(tab){wireWsChooseMode(tab.dataset.wsMode);return;}
+ const jump=e.target.closest?.('[data-ws-jump]');
+ if(jump){wireWsJump(Number(jump.dataset.wsJump));return;}
+ const inspect=e.target.closest?.('[data-ws-inspect]');
+ if(inspect){
+ const parts=inspect.dataset.wsInspect.split(':').map(Number);
+ if(parts.length!==2||parts.some(x=>!Number.isInteger(x)))return;
+ wireWsInspect={src:parts[0],dst:parts[1]};wireWsRemoveConfirm=null;
+ renderWireWsInspector();return;
+ }
+ const disconnect=e.target.closest?.('[data-ws-remove]');
+ if(disconnect){
+ const key=disconnect.dataset.wsRemove;
+ if(wireWsRemoveConfirm!==key){wireWsRemoveConfirm=key;renderWireWsInspector();return;}
+ const parts=key.split(':').map(Number),edge=wireWsFindEdge(parts[0],parts[1]);
+ wireWsRemoveConfirm=null;wireWsInspect=null;
+ if(edge){const before=wireWsSnapshot();replugWireEdge(parts[0],parts[1],null);wireWsRecord(before);}
+ renderWireWorkspace();return;
+ }
+ const join=e.target.closest?.('[data-ws-join]');
+ if(!join)return;
+ const parts=join.dataset.wsJoin.split(':').map(Number);
+ if(parts.length!==2||parts.some(x=>!Number.isInteger(x)))return;
+ const src=wireSourceTrack(parts[0]),dst=wireSourceTrack(parts[1]);
+ if(!src||!dst||src.id===dst.id)return;
+ const info=wireWsRouteKind(src.id,dst.id,wireWsRoutes());
+ if(info){wireWsInspect={src:src.id,dst:dst.id};renderWireWsInspector();return;}
+ if(!wireWsCanJoin(src.id,dst.id)){
+ say('WIRE rejected: feedback cycle or invalid destination · graph unchanged');return;
+ }
+ // A matrix crosspoint explicitly sets FROM. Normal destination-first TO BUS
+ // never moves the displayed mixer bank or a third-party routing endpoint.
+ if(wireWsMode!=='bus'&&(!armedWireSource()||armedWireSource().id!==src.id))
+ selectWireSource(src);
+ const before=wireWsSnapshot();
+ requestWireConnection(src,dst,join);
+ if(document.getElementById('routeChoice')?.hidden===false)wireWsPendingBefore=before;
+ else wireWsRecord(before);
+ renderWireWorkspace();
+});
+document.getElementById('wireWsSearch').addEventListener('input',e=>{
+ wireWsQuery=String(e.target.value||'').slice(0,80);renderWireWorkspace();
+});
+document.getElementById('wireWsSourceSelect').addEventListener('change',e=>{
+ const src=wireSourceTrack(Number(e.target.value));
+ if(src)selectWireSource(src);
+ renderWireWorkspace();
+});
+document.getElementById('wireWsBus').addEventListener('change',e=>{
+ const b=tracks.find(t=>t.id===Number(e.target.value)&&t.kind==='bus');
+ if(b)wireWsBusId=b.id;
+ renderWireWorkspace();
+});
+document.getElementById('wireWsInspector').addEventListener('focusin',e=>{
+ if(e.target.closest?.('[data-ws-gain],[data-ws-tap]'))wireWsEditBefore=wireWsSnapshot();
+});
+document.getElementById('wireWsInspector').addEventListener('input',e=>{
+ const gain=e.target.closest?.('[data-ws-gain]');
+ if(!gain)return;
+ const edge=wireEdges.find(x=>x.id===Number(gain.dataset.wsGain)&&x.enabled);
+ if(!edge)return;
+ edge.levelDb=Math.max(-60,Math.min(6,Math.round(Number(gain.value)||0)));
+ document.getElementById('wireWsGainText').textContent=edge.levelDb+' dB';
+});
+document.getElementById('wireWsInspector').addEventListener('change',e=>{
+ const gain=e.target.closest?.('[data-ws-gain]'),tap=e.target.closest?.('[data-ws-tap]');
+ if(tap){
+ const edge=wireEdges.find(x=>x.id===Number(tap.dataset.wsTap)&&x.enabled);
+ if(edge&&edge.kind!=='primary')edge.mode=tap.value==='split'?'split':'send';
+ }
+ if(gain||tap){wireWsRecord(wireWsEditBefore);wireWsEditBefore=null;render();renderWireWorkspace();say('WIRE inspector updated '+wireWsLabel(wireWsInspect?.src)+' → '+wireWsLabel(wireWsInspect?.dst)+' · GUI reference');}
+});
+
document.getElementById('wireLegend').addEventListener('change',e=>{
const picker=e.target.closest('[data-wire-destination]');
if(!picker||!picker.value)return;
diff --git a/design-references/audition-mixer-study/smoke.test.cjs b/design-references/audition-mixer-study/smoke.test.cjs
index 05fedaef6..5cc402abe 100644
--- a/design-references/audition-mixer-study/smoke.test.cjs
+++ b/design-references/audition-mixer-study/smoke.test.cjs
@@ -1069,8 +1069,9 @@ check(html.includes('(y0+control).toFixed(1)') &&
!html.includes('(y0-rise).toFixed(1)'),
'V31 both cubic control points hang BELOW their anchors, including right-to-left routes');
check(html.includes('let wireMotion={key:null,offset:0,token:0}') &&
- html.includes('frame<14') &&
- html.includes('wireMotion.offset=1.7*Math.exp(-frame*.28)') &&
+ html.includes('frame<20') &&
+ html.includes('wireMotion.offset=3.8*Math.exp(-frame*.15)*Math.cos(frame*.23)') &&
+ html.includes('paint(3.8)') &&
html.includes('data-wire-destination') &&
html.includes('wireMotionGeometry.get(key)') &&
html.includes('path.setAttribute(\'d\',d)') &&
diff --git a/design-references/audition-mixer-study/visual_wire_v32_cross_bank_qa.py b/design-references/audition-mixer-study/visual_wire_v32_cross_bank_qa.py
index 23a95ba0c..9659f4ae7 100644
--- a/design-references/audition-mixer-study/visual_wire_v32_cross_bank_qa.py
+++ b/design-references/audition-mixer-study/visual_wire_v32_cross_bank_qa.py
@@ -33,11 +33,16 @@ def route_to(n):
page.evaluate("""() => {
const seen={};
window.__v32Seen=seen;
+ window.__v32MotionCurves=[];
window.__v32Observer=new MutationObserver(muts=>{
for(const m of muts){
if(m.type!=='attributes'||m.attributeName!=='d')continue;
const key=m.target.getAttribute('data-cable-key');
if(key)seen[key]=(seen[key]||0)+1;
+ if(key==='1-4'){
+ const nums=(m.target.getAttribute('d').match(/-?[0-9]+(?:[.][0-9]+)?/g)||[]).map(Number);
+ if(nums.length===8)window.__v32MotionCurves.push(nums[3]);
+ }
}
});
window.__v32Observer.observe(document.getElementById('wireLayer'),
@@ -45,10 +50,14 @@ def route_to(n):
}""")
route_to(4)
page.wait_for_timeout(360)
- seen=page.evaluate("""() => {
+ motion=page.evaluate("""() => {
window.__v32Observer.disconnect();
- return window.__v32Seen;
+ return {seen:window.__v32Seen,curves:window.__v32MotionCurves};
}""")
+ seen=motion['seen']
+ curves=motion['curves']
+ verify(len(curves)>=5 and max(curves)-min(curves)>=3.1,
+ f"{width}: plug-in motion too small or missing: {curves}")
verify(cable(1,3).get_attribute('d')==before,
f"{width}: old cable changed shape when another cable was plugged")
verify(seen.get("1-3",0)==0,
diff --git a/design-references/audition-mixer-study/visual_wire_v34_navigator_qa.py b/design-references/audition-mixer-study/visual_wire_v34_navigator_qa.py
new file mode 100644
index 000000000..32cf64213
--- /dev/null
+++ b/design-references/audition-mixer-study/visual_wire_v34_navigator_qa.py
@@ -0,0 +1,136 @@
+#!/usr/bin/env python3
+"""V34 Smart WIRE: non-destructive multipage navigator, bus mixing and matrix."""
+from pathlib import Path
+from playwright.sync_api import sync_playwright
+PAGE=Path(__file__).with_name('index.html')
+
+def must(value,message):
+ if not value: raise AssertionError(message)
+
+def main():
+ with sync_playwright() as pw:
+ browser=pw.chromium.launch(headless=True)
+ for width,height in ((1366,768),(1680,900),(1920,1080)):
+ page=browser.new_page(viewport={'width':width,'height':height})
+ errors=[]
+ page.on('pageerror',lambda e:errors.append(str(e)))
+ page.goto(PAGE.as_uri())
+ rail=page.locator('.section-rail [data-section="send"]')
+ rail.click()
+ ch=lambda n:page.locator(f'#tracks .strip[data-id="{n}"]')
+ route=lambda a,b:page.locator(f'#wireLayer path[data-from="{a}"][data-to="{b}"]')
+ panel=page.locator('#wireWorkspace')
+ must(panel.is_hidden(),f'{width}: workspace must not disturb normal mixer')
+ initial=ch(3).locator('.wire-node-in').bounding_box()
+ page.locator('#wireNavigatorToggle').click()
+ must(panel.is_visible(),f'{width}: ROUTES button did not open workspace')
+ must(panel.locator('[data-ws-mode="find"]').get_attribute('aria-selected')=='true',
+ f'{width}: FIND must be default')
+ page.locator('#wireWsSourceSelect').select_option('1')
+ must('CH01' in page.locator('#wireWsSource').inner_text(),
+ f'{width}: source OUT not pinned in navigator')
+ page.locator('#wireWsSearch').fill('Bus A')
+ rows=page.locator('#wireWsList .wire-ws-row')
+ must(rows.count()==1 and 'CH11' in rows.first.inner_text(),
+ f'{width}: global destination search did not find off-bank Bus A')
+ must('Bank 2' in rows.first.inner_text(),f'{width}: wrong bank location')
+ rows.first.locator('[data-ws-inspect]').click()
+ must('LEGACY' in page.locator('#wireWsInspector').inner_text().upper(),
+ f'{width}: existing CH01→CH11 legacy SEND not read-only')
+ must(page.locator('#wireWsInspector [data-ws-remove]').count()==0,
+ f'{width}: duplicate legacy route exposed disconnect')
+ page.locator('#wireWsSourceSelect').select_option('5')
+ must(ch(5).count()==1 and ch(11).count()==0,
+ f'{width}: source selection changed current mixer bank')
+ page.locator('#wireWsList [data-ws-join="5:11"]').click()
+ must(page.locator('#routeChoice').is_visible(),
+ f'{width}: remote BUS choice must not be silently bypassed')
+ page.locator('#routeParallel').click()
+ must(not page.locator('#routeChoice').is_visible(),
+ f'{width}: parallel Bus choice did not close')
+ must(ch(11).count()==0 and ch(5).count()==1,
+ f'{width}: remote patch forcibly switched mixer page')
+ must('CH05' in page.locator('#wireWsSource').inner_text(),
+ f'{width}: committed source not retained')
+ page.locator('[data-ws-mode="routes"]').click()
+ must(page.locator('#wireWsList [data-ws-inspect="5:11"]').count()==1,
+ f'{width}: outgoing remote route missing')
+ page.locator('#wireWsList [data-ws-inspect="5:11"]').click()
+ must(page.locator('#wireWsInspector [data-ws-gain]').count()==1,
+ f'{width}: remote Route Inspector cannot edit real WIRE edge')
+ page.locator('#wireWsGain').fill('-12')
+ page.locator('#wireWsTap').select_option('split')
+ must(page.locator('#wireWsGain').input_value()=='-12' and
+ page.locator('#wireWsTap').input_value()=='split',
+ f'{width}: editable gain/tap was not preserved')
+ # Destination jump must show a real receiver and off-bank source portal.
+ page.locator('#wireWsInspector [data-ws-jump="11"]').click()
+ must(ch(11).count()==1 and ch(5).count()==0,
+ f'{width}: jump to destination did not open remote bank')
+ must('FROM CH05' in page.locator('#wireLegend').inner_text(),
+ f'{width}: source lost during remote-bank jump')
+ must(ch(11).locator('.wire-node-in').get_attribute('aria-pressed')=='true',
+ f'{width}: remote receiver did not show committed route')
+ must(route(5,11).count()>=1,
+ f'{width}: cross-bank edge lacks entry portal in focused SVG')
+ page.locator('#wireWsInspector [data-ws-jump="5"]').click()
+ must(ch(5).count()==1 and ch(11).count()==0,
+ f'{width}: jump back to source failed')
+ # Matrix is same graph, only a different view. Use one crosspoint.
+ page.locator('#wireMatrixToggle').click()
+ must('is-matrix' in panel.get_attribute('class') and panel.is_visible(),
+ f'{width}: matrix not accessible')
+ matrix=page.locator('#wireWsList .wire-ws-matrix')
+ must(matrix.count()==1 and matrix.locator('button').count()>0,
+ f'{width}: global matrix missing crosspoints')
+ must(matrix.locator('[data-ws-inspect="5:11"]').count()==1,
+ f'{width}: matrix does not share existing remote wire graph')
+ # TO BUS destination-first: choose CH06 as source without bank navigation.
+ page.locator('[data-ws-mode="bus"]').click()
+ page.locator('#wireWsSearch').fill('CH06')
+ page.locator('#wireWsBus').select_option('11')
+ join=page.locator('#wireWsList [data-ws-join="6:11"]')
+ must(join.count()==1,f'{width}: destination-first Bus send unavailable')
+ join.click()
+ must(page.locator('#routeChoice').is_visible(),
+ f'{width}: destination-first bypassed Bus choice')
+ page.locator('#routeParallel').click()
+ must(page.locator('#wireWsList [data-ws-inspect="6:11"]').count()==1,
+ f'{width}: Bus send not shown connected')
+ page.locator('[data-ws-mode="routes"]').click()
+ page.locator('#wireWsSourceSelect').select_option('5')
+ page.locator('#wireWsList [data-ws-inspect="5:11"]').click()
+ page.locator('#wireWsInspector [data-ws-remove="5:11"]').click()
+ must('Confirm remove' in page.locator('#wireWsInspector').inner_text(),
+ f'{width}: disconnect needs two-step confirmation')
+ page.locator('#wireWsInspector [data-ws-remove="5:11"]').click()
+ must(page.locator('#wireWsList [data-ws-inspect="5:11"]').count()==0,
+ f'{width}: targeted disconnect did not remove edge')
+ page.locator('#wireWsSourceSelect').select_option('6')
+ must(page.locator('#wireWsList [data-ws-inspect="6:11"]').count()==1,
+ f'{width}: disconnect damaged independent CH06→Bus A route')
+ page.locator('#wireWsUndo').click()
+ page.locator('#wireWsSourceSelect').select_option('5')
+ must(page.locator('#wireWsList [data-ws-inspect="5:11"]').count()==1,
+ f'{width}: Undo did not restore the disconnected CH05→Bus route')
+ page.locator('#wireWsList [data-ws-inspect="5:11"]').click()
+ must(page.locator('#wireWsGain').input_value()=='-12' and
+ page.locator('#wireWsTap').input_value()=='split',
+ f'{width}: Undo restored link but lost gain/tap metadata')
+ page.locator('#wireWsSourceSelect').select_option('6')
+ must(page.locator('#wireWsList [data-ws-inspect="6:11"]').count()==1,
+ f'{width}: Undo rewound unrelated Bus mix')
+ page.locator('#wireWsClose').click()
+ must(panel.is_hidden(),f'{width}: close leaked persistent panel')
+ after=ch(3).locator('.wire-node-in').bounding_box()
+ must(all(abs(initial[k]-after[k])<=1 for k in ('x','y','width','height')),
+ f'{width}: opening WIRE workspace shifted mixer geometry: {initial} -> {after}')
+ if width==1680:
+ page.locator('#wireMatrixToggle').click()
+ page.screenshot(path=str(PAGE.with_name('preview-v34-global-matrix-1680.png')))
+ must(not errors,f'{width}: uncaught browser exceptions: {errors}')
+ page.close()
+ browser.close()
+ print('PASS V34 finder, remote CH05->CH11 inspector, portal, Bus mix, matrix and isolated disconnect on 3 screens')
+
+if __name__=='__main__':main()