58 lines
1.2 KiB
TypeScript
58 lines
1.2 KiB
TypeScript
import {
|
|
DSPState as DSP408State,
|
|
DSPMode,
|
|
DSP408OutputMeters,
|
|
DSP408InputMeters,
|
|
} from './features/dsp408/types';
|
|
|
|
export type DSPStatus = 'connected' | 'connecting' | 'disconnected';
|
|
|
|
export type NotificationType = 'success' | 'error' | 'warning';
|
|
export type Notification = {
|
|
id: number;
|
|
message: string;
|
|
type: NotificationType;
|
|
removing?: boolean;
|
|
};
|
|
|
|
export type AppPage = 'home' | 'add-dsp' | 'view-dsp' | 'credits';
|
|
|
|
type DSPDefaultParameters = {
|
|
ip: string;
|
|
defaultPort: number;
|
|
device_id: number;
|
|
};
|
|
|
|
export type DSPTypes = 'DSP408' | 'DSP204';
|
|
|
|
export const DSP_DEFAULT_PARAMETERS: Record<DSPTypes, DSPDefaultParameters> = {
|
|
DSP408: { ip: '192.168.49.30', defaultPort: 9761, device_id: 1 },
|
|
DSP204: { ip: '192.168.49.30', defaultPort: 94, device_id: 1 },
|
|
};
|
|
|
|
interface DSPBase {
|
|
id: number;
|
|
name: string;
|
|
ip: string;
|
|
port: number;
|
|
deviceId: number;
|
|
mode: DSPMode;
|
|
|
|
status: DSPStatus;
|
|
|
|
pollingPaused: boolean;
|
|
}
|
|
|
|
export type DSP408 = DSPBase & {
|
|
type: 'DSP408';
|
|
state: DSP408State;
|
|
input_meters: DSP408InputMeters;
|
|
output_meters: DSP408OutputMeters;
|
|
};
|
|
|
|
export type DSP204 = DSPBase & {
|
|
type: 'DSP204';
|
|
};
|
|
|
|
export type DSP = DSP408 | DSP204;
|