OSSIA
Open Scenario System for Interactive Application
ossia-max/src/parameter_base.hpp
1 #pragma once
2 #include <ossia-max/src/object_base.hpp>
3 
4 namespace ossia
5 {
6 namespace max_binding
7 {
8 
9 class parameter_base : public object_base
10 {
11 public:
12  static void update_attribute(
13  parameter_base* x, ossia::string_view attribute,
14  const ossia::net::node_base* node);
15  static t_max_err
16  notify(parameter_base* x, t_symbol* s, t_symbol* msg, void* sender, void* data);
17 
18  parameter_base();
19 
20  void output_values(bool only_default);
21 
22  // attribute setting method
23  void set_access_mode();
24  void set_repetition_filter();
25  void set_critical();
26  void set_enable();
27  void set_minmax();
28  void set_range();
29  void set_bounding_mode();
30  void set_default();
31  void set_type();
32  void set_rate();
33  void set_unit();
34  void set_mute();
35 
36  static void class_setup(t_class* c);
37 
38  static void get_mess_cb(parameter_base* x, t_symbol* s);
39  static void get_unit(parameter_base* x, std::vector<matcher*> nodes);
40  static void get_rate(parameter_base* x, std::vector<matcher*> nodes);
41  static void get_mute(parameter_base* x, std::vector<matcher*> nodes);
42  static void get_domain(parameter_base* x, std::vector<matcher*> nodes);
43  static void get_min(parameter_base* x, std::vector<matcher*> nodes);
44  static void get_max(parameter_base* x, std::vector<matcher*> nodes);
45  static void get_bounding_mode(parameter_base* x, std::vector<matcher*> nodes);
46  static void get_default(parameter_base* x, std::vector<matcher*> nodes);
47  static void get_type(parameter_base* x, std::vector<matcher*> nodes);
48  static void get_access_mode(parameter_base* x, std::vector<matcher*> nodes);
49  static void get_repetition_filter(parameter_base* x, std::vector<matcher*> nodes);
50  static void get_critical(parameter_base* x, std::vector<matcher*> nodes);
51  static void get_enable(parameter_base* x, std::vector<matcher*> nodes);
52 
53  // attributes
54  t_symbol* m_type{};
55  t_atom m_default[OSSIA_MAX_MAX_ATTR_SIZE] = {{}};
56  t_atom m_min[OSSIA_MAX_MAX_ATTR_SIZE] = {{}};
57  t_atom m_max[OSSIA_MAX_MAX_ATTR_SIZE] = {{}};
58  t_atom m_range[OSSIA_MAX_MAX_ATTR_SIZE] = {{}};
59  t_symbol* m_bounding_mode{};
60  t_symbol* m_access_mode{};
61  long m_repetitions{1};
62  long m_mute{0};
63  long m_enable{1};
64  long m_critical{0};
65  t_symbol* m_unit{};
66  std::optional<ossia::unit_t> m_local_unit;
67 
68  // size of size-variable attribute
69  long m_default_size{};
70  long m_range_size{};
71  long m_min_size{};
72  long m_max_size{};
73 
74  bool m_set_flag{};
75 
82  static void push(parameter_base* x, t_symbol*, int argc, t_atom* argv);
83 
87  static void push_one(parameter_base* x, t_symbol* s, int argc, t_atom* argv);
88 
93  static void bang(parameter_base* x);
94  static void push_default_value(parameter_base* x);
95 
96  static void set(parameter_base* x, t_symbol* s, int argc, t_atom* argv);
97  static void in_float(parameter_base* x, double f);
98  static void in_int(parameter_base* x, long int f);
99  static void in_symbol(parameter_base* x, t_symbol* f);
100 };
101 
102 } // namespace max
103 } // namespace ossia
The node_base class.
Definition: network/base/node.hpp:48
Definition: git_info.h:7