feat: buffer/latency control + non-selectable node text

Buffer Control:
- GET /api/quantum - reads current graph quantum via pw-metadata
- POST /api/quantum {quantum:N} - sets quantum via pw-metadata
- Toolbar dropdown with presets: 32, 64, 128, 256, 512, 1024, 2048, 4096
- Loads current quantum on startup

Text Selection Fix:
- Added user-select: none to wrap and canvas CSS
- Node text no longer gets selected when dragging
This commit is contained in:
joren
2026-03-30 01:10:46 +02:00
parent 839eb5156a
commit f76583a33e
3 changed files with 77 additions and 3 deletions

View File

@@ -441,4 +441,25 @@ export async function unloadModule(moduleId: number) {
}
}
// Quantum (buffer size) control
export async function getQuantum(): Promise<number> {
try {
const res = await fetch('/api/quantum');
const data = await res.json();
return data.quantum || 0;
} catch { return 0; }
}
export async function setQuantum(quantum: number) {
try {
await fetch('/api/quantum', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ quantum }),
});
} catch (e) {
console.error('[api] set-quantum failed:', e);
}
}
export { connectPorts, disconnectPorts };