- sink_volume and source_volume knobs now show a dropdown of active PulseAudio/PipeWire output/input devices (monitors excluded), with the system-default device marked in the label - app_volume knob shows a dropdown of running apps (was already a dropdown, previously had a textarea for group_volume) - group_volume knob shows a <select multiple> listbox so several apps can be selected at once with ctrl/shift-click - Add GET /api/sinks and GET /api/sources backend endpoints - Add fetchSinks() / fetchSources() in api.ts with AudioDevice type - Load sinks and sources in App.tsx alongside running apps on refresh - All 23 frontend tests pass
42 lines
941 B
TypeScript
42 lines
941 B
TypeScript
export type LedMode = 'volume' | 'static' | 'off';
|
|
export type KnobAction = 'sink_volume' | 'source_volume' | 'app_volume' | 'group_volume';
|
|
export type ButtonAction = 'mute_sink' | 'mute_source' | 'command';
|
|
|
|
export interface LedConfig {
|
|
mode: LedMode;
|
|
low_color: [number, number, number];
|
|
high_color: [number, number, number];
|
|
}
|
|
|
|
export interface KnobConfig {
|
|
action: KnobAction;
|
|
target?: string;
|
|
targets?: string[];
|
|
led?: Partial<LedConfig>;
|
|
}
|
|
|
|
export interface ButtonConfig {
|
|
action: ButtonAction;
|
|
target: string;
|
|
}
|
|
|
|
export interface Config {
|
|
port: string;
|
|
baud: number;
|
|
leds: LedConfig;
|
|
knobs: Record<string, KnobConfig>;
|
|
buttons: Record<string, ButtonConfig>;
|
|
}
|
|
|
|
export interface AudioDevice {
|
|
name: string;
|
|
description: string;
|
|
is_default?: boolean;
|
|
}
|
|
|
|
export interface ToastItem {
|
|
id: number;
|
|
message: string;
|
|
type: 'success' | 'error' | 'info';
|
|
}
|