OSSIA
Open Scenario System for Interactive Application
monitor.hpp
1 #pragma once
2 #include "search_filter.hpp"
3 
4 #include <ossia-max/src/object_base.hpp>
5 
6 #include <set>
7 
8 namespace ossia
9 {
10 namespace max_binding
11 {
12 
13 #define MAX_NUM_ITEMS 256
14 
15 #pragma mark -
16 #pragma mark t_monitor structure declaration
17 
18 struct monitor
19  : object_base
20  , search_filter
21 {
22  using is_monitor = std::true_type;
23 
24  // argument variables
25  long m_highlight{};
26  long m_depth{0}; // 0 means no depth filtering
27 
28  t_symbol* m_sort{};
29  t_symbol* m_format{};
30  t_symbol* m_method{};
31 
32  std::set<ossia::net::device_base*> m_devices;
33 
34  // ctor / dtor
35  monitor(long argc, t_atom* argv);
36  ~monitor();
37 
38  void stop_monitoring();
39 
40  bool unregister();
41  void parse_args(t_symbol* s, long argc, t_atom* argv);
42 
43  // device callbacks
44  void on_node_created_callback(const ossia::net::node_base& node);
45  void on_node_removing_callback(const ossia::net::node_base& node);
46  void
47  on_node_renamed_callback(const ossia::net::node_base& node, const std::string& name);
48  void on_parameter_created_callback(const ossia::net::parameter_base& addr);
49  void on_parameter_removing_callback(const ossia::net::parameter_base& addr);
50  void on_device_deleted(const ossia::net::node_base&);
51  void handle_modification(
52  const ossia::net::node_base& node, t_symbol* type, t_symbol* action);
53 
54  static void
55  execute_method(ossia::max_binding::monitor* x, t_symbol* s, long argc, t_atom* argv);
56  static void free(ossia::max_binding::monitor* x);
57  static t_max_err
58  notify(monitor* x, t_symbol* s, t_symbol* msg, void* sender, void* data);
59  static void assist(monitor* x, void* b, long m, long a, char* s);
60 
61  static t_symbol* s_monitor;
62  static t_symbol* s_parameter;
63  static t_symbol* s_node;
64  static t_symbol* s_created;
65  static t_symbol* s_removing;
66  static t_symbol* s_renamed;
67 };
68 } // max namespace
69 } // ossia namespace
70 
71 #pragma mark -
72 #pragma mark ossia_monitor class declaration
73 
74 extern "C" {
75 void* ossia_monitor_new(t_symbol* s, long argc, t_atom* argv);
76 }
The node_base class.
Definition: network/base/node.hpp:48
The parameter_base class.
Definition: ossia/network/base/parameter.hpp:48
Definition: git_info.h:7