OSSIA
Open Scenario System for Interactive Application
ossia-max/src/device.hpp
1 #pragma once
2 
3 #include <ossia/network/base/protocol.hpp>
4 
5 #include <ossia-max/src/device_base.hpp>
6 
7 namespace ossia
8 {
9 namespace max_binding
10 {
11 
12 class device : public device_base
13 {
14 public:
15  using is_device = std::true_type;
16 
17  static void register_children(device*);
18  static void loadbang(device*);
19 
20  static void expose(device* x, t_symbol*, long argc, t_atom* argv);
21  static void name(device* x, t_symbol*, long argc, t_atom* argv);
22  static void get_protocols(device* x);
23  static void get_oscq_clients(device* x);
24  static void stop_expose(device* x, int index);
25  static void enable_buffering(device* x, int index, int enable);
26  static void send_buffer(device* x, int index);
27  static void get_mess_cb(device* x, t_symbol* s);
28  static void assist(ossia::max_binding::device*, void*, long, long, char*);
29  static void send_raw_osc(device* x, t_symbol* s, int argc, t_atom* argv);
30  static void resend_all_values(device* x, t_symbol* s);
31 
32  static void* create(t_symbol*, long, t_atom*);
33  static void destroy(ossia::max_binding::device*);
34  static void class_setup(t_class* c);
35 };
36 
37 namespace protocol_settings
38 {
39 
40 struct minuit
41 {
42  std::string remoteip{"localhost"};
43  unsigned int remoteport = 13579;
44  unsigned int localport = 9998;
45 };
46 
47 struct oscquery
48 {
49  unsigned int oscport = 9999;
50  unsigned int wsport = 5678;
51 };
52 
53 struct osc
54 {
55  std::string remoteip{"localhost"};
56  unsigned int remoteport = 9997;
57  unsigned int localport = 9996;
58 };
59 
60 static void print_protocol_help()
61 {
62  post("expose <protocol> <args> ...");
63  post("Available protocols (case sensitive): Minuit, oscquery, osc");
64 
65  post("Protocols parameters :");
66 
67  post(
68  "Minuit <remoteip> <remoteport> <localport> :\n"
69  "\tremoteip (symbol): ip of target device\n"
70  "\tremoteport (int): port on which packet should be send\n"
71  "\tlocalport (int): port to which this device is listening");
72 
73  post(
74  "oscquery <oscport> <wsport> :\n"
75  "\toscport (int) : port on which osc packet are sent\n"
76  "\twsport (int) : WebSocket port on which distant application will "
77  "connect.");
78 
79  post(
80  "osc <remoteip> <remoteport> <localpoort>\n"
81  "\tremoteip (symbol): ip of target device\n"
82  "\tremoteport (int): port on which packet should be send\n"
83  "\tlocalport (int): port this device is listening.");
84 }
85 
86 } // protocol_setting namespace
87 } // max namespace
88 } // ossia namespace
Definition: git_info.h:7