OSSIA
Open Scenario System for Interactive Application
ossia-pd/src/parameter_base.hpp
1 #pragma once
2 #include <ossia-pd/src/object_base.hpp>
3 
4 namespace ossia::pd
5 {
6 
7 class parameter_base : public object_base
8 {
9 public:
10  parameter_base(t_eclass* x);
11 
12  static void update_attribute(
13  parameter_base* x, ossia::string_view attribute,
14  const ossia::net::node_base* node = nullptr);
15 
16  // attribute setting method
17  void set_access_mode();
18  void set_repetition_filter();
19  void set_critical();
20  void set_enable();
21  void set_mute();
22  void set_minmax();
23  void set_range();
24  void set_bounding_mode();
25  void set_default();
26  void set_type();
27  void set_rate();
28  void set_unit();
29 
30  static void class_setup(t_eclass* c);
31  static t_pd_err
32  notify(parameter_base* x, t_symbol* s, t_symbol* msg, void* sender, void* data);
33 
34  static void get_mess_cb(parameter_base* x, t_symbol* s);
35  static void get_unit(parameter_base* x, std::vector<t_matcher*> nodes);
36  static void get_rate(parameter_base* x, std::vector<t_matcher*> nodes);
37  static void get_mute(parameter_base* x, std::vector<t_matcher*> nodes);
38  static void get_domain(parameter_base* x, std::vector<t_matcher*> nodes);
39  static void get_min(parameter_base* x, std::vector<t_matcher*> nodes);
40  static void get_max(parameter_base* x, std::vector<t_matcher*> nodes);
41  static void get_bounding_mode(parameter_base* x, std::vector<t_matcher*> nodes);
42  static void get_default(parameter_base* x, std::vector<t_matcher*> nodes);
43  static void get_type(parameter_base* x, std::vector<t_matcher*> nodes);
44  static void get_priority(parameter_base* x, std::vector<t_matcher*> nodes);
45  static void get_access_mode(parameter_base* x, std::vector<t_matcher*> nodes);
46  static void get_repetition_filter(parameter_base* x, std::vector<t_matcher*> nodes);
47  static void get_critical(parameter_base* x, std::vector<t_matcher*> nodes);
48  static void get_enable(parameter_base* x, std::vector<t_matcher*> nodes);
49  static void get_queue_length(parameter_base* x, std::vector<t_matcher*> nodes);
50 
51  // attributes
52  t_symbol* m_type{};
53  t_atom m_default[OSSIA_PD_MAX_ATTR_SIZE] = {{}};
54  t_atom m_min[OSSIA_PD_MAX_ATTR_SIZE] = {{}};
55  t_atom m_max[OSSIA_PD_MAX_ATTR_SIZE] = {{}};
56  t_atom m_range[OSSIA_PD_MAX_ATTR_SIZE] = {{}};
57  t_symbol* m_bounding_mode{};
58  t_symbol* m_access_mode{};
59  t_float m_repetitions{1};
60  t_float m_critical{0};
61  t_symbol* m_unit{};
62  int m_mute{0};
63  int m_enable{1};
64  std::optional<ossia::unit_t> m_ounit;
65 
66  // size of size-variable attribute
67  long m_default_size{};
68  long m_range_size{};
69  long m_min_size{};
70  long m_max_size{};
71 
78  static void push(parameter_base* x, t_symbol*, int argc, t_atom* argv);
79  static void push_symbol(parameter_base* x, t_symbol* s);
80 
81  static void push_default_value(parameter_base* x);
86  static void bang(parameter_base* x);
87  static void output_value(parameter_base* x);
88 };
89 
90 } // namespace ossia
The node_base class.
Definition: network/base/node.hpp:48