UNPKG

reaper-osc

Version:
150 lines (149 loc) 5.63 kB
/** * Contains classes for the OSC device's currently selected track * @module */ import { Fx } from './Fx'; import { SelectedTrackSend } from './Send'; import { SelectedTrackReceive } from './Receive'; import { INotifyPropertyChanged } from './Notify'; import { ReaperOscEvent, RecordMonitoringMode } from './Client/Events'; import { ReaperOscCommand } from './Client/Commands'; declare type SendCommand = (command: ReaperOscCommand) => void; /** * The OSC device's currently selected track. * * Receives state via the `/track/` (no index) address space, which Reaper populates * with a full sync burst whenever the device's focused track changes. * * @see {@link DeviceState.selectTrack} to change which track is selected */ export declare class SelectedTrack implements INotifyPropertyChanged { private _isMuted; private _isRecordArmed; private _isSelected; private _isSoloed; private _name; private _pan; private _pan2; private _panMode; private _recordMonitoring; private _volumeDb; private _volumeFaderPosition; private _vu; private _vuLeft; private _vuRight; private readonly _fx; private readonly _selectedFx; private readonly _sends; private readonly _receives; private readonly _send; /** * @param numberOfFx The number of FX slots in the device FX bank * @param numberOfSends The number of sends in the device send bank * @param numberOfReceives The number of receives in the device receive bank * @param send A callback used to send typed commands to Reaper */ constructor(numberOfFx: number, numberOfSends: number, numberOfReceives: number, send: SendCommand); /** Deselect this track in Reaper */ deselect(): void; /** The FX bank for this track */ get fx(): ReadonlyArray<Fx>; /** The sends for this track */ get sends(): ReadonlyArray<SelectedTrackSend>; /** The receives for this track */ get receives(): ReadonlyArray<SelectedTrackReceive>; /** * Handle a typed incoming event * @param event The event to handle */ handleEvent(event: ReaperOscEvent): void; /** Indicates whether the track is muted */ get isMuted(): boolean; /** Indicates whether the track is armed for recording */ get isRecordArmed(): boolean; /** * Indicates whether this track is selected in the Reaper project. * @see {@link DeviceState.selectTrack} to change the device's focused track */ get isSelected(): boolean; /** Indicates whether the track is soloed */ get isSoloed(): boolean; /** Mute the track */ mute(): void; /** The track name */ get name(): string; onPropertyChanged(property: string, callback: () => void): () => void; /** A floating-point value between -1 and 1 that indicates the pan position, with -1 being 100% left and 1 being 100% right */ get pan(): number; /** A floating-point value between -1 and 1 that indicates the pan 2 position, with -1 being 100% left and 1 being 100% right */ get pan2(): number; /** The current pan mode */ get panMode(): string; /** Arm the track for recording */ recordArm(): void; /** Indicates the record monitoring mode */ get recordMonitoring(): RecordMonitoringMode; /** Disarm track recording */ recordDisarm(): void; /** * Renames the track * @param name The new name for the track */ rename(name: string): void; /** * Select this track in Reaper. * Note: this selects the track in the Reaper project. To change which track the * device is focused on, use {@link DeviceState.selectTrack} instead. */ select(): void; /** The device's currently focused FX on this track */ get selectedFx(): Fx; /** * Set the record monitoring mode * @param value The monitoring mode to set */ setMonitoringMode(value: RecordMonitoringMode): void; /** * Sets the pan * @param value A floating-point value between -1 and 1, where -1 is 100% left and 1 is 100% right */ setPan(value: number): void; /** * Sets the pan 2 * @param value A floating-point value between -1 and 1, where -1 is 100% left and 1 is 100% right */ setPan2(value: number): void; /** * Sets the volume to a specific dB value. * @param value Value (in dB) to set the volume to. Valid range is -100 to 12. */ setVolumeDb(value: number): void; /** * Sets the volume by moving the fader to a specific position * @param position A value for the fader position between 0 and 1, where 0 is all the way down and 1 is all the way up */ setVolumeFaderPosition(position: number): void; /** Solo the track */ solo(): void; /** Toggle mute on/off */ toggleMute(): void; /** Toggle record arm on/off */ toggleRecordArm(): void; /** Toggle solo on/off */ toggleSolo(): void; /** Unmute the track */ unmute(): void; /** Unsolo the track */ unsolo(): void; /** The track volume in dB */ get volumeDb(): number; /** A floating-point value between 0 and 1 that indicates the fader position, with 0 being all the way down and 1 being all the way up */ get volumeFaderPosition(): number; /** A floating-point value between 0 and 1 that indicates the VU level */ get vu(): number; /** A floating-point value between 0 and 1 that indicates the Left VU level */ get vuLeft(): number; /** A floating-point value between 0 and 1 that indicates the Right VU level */ get vuRight(): number; } export {};