UNPKG

reaper-osc

Version:
130 lines 4.31 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DeviceState = void 0; /** * Contains classes for controlling Reaper's OSC device state * @module */ const Commands_1 = require("./Client/Commands"); /** Controls the OSC device's navigation state within Reaper */ class DeviceState { constructor(_send) { this._send = _send; } // --- Track --- /** * Set the device's focused track to a specific bank-relative slot. * Reaper will respond with a full state sync burst for the selected track. * @param index 1-based track index within the current device track bank */ selectTrack(index) { this._send(Commands_1.SelectDeviceTrack(index)); } /** Move the device's focused track to the next track in the bank */ nextTrack() { this._send(Commands_1.NextDeviceTrack()); } /** Move the device's focused track to the previous track in the bank */ previousTrack() { this._send(Commands_1.PreviousDeviceTrack()); } // --- Track bank --- /** * Set the active device track bank. * e.g. bank 2 with a bank size of 8 maps `/track/1/` through `/track/8/` to absolute tracks 9-16. * @param index 1-based bank index */ selectTrackBank(index) { this._send(Commands_1.SelectDeviceTrackBank(index)); } /** Move to the next track bank */ nextTrackBank() { this._send(Commands_1.NextDeviceTrackBank()); } /** Move to the previous track bank */ previousTrackBank() { this._send(Commands_1.PreviousDeviceTrackBank()); } // --- FX --- /** * Set the device's focused FX slot on the currently selected track. * @param index 1-based FX index within the current device FX bank */ selectFx(index) { this._send(Commands_1.SelectDeviceFx(index)); } /** Move the device's focused FX to the next slot */ nextFx() { this._send(Commands_1.NextDeviceFx()); } /** Move the device's focused FX to the previous slot */ previousFx() { this._send(Commands_1.PreviousDeviceFx()); } // --- FX param bank --- /** * Set the active FX parameter bank. * @param index 1-based bank index */ selectFxParameterBank(index) { this._send(Commands_1.SelectDeviceFxParameterBank(index)); } /** Move to the next FX parameter bank */ nextFxParameterBank() { this._send(Commands_1.NextDeviceFxParameterBank()); } /** Move to the previous FX parameter bank */ previousFxParameterBank() { this._send(Commands_1.PreviousDeviceFxParameterBank()); } // --- FX instrument param bank --- /** * Set the active FX instrument parameter bank. * @param index 1-based bank index */ selectFxInstrumentParameterBank(index) { this._send(Commands_1.SelectDeviceFxInstrumentParameterBank(index)); } /** Move to the next FX instrument parameter bank */ nextFxInstrumentParameterBank() { this._send(Commands_1.NextDeviceFxInstrumentParameterBank()); } /** Move to the previous FX instrument parameter bank */ previousFxInstrumentParameterBank() { this._send(Commands_1.PreviousDeviceFxInstrumentParameterBank()); } // --- Marker bank --- /** * Set the active marker bank. * @param index 1-based bank index */ selectMarkerBank(index) { this._send(Commands_1.SelectDeviceMarkerBank(index)); } /** Move to the next marker bank */ nextMarkerBank() { this._send(Commands_1.NextDeviceMarkerBank()); } /** Move to the previous marker bank */ previousMarkerBank() { this._send(Commands_1.PreviousDeviceMarkerBank()); } // --- Region bank --- /** * Set the active region bank. * @param index 1-based bank index */ selectRegionBank(index) { this._send(Commands_1.SelectDeviceRegionBank(index)); } /** Move to the next region bank */ nextRegionBank() { this._send(Commands_1.NextDeviceRegionBank()); } /** Move to the previous region bank */ previousRegionBank() { this._send(Commands_1.PreviousDeviceRegionBank()); } } exports.DeviceState = DeviceState; //# sourceMappingURL=Device.js.map