OSSIA
Open Scenario System for Interactive Application
opp::node Class Reference

The node class holds all ossia nodes and their std::optional parameters. More...

Detailed Description

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

See also
ossia::value

Public Member Functions

 node ()
 node default constructor
 
 node (const node &)
 node copy constructor
 
nodeoperator= (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< nodeget_namespace () const
 return all children recursively by priority order More...
 
std::vector< nodeget_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< nodefind_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...
 
nodeset_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...
 
nodeset_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...
 
nodeset_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...
 
nodeset_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...
 
nodeset_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::valueget_accepted_values () const
 gets a list of the values accepted by this node's parameter ("values" attribute) More...
 
nodeset_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...
 
nodeset_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...
 
nodeset_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...
 
nodeset_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...
 
nodeset_refresh_rate (int v)
 sets the refresh_rate attribute of this node's parameter More...
 
nodeunset_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...
 
nodeset_value_step_size (double v)
 sets the value_step_size attribute of this node's parameter More...
 
nodeunset_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...
 
nodeset_priority (float v)
 sets the priority attribute of this node's parameter More...
 
nodeunset_priority ()
 unsets the priority attribute of this node's parameter More...
 
float get_priority ()
 gets the priority attribute of this node's parameter More...
 
nodeset_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...
 
nodeset_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...
 
nodeset_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...
 
nodeset_description (std::string v)
 sets this node's description attribute More...
 
std::string get_description () const
 gets this node's description attribute More...
 
nodeset_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...
 
nodeset_instance_bounds (int min, int max)
 sets how many instances this node can have More...
 
nodeunset_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...
 
nodeset_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_baseget_raw_node_pointer ()
 Get the raw node pointer. More...
 

Member Function Documentation

◆ operator=()

node & opp::node::operator= ( const node other)
noexcept

assign the current node to another one

Returns
reference to the assigned node

◆ operator bool()

opp::node::operator bool ( ) const

checks is the node is valid

Returns
true if the node is valid

◆ request_add_child()

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

◆ request_remove_child()

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

◆ request_rename_child()

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

◆ get_name()

std::string opp::node::get_name ( ) const

get a node's name

Returns
a string with the node's name

◆ set_name()

void opp::node::set_name ( std::string  s)

set or change a node's name

Parameters
astring with the desired node name

◆ has_parameter()

bool opp::node::has_parameter ( ) const

does this node have a parameter ?

Returns
true if there is a parameter to this node

◆ get_address()

std::string opp::node::get_address ( ) const

get this node's OSC address

Returns
this node's OSC address as a string

◆ get_namespace()

std::vector< node > opp::node::get_namespace ( ) const

return all children recursively by priority order

Returns
a vector of opp::node

◆ get_children()

std::vector< node > opp::node::get_children ( ) const

returns all direct children (one level of hierarchy only)

Returns
a vector of opp::node

◆ find_child()

node opp::node::find_child ( std::string  addr) const

finds a child node by its name

Parameters
addris a string corresponding to the desired child node's name
Returns
the child node

◆ find_children()

std::vector< node > opp::node::find_children ( std::string  pattern) const

finds children matching pattern

Parameters
patternto match
Returns
found children vector

◆ remove_child()

void opp::node::remove_child ( std::string  addr)

removes a child node, described by its name

Parameters
addra string corresponding to the child node's name that one wants to remove

◆ create_child()

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

Parameters
addris a string to use as the child's node name
Returns
the just-created node object

◆ set_impulse()

void opp::node::set_impulse ( )

adds an impulse parameter to the current node

Impulse: no value; just a message.

◆ set_char()

void opp::node::set_char ( )

adds a char parameter to the current node

Char: 8-bit value

◆ set_int()

void opp::node::set_int ( )

adds an int parameter to the current node

Integer: 32-bit int.

◆ set_float()

void opp::node::set_float ( )

adds a float parameter to the current node

Floating-point: 32-bit float.

◆ set_bool()

void opp::node::set_bool ( )

adds a bool parameter to the current node

Boolean: true/false.

◆ set_vec2f()

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

◆ set_vec3f()

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

◆ set_vec4f()

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

◆ set_list()

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"]]

◆ set_string()

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

◆ set_buffer()

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.

◆ set_filepath()

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

◆ set_rgb()

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

◆ set_rgba()

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

◆ set_argb()

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

◆ set_argb8()

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

◆ set_rgba8()

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

◆ set_hsv()

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

◆ set_cart2D()

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)

◆ set_cart3D()

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)

◆ set_opengl()

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

◆ set_polar()

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))

◆ set_spherical()

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)

◆ set_cylindrical()

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))

◆ set_angle_radian()

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

◆ set_angle_degree()

void opp::node::set_angle_degree ( )

adds a vec3f parameter to the current node, with theangle.radian unit

degree: a angle expressed in degrees

◆ set_quaternion()

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

◆ set_euler()

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

◆ set_axis()

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

◆ set_decibel()

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)

◆ set_midigain()

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

◆ set_linear()

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

◆ set_frequency()

void opp::node::set_frequency ( )

adds a float parameter to the current node, with the time.frequency unit

frequency: a frequency expressed in Hertz

◆ set_midi_pitch()

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)

◆ set_bpm()

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

◆ create_void()

node opp::node::create_void ( std::string  addr)

creates a child node with the name, and without parameter

Void: no value, no message.

Parameters
addrthe name of the created node
Returns
the created opp::node object

◆ create_impulse()

node opp::node::create_impulse ( std::string  addr)

creates a child node with tne given name, and an impulse parameter

Impulse: no value; just a message.

Parameters
addrthe name of the created node
Returns
the created opp::node object

◆ create_int()

node opp::node::create_int ( std::string  addr)

creates a child node with tne given name, and an int parameter

Integer: 32-bit int.

Parameters
addrthe name of the created node
Returns
the created opp::node object

◆ create_float()

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.

Parameters
addrthe name of the created node
Returns
the created opp::node object

◆ create_bool()

node opp::node::create_bool ( std::string  addr)

creates a child node with tne given name, and a bool parameter

Boolean: true/false.

Parameters
addrthe name of the created node
Returns
the created opp::node object

◆ create_vec2f()

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

Parameters
addrthe name of the created node
Returns
the created opp::node object

◆ create_vec3f()

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

Parameters
addrthe name of the created node
Returns
the created opp::node object

◆ create_vec4f()

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

Parameters
addrthe name of the created node
Returns
the created opp::node object

◆ create_list()

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"]]

Parameters
addrthe name of the created node
Returns
the created opp::node object

◆ create_string()

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

Parameters
addrthe name of the created node
Returns
the created opp::node object

◆ create_buffer()

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.

Parameters
addrthe name of the created node
Returns
the created opp::node object

◆ create_filepath()

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

Parameters
addrthe name of the created node
Returns
the created opp::node object

◆ create_rgb()

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

Parameters
addrthe name of the created node
Returns
the created opp::node object

◆ create_rgba()

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

Parameters
addrthe name of the created node
Returns
the created opp::node object

◆ create_rgba8()

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

Parameters
addrthe name of the created node
Returns
the created opp::node object

◆ create_argb()

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

Parameters
addrthe name of the created node
Returns
the created opp::node object

◆ create_argb8()

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

Parameters
addrthe name of the created node
Returns
the created opp::node object

◆ create_hsv()

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

Parameters
addrthe name of the created node
Returns
the created opp::node object

◆ create_cart2D()

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)

Parameters
addrthe name of the created node
Returns
the created opp::node object

◆ create_cart3D()

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)

Parameters
addrthe name of the created node
Returns
the created opp::node object

◆ create_opengl()

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

Parameters
addrthe name of the created node
Returns
the created opp::node object

◆ create_polar()

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))

Parameters
addrthe name of the created node
Returns
the created opp::node object

◆ create_spherical()

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)

Parameters
addrthe name of the created node
Returns
the created opp::node object

◆ create_cylindrical()

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))

Parameters
addrthe name of the created node
Returns
the created opp::node object

◆ create_angle_radian()

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

Parameters
addrthe name of the created node
Returns
the created opp::node object

◆ create_angle_degree()

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

Parameters
addrthe name of the created node
Returns
the created opp::node object

◆ create_quaternion()

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

Parameters
addrthe name of the created node
Returns
the created opp::node object

◆ create_euler()

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

Parameters
addrthe name of the created node
Returns
the created opp::node object

◆ create_axis()

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

Parameters
addrthe name of the created node
Returns
the created opp::node object

◆ create_decibel()

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)

Parameters
addrthe name of the created node
Returns
the created opp::node object

◆ create_midigain()

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

Parameters
addrthe name of the created node
Returns
the created opp::node object

◆ create_linear()

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

Parameters
addrthe name of the created node
Returns
the created opp::node object

◆ create_frequency()

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

Parameters
addrthe name of the created node
Returns
the created opp::node object

◆ create_midi_pitch()

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)

Parameters
addrthe name of the created node
Returns
the created opp::node object

◆ create_bpm()

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

Parameters
addrthe name of the created node
Returns
the created opp::node object

◆ set_value()

node & opp::node::set_value ( opp::value  v)

set the node's parameter's value

Parameters
van opp:value
Returns
a reference to this node
See also
opp::value

◆ get_value()

value opp::node::get_value ( ) const

get this node's (local) parameter's value

Returns
an opp::value with this node's parameter's value

◆ fetch_value()

value opp::node::fetch_value ( ) const

fetch this node's parameter's value over the network:

Returns
an opp::value with this node's parameter's value
See also
opp::oscquery_mirror

◆ set_value_callback()

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.

Parameters
ca value_callback
ctxthe context as a void*
Returns
a callback_index struct
See also
opp::value_callback
opp::callback_index

◆ remove_value_callback()

void opp::node::remove_value_callback ( callback_index  idx)

removes a value_callback, previously set with set_value_callback()

Parameters
idxa callback_index, as returned by set_value_callback()
See also
opp::callback_index

◆ set_access()

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:

  • GET: read-only
  • SET: write-only
  • BI: read-write

For instance:

  • The value of a vu-meter should be GET
  • A "play" button should be SET.
  • The cutoff of a filter or a controllable color should be BI.
    Parameters
    van opp::access_mode of the chosen mode
    Returns
    a reference to this node

◆ get_access()

access_mode opp::node::get_access ( ) const

gets the access_mode attribute of this node's parameter

Returns
an opp::access_mode with this node's parameter's access mode
See also
opp::node::set_acess

◆ set_min()

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)

Parameters
minan opp::value with the desired minimum value
Returns
a reference to this node
See also
opp::node::set_bounding

◆ get_min()

value opp::node::get_min ( ) const

gets the 'min' attribute of this node's parameter (minimum value)

Returns
an opp::value with this node's parameter's minimum value
See also
opp::node::set_min
opp::node::get_bounding

◆ set_max()

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)

Parameters
minan opp::value with the desired mmaximum value
Returns
a reference to this node
See also
opp::node::set_bounding

◆ get_max()

value opp::node::get_max ( ) const

gets the 'max' attribute of this node's parameter (maximum value)

Returns
an opp::value with this node's parameter's maximum value
See also
opp::node::set_max
opp::node::get_bounding

◆ set_accepted_values()

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

Parameters
va vector of opp::value with the desired list of accepted values
Returns
a reference to this node
See also
opp::node::set_bounding

◆ get_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)

Returns
a vector of opp::value with the list of this node's parameter's accepted values
See also
opp::node::set_accepted_values
opp::node::set_bounding

◆ set_bounding()

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:

  • FREE : no clipping; domain is only indicative.
  • CLIP : clipped to the closest value in the range.
  • LOW : only clips values lower than the min.
  • HIGH : only clips values higher than the max.
  • WRAP : wraps values around the range
  • FOLD : folds back values into the range

The default is FREE.

Parameters
van opp::bounding_mode of the chosen mode
Returns
a reference to this node
See also
opp::node::set_min
opp::node::set_max

◆ get_bounding()

bounding_mode opp::node::get_bounding ( ) const

gets the bounding_mode attribute of this node's parameter

Returns
an opp::bounding_mode with this node's parameter's access mode

◆ set_unit()

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:

  • "category.unit" (such as "position.cart2D"),
  • only with the unit name (such as "cart2D", those being all unique),
  • or with "nicknames", that are indicated in parentheses, after the unit name
    A list of all supported units is given below.
Parameters
va string with this unit's name
Returns
a reference to this node
See also
ossia::unit_t
  • Position
    • cart3D (xyz, pos, point, point3d, 3d, cartesian3d, coord, coordinate, coordinates, pvector *, vertex): Cartesian 3-dimensional position (ie. X, Y, Z) in the OpenGL coordinate reference system
    • cart2D (xy, complex, point2d, 2d, cartesian2d): Cartesian 2-dimensional position (i.e. X, Y)
    • opengl (gl, position.gl): Cartesian 3-dimensional position (ie. X, Y, Z) in the OpenGL coordinate reference system
    • spherical (aed): Polar 3-dimensional position (ie. aed: azimuth, elevation, distance)
    • polar (ad): Polar 2-dimensional position (ie. ad: azimuth, distance)
    • cylindrical (daz): Mixed 3-dimensional position (ie. daz: distance, azimuth, Z)
  • Orientation
    • quaternion: An extension of the complex numbers for 3D orientation, in the form a+bi+cj+dk
    • euler: A triplet of angles (in degrees) describing the orientation of a rigid body with respect to a fixed coordinate system
    • axis: An angle (a, in degrees) relative to a 3-dimensional vector, expressed in the order X, Y, Z, a
  • Color
    • argb (col): 4 float numbers between 0. and 1. describing respectively Alpha, Red, Green and Blue color values
    • rgba: 4 float numbers between 0. and 1. describing respectively Red, Green, Blue and Alpha color values
    • rgb: 3 float numbers between 0. and 1. describing respectively Red, Green and Blue color values
    • bgr: 3 float numbers between 0. and 1. describing respectively Blue, Green and Red color values
    • argb8: 4 int numbers between 0 and 255 describing respectively Alpha, Red, Green and Blue color values
    • hsv: 3 float numbers between 0. and 1. describing respectively Hue, Saturation and Value (Luminosity) color values in the * HSV colorspace
    • cmy8: 3 int numbers between 0 and 255 describing respectively Cyan, Magenta, and Yellow color values
    • cmyk8: 4 int numbers between 0 and 255 describing respectively Cyan, Magenta, Yellow and Black color values
  • Angle
    • radian
    • degree
  • Distance
    • meter
    • kilometer
    • decimeter
    • centimeter
    • millimeter
    • micrometer
    • nanometer
    • picometer
    • inch
    • foot
    • mile
  • Time
    • second
    • bark
    • bpm
    • cent
    • frequency (freq, frequence, Hz, hz, Hertz):
    • mel
    • midi_pitch (midinote):
    • millisecond (ms)
    • playback_speed
    • sample (the length of a sample, for a sample_rate of 44100Hz)
  • Gain
    • linear: A linear gain in the [0. 1.] range, with 1. being the nominal level
    • midigain: A value in the [0 127] range mimicking a MIDI gain controller. 100 for the nominal level, 127 for +12dB
    • decibel (db, dB): 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, clipped at -96dB)
    • decibel_raw Same as deciBel, but unclipped.
  • Speed
    • meter_per_second
    • miles_per_hour
    • kilometer_per_hour
    • knot
    • foot_per_second
    • foot_per_hour

◆ get_unit()

std::string opp::node::get_unit ( ) const

gets the unit of this node's parameter

Returns
a string with this node's parameter's unit name
See also
ossia::unit_t

◆ set_default_value()

node & opp::node::set_default_value ( value  v)

sets the default_value attribute of this node's parameter

A default value for a given node. Useful for resetting to a default state.

Parameters
van opp::value with this node's parameter's default value
Returns
a reference to this node
See also
ossia::unit_t

◆ get_default_value()

value opp::node::get_default_value ( )

gets the default_value attribute of this node's parameter

Returns
an opp::value with this node's parameter's default value

◆ set_repetition_filter()

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.

Parameters
van bool: true to filter out this node's parameter's value repetitions
Returns
a reference to this node

◆ get_repetition_filter()

bool opp::node::get_repetition_filter ( ) const

gets the repetition_filter attribute of this node's parameter

Returns
a bool: true if this node's parameter's value repetitions are filtered out

◆ set_refresh_rate()

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.

Parameters
van int with this node's parameter's refresh_rate value
Returns
a reference to this node

◆ unset_refresh_rate()

node & opp::node::unset_refresh_rate ( )

unsets the refresh_rate attribute of this node's parameter

Returns
a reference to this node

◆ get_refresh_rate()

int opp::node::get_refresh_rate ( )

gets the refresh_rate attribute of this node's parameter

Returns
a float with this node's parameter's refresh_rate value

◆ set_value_step_size()

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.

Parameters
vthe increment size
Returns
a reference to this node

◆ unset_value_step_size()

node & opp::node::unset_value_step_size ( )

unsets the value_step_size attribute of this node's parameter

Returns
a reference to this node

◆ get_value_step_size()

double opp::node::get_value_step_size ( )

gets the value_step_size attribute of this node's parameter

Returns
a float with this node's parameter's refresh_rate value

◆ set_priority()

node & opp::node::set_priority ( float  v)

sets the priority attribute of this node's parameter

Nodes with the highest priority should execute first.

Parameters
va float with this node's parameter's priority value (higher numbers for higher priorities)
Returns
a reference to this node

◆ unset_priority()

node & opp::node::unset_priority ( )

unsets the priority attribute of this node's parameter

Returns
a reference to this node

◆ get_priority()

float opp::node::get_priority ( )

gets the priority attribute of this node's parameter

Returns
a float with this node's parameter's priority value (higher numbers for higher priorities)

◆ set_disabled()

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.

Parameters
va bool: true to disable this node's parameter
Returns
a reference to this node

◆ get_disabled()

bool opp::node::get_disabled ( ) const

gets the disabled attribute of this node's parameter

Returns
a bool: true if the node's parameter is disabled

◆ set_muted()

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.

Parameters
va bool: true to mute this node's parameter
Returns
a reference to this node

◆ get_muted()

bool opp::node::get_muted ( ) const

gets the muted attribute of this node's parameter

Returns
a bool: true if the node's parameter is muted

◆ set_critical()

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.

Parameters
va bool: true to mark this node's parameter as critical
Returns
a reference to this node

◆ get_critical()

bool opp::node::get_critical ( ) const

gets the critical attribute of this node's parameter

Returns
a bool: true if the node's parameter is critical

◆ set_description()

node & opp::node::set_description ( std::string  v)

sets this node's description attribute

An std::optional textual description.

Parameters
va string with the textual description of this node
Returns
a reference to this node

◆ get_description()

std::string opp::node::get_description ( ) const

gets this node's description attribute

Returns
a string with the textual description of this node

◆ set_tags()

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.

Parameters
va vector of strings with the desired tags of this node'
Returns
a reference to this node

◆ get_tags()

std::vector< std::string > opp::node::get_tags ( ) const

gets this node's tags attribute

Returns
a string with this node's tags

◆ set_instance_bounds()

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.

Parameters
minthe minimum number of instances this node can have
maxthe maximum number of instances this node can have
Returns
a reference to this node

◆ unset_instance_bounds()

node & opp::node::unset_instance_bounds ( )

unset how many instances this node can have

Returns
a reference to this node

◆ get_instance_bounds()

std::pair< int, int > opp::node::get_instance_bounds ( ) const

gets how many instances this node can have

Returns
a std::pair with the minimum and maximum number of instances this node can have

◆ set_hidden()

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.

Parameters
va bool: true to hide this node
Returns
a reference to this node

◆ get_hidden()

bool opp::node::get_hidden ( ) const

gets this node's hidden attribute

Returns
a bool: true if the node is hidden

◆ get_zombie()

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.

Returns
a bool: true if the node has been zombified

◆ load_preset()

void opp::node::load_preset ( const std::string &  filename)

load_preset: load JSON preset from a file

Parameters
filename

◆ save_preset()

void opp::node::save_preset ( const std::string &  filename)

save_preset: save JSON preset to a file

Parameters
filename

◆ get_raw_node_pointer()

ossia::net::node_base* opp::node::get_raw_node_pointer ( )
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)