diff options
author | Luciano Iam <lucianito@gmail.com> | 2020-04-12 12:38:49 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2020-04-13 16:29:39 +0200 |
commit | dbbd3b0eafbaa0f36cc6ffc8ff5610224ffbef6d (patch) | |
tree | d4f17301f7d3746901687a0dfe907d3a7a07e251 /share | |
parent | 2b8e9ceb891d7a46554d691661e17974989270bc (diff) |
WebSockets: export Node constants in channel.js
Diffstat (limited to 'share')
-rw-r--r-- | share/web_surfaces/shared/channel.js | 19 |
1 files changed, 17 insertions, 2 deletions
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); |