Ardour  8.7-14-g57a6773833
dispatcher.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2020 Luciano Iam <oss@lucianoiam.com>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License along
15  * with this program; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17  */
18 
19 #ifndef _ardour_surface_websockets_dispatcher_h_
20 #define _ardour_surface_websockets_dispatcher_h_
21 
22 #include <boost/unordered_map.hpp>
23 
24 #include "client.h"
25 #include "component.h"
26 #include "message.h"
27 
28 namespace ArdourSurface {
29 
31 {
32 public:
34  : SurfaceComponent (surface){};
35  virtual ~WebsocketsDispatcher (){};
36 
39 
40 private:
42  typedef boost::unordered_map<std::string, DispatcherMethod> NodeMethodMap;
43 
45 
54 
55  void update (Client, std::string, TypedValue);
56  void update (Client, std::string, uint32_t, TypedValue);
57  void update (Client, std::string, uint32_t, uint32_t, TypedValue);
58  void update (Client, std::string, uint32_t, uint32_t, uint32_t, TypedValue);
59  void update (Client, std::string, const AddressVector&, const ValueVector&);
60 };
61 
62 } // namespace ArdourSurface
63 
64 #endif // _ardour_surface_websockets_dispatcher_h_
void strip_pan_handler(Client, const NodeStateMessage &)
void(WebsocketsDispatcher::* DispatcherMethod)(Client, const NodeStateMessage &)
Definition: dispatcher.h:41
void update(Client, std::string, const AddressVector &, const ValueVector &)
void transport_roll_handler(Client client, const NodeStateMessage &)
void transport_record_handler(Client client, const NodeStateMessage &)
void update(Client, std::string, uint32_t, TypedValue)
void strip_mute_handler(Client, const NodeStateMessage &)
void dispatch(Client, const NodeStateMessage &)
boost::unordered_map< std::string, DispatcherMethod > NodeMethodMap
Definition: dispatcher.h:42
void update(Client, std::string, TypedValue)
void transport_tempo_handler(Client, const NodeStateMessage &)
void strip_plugin_enable_handler(Client, const NodeStateMessage &)
void strip_gain_handler(Client, const NodeStateMessage &)
static NodeMethodMap _node_to_method
Definition: dispatcher.h:44
WebsocketsDispatcher(ArdourSurface::ArdourWebsockets &surface)
Definition: dispatcher.h:33
void strip_plugin_param_value_handler(Client, const NodeStateMessage &)
void update(Client, std::string, uint32_t, uint32_t, TypedValue)
void update(Client, std::string, uint32_t, uint32_t, uint32_t, TypedValue)
struct lws * Client
Definition: client.h:28
std::vector< uint32_t > AddressVector
Definition: state.h:52
std::vector< TypedValue > ValueVector
Definition: state.h:53