From dbbd3b0eafbaa0f36cc6ffc8ff5610224ffbef6d Mon Sep 17 00:00:00 2001 From: Luciano Iam Date: Sun, 12 Apr 2020 12:38:49 +0200 Subject: WebSockets: export Node constants in channel.js --- share/web_surfaces/shared/channel.js | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'share') diff --git a/share/web_surfaces/shared/channel.js b/share/web_surfaces/shared/channel.js index 89b223ac18..2bec7f6795 100644 --- a/share/web_surfaces/shared/channel.js +++ b/share/web_surfaces/shared/channel.js @@ -16,12 +16,27 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -const JSON_INF = 1.0e+128; +export const JSON_INF = 1.0e+128; + +export const Node = 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", + STRUP_PLUGIN_PARAM_DESC: "strip_plugin_param_desc", + STRIP_PLUGIN_PARAM_VALUE: "strip_plugin_param_value" +}); + export function nodeAddressHash(node, addr) { return [node].concat(addr).join('_'); } + export class MessageChannel { constructor (host) { @@ -81,7 +96,7 @@ export class Message { } } } - + static fromJsonText (jsonText) { let rawMsg = JSON.parse(jsonText); return new Message(rawMsg.node, rawMsg.addr || [], rawMsg.val); -- cgit v1.2.3