2 #include <ossia/detail/string_view.hpp>
3 #include <ossia/network/base/node.hpp>
5 #include <ossia/network/base/parameter.hpp>
6 #include <ossia/network/common/parameter_properties.hpp>
7 #include <ossia/network/oscquery/detail/typetag.hpp>
9 #include <boost/mp11/list.hpp>
17 namespace ossia::oscquery
27 constexpr
auto osc_ip()
31 constexpr
auto osc_port()
35 constexpr
auto ws_ip()
39 constexpr
auto ws_port()
43 constexpr
auto transport()
47 constexpr
auto attribute_full_path()
52 constexpr
auto attribute_typetag()
56 constexpr
auto contents()
61 constexpr
auto attribute_value()
65 constexpr
auto attribute_range()
69 constexpr
auto attribute_clipmode()
73 constexpr
auto attribute_accessmode()
77 constexpr
auto attribute_description()
81 constexpr
auto attribute_tags()
87 constexpr
auto attribute_unit()
91 constexpr
auto attribute_refresh_rate()
93 return "REFRESH_RATE";
95 constexpr
auto attribute_priority()
99 constexpr
auto attribute_step_size()
103 constexpr
auto attribute_instance_bounds()
105 return "INSTANCE_BOUNDS";
107 constexpr
auto attribute_critical()
111 constexpr
auto attribute_hidden()
115 constexpr
auto attribute_disabled()
119 constexpr
auto attribute_extended_type()
121 return "EXTENDED_TYPE";
123 constexpr
auto attribute_repetition_filter()
125 return "REPETITION_FILTER";
127 constexpr
auto attribute_default_value()
129 return "DEFAULT_VALUE";
131 constexpr
auto attribute_app_name()
135 constexpr
auto attribute_app_version()
137 return "APP_VERSION";
139 constexpr
auto attribute_app_creator()
141 return "APP_CREATOR";
145 constexpr
auto command()
149 constexpr
auto data()
154 constexpr
auto path_added()
158 constexpr
auto path_removed()
160 return "PATH_REMOVED";
162 constexpr
auto path_renamed()
164 return "PATH_RENAMED";
166 constexpr
auto path_changed()
168 return "PATH_CHANGED";
170 constexpr
auto attributes_changed()
172 return "ATTRIBUTES_CHANGED";
176 constexpr
auto add_node()
178 constexpr_return(ossia::make_string_view(
"ADD_NODE"));
180 constexpr
auto remove_node()
182 constexpr_return(ossia::make_string_view(
"REMOVE_NODE"));
184 constexpr
auto rename_node()
186 constexpr_return(ossia::make_string_view(
"RENAME_NODE"));
188 constexpr
auto node_name()
190 constexpr_return(ossia::make_string_view(
"NAME"));
192 constexpr
auto start_osc_streaming()
194 constexpr_return(ossia::make_string_view(
"START_OSC_STREAMING"));
196 constexpr
auto local_server_port()
198 constexpr_return(ossia::make_string_view(
"LOCAL_SERVER_PORT"));
200 constexpr
auto local_sender_port()
202 constexpr_return(ossia::make_string_view(
"LOCAL_SENDER_PORT"));
204 constexpr
auto listen()
206 constexpr_return(ossia::make_string_view(
"LISTEN"));
208 constexpr
auto ignore()
210 constexpr_return(ossia::make_string_view(
"IGNORE"));
212 constexpr
auto text_true()
214 constexpr_return(ossia::make_string_view(
"TRUE"));
216 constexpr
auto text_false()
218 constexpr_return(ossia::make_string_view(
"FALSE"));
220 constexpr
auto query_value()
222 constexpr_return(ossia::make_string_view(
"?VALUE"));
225 struct OSSIA_EXPORT full_path_attribute
227 using type = std::string;
228 static auto text() {
return detail::attribute_full_path(); }
232 struct OSSIA_EXPORT typetag_attribute
234 using type = std::string;
235 static auto text() {
return ossia::net::text_value_type(); }
238 return oscquery::get_osc_typetag(n);
242 return oscquery::set_osc_typetag(n, t);
246 template <
typename Attr>
251 struct metadata<full_path_attribute>
253 static constexpr
auto key() {
return detail::attribute_full_path(); }
256 struct metadata<typetag_attribute>
258 static constexpr
auto key() {
return detail::attribute_typetag(); }
263 struct metadata<net::value_attribute>
265 static constexpr
auto key() {
return detail::attribute_value(); }
268 struct metadata<net::domain_attribute>
270 static constexpr
auto key() {
return detail::attribute_range(); }
273 struct metadata<net::access_mode_attribute>
275 static constexpr
auto key() {
return detail::attribute_accessmode(); }
278 struct metadata<net::bounding_mode_attribute>
280 static constexpr
auto key() {
return detail::attribute_clipmode(); }
283 struct metadata<net::unit_attribute>
285 static constexpr
auto key() {
return detail::attribute_unit(); }
288 struct metadata<net::default_value_attribute>
290 static constexpr
auto key() {
return detail::attribute_default_value(); }
293 struct metadata<net::tags_attribute>
295 static constexpr
auto key() {
return detail::attribute_tags(); }
298 struct metadata<net::refresh_rate_attribute>
300 static constexpr
auto key() {
return detail::attribute_refresh_rate(); }
303 struct metadata<net::priority_attribute>
305 static constexpr
auto key() {
return detail::attribute_priority(); }
308 struct metadata<net::value_step_size_attribute>
310 static constexpr
auto key() {
return detail::attribute_step_size(); }
313 struct metadata<net::instance_bounds_attribute>
315 static constexpr
auto key() {
return detail::attribute_instance_bounds(); }
318 struct metadata<net::critical_attribute>
320 static constexpr
auto key() {
return detail::attribute_critical(); }
323 struct metadata<net::hidden_attribute>
325 static constexpr
auto key() {
return detail::attribute_hidden(); }
328 struct metadata<net::disabled_attribute>
330 static constexpr
auto key() {
return detail::attribute_disabled(); }
333 struct metadata<net::extended_type_attribute>
335 static constexpr
auto key() {
return detail::attribute_extended_type(); }
338 struct metadata<net::description_attribute>
340 static constexpr
auto key() {
return detail::attribute_description(); }
343 struct metadata<net::repetition_filter_attribute>
345 static constexpr
auto key() {
return detail::attribute_repetition_filter(); }
348 struct metadata<net::app_version_attribute>
350 static constexpr
auto key() {
return detail::attribute_app_version(); }
353 struct metadata<net::app_creator_attribute>
355 static constexpr
auto key() {
return detail::attribute_app_creator(); }
358 struct metadata<net::app_name_attribute>
360 static constexpr
auto key() {
return detail::attribute_app_name(); }
363 using base_attributes = boost::mp11::mp_list<
364 typetag_attribute, net::value_attribute, net::domain_attribute,
365 net::access_mode_attribute, net::bounding_mode_attribute,
366 net::repetition_filter_attribute, net::unit_attribute, net::default_value_attribute>;
368 using base_attributes_without_type = boost::mp11::mp_list<
369 net::value_attribute, net::domain_attribute, net::access_mode_attribute,
370 net::bounding_mode_attribute, net::repetition_filter_attribute, net::unit_attribute,
371 net::default_value_attribute>;
373 using extended_attributes = boost::mp11::mp_list<
374 net::tags_attribute, net::refresh_rate_attribute, net::priority_attribute,
375 net::value_step_size_attribute, net::instance_bounds_attribute,
376 net::critical_attribute, net::hidden_attribute, net::disabled_attribute,
377 net::extended_type_attribute, net::description_attribute, net::app_name_attribute,
378 net::app_creator_attribute, net::app_version_attribute>;
380 using attributes_when_reading = boost::mp11::mp_list<
381 net::domain_attribute, net::access_mode_attribute, net::bounding_mode_attribute,
382 net::repetition_filter_attribute, net::tags_attribute, net::refresh_rate_attribute,
383 net::priority_attribute, net::value_step_size_attribute,
384 net::instance_bounds_attribute, net::critical_attribute, net::hidden_attribute,
385 net::disabled_attribute, net::description_attribute, net::app_name_attribute,
386 net::app_creator_attribute, net::app_version_attribute>;
388 using all_attributes = boost::mp11::mp_list<
389 typetag_attribute, net::unit_attribute, net::extended_type_attribute,
391 net::value_attribute, net::default_value_attribute,
393 net::domain_attribute, net::access_mode_attribute, net::bounding_mode_attribute,
394 net::repetition_filter_attribute, net::tags_attribute, net::refresh_rate_attribute,
395 net::priority_attribute, net::value_step_size_attribute,
396 net::instance_bounds_attribute, net::critical_attribute, net::hidden_attribute,
397 net::disabled_attribute, net::description_attribute, net::app_name_attribute,
398 net::app_creator_attribute, net::app_version_attribute>;
400 enum class message_type
416 using key_map_type = string_view_map<std::string_view>;
419 OSSIA_EXPORT
const key_map_type& ossia_to_oscquery_key();
422 OSSIA_EXPORT
const key_map_type& oscquery_to_ossia_key();
425 OSSIA_EXPORT std::optional<std::string_view> ossia_to_oscquery_key(std::string_view);
428 OSSIA_EXPORT std::optional<std::string_view> oscquery_to_ossia_key(std::string_view);
The node_base class.
Definition: network/base/node.hpp:48