OSSIA
Open Scenario System for Interactive Application
ossia-max/src/client.hpp
1 #pragma once
2 
3 #include <ossia/network/local/local.hpp>
4 #include <ossia/network/oscquery/oscquery_mirror.hpp>
5 #include <ossia/network/zeroconf/zeroconf.hpp>
6 
7 #include <ossia-max/src/device_base.hpp>
8 
9 namespace ossia
10 {
11 namespace max_binding
12 {
13 
14 #pragma mark -
15 #pragma mark t_client structure declaration
16 
17 class client : public device_base
18 {
19 public:
20  using is_client = std::true_type;
21 
22  static void register_children(client*);
23  void unregister_children();
24  static void loadbang(client*);
25 
26  static void print_protocol_help()
27  {
28  post("connect <protocol> <args> ...");
29  post("Available protocols (case sensitive): Minuit, oscquery");
30  post("Protocols parameters :");
31  post(
32  "Minuit <remoteip> <remoteport> <localport> :\n"
33  "\tremoteip (symbol): ip of target device\n"
34  "\tremoteport (float): port on which packet should be send\n"
35  "\tlocalport (float): port to which this device is listening");
36  post(
37  "oscquery <oscport> <wsurl> :\n"
38  "\twsurl (symbol) : url to connect to (default : "
39  "ws://127.0.0.1:5678)\n");
40  post(
41  "osc <remoteip> <remoteport> <localport> :\n"
42  "\tremoteip (symbol): ip of target device\n"
43  "\tremoteport (float): port on which packet should be send\n"
44  "\tlocalport (float): port to which this device is listening");
45  }
46 
47  std::vector<ossia::net::minuit_connection_data> m_minuit_devices;
48  std::vector<ossia::net::oscquery_connection_data> m_oscq_devices;
49 
50  void* m_poll_clock;
51 
52  ossia::oscquery::oscquery_mirror_protocol* m_oscq_protocol{};
53 
54  bool m_zeroconf{true};
55  bool is_zeroconf() const { return m_zeroconf; }
56  std::string get_name() const { return m_name ? std::string(m_name->s_name) : ""; }
57 
58  static void connect(client*);
59  static void connect_mess_cb(client* x, t_symbol*, int argc, t_atom* argv);
60  static void disconnect(client*);
61  static void get_devices(client* x);
62  static void check_thread_status(client* x);
63  static void update(client* x);
64  static void poll_message(client* x);
65  // static void destroy(client* x);
66  // static void* create(t_symbol* name, int argc, t_atom* argv);
67  static void find_devices_async(client* x);
68  static void assist(client*, void*, long, long, char*);
69  static void get_mess_cb(client*, t_symbol*);
70 
71  static void* create(t_symbol*, long, t_atom*);
72  static void destroy(ossia::max_binding::client*);
73 
74  int m_argc{};
75  t_atom* m_argv{};
76 };
77 
78 } // max namespace
79 } // ossia namespace
Definition: git_info.h:7