soundcraft-ui-connection
Version:
Library for controlling the Soundcraft Ui series audio mixers
153 lines (152 loc) • 4.85 kB
TypeScript
import { OperatorFunction } from 'rxjs';
import { FxType } from '../types';
type Projector<T> = (state: unknown) => T;
type Selector<T> = (...args: any[]) => Projector<T>;
/**
* RxJS operator to apply a custom projection to the full mixer state.
* @param projector Projector function generated by a selector
*/
export declare const select: <T>(projector: Projector<T>) => OperatorFunction<unknown, T>;
/**
* RxJS operator to select a raw value from the mixer state.
* @param path State key to select
*/
export declare const selectRawValue: <T>(path: string, defaultValue?: T) => OperatorFunction<unknown, T>;
/**
* RxJS operator to select a boolean (on/off) value from the mixer state.
* The underlying numeric `0`/`1` value is coerced to `false`/`true`.
* @param path State key to select
* @param defaultValue Value to use when the state key is absent (default `false`)
*/
export declare const selectBoolean: (path: string, defaultValue?: boolean) => OperatorFunction<unknown, boolean>;
/**
* Select level value of the master fader
*/
export declare const selectMasterValue: Selector<number>;
/**
* Select pan value of the master fader
*/
export declare const selectMasterPan: Selector<number>;
/**
* Select dim value of the master fader
*/
export declare const selectMasterDim: Selector<boolean>;
/**
* Select delay value of the master output (L or R)
*/
export declare const selectMasterDelay: Selector<number>;
/**
* Select pan value of a channel
* @param channelType Type of the channel
* @param channel Channel number
* @param busType Type of the bus
* @param bus bus number
*/
export declare const selectPan: Selector<number>;
/**
* Select mute value of a channel
* @param channelType
* @param channel
* @param busType
* @param bus
*/
export declare const selectMute: Selector<boolean>;
/**
* Select solo value of a channel
* @param channelType
* @param channel
*/
export declare const selectSolo: Selector<boolean>;
/**
* Select fader value of a channel
* @param channelType
* @param channel
* @param busType
* @param bus
*/
export declare const selectFaderValue: Selector<number>;
/**
* Select delay value of a master channel in ms
* @param channelType
* @param channel
*/
export declare const selectDelayValue: Selector<number>;
/**
* Select "post" value of a send channel
* @param channelType
* @param channel
*/
export declare const selectPost: Selector<boolean>;
/**
* Select "postproc" value of a send channel
* @param channelType
* @param channel
* @param busType
* @param bus
*/
export declare const selectPostProc: Selector<boolean>;
/**
* Select BPM value of an FX bus
* @param bus
*/
export declare const selectFxBpm: Selector<number>;
/**
* Select FX type of an FX bus
* @param channelType
* @param channel
*/
export declare const selectFxType: Selector<FxType>;
/**
* Select stereo index of a channel.
* This will be -1 when no stereo link is active, 0 when the channel is left in the link, 1 if it's right
* @param channelType
* @param channel
*/
export declare const selectStereoIndex: Selector<number>;
/**
* Select whether an AUX bus is currently configured as a matrix bus.
* Only available on the Ui24R. Returns `true` or `false`.
* @param bus AUX/matrix bus number
*/
export declare const selectMatrix: Selector<boolean>;
/**
* Select phantom power state of a hardware channel
* @param channel
* @param key Type of the channel: `hw` or `i`, according to the mixer model
*/
export declare const selectPhantom: Selector<boolean>;
/**
* Select linear gain level of a channel
* @param channel
* @param key Type of the channel: `hw` or `i`, according to the mixer model
*/
export declare const selectGain: Selector<number>;
/**
* Select fader value of a volume bus (headphones or solo)
* @param busName Name of the bus in the "settings" part of the state
* @param busId Optional ID of the bus
*/
export declare const selectVolumeBusValue: Selector<number>;
/**************
* PLAYER
*************/
/** Select player current length */
export declare const selectPlayerLength: Selector<number>;
/** Select player current position */
export declare const selectPlayerCurrentTrackPos: Selector<number>;
/** Select player elapsed time */
export declare const selectPlayerElapsedTime: Selector<number>;
/** Select player remaining time */
export declare const selectPlayerRemainingTime: Selector<number>;
/**************
* MULTITRACK
*************/
/** Select player current length */
export declare const selectMtkLength: Selector<number>;
/** Select player current position */
export declare const selectMtkCurrentTrackPos: Selector<number>;
/** Select player elapsed time */
export declare const selectMtkElapsedTime: Selector<number>;
/** Select player remaining time */
export declare const selectMtkRemainingTime: Selector<number>;
export {};