WebSockets: add transport methods to client JS
This commit is contained in:
parent
dc97bf3ff0
commit
1d84cc0046
@ -30,6 +30,9 @@
|
||||
|
||||
// Globals
|
||||
onTempo (bpm) {}
|
||||
onPositionTime (seconds) {}
|
||||
onTransportRoll (value) {}
|
||||
onRecordState (value) {}
|
||||
|
||||
// Strips
|
||||
onStripDescription (stripId, name) {}
|
||||
|
@ -25,6 +25,14 @@ export class ControlMixin {
|
||||
async getTempo () {
|
||||
return await this._sendRecvSingle(ANode.TEMPO);
|
||||
}
|
||||
|
||||
async getTransportRoll () {
|
||||
return await this._sendRecvSingle(ANode.TRANSPORT_ROLL);
|
||||
}
|
||||
|
||||
async getRecordState () {
|
||||
return await this._sendRecvSingle(ANode.RECORD_STATE);
|
||||
}
|
||||
|
||||
async getStripGain (stripId) {
|
||||
return await this._sendRecvSingle(ANode.STRIP_GAIN, [stripId]);
|
||||
@ -50,6 +58,14 @@ export class ControlMixin {
|
||||
this._send(ANode.TEMPO, [], [bpm]);
|
||||
}
|
||||
|
||||
setTransportRoll (value) {
|
||||
this._send(ANode.TRANSPORT_ROLL, [], [value]);
|
||||
}
|
||||
|
||||
setRecordState (value) {
|
||||
this._send(ANode.RECORD_STATE, [], [value]);
|
||||
}
|
||||
|
||||
setStripGain (stripId, db) {
|
||||
this._send(ANode.STRIP_GAIN, [stripId], [db]);
|
||||
}
|
||||
|
@ -20,6 +20,9 @@ export const JSON_INF = 1.0e+128;
|
||||
|
||||
export const ANode = Object.freeze({
|
||||
TEMPO: 'tempo',
|
||||
POSITION_TIME: 'position_time',
|
||||
TRANSPORT_ROLL: 'transport_roll',
|
||||
RECORD_STATE: 'record_state',
|
||||
STRIP_DESC: 'strip_desc',
|
||||
STRIP_METER: 'strip_meter',
|
||||
STRIP_GAIN: 'strip_gain',
|
||||
|
Loading…
Reference in New Issue
Block a user