WebSockets: implement a JavaScript object-oriented client API

Replace previous callback based basic client with an easier
to use object-oriented API that further abstracts the low level
details of the WebSockets Server surface messaging protocol.

All built-in web surface demos were updated to use the new API.
This commit is contained in:
Luciano Iam
2020-05-29 11:37:34 +02:00
committed by Robin Gareus
parent 5296ed141f
commit ae4df127ad
18 changed files with 812 additions and 361 deletions

View File

@@ -55,11 +55,6 @@ WebsocketsDispatcher::dispatch (Client client, const NodeStateMessage& msg)
void
WebsocketsDispatcher::update_all_nodes (Client client)
{
update (client, Node::tempo, globals ().tempo ());
update (client, Node::position_time, globals ().position_time ());
update (client, Node::transport_roll, globals ().transport_roll ());
update (client, Node::record_state, globals ().record_state ());
for (uint32_t strip_n = 0; strip_n < strips ().strip_count (); ++strip_n) {
boost::shared_ptr<Stripable> strip = strips ().nth_strip (strip_n);
@@ -140,6 +135,11 @@ WebsocketsDispatcher::update_all_nodes (Client client)
}
}
}
update (client, Node::tempo, globals ().tempo ());
update (client, Node::position_time, globals ().position_time ());
update (client, Node::transport_roll, globals ().transport_roll ());
update (client, Node::record_state, globals ().record_state ());
}
void