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