reaper-osc
Version:
Controls Cockos Reaper using OSC
137 lines (136 loc) • 4.79 kB
TypeScript
/** Contains classes for controlling tracks in Reaper
* @module
*/
import { TrackFx } from './Fx';
import { INotifyPropertyChanged } from './Notify';
import { ISendOscMessage, OscMessage } from './Messages';
/** A Reaper track */
export declare class Track implements INotifyPropertyChanged {
readonly trackNumber: number;
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 _handlers;
private readonly _sendOscMessage;
/**
* @param trackNumber The track's number in the current bank
* @param numberOfFx The number of FX per FX bank
* @param sendOscMessage A callback used to send OSC messages to Reaper
*/
constructor(trackNumber: number, numberOfFx: number, sendOscMessage: ISendOscMessage);
/** Deselect the track */
deselect(): void;
/** The track's current FX back */
get fx(): TrackFx[];
/** Indicates whether the track is muted */
get isMuted(): boolean;
/** Indicates whether the track is armed for recording */
get isRecordArmed(): boolean;
/** Indicates whether the track is selected*/
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;
/**
* Receive and handle an OSC message
* @param message The message to be handled
*/
receive(message: OscMessage): boolean;
/** 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 of the track
* @example
* ```typescript
* // Change the track name to 'Guitar'
* track.rename('Guitar');
* ```
*/
rename(name: string): void;
/** Select the track */
select(): void;
/**
* Set the record monitoring mode
* @param {RecordMonitorMode} value
* */
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;
private initHandlers;
/** The OSC address of the track */
private get oscAddress();
}
export declare enum RecordMonitoringMode {
/** Record monitoring disabled */
OFF = 0,
/** Record monitoring enabled */
ON = 1,
/** Tape auto style */
AUTO = 2
}