19 #ifndef _ardour_surface_mcp_http_server_h_
20 #define _ardour_surface_mcp_http_server_h_
26 #include <unordered_map>
28 #include <libwebsockets.h>
62 typedef std::unordered_map<struct lws*, ClientContext>
ClientMap;
70 struct lws_context_creation_info
_info;
80 int callback (
struct lws*,
enum lws_callback_reasons,
void*,
void*,
size_t);
92 static int lws_callback (
struct lws*,
enum lws_callback_reasons,
void*,
void*,
size_t);
int handle_http_writeable(struct lws *, ClientContext &)
int handle_http_body_completion(struct lws *, ClientContext &)
std::thread _service_thread
MCPHttpServer(ARDOUR::Session &, uint16_t port, int debug_level, PBD::EventLoop *event_loop)
int callback(struct lws *, enum lws_callback_reasons, void *, void *, size_t)
std::string dispatch_jsonrpc(const std::string &) const
PBD::EventLoop * _event_loop
int handle_http(struct lws *, ClientContext &)
void set_debug_level(int)
std::atomic< int > _debug_level
static int lws_callback(struct lws *, enum lws_callback_reasons, void *, void *, size_t)
int send_json_headers(struct lws *)
struct lws_protocols _protocols[2]
ClientContext & client(struct lws *)
struct lws_context_creation_info _info
int write_json_response(struct lws *, ClientContext &)
struct lws_context * _context
int handle_http_body(struct lws *, ClientContext &, void *, size_t)
int send_http_status(struct lws *, unsigned int)
void erase_client(struct lws *)
ARDOUR::Session & _session
std::unordered_map< struct lws *, ClientContext > ClientMap
std::string response_body