From ce15581ca8e240307e035e88aab1c60f000df992 Mon Sep 17 00:00:00 2001 From: Jafz2001 Date: Tue, 7 Jul 2026 23:35:33 -0400 Subject: [PATCH] audio: expose replaceIR over the IPC bridge Wire the native replaceIR(slotId, path, gain) through audio-bridge (ipcMain handle) + preload, so renderers get feedBackDesktop.audio.replaceIR. Lets the rig-builder cab room swap a cab's IRs in place instead of a full loadPreset + param re-apply (that re-apply was the brief 'can't move the mic yet' lag). Co-Authored-By: Claude Opus 4.8 (1M context) --- src/main/audio-bridge.ts | 4 ++++ src/main/preload.ts | 2 ++ 2 files changed, 6 insertions(+) diff --git a/src/main/audio-bridge.ts b/src/main/audio-bridge.ts index f4e14f1..691df6f 100644 --- a/src/main/audio-bridge.ts +++ b/src/main/audio-bridge.ts @@ -1080,6 +1080,10 @@ export function initAudioBridge(): void { return await audio?.loadIR(irPath) ?? -1; }); + ipcMain.handle('audio:replaceIR', async (_event, slotId: number, irPath: string, gain?: number) => { + return await audio?.replaceIR(slotId, irPath, typeof gain === 'number' ? gain : -1) ?? false; + }); + ipcMain.handle('audio:removeProcessor', (_event, slotId: number) => { audio?.removeProcessor(slotId); vstSlotPaths.delete(slotId); diff --git a/src/main/preload.ts b/src/main/preload.ts index 9a360b3..40ef9f6 100644 --- a/src/main/preload.ts +++ b/src/main/preload.ts @@ -402,6 +402,8 @@ const feedBackDesktopApi = { loadVST: (pluginPath: string) => ipcRenderer.invoke('audio:loadVST', pluginPath), loadNAMModel: (modelPath: string) => ipcRenderer.invoke('audio:loadNAMModel', modelPath), loadIR: (irPath: string) => ipcRenderer.invoke('audio:loadIR', irPath), + replaceIR: (slotId: number, irPath: string, gain?: number) => + ipcRenderer.invoke('audio:replaceIR', slotId, irPath, gain), removeProcessor: (slotId: number) => ipcRenderer.invoke('audio:removeProcessor', slotId), moveProcessor: (from: number, to: number) => ipcRenderer.invoke('audio:moveProcessor', from, to), setBypass: (slotId: number, bypassed: boolean) => ipcRenderer.invoke('audio:setBypass', slotId, bypassed),