OSSIA
Open Scenario System for Interactive Application
|
The node class holds all ossia nodes and their std::optional parameters. More...
The node class holds all ossia nodes and their std::optional parameters.
The nodes in the device are simply called "nodes" in the API. Nodes are identified with the OSC syntax: /foo/bar. Nodes per se don't carry any value; they have to be extended with parameters to be able to send and receive messages. When multiple nodes with the same name are created, they will be appended instance numbers, separated with a dot. E.g. when duplicating the node /foo, its duplicates will be named /foo.1, /foo.2, etc… This allows to have a cleaner representation of the address/namespace. Namespace using slashes for instances Namespace using dots for instances
Public Member Functions | |
node () | |
node default constructor | |
node (const node &) | |
node copy constructor | |
node & | operator= (const node &) |
assign the current node to another one More... | |
~node () | |
node default destructor | |
operator bool () const | |
checks is the node is valid More... | |
node | parent () const |
Return the parent of the node, or an invalid node if it is the root. | |
void | request_add_child (const std::string &) |
Send to the device a request to add a node. More... | |
void | request_remove_child (const std::string &) |
Send to the device a request to remove a node. More... | |
void | request_rename_child (const std::string &, const std::string &) |
Send to the device a request to rename a node. More... | |
std::string | get_name () const |
get a node's name More... | |
void | set_name (std::string s) |
set or change a node's name More... | |
bool | has_parameter () const |
does this node have a parameter ? More... | |
std::string | get_address () const |
get this node's OSC address More... | |
std::vector< node > | get_namespace () const |
return all children recursively by priority order More... | |
std::vector< node > | get_children () const |
returns all direct children (one level of hierarchy only) More... | |
node | find_child (std::string addr) const |
finds a child node by its name More... | |
std::vector< node > | find_children (std::string pattern) const |
finds children matching pattern More... | |
void | remove_child (std::string addr) |
removes a child node, described by its name More... | |
void | remove_children () |
removes all children of the current node | |
node | create_child (std::string addr) |
creates a child node to the current node this creates a "container", without a parameter, which can later be added with the set_(type) methods below More... | |
void | set_impulse () |
adds an impulse parameter to the current node More... | |
void | set_char () |
adds a char parameter to the current node More... | |
void | set_int () |
adds an int parameter to the current node More... | |
void | set_float () |
adds a float parameter to the current node More... | |
void | set_bool () |
adds a bool parameter to the current node More... | |
void | set_vec2f () |
adds a vec2f parameter to the current node More... | |
void | set_vec3f () |
adds a vec3f parameter to the current node More... | |
void | set_vec4f () |
adds a vec4f parameter to the current node More... | |
void | set_list () |
adds a list parameter to the current node More... | |
void | set_string () |
adds a string parameter to the current node More... | |
void | set_buffer () |
adds a buffer parameter to the current node More... | |
void | set_filepath () |
adds a filepath parameter to the current node More... | |
void | set_rgb () |
adds a vec3f parameter to the current node, with the color.rgb unit More... | |
void | set_rgba () |
adds a vec4f parameter to the current node, with the color.rgba unit More... | |
void | set_argb () |
adds a vec4f parameter to the current node, with the color.argb unit More... | |
void | set_argb8 () |
adds a vec4f parameter to the current node, with the color.argb8 unit More... | |
void | set_rgba8 () |
adds a vec4f parameter to the current node, with the color.rgba8 unit More... | |
void | set_hsv () |
adds a vec3f parameter to the current node, with the color.hsv unit More... | |
void | set_cart2D () |
adds a vec2f parameter to the current node, with the position.cart2D unit More... | |
void | set_cart3D () |
adds a vec3f parameter to the current node, with the position.cart3D unit More... | |
void | set_opengl () |
adds a vec3f parameter to the current node, with the position.openGL unit (aka X, Y, Z) More... | |
void | set_polar () |
adds a vec2f parameter to the current node, with the position.polar unit More... | |
void | set_spherical () |
adds a vec3f parameter to the current node, with the position.spherical unit (aka aed) More... | |
void | set_cylindrical () |
adds a vec3f parameter to the current node, with the position.cylindrical unit (aka daz) More... | |
void | set_angle_radian () |
cadds a vec3f parameter to the current node, with the angle.radian unit More... | |
void | set_angle_degree () |
adds a vec3f parameter to the current node, with theangle.radian unit More... | |
void | set_quaternion () |
adds a vec4f parameter to the current node, with the orientation.quaternion unit More... | |
void | set_euler () |
adds a vec3f parameter to the current node, with the orientation.euler unit (aka Euler angles) More... | |
void | set_axis () |
adds a vec4f parameter to the current node, with the orientation.axis unit More... | |
void | set_decibel () |
adds a float parameter to the current node, with the gain.decibel unit More... | |
void | set_midigain () |
adds a float parameter to the current node, with the gain.midigain unit More... | |
void | set_linear () |
adds a float parameter to the current node, with the gain.linear unit More... | |
void | set_frequency () |
adds a float parameter to the current node, with the time.frequency unit More... | |
void | set_midi_pitch () |
adds a float parameter to the current node, with the time.midi_pitch unit More... | |
void | set_bpm () |
adds a float parameter to the current node, with the time.bpm unit More... | |
node | create_void (std::string addr) |
creates a child node with the name, and without parameter More... | |
node | create_impulse (std::string addr) |
creates a child node with tne given name, and an impulse parameter More... | |
node | create_int (std::string addr) |
creates a child node with tne given name, and an int parameter More... | |
node | create_float (std::string addr) |
creates a child node with tne given name, and a float parameter More... | |
node | create_bool (std::string addr) |
creates a child node with tne given name, and a bool parameter More... | |
node | create_vec2f (std::string addr) |
creates a child node with tne given name, and a vec2f parameter More... | |
node | create_vec3f (std::string addr) |
creates a child node with tne given name, and a vec3f parameter More... | |
node | create_vec4f (std::string addr) |
creates a child node with tne given name, and a vec4f parameter More... | |
node | create_list (std::string addr) |
creates a child node with tne given name, and a list parameter More... | |
node | create_string (std::string addr) |
creates a child node with tne given name, and a string parameter More... | |
node | create_buffer (std::string addr) |
creates a child node with tne given name, and a buffer parameter More... | |
node | create_filepath (std::string addr) |
creates a child node with tne given name, and a filepath parameter More... | |
node | create_rgb (std::string addr) |
creates a child node with tne given name, and a vec3f parameter with the color.rgb unit More... | |
node | create_rgba (std::string addr) |
creates a child node with tne given name, and a vec4f parameter with the color.rgba unit More... | |
node | create_rgba8 (std::string addr) |
creates a child node with tne given name, and a vec4f parameter with the color.rgba8 unit More... | |
node | create_argb (std::string addr) |
creates a child node with tne given name, and a vec4f parameter with the color.argb unit More... | |
node | create_argb8 (std::string addr) |
creates a child node with tne given name, and a vec4f parameter with the color.argb8 unit More... | |
node | create_hsv (std::string addr) |
creates a child node with tne given name, and a vec3f parameter with the color.hsv unit More... | |
node | create_cart2D (std::string addr) |
creates a child node with tne given name, and a vec2f parameter with the position.cart2D unit (aka xy) More... | |
node | create_cart3D (std::string addr) |
creates a child node with tne given name, and a vec3f parameter with the position.cart3D unit (aka XYZ) More... | |
node | create_opengl (std::string addr) |
creates a child node with tne given name, and a vec3f parameter with the position.openGL unit (aka xyz) More... | |
node | create_polar (std::string addr) |
creates a child node with tne given name, and a vec2f parameter with the position.polar unit (aka rp) More... | |
node | create_spherical (std::string addr) |
creates a child node with tne given name, and a vec3f parameter with the position.spherical unit (aka rtp) More... | |
node | create_cylindrical (std::string addr) |
creates a child node with tne given name, and a vec3f parameter with the position.cylindrical unit (aka rpz) More... | |
node | create_angle_radian (std::string addr) |
creates a child node with tne given name, and a float parameter with the angle.radian unit More... | |
node | create_angle_degree (std::string addr) |
creates a child node with tne given name, and a float parameter with the angle.radian unit More... | |
node | create_quaternion (std::string addr) |
creates a child node with tne given name, and a vec4f parameter with the orientation.quaternion unit More... | |
node | create_euler (std::string addr) |
creates a child node with tne given name, and a vec3f parameter with the orientation.euler unit (aka Euler angles) More... | |
node | create_axis (std::string addr) |
creates a child node with tne given name, and a vec4f parameter with the orientation.axis unit (aka xyza) More... | |
node | create_decibel (std::string addr) |
creates a child node with tne given name, and a float parameter with the gain.decibel unit More... | |
node | create_midigain (std::string addr) |
creates a child node with tne given name, and a float parameter with the gain.midigain unit in the [0 127) range More... | |
node | create_linear (std::string addr) |
creates a child node with tne given name, and a float parameter with the gain.linear unit in the [0. 1.) range More... | |
node | create_frequency (std::string addr) |
creates a child node with tne given name, and a float parameter with the time.frequency unit More... | |
node | create_midi_pitch (std::string addr) |
creates a child node with tne given name, and a float parameter with the time.midi_pitch unit More... | |
node | create_bpm (std::string addr) |
creates a child node with tne given name, and a float parameter with the time.bpm unit More... | |
node & | set_value (opp::value v) |
set the node's parameter's value More... | |
opp::value | get_value () const |
get this node's (local) parameter's value More... | |
opp::value | fetch_value () const |
fetch this node's parameter's value over the network: More... | |
callback_index | set_value_callback (value_callback c, void *ctx) |
sets a callback allowing to listen to this value More... | |
void | remove_value_callback (callback_index idx) |
removes a value_callback, previously set with set_value_callback() More... | |
node & | set_access (access_mode v) |
sets the access_mode attribute of this node's parameter More... | |
access_mode | get_access () const |
gets the access_mode attribute of this node's parameter More... | |
node & | set_min (opp::value min) |
sets the 'min' attribute of this node's parameter (minimum value) More... | |
opp::value | get_min () const |
gets the 'min' attribute of this node's parameter (minimum value) More... | |
node & | set_max (opp::value max) |
sets the 'max' attribute of this node's parameter (maximum value) More... | |
opp::value | get_max () const |
gets the 'max' attribute of this node's parameter (maximum value) More... | |
node & | set_accepted_values (std::vector< opp::value > v) |
sets a list of the values accepted by this node's parameter ("values" attribute) More... | |
std::vector< opp::value > | get_accepted_values () const |
gets a list of the values accepted by this node's parameter ("values" attribute) More... | |
node & | set_bounding (bounding_mode v) |
sets the bounding_mode attribute of this node's parameter More... | |
bounding_mode | get_bounding () const |
gets the bounding_mode attribute of this node's parameter More... | |
node & | set_unit (std::string v) |
sets the unit attribute of this node's parameter More... | |
std::string | get_unit () const |
gets the unit of this node's parameter More... | |
node & | set_default_value (value v) |
sets the default_value attribute of this node's parameter More... | |
value | get_default_value () |
gets the default_value attribute of this node's parameter More... | |
node & | set_repetition_filter (bool v) |
sets the repetition_filter attribute of this node's parameter More... | |
bool | get_repetition_filter () const |
gets the repetition_filter attribute of this node's parameter More... | |
node & | set_refresh_rate (int v) |
sets the refresh_rate attribute of this node's parameter More... | |
node & | unset_refresh_rate () |
unsets the refresh_rate attribute of this node's parameter More... | |
int | get_refresh_rate () |
gets the refresh_rate attribute of this node's parameter More... | |
node & | set_value_step_size (double v) |
sets the value_step_size attribute of this node's parameter More... | |
node & | unset_value_step_size () |
unsets the value_step_size attribute of this node's parameter More... | |
double | get_value_step_size () |
gets the value_step_size attribute of this node's parameter More... | |
node & | set_priority (float v) |
sets the priority attribute of this node's parameter More... | |
node & | unset_priority () |
unsets the priority attribute of this node's parameter More... | |
float | get_priority () |
gets the priority attribute of this node's parameter More... | |
node & | set_disabled (bool v) |
sets the disabled attribute of this node's parameter More... | |
bool | get_disabled () const |
gets the disabled attribute of this node's parameter More... | |
node & | set_muted (bool v) |
sets the muted attribute of this node's parameter More... | |
bool | get_muted () const |
gets the muted attribute of this node's parameter More... | |
node & | set_critical (bool v) |
sets the critical attribute of this node's parameter More... | |
bool | get_critical () const |
gets the critical attribute of this node's parameter More... | |
node & | set_description (std::string v) |
sets this node's description attribute More... | |
std::string | get_description () const |
gets this node's description attribute More... | |
node & | set_tags (std::vector< std::string > v) |
sets his node's tags attribute More... | |
std::vector< std::string > | get_tags () const |
gets this node's tags attribute More... | |
node & | set_instance_bounds (int min, int max) |
sets how many instances this node can have More... | |
node & | unset_instance_bounds () |
unset how many instances this node can have More... | |
std::pair< int, int > | get_instance_bounds () const |
gets how many instances this node can have More... | |
node & | set_hidden (bool v) |
sets this node's hidden attribute More... | |
bool | get_hidden () const |
gets this node's hidden attribute More... | |
bool | get_zombie () const |
gets the zombie attribute of this node's parameter More... | |
void | load_preset (const std::string &filename) |
load_preset: load JSON preset from a file More... | |
void | save_preset (const std::string &filename) |
save_preset: save JSON preset to a file More... | |
ossia::net::node_base * | get_raw_node_pointer () |
Get the raw node pointer. More... | |
assign the current node to another one
opp::node::operator bool | ( | ) | const |
checks is the node is valid
void opp::node::request_add_child | ( | const std::string & | name | ) |
Send to the device a request to add a node.
This is only relevant on node that belongs to a mirrored device
void opp::node::request_remove_child | ( | const std::string & | name | ) |
Send to the device a request to remove a node.
This is only relevant on node that belongs to a mirrored device
void opp::node::request_rename_child | ( | const std::string & | old_name, |
const std::string & | new_name | ||
) |
Send to the device a request to rename a node.
This is only relevant on node that belongs to a mirrored device
std::string opp::node::get_name | ( | ) | const |
get a node's name
void opp::node::set_name | ( | std::string | s | ) |
set or change a node's name
a | string with the desired node name |
bool opp::node::has_parameter | ( | ) | const |
does this node have a parameter ?
std::string opp::node::get_address | ( | ) | const |
get this node's OSC address
std::vector< node > opp::node::get_namespace | ( | ) | const |
return all children recursively by priority order
std::vector< node > opp::node::get_children | ( | ) | const |
returns all direct children (one level of hierarchy only)
node opp::node::find_child | ( | std::string | addr | ) | const |
finds a child node by its name
addr | is a string corresponding to the desired child node's name |
std::vector< node > opp::node::find_children | ( | std::string | pattern | ) | const |
finds children matching pattern
pattern | to match |
void opp::node::remove_child | ( | std::string | addr | ) |
removes a child node, described by its name
addr | a string corresponding to the child node's name that one wants to remove |
node opp::node::create_child | ( | std::string | addr | ) |
creates a child node to the current node this creates a "container", without a parameter, which can later be added with the set_(type) methods below
addr | is a string to use as the child's node name |
void opp::node::set_impulse | ( | ) |
adds an impulse parameter to the current node
Impulse: no value; just a message.
void opp::node::set_char | ( | ) |
adds a char parameter to the current node
Char: 8-bit value
void opp::node::set_int | ( | ) |
adds an int parameter to the current node
Integer: 32-bit int.
void opp::node::set_float | ( | ) |
adds a float parameter to the current node
Floating-point: 32-bit float.
void opp::node::set_bool | ( | ) |
adds a bool parameter to the current node
Boolean: true/false.
void opp::node::set_vec2f | ( | ) |
adds a vec2f parameter to the current node
Vec2f: As an optimisation, vec2f is a specific type for 2 floats
void opp::node::set_vec3f | ( | ) |
adds a vec3f parameter to the current node
Vec3f: As an optimisation, vec3f is a specific type for 3 floats
void opp::node::set_vec4f | ( | ) |
adds a vec4f parameter to the current node
Vec4f: As an optimisation, vec4f is a specific type for 4 floats
void opp::node::set_list | ( | ) |
adds a list parameter to the current node
List: : a generic list of values: [3, 'a', 2.68, ["foo", "bar"]]
void opp::node::set_string | ( | ) |
adds a string parameter to the current node
String: a string of chars as defined in the C++ standard library
void opp::node::set_buffer | ( | ) |
adds a buffer parameter to the current node
Generic buffer : when a string should be interpreted as a a raw binary blob.
void opp::node::set_filepath | ( | ) |
adds a filepath parameter to the current node
File path : used for when a string is a filesystem path, like /home/self/sound.wav or c:\document.txt
void opp::node::set_rgb | ( | ) |
adds a vec3f parameter to the current node, with the color.rgb unit
RGB: 3 float numbers between 0. and 1. describing respectively Red, Green and Blue color values
void opp::node::set_rgba | ( | ) |
adds a vec4f parameter to the current node, with the color.rgba unit
RGBA: 4 float numbers between 0. and 1. describing respectively Red, Green, Blue and Alpha color values
void opp::node::set_argb | ( | ) |
adds a vec4f parameter to the current node, with the color.argb unit
ARGB: 4 float numbers between 0. and 1. describing respectively Alpha, Red, Green and Blue color values
void opp::node::set_argb8 | ( | ) |
adds a vec4f parameter to the current node, with the color.argb8 unit
8 bits ARGB: 4 int numbers between 0 and 255 describing respectively Alpha, Red, Green and Blue color values
void opp::node::set_rgba8 | ( | ) |
adds a vec4f parameter to the current node, with the color.rgba8 unit
RGBA8: 4 int numbers between 0 and 255 describing respectively Red, Green, Blue and Alpha color values
void opp::node::set_hsv | ( | ) |
adds a vec3f parameter to the current node, with the color.hsv unit
HSV: 3 float numbers between 0. and 1. describing respectively Hue, Saturation and Value (Luminosity) color values in the HSV colorspace
void opp::node::set_cart2D | ( | ) |
adds a vec2f parameter to the current node, with the position.cart2D unit
Cart2D: Cartesian 2-dimensional position (i.e. X, Y)
void opp::node::set_cart3D | ( | ) |
adds a vec3f parameter to the current node, with the position.cart3D unit
Cart3D: Cartesian 3-dimensional position (ie. X, Y, Z)
void opp::node::set_opengl | ( | ) |
adds a vec3f parameter to the current node, with the position.openGL unit (aka X, Y, Z)
OpenGL: Cartesian 3-dimensional position (ie. X, Y, Z) in the OpenGL coordinate reference system
void opp::node::set_polar | ( | ) |
adds a vec2f parameter to the current node, with the position.polar unit
Polar: Polar 2-dimensional position (ie. rp: radial distance, inclination angle, azimuth angle))
void opp::node::set_spherical | ( | ) |
adds a vec3f parameter to the current node, with the position.spherical unit (aka aed)
Spherical: Polar 3-dimensional position (ie. rtp: radial distance, inclination angle, azimuth angle)
void opp::node::set_cylindrical | ( | ) |
adds a vec3f parameter to the current node, with the position.cylindrical unit (aka daz)
Cylindrical: Mixed 3-dimensional position (ie. rpz: radial distance, azimuth angle, height (Z))
void opp::node::set_angle_radian | ( | ) |
cadds a vec3f parameter to the current node, with the angle.radian unit
radian: a angle expressed in radian
void opp::node::set_angle_degree | ( | ) |
adds a vec3f parameter to the current node, with theangle.radian unit
degree: a angle expressed in degrees
void opp::node::set_quaternion | ( | ) |
adds a vec4f parameter to the current node, with the orientation.quaternion unit
Quaternion: An extension of the complex numbers for 3D orientation, in the form a+bi+cj+dk
void opp::node::set_euler | ( | ) |
adds a vec3f parameter to the current node, with the orientation.euler unit (aka Euler angles)
Euler: A triplet of angles (in degrees) describing the orientation of a rigid body with respect to a fixed coordinate system
void opp::node::set_axis | ( | ) |
adds a vec4f parameter to the current node, with the orientation.axis unit
Axis: An angle (a, in degrees) relative to a 3-dimensional vector, expressed in the order X, Y, Z, w
void opp::node::set_decibel | ( | ) |
adds a float parameter to the current node, with the gain.decibel unit
deciBel: a single float value expressed in a logarithmic scale, typically to describe an audio gain (0dB being the nominal gain, <0dB describing a signal attenuation)
void opp::node::set_midigain | ( | ) |
adds a float parameter to the current node, with the gain.midigain unit
midigain: a value in the [0 127] range mimicking a MIDI gain controller. 100 for the nominal level, 127 for +12dB
void opp::node::set_linear | ( | ) |
adds a float parameter to the current node, with the gain.linear unit
linear: a linear gain in the [0. 1.) range, with 1. being the nominal level
void opp::node::set_frequency | ( | ) |
adds a float parameter to the current node, with the time.frequency unit
frequency: a frequency expressed in Hertz
void opp::node::set_midi_pitch | ( | ) |
adds a float parameter to the current node, with the time.midi_pitch unit
midi_pitch: a frequency expressed as a MIDI pitch (ie. 36 for C3)
void opp::node::set_bpm | ( | ) |
adds a float parameter to the current node, with the time.bpm unit
bpm: a frequency expressed in beats per minute
node opp::node::create_void | ( | std::string | addr | ) |
creates a child node with the name, and without parameter
Void: no value, no message.
addr | the name of the created node |
node opp::node::create_impulse | ( | std::string | addr | ) |
node opp::node::create_int | ( | std::string | addr | ) |
creates a child node with tne given name, and an int parameter
Integer: 32-bit int.
addr | the name of the created node |
node opp::node::create_float | ( | std::string | addr | ) |
creates a child node with tne given name, and a float parameter
Floating-point: 32-bit float.
addr | the name of the created node |
node opp::node::create_bool | ( | std::string | addr | ) |
creates a child node with tne given name, and a bool parameter
Boolean: true/false.
addr | the name of the created node |
node opp::node::create_vec2f | ( | std::string | addr | ) |
creates a child node with tne given name, and a vec2f parameter
Vec2f: As an optimisation, vec2f is a specific type for 2 floats
addr | the name of the created node |
node opp::node::create_vec3f | ( | std::string | addr | ) |
creates a child node with tne given name, and a vec3f parameter
Vec3f: As an optimisation, vec3f is a specific type for 3 floats
addr | the name of the created node |
node opp::node::create_vec4f | ( | std::string | addr | ) |
creates a child node with tne given name, and a vec4f parameter
Vec4f: As an optimisation, vec4f is a specific type for 4 floats
addr | the name of the created node |
node opp::node::create_list | ( | std::string | addr | ) |
creates a child node with tne given name, and a list parameter
List: : a generic list of values: [3, 'a', 2.68, ["foo", "bar"]]
addr | the name of the created node |
node opp::node::create_string | ( | std::string | addr | ) |
creates a child node with tne given name, and a string parameter
String: a string of chars as defined in the C++ standard library
addr | the name of the created node |
node opp::node::create_buffer | ( | std::string | addr | ) |
creates a child node with tne given name, and a buffer parameter
Generic buffer : when a string should be interpreted as a a raw binary blob.
addr | the name of the created node |
node opp::node::create_filepath | ( | std::string | addr | ) |
creates a child node with tne given name, and a filepath parameter
File path : used for when a string is a filesystem path, like /home/self/sound.wav or c:\document.txt
addr | the name of the created node |
node opp::node::create_rgb | ( | std::string | addr | ) |
creates a child node with tne given name, and a vec3f parameter with the color.rgb unit
RGB: 3 float numbers between 0. and 1. describing respectively Red, Green and Blue values
addr | the name of the created node |
node opp::node::create_rgba | ( | std::string | addr | ) |
creates a child node with tne given name, and a vec4f parameter with the color.rgba unit
RGBA: 4 float numbers between 0. and 1. describing respectively Red, Green, Blue and Alpha values
addr | the name of the created node |
node opp::node::create_rgba8 | ( | std::string | addr | ) |
creates a child node with tne given name, and a vec4f parameter with the color.rgba8 unit
RGBA8: 4 int numbers between 0 and 255 describing respectively Red, Green, Blue and Alpha values
addr | the name of the created node |
node opp::node::create_argb | ( | std::string | addr | ) |
creates a child node with tne given name, and a vec4f parameter with the color.argb unit
ARGB: 4 float numbers between 0. and 1. describing respectively Alpha, Red, Green and Blue values
addr | the name of the created node |
node opp::node::create_argb8 | ( | std::string | addr | ) |
creates a child node with tne given name, and a vec4f parameter with the color.argb8 unit
8 bits ARGB: 4 int numbers between 0 and 255 describing respectively Alpha, Red, Green and Blue values
addr | the name of the created node |
node opp::node::create_hsv | ( | std::string | addr | ) |
creates a child node with tne given name, and a vec3f parameter with the color.hsv unit
HSV: 3 float numbers between 0. and 1. describing respectively Hue, Saturation and Value (Luminosity) values in the HSV colorspace
addr | the name of the created node |
node opp::node::create_cart2D | ( | std::string | addr | ) |
creates a child node with tne given name, and a vec2f parameter with the position.cart2D unit (aka xy)
Cart2D: Cartesian 2-dimensional position (i.e. X, Y)
addr | the name of the created node |
node opp::node::create_cart3D | ( | std::string | addr | ) |
creates a child node with tne given name, and a vec3f parameter with the position.cart3D unit (aka XYZ)
Cart3D: Cartesian 3-dimensional position (ie. X, Y, Z)
addr | the name of the created node |
node opp::node::create_opengl | ( | std::string | addr | ) |
creates a child node with tne given name, and a vec3f parameter with the position.openGL unit (aka xyz)
OpenGL: Cartesian 3-dimensional position (ie. X, Y, Z) in the OpenGL coordinate reference system
addr | the name of the created node |
node opp::node::create_polar | ( | std::string | addr | ) |
creates a child node with tne given name, and a vec2f parameter with the position.polar unit (aka rp)
Polar: Polar 2-dimensional position (ie. rp: radial distance, inclination angle, azimuth angle))
addr | the name of the created node |
node opp::node::create_spherical | ( | std::string | addr | ) |
creates a child node with tne given name, and a vec3f parameter with the position.spherical unit (aka rtp)
Spherical: Polar 3-dimensional position (ie. rtp: radial distance, inclination angle, azimuth angle)
addr | the name of the created node |
node opp::node::create_cylindrical | ( | std::string | addr | ) |
creates a child node with tne given name, and a vec3f parameter with the position.cylindrical unit (aka rpz)
Cylindrical: Mixed 3-dimensional position (ie. rpz: radial distance, azimuth angle, height (Z))
addr | the name of the created node |
node opp::node::create_angle_radian | ( | std::string | addr | ) |
creates a child node with tne given name, and a float parameter with the angle.radian unit
Radian: a angle expressed in radian
addr | the name of the created node |
node opp::node::create_angle_degree | ( | std::string | addr | ) |
creates a child node with tne given name, and a float parameter with the angle.radian unit
Degree: a angle expressed in degrees
addr | the name of the created node |
node opp::node::create_quaternion | ( | std::string | addr | ) |
creates a child node with tne given name, and a vec4f parameter with the orientation.quaternion unit
Quaternion: An extension of the complex numbers for 3D orientation, in the form a+bi+cj+dk
addr | the name of the created node |
node opp::node::create_euler | ( | std::string | addr | ) |
creates a child node with tne given name, and a vec3f parameter with the orientation.euler unit (aka Euler angles)
Euler: A triplet of angles (in degrees): {yaw, pitch, roll} describing the orientation of a rigid body with respect to a fixed coordinate system
addr | the name of the created node |
node opp::node::create_axis | ( | std::string | addr | ) |
creates a child node with tne given name, and a vec4f parameter with the orientation.axis unit (aka xyza)
Axis: An angle (w, in degrees) relative to a 3-dimensional vector, expressed in the order X, Y, Z, w
addr | the name of the created node |
node opp::node::create_decibel | ( | std::string | addr | ) |
creates a child node with tne given name, and a float parameter with the gain.decibel unit
deciBel: a single float value expressed in a logarithmic scale, typically to describe an audio gain (0dB being the nominal gain, <0dB describing a signal attenuation)
addr | the name of the created node |
node opp::node::create_midigain | ( | std::string | addr | ) |
creates a child node with tne given name, and a float parameter with the gain.midigain unit in the [0 127) range
midigain: a value in the [0 127] range mimicking a MIDI gain controller. 100 for the nominal level, 127 for +12dB
addr | the name of the created node |
node opp::node::create_linear | ( | std::string | addr | ) |
creates a child node with tne given name, and a float parameter with the gain.linear unit in the [0. 1.) range
linear: a linear gain in the [0. 1.) range, with 1. being the nominal level
addr | the name of the created node |
node opp::node::create_frequency | ( | std::string | addr | ) |
creates a child node with tne given name, and a float parameter with the time.frequency unit
frequency: a frequency expressed in Hertz
addr | the name of the created node |
node opp::node::create_midi_pitch | ( | std::string | addr | ) |
creates a child node with tne given name, and a float parameter with the time.midi_pitch unit
midi_pitch: a frequency expressed as a MIDI pitch (ie. 36 for C3)
addr | the name of the created node |
node opp::node::create_bpm | ( | std::string | addr | ) |
creates a child node with tne given name, and a float parameter with the time.bpm unit
bpm: a frequency expressed in beats per minute
addr | the name of the created node |
node & opp::node::set_value | ( | opp::value | v | ) |
set the node's parameter's value
v | an opp:value |
value opp::node::get_value | ( | ) | const |
get this node's (local) parameter's value
value opp::node::fetch_value | ( | ) | const |
fetch this node's parameter's value over the network:
callback_index opp::node::set_value_callback | ( | value_callback | c, |
void * | ctx | ||
) |
sets a callback allowing to listen to this value
Parameter callbacks will inform you every time a parameter receives a message: this will enable listening on the remote end, ie. messages will be sent upon modification.
c | a value_callback |
ctx | the context as a void* |
void opp::node::remove_value_callback | ( | callback_index | idx | ) |
removes a value_callback, previously set with set_value_callback()
idx | a callback_index, as returned by set_value_callback() |
node & opp::node::set_access | ( | access_mode | v | ) |
sets the access_mode attribute of this node's parameter
Access mode is a metadata that categorizes parameters between:
For instance:
v | an opp::access_mode of the chosen mode |
access_mode opp::node::get_access | ( | ) | const |
gets the access_mode attribute of this node's parameter
node & opp::node::set_min | ( | opp::value | min | ) |
sets the 'min' attribute of this node's parameter (minimum value)
Domains allow to set a range of accepted values for a given parameter.
This range can be continuous (between a min and max), or discrete: a set of accepted values.
This function defines the minimum of a continuous range.
This is only meaningful for nodes with parameters of numerical types (ie ints, floats, vecnfs and some lists)
min | an opp::value with the desired minimum value |
value opp::node::get_min | ( | ) | const |
gets the 'min' attribute of this node's parameter (minimum value)
node & opp::node::set_max | ( | opp::value | max | ) |
sets the 'max' attribute of this node's parameter (maximum value)
Domains allow to set a range of accepted values for a given parameter.
This range can be continuous (between a min and max), or discrete: a set of accepted values.
This function defines the maximum of a continuous range.
This is only meaningful for nodes with parameters of numerical types (ie ints, floats, vecnfs and some lists)
min | an opp::value with the desired mmaximum value |
value opp::node::get_max | ( | ) | const |
gets the 'max' attribute of this node's parameter (maximum value)
node & opp::node::set_accepted_values | ( | std::vector< opp::value > | v | ) |
sets a list of the values accepted by this node's parameter ("values" attribute)
Domains allow to set a range of accepted values for a given parameter.
This range can be continuous (between a min and max), or discrete: a set of accepted values.
This function defines a set of accepted values.
This is only meaningful for nodes with parameters of about any types except Impulse
v | a vector of opp::value with the desired list of accepted values |
std::vector< value > opp::node::get_accepted_values | ( | ) | const |
gets a list of the values accepted by this node's parameter ("values" attribute)
node & opp::node::set_bounding | ( | bounding_mode | v | ) |
sets the bounding_mode attribute of this node's parameter
The bounding mode tells what happens when a value is outside of the min / max:
The default is FREE.
v | an opp::bounding_mode of the chosen mode |
bounding_mode opp::node::get_bounding | ( | ) | const |
gets the bounding_mode attribute of this node's parameter
node & opp::node::set_unit | ( | std::string | v | ) |
sets the unit attribute of this node's parameter
Units give a semantic meaning to the value of a parameter.
Units are sorted by categories (coined "dataspace" ): every unit in a category is convertible to the other units in the same category.
Every category has a neutral unit to/from which conversions are made.
An unit, when setting it as a parameter's attribute, can be expressed as a string in the form:
v | a string with this unit's name |
std::string opp::node::get_unit | ( | ) | const |
gets the unit of this node's parameter
sets the default_value attribute of this node's parameter
A default value for a given node. Useful for resetting to a default state.
v | an opp::value with this node's parameter's default value |
value opp::node::get_default_value | ( | ) |
gets the default_value attribute of this node's parameter
node & opp::node::set_repetition_filter | ( | bool | v | ) |
sets the repetition_filter attribute of this node's parameter
When the repetition filter is enabled, if the same value is sent twice, the second time will be filtered out.
v | an bool: true to filter out this node's parameter's value repetitions |
bool opp::node::get_repetition_filter | ( | ) | const |
gets the repetition_filter attribute of this node's parameter
node & opp::node::set_refresh_rate | ( | int | v | ) |
sets the refresh_rate attribute of this node's parameter
An std::optional value that says how often a value should be updated.
v | an int with this node's parameter's refresh_rate value |
node & opp::node::unset_refresh_rate | ( | ) |
unsets the refresh_rate attribute of this node's parameter
int opp::node::get_refresh_rate | ( | ) |
gets the refresh_rate attribute of this node's parameter
node & opp::node::set_value_step_size | ( | double | v | ) |
sets the value_step_size attribute of this node's parameter
An std::optional value that says by which increment a value should change, for instance in a value editor.
v | the increment size |
node & opp::node::unset_value_step_size | ( | ) |
unsets the value_step_size attribute of this node's parameter
double opp::node::get_value_step_size | ( | ) |
gets the value_step_size attribute of this node's parameter
node & opp::node::set_priority | ( | float | v | ) |
sets the priority attribute of this node's parameter
Nodes with the highest priority should execute first.
v | a float with this node's parameter's priority value (higher numbers for higher priorities) |
node & opp::node::unset_priority | ( | ) |
unsets the priority attribute of this node's parameter
float opp::node::get_priority | ( | ) |
gets the priority attribute of this node's parameter
node & opp::node::set_disabled | ( | bool | v | ) |
sets the disabled attribute of this node's parameter
This attribute will disable a node: it will stop receiving and sending messages from/to the network.
v | a bool: true to disable this node's parameter |
bool opp::node::get_disabled | ( | ) | const |
gets the disabled attribute of this node's parameter
node & opp::node::set_muted | ( | bool | v | ) |
sets the muted attribute of this node's parameter
This attribute will disable a node: it will stop sending messages to the network.
Unlike the "disabled" attribute, it won't propagate to other mirrored servers.
v | a bool: true to mute this node's parameter |
bool opp::node::get_muted | ( | ) | const |
gets the muted attribute of this node's parameter
node & opp::node::set_critical | ( | bool | v | ) |
sets the critical attribute of this node's parameter
This attribute informs the network protocol that the value has a particular importance and should if possible use a protocol not subject to message loss, eg TCP instead of UDP. This is useful for instance for "play" messages.
v | a bool: true to mark this node's parameter as critical |
bool opp::node::get_critical | ( | ) | const |
gets the critical attribute of this node's parameter
node & opp::node::set_description | ( | std::string | v | ) |
sets this node's description attribute
An std::optional textual description.
v | a string with the textual description of this node |
std::string opp::node::get_description | ( | ) | const |
gets this node's description attribute
node & opp::node::set_tags | ( | std::vector< std::string > | v | ) |
sets his node's tags attribute
An std::optional array of tags for nodes, expressed as one string per tag.
v | a vector of strings with the desired tags of this node' |
std::vector< std::string > opp::node::get_tags | ( | ) | const |
gets this node's tags attribute
node & opp::node::set_instance_bounds | ( | int | min, |
int | max | ||
) |
sets how many instances this node can have
For nodes that can have instantiatable children, this sets the minimum and maximum number of children that can exist. This is an std::optional attribute: it is not enforced and is only to be relied upon as a metadata.
min | the minimum number of instances this node can have |
max | the maximum number of instances this node can have |
node & opp::node::unset_instance_bounds | ( | ) |
unset how many instances this node can have
std::pair< int, int > opp::node::get_instance_bounds | ( | ) | const |
gets how many instances this node can have
node & opp::node::set_hidden | ( | bool | v | ) |
sets this node's hidden attribute
This attribute is to use for nodes that are not to be exposed to the network.
v | a bool: true to hide this node |
bool opp::node::get_hidden | ( | ) | const |
gets this node's hidden attribute
bool opp::node::get_zombie | ( | ) | const |
gets the zombie attribute of this node's parameter
This is a read-only attribute: it informs of whether a node is in a zombie state. A zombie node is an node in a remote device, whose source has been removed. It is kept in the mirrors but marked as such.
void opp::node::load_preset | ( | const std::string & | filename | ) |
load_preset: load JSON preset from a file
filename |
void opp::node::save_preset | ( | const std::string & | filename | ) |
save_preset: save JSON preset to a file
filename |
|
inline |
Get the raw node pointer.
Be careful, this gives you great power and with great power comes... It's useful to make use of ossia feature that are not available in opp:: namespace (but requires some more computer skill)