From 50ba8dea96415f651b5173c017592dd46a2541ec Mon Sep 17 00:00:00 2001 From: Luciano Iam Date: Tue, 14 Apr 2020 22:58:44 +0200 Subject: 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 --- libs/surfaces/websockets/dispatcher.cc | 11 +++++------ libs/surfaces/websockets/server.cc | 6 +++--- 2 files changed, 8 insertions(+), 9 deletions(-) (limited to 'libs/surfaces/websockets') diff --git a/libs/surfaces/websockets/dispatcher.cc b/libs/surfaces/websockets/dispatcher.cc index b497c24081..62f64268aa 100644 --- a/libs/surfaces/websockets/dispatcher.cc +++ b/libs/surfaces/websockets/dispatcher.cc @@ -29,13 +29,13 @@ using namespace ARDOUR; #define NODE_METHOD_PAIR(x) (Node::x, &WebsocketsDispatcher::x##_handler) WebsocketsDispatcher::NodeMethodMap - WebsocketsDispatcher::_node_to_method = boost::assign::map_list_of + WebsocketsDispatcher::_node_to_method = boost::assign::map_list_of NODE_METHOD_PAIR (tempo) NODE_METHOD_PAIR (strip_gain) - NODE_METHOD_PAIR (strip_pan) - NODE_METHOD_PAIR (strip_mute) - NODE_METHOD_PAIR (strip_plugin_enable) - NODE_METHOD_PAIR (strip_plugin_param_value); + NODE_METHOD_PAIR (strip_pan) + NODE_METHOD_PAIR (strip_mute) + NODE_METHOD_PAIR (strip_plugin_enable) + NODE_METHOD_PAIR (strip_plugin_param_value); void WebsocketsDispatcher::dispatch (Client client, const NodeStateMessage& msg) @@ -105,7 +105,6 @@ WebsocketsDispatcher::update_all_nodes (Client client) val.push_back (std::string ("i")); val.push_back (pd.lower); val.push_back (pd.upper); - val.push_back (pd.integer_step); } else { val.push_back (std::string ("d")); val.push_back (pd.lower); diff --git a/libs/surfaces/websockets/server.cc b/libs/surfaces/websockets/server.cc index 7f52b261de..8bd7eb178b 100644 --- a/libs/surfaces/websockets/server.cc +++ b/libs/surfaces/websockets/server.cc @@ -92,10 +92,10 @@ WebsocketsServer::WebsocketsServer (ArdourSurface::ArdourWebsockets& surface) #if LWS_LIBRARY_VERSION_MAJOR < 3 /* older libwebsockets does not define mime type for svg files */ memset (&_lws_vhost_opt, 0, sizeof (lws_protocol_vhost_options)); - _lws_vhost_opt.name = ".svg"; - _lws_vhost_opt.value = "image/svg+xml"; + _lws_vhost_opt.name = ".svg"; + _lws_vhost_opt.value = "image/svg+xml"; _lws_mnt_index.extra_mimetypes = &_lws_vhost_opt; - _lws_mnt_user.extra_mimetypes = &_lws_vhost_opt; + _lws_mnt_user.extra_mimetypes = &_lws_vhost_opt; #endif } -- cgit v1.2.3