From 1d84cc0046ce2e7c099fed339e79a5eec9c1ba53 Mon Sep 17 00:00:00 2001 From: Luciano Iam Date: Sat, 18 Apr 2020 15:19:14 +0200 Subject: WebSockets: add transport methods to client JS --- share/web_surfaces/shared/callback.js | 3 +++ share/web_surfaces/shared/control.js | 16 ++++++++++++++++ share/web_surfaces/shared/message.js | 3 +++ 3 files changed, 22 insertions(+) (limited to 'share') diff --git a/share/web_surfaces/shared/callback.js b/share/web_surfaces/shared/callback.js index ca1f33e437..b50a70878f 100644 --- a/share/web_surfaces/shared/callback.js +++ b/share/web_surfaces/shared/callback.js @@ -30,6 +30,9 @@ // Globals onTempo (bpm) {} + onPositionTime (seconds) {} + onTransportRoll (value) {} + onRecordState (value) {} // Strips onStripDescription (stripId, name) {} diff --git a/share/web_surfaces/shared/control.js b/share/web_surfaces/shared/control.js index 94ffa0a83d..13dbdfa695 100644 --- a/share/web_surfaces/shared/control.js +++ b/share/web_surfaces/shared/control.js @@ -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]); } diff --git a/share/web_surfaces/shared/message.js b/share/web_surfaces/shared/message.js index 0252c9fa63..9391fab4b4 100644 --- a/share/web_surfaces/shared/message.js +++ b/share/web_surfaces/shared/message.js @@ -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', -- cgit v1.2.3