WebSockets: improve JS client and demo

add methods to callback.js
automatically reconnect js client on disconnection
mixer-demo do not recreate UI on reconnection
NO-OP: indentation in message.js
make client JS reconnection optional
fix mixer-demo scrolling
minor JS client refactor
improve mixer-demo readability
This commit is contained in:
Luciano Iam 2020-04-14 22:58:44 +02:00 committed by Robin Gareus
parent 612c71aa25
commit 50ba8dea96
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04
9 changed files with 191 additions and 145 deletions

View file

@ -23,27 +23,27 @@ import { ANode } from './message.js';
export class ControlMixin {
async getTempo () {
return (await this._sendAndReceive(ANode.TEMPO))[0];
return await this._sendRecvSingle(ANode.TEMPO);
}
async getStripGain (stripId) {
return (await this._sendAndReceive(ANode.STRIP_GAIN, [stripId]))[0];
return await this._sendRecvSingle(ANode.STRIP_GAIN, [stripId]);
}
async getStripPan (stripId) {
return (await this._sendAndReceive(ANode.STRIP_PAN, [stripId]))[0];
return await this._sendRecvSingle(ANode.STRIP_PAN, [stripId]);
}
async getStripMute (stripId) {
return (await this._sendAndReceive(ANode.STRIP_MUTE, [stripId]))[0];
return await this._sendRecvSingle(ANode.STRIP_MUTE, [stripId]);
}
async getStripPluginEnable (stripId, pluginId) {
return (await this._sendAndReceive(ANode.STRIP_PLUGIN_ENABLE, [stripId, pluginId]))[0];
return await this._sendRecvSingle(ANode.STRIP_PLUGIN_ENABLE, [stripId, pluginId]);
}
async getStripPluginParamValue (stripId, pluginId, paramId) {
return (await this._sendAndReceive(ANode.STRIP_PLUGIN_PARAM_VALUE, [stripId, pluginId, paramId]))[0];
return await this._sendRecvSingle(ANode.STRIP_PLUGIN_PARAM_VALUE, [stripId, pluginId, paramId]);
}
setTempo (bpm) {