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

@ -19,15 +19,15 @@
export const JSON_INF = 1.0e+128;
export const ANode = Object.freeze({
TEMPO: 'tempo',
STRIP_DESC: 'strip_desc',
STRIP_METER: 'strip_meter',
STRIP_GAIN: 'strip_gain',
STRIP_PAN: 'strip_pan',
STRIP_MUTE: 'strip_mute',
STRIP_PLUGIN_DESC: 'strip_plugin_desc',
STRIP_PLUGIN_ENABLE: 'strip_plugin_enable',
STRIP_PLUGIN_PARAM_DESC: 'strip_plugin_param_desc',
TEMPO: 'tempo',
STRIP_DESC: 'strip_desc',
STRIP_METER: 'strip_meter',
STRIP_GAIN: 'strip_gain',
STRIP_PAN: 'strip_pan',
STRIP_MUTE: 'strip_mute',
STRIP_PLUGIN_DESC: 'strip_plugin_desc',
STRIP_PLUGIN_ENABLE: 'strip_plugin_enable',
STRIP_PLUGIN_PARAM_DESC: 'strip_plugin_param_desc',
STRIP_PLUGIN_PARAM_VALUE: 'strip_plugin_param_value'
});
@ -49,7 +49,7 @@ export class Message {
}
}
static hash (node, addr) {
static nodeAddrId (node, addr) {
return [node].concat(addr || []).join('_');
}
@ -74,8 +74,8 @@ export class Message {
return JSON.stringify({node: this.node, addr: this.addr, val: val});
}
get hash () {
return Message.hash(this.node, this.addr);
get nodeAddrId () {
return Message.nodeAddrId(this.node, this.addr);
}
toString () {