1 #ifndef OSSIA_CPP98_HPP_2017_07_07
2 #define OSSIA_CPP98_HPP_2017_07_07
3 #include <ossia_export.h>
8 #if(__cplusplus >= 201103L) || (defined(_MSC_VER) && (_MSC_VER >= 1900))
9 #define OSSIA_CPP_CXX11
21 struct parameter_data;
85 class oscquery_server;
86 class oscquery_mirror;
112 float& operator[](
int i) {
return data[i]; }
121 float& operator[](
int i) {
return data[i]; }
129 float& operator[](
int i) {
return data[i]; }
203 value(std::vector<opp::value> v);
208 value(std::string v);
213 value(
const char* v);
228 bool is_impulse()
const;
238 bool is_float()
const;
243 bool is_bool()
const;
248 bool is_vec2f()
const;
253 bool is_vec3f()
const;
258 bool is_vec4f()
const;
263 bool is_list()
const;
268 bool is_string()
const;
278 char to_char()
const;
288 float to_float()
const;
293 bool to_bool()
const;
298 vec2f to_vec2f()
const;
303 vec3f to_vec3f()
const;
308 vec4f to_vec4f()
const;
313 std::vector<opp::value> to_list()
const;
318 std::string to_string()
const;
335 value& operator=(
char v);
341 value& operator=(
int v);
347 value& operator=(
float v);
353 value& operator=(
bool v);
377 value& operator=(std::vector<opp::value> v);
383 value& operator=(std::string v);
411 void set_float(
float v);
416 void set_bool(
bool v);
421 void set_vec2f(
vec2f v);
426 void set_vec3f(
vec3f v);
431 void set_vec4f(
vec4f v);
436 void set_list(std::vector<opp::value> v);
441 void set_string(std::string v);
443 #if defined(OSSIA_CPP_CXX11)
465 template <
typename T>
528 operator bool()
const;
581 operator bool()
const;
592 void request_add_child(
const std::string&);
598 void request_remove_child(
const std::string&);
604 void request_rename_child(
const std::string&,
const std::string&);
610 std::string get_name()
const;
615 void set_name(std::string s);
621 bool has_parameter()
const;
627 std::string get_address()
const;
632 std::vector<node> get_namespace()
const;
637 std::vector<node> get_children()
const;
643 node find_child(std::string addr)
const;
650 std::vector<node> find_children(std::string pattern)
const;
656 void remove_child(std::string addr);
660 void remove_children();
673 node create_child(std::string addr);
805 void set_spherical();
812 void set_cylindrical();
817 void set_angle_radian();
822 void set_angle_degree();
829 void set_quaternion();
865 void set_frequency();
870 void set_midi_pitch();
887 node create_void(std::string addr);
894 node create_impulse(std::string addr);
901 node create_int(std::string addr);
908 node create_float(std::string addr);
915 node create_bool(std::string addr);
922 node create_vec2f(std::string addr);
929 node create_vec3f(std::string addr);
936 node create_vec4f(std::string addr);
943 node create_list(std::string addr);
950 node create_string(std::string addr);
957 node create_buffer(std::string addr);
965 node create_filepath(std::string addr);
974 node create_rgb(std::string addr);
983 node create_rgba(std::string addr);
992 node create_rgba8(std::string addr);
1001 node create_argb(std::string addr);
1010 node create_argb8(std::string addr);
1019 node create_hsv(std::string addr);
1027 node create_cart2D(std::string addr);
1035 node create_cart3D(std::string addr);
1044 node create_opengl(std::string addr);
1053 node create_polar(std::string addr);
1062 node create_spherical(std::string addr);
1071 node create_cylindrical(std::string addr);
1080 node create_angle_radian(std::string addr);
1088 node create_angle_degree(std::string addr);
1098 node create_quaternion(std::string addr);
1107 node create_euler(std::string addr);
1116 node create_axis(std::string addr);
1126 node create_decibel(std::string addr);
1135 node create_midigain(std::string addr);
1143 node create_linear(std::string addr);
1151 node create_frequency(std::string addr);
1159 node create_midi_pitch(std::string addr);
1167 node create_bpm(std::string addr);
1292 node& set_accepted_values(std::vector<opp::value> v);
1301 std::vector<opp::value> get_accepted_values()
const;
1349 node& set_unit(std::string v);
1473 std::string get_unit()
const;
1489 value get_default_value();
1498 node& set_repetition_filter(
bool v);
1503 bool get_repetition_filter()
const;
1511 node& set_refresh_rate(
int v);
1516 node& unset_refresh_rate();
1521 int get_refresh_rate();
1530 node& set_value_step_size(
double v);
1535 node& unset_value_step_size();
1540 double get_value_step_size();
1549 node& set_priority(
float v);
1554 node& unset_priority();
1560 float get_priority();
1569 node& set_disabled(
bool v);
1574 bool get_disabled()
const;
1583 node& set_muted(
bool v);
1588 bool get_muted()
const;
1598 node& set_critical(
bool v);
1603 bool get_critical()
const;
1613 node& set_description(std::string v);
1618 std::string get_description()
const;
1626 node& set_tags(std::vector<std::string> v);
1631 std::vector<std::string> get_tags()
const;
1647 node& unset_instance_bounds();
1653 std::pair<int, int> get_instance_bounds()
const;
1661 node& set_hidden(
bool v);
1666 bool get_hidden()
const;
1675 bool get_zombie()
const;
1685 void load_preset(
const std::string& filename);
1691 void save_preset(
const std::string& filename);
1693 #if defined(OSSIA_CPP_CXX11)
1753 oscquery_server(std::string name,
int oscPort = 1234,
int wsPort = 5678);
1767 void setup(std::string name,
int oscPort = 1234,
int wsPort = 5678);
1775 node get_root_node()
const;
1782 void set_echo(
bool echo);
1801 void remove_connection_callback();
1812 void remove_disconnection_callback();
1820 void remove_add_node_callback();
1828 void remove_remove_node_callback();
1836 void remove_rename_node_callback();
1841 bool connected()
const;
1853 void on_connection(
const std::string&);
1854 void on_disconnection(
const std::string&);
1855 void on_add_node_request(
1857 void on_remove_node_request(
const std::string& parent,
const std::string&
node);
1859 on_rename_node_request(
const std::string& node_to_rename,
const std::string& new_name);
1869 void* m_add_node_ctx;
1872 void* m_remove_node_ctx;
1875 void* m_rename_node_ctx;
1900 oscquery_mirror(std::string name, std::string host =
"ws://127.0.0.1:5678");
1912 node get_root_node()
const;
1934 void reconnect(std::string name =
"", std::string host =
"");
1951 void remove_parameter_created_callback();
1962 void remove_parameter_removed_callback();
1973 void remove_node_created_callback();
1984 void remove_node_removed_callback();
1995 void remove_node_renamed_callback();
2006 void remove_message_callback();
2017 void remove_unhandled_message_callback();
2029 void remove_attribute_modified_callback();
2035 void set_zombie_on_remove(
bool b);
2041 bool get_zombie_on_remove()
const;
2048 void request_add_node(
node parent,
const std::string& name);
2054 void request_remove_node(
node node_to_be_removed);
2061 void request_rename_node(
node node, std::string new_name);
2081 void on_unhandled_message(
const std::string&,
const ossia::value&);
2089 void* m_rm_param_ctx;
2095 void* m_rm_node_ctx;
2098 void* m_rn_node_ctx;
2101 void* m_message_ctx;
2104 void* m_unhandled_message_ctx;
2107 void* m_attribute_modified_ctx;
The node class holds all ossia nodes and their std::optional parameters.
Definition: ossia-cpp98.hpp:552
ossia::net::node_base * get_raw_node_pointer()
Get the raw node pointer.
Definition: ossia-cpp98.hpp:1704
void set_char()
adds a char parameter to the current node
The oscquery_mirror class allows to create a mirror image of a remote OSCQuery server.
Definition: ossia-cpp98.hpp:1887
ossia::net::device_base * get_raw_device_pointer()
Get the raw device pointer.
Definition: ossia-cpp98.hpp:2070
bool is_connected() const
is_connected
Definition: ossia-cpp98.hpp:1940
The oscquery_server class allows to create a local OSCQuery server.
Definition: ossia-cpp98.hpp:1737
ossia::net::device_base * get_raw_device_pointer()
Get the raw device pointer.
Definition: ossia-cpp98.hpp:1850
The value class holds all ossia parameters typed values.
Definition: ossia-cpp98.hpp:103
ossia::value * get_raw_value_pointer()
Get the raw value pointer.
Definition: ossia-cpp98.hpp:454
Root of a device tree.
Definition: ossia/network/base/device.hpp:58
The node_base class.
Definition: node.hpp:48
The parameter_base class.
Definition: ossia/network/base/parameter.hpp:48
The value class.
Definition: value.hpp:173
Definition: ossia-cpp98.cpp:25
bool(* remove_node_callback)(void *, const std::string &)
container for a node remove request callback should return true if node could be remove
Definition: ossia-cpp98.hpp:508
void(* message_callback)(void *, const opp::node &)
container for a message callback
Definition: ossia-cpp98.hpp:494
void(* parameter_callback)(void *, const opp::node &)
container for a parameter creation/deletion callback
Definition: ossia-cpp98.hpp:485
bool(* rename_node_callback)(void *, const std::string &, const std::string &)
container for a node rename request callback should return true if node could be renamed
Definition: ossia-cpp98.hpp:504
void(* unhandled_message_callback)(void *, const std::string &, const opp::value &)
container for an unhandled message callback
Definition: ossia-cpp98.hpp:497
access_mode
Defines Write (Set), Read (Get) or Read/Write (Bi) access to the parameter's value.
Definition: ossia-cpp98.hpp:66
@ Set
Definition: ossia-cpp98.hpp:68
@ Bi
Definition: ossia-cpp98.hpp:69
@ Get
Definition: ossia-cpp98.hpp:67
bounding_mode
Behaviour at the bounds of the value.
Definition: ossia-cpp98.hpp:75
@ Low
Definition: ossia-cpp98.hpp:80
@ Fold
Definition: ossia-cpp98.hpp:79
@ High
Definition: ossia-cpp98.hpp:81
@ Wrap
Definition: ossia-cpp98.hpp:78
@ Clip
Definition: ossia-cpp98.hpp:77
@ Free
Definition: ossia-cpp98.hpp:76
void(* connection_callback)(void *, const std::string &)
container for a connection callback
Definition: ossia-cpp98.hpp:478
void(* node_rn_callback)(void *, const opp::node &, std::string)
container for a node renamed callback
Definition: ossia-cpp98.hpp:491
void(* node_callback)(void *, const opp::node &)
container for a node creation/deletion callback
Definition: ossia-cpp98.hpp:488
void(* disconnection_callback)(void *, const std::string &)
container for a disconnection callback
Definition: ossia-cpp98.hpp:482
bool(* add_node_callback)(void *, const std::string &, const std::string &)
container for a node creation request callback should return true if node could be created
Definition: ossia-cpp98.hpp:512
void(* attribute_modified_callback)(void *, const opp::node &, const std::string &)
container for an attribute modified callback
Definition: ossia-cpp98.hpp:500
void(* value_callback)(void *, const opp::value &)
container for a value callback
Definition: ossia-cpp98.hpp:474
constexpr OSSIA_INLINE 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
constexpr OSSIA_INLINE 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
The callback_index struct holds callbacks for adding listeners to parameters' values.
Definition: ossia-cpp98.hpp:523
Definition: ossia-cpp98.hpp:137
container for a vector of 2 floats
Definition: ossia-cpp98.hpp:110
container for a vector of 3 floats
Definition: ossia-cpp98.hpp:119
container for a vector of 4 floats
Definition: ossia-cpp98.hpp:127
The data that can be found inside a parameter.
Definition: parameter_data.hpp:21