Ardour  9.0-pre0-380-gbbdb6b0e63
client.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_client_h_
20 #define _ardour_surface_websockets_client_h_
21 
22 #include <set>
23 #include <list>
24 
25 #include "message.h"
26 #include "state.h"
27 
28 typedef struct lws* Client;
29 
30 namespace ArdourSurface {
31 
32 typedef std::list<NodeStateMessage> ClientOutputBuffer;
33 
35 {
36 public:
38  : _wsi (wsi){};
39  virtual ~ClientContext (){};
40 
41  Client wsi () const
42  {
43  return _wsi;
44  }
45 
46  bool has_state (const NodeState&);
47  void update_state (const NodeState&);
48 
50  {
51  return _output_buf;
52  }
53 
54  std::string debug_str ();
55 
56 private:
58 
59  typedef std::set<NodeState> ClientState;
61 
63 };
64 
65 } // namespace ArdourSurface
66 
67 #endif // _ardour_surface_websockets_client_h_
ClientOutputBuffer & output_buf()
Definition: client.h:49
bool has_state(const NodeState &)
Client wsi() const
Definition: client.h:41
std::set< NodeState > ClientState
Definition: client.h:59
ClientContext(Client wsi)
Definition: client.h:37
ClientOutputBuffer _output_buf
Definition: client.h:62
void update_state(const NodeState &)
struct lws * Client
Definition: client.h:28
std::list< NodeStateMessage > ClientOutputBuffer
Definition: client.h:32