4#include "jpatcher_api.h"
8#include <ossia/detail/fmt.hpp>
10#include <ossia/network/domain/domain.hpp>
12#include <ossia-max/src/client.hpp>
13#include <ossia-max/src/model.hpp>
14#include <ossia-max/src/object_base.hpp>
15#include <ossia-max/src/ossia-max.hpp>
16#include <ossia-max/src/parameter.hpp>
17#include <ossia-max/src/remote.hpp>
18#include <ossia-max/src/view.hpp>
24void object_namespace(object_base* x);
33std::vector<object_base*> find_children_to_register(
34 t_object*
object, t_object* patcher, t_symbol* classname,
bool search_dev =
false);
42void register_children_in_patcher_recursively(
43 t_object* root_patcher, object_base* caller);
51long get_poly_index(t_object* patcher);
56t_object* get_patcher(t_object*
object);
62void update_path_recursively(t_object* patcher);
66std::vector<std::string> parse_tags_symbol(t_symbol** tags_symbol,
long size);
73std::vector<ossia::net::generic_device*> get_all_devices();
80ossia::net::address_scope get_address_scope(ossia::string_view addr);
88std::vector<ossia::value> attribute2value(t_atom* atom,
long size);
115std::vector<ossia::max_binding::matcher*>
118ossia::value atom2value(t_symbol* s,
int argc, t_atom* argv);
126 std::vector<ossia::net::priority> priorities;
128 friend std::ostream& operator<<(std::ostream& output,
const node_priority& n)
130 output << object_classname(n.obj->get_owner())->s_name <<
"\t"
131 << n.obj->get_node()->get_name() <<
"\t";
132 for(
auto p : n.priorities)
143void fire_values_by_priority(
144 std::vector<node_priority>& priority_graph,
bool only_default);
151void output_all_values(t_object* patcher,
bool only_default);
154void address_mess_cb(T* x, t_symbol* address)
156 x->save_children_state();
158 x->m_addr_scope = ossia::net::get_address_scope(x->m_name->s_name);
160 x->m_node_selection.clear();
161 x->m_matchers.clear();
162 x->do_registration();
166 case object_class::view:
167 case object_class::model:
168 register_children_in_patcher_recursively(x->m_patcher, x);
169 output_all_values(x->m_patcher,
false);
171 case object_class::param:
172 for(
const auto& m : x->m_matchers)
174 auto param = m->get_node()->get_parameter();
175 param->push_value(param->value());
178 case object_class::remote:
179 for(
const auto& m : x->m_matchers)
181 auto param = m->get_node()->get_parameter();
182 auto val = param->value();
183 m->output_value(val);
193 template <
typename T>
194 void operator()(ossia::domain_base<T>& d)
199 A_SETFLOAT(x->m_range, *d.min);
200 A_SETFLOAT(x->m_range + 1, *d.max);
206 A_SETFLOAT(x->m_min, *d.min);
212 A_SETFLOAT(x->m_max, *d.max);
215 void operator()(ossia::domain_base<bool>& d)
219 void operator()(ossia::domain_base<impulse>& d)
223 void operator()(ossia::domain_base<std::string> d)
225 if(!d.values.empty())
227 x->m_range_size = d.values.size() > OSSIA_MAX_MAX_ATTR_SIZE
228 ? OSSIA_MAX_MAX_ATTR_SIZE
231 for(
const auto& s : d.values)
233 auto sym = gensym(s.c_str());
234 A_SETSYM(x->m_range + i, sym);
236 if(i == x->m_range_size)
241 void operator()(ossia::domain_base<ossia::value> d)
250 if(!d.values.empty())
255 template <std::
size_t N>
256 void operator()(ossia::vecf_domain<N>& d)
258 x->m_min_size = d.min.size() > OSSIA_MAX_MAX_ATTR_SIZE ? OSSIA_MAX_MAX_ATTR_SIZE
260 x->m_max_size = d.max.size() > OSSIA_MAX_MAX_ATTR_SIZE ? OSSIA_MAX_MAX_ATTR_SIZE
263 for(
int i = 0; i < x->m_max_size; i++)
264 atom_setfloat(&x->m_max[i], *d.max[i]);
266 for(
int i = 0; i < x->m_min_size; i++)
267 atom_setfloat(&x->m_min[i], *d.min[i]);
270 if(x->m_min_size == x->m_max_size && x->m_min_size > 1)
273 for(
int i = 1; i < x->m_min_size && flag; i++)
275 flag |= *d.min[0] == *d.min[i];
276 flag |= *d.max[0] == *d.max[i];
283 atom_setfloat(&x->m_range[0], *d.min[0]);
284 atom_setfloat(&x->m_range[1], *d.max[0]);
289 void operator()(ossia::vector_domain& d)
291 x->m_min_size = d.min.size() > OSSIA_MAX_MAX_ATTR_SIZE ? OSSIA_MAX_MAX_ATTR_SIZE
293 x->m_max_size = d.max.size() > OSSIA_MAX_MAX_ATTR_SIZE ? OSSIA_MAX_MAX_ATTR_SIZE
296 std::vector<t_atom> vamin, vamax;
297 value2atom minvisitor{vamin}, maxvisitor{vamax};
298 for(
const auto& v : d.
min)
300 for(
int i = 0; i < vamin.size(); i++)
301 x->m_min[i] = vamin[i];
303 for(
const auto& v : d.
max)
305 for(
int i = 0; i < vamax.size(); i++)
306 x->m_max[i] = vamax[i];
311 void operator()() { }
The node_base class.
Definition node.hpp:48
The value class.
Definition value.hpp:173
OSSIA_INLINE constexpr auto min(const T a, const U b) noexcept -> typename std::conditional<(sizeof(T) > sizeof(U)), T, U >::type
min function tailored for values
Definition math.hpp:125
val_type
Enum to represent the types that a value can take.
Definition parameter_properties.hpp:16
bounding_mode
Address behaviors at crossing domain boundaries.
Definition parameter_properties.hpp:56
access_mode
Address behaviors at crossing domain boundaries time.
Definition parameter_properties.hpp:46
OSSIA_INLINE constexpr auto max(const T a, const U b) noexcept -> typename std::conditional<(sizeof(T) > sizeof(U)), T, U >::type
max function tailored for values
Definition math.hpp:96