diff options
author | Luciano Iam <lucianito@gmail.com> | 2020-04-18 15:19:14 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2020-04-20 22:59:16 +0200 |
commit | 1d84cc0046ce2e7c099fed339e79a5eec9c1ba53 (patch) | |
tree | 29eee9767009fe4610f13a64f05b2cd78e6a390b /share | |
parent | dc97bf3ff0b28eb0b532e45049eaf328a5288b88 (diff) |
WebSockets: add transport methods to client JS
Diffstat (limited to 'share')
-rw-r--r-- | share/web_surfaces/shared/callback.js | 3 | ||||
-rw-r--r-- | share/web_surfaces/shared/control.js | 16 | ||||
-rw-r--r-- | share/web_surfaces/shared/message.js | 3 |
3 files changed, 22 insertions, 0 deletions
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', |