OSSIA
Open Scenario System for Interactive Application
Parameter

Parameter creation, and attributes. More...

Detailed Description

Parameter creation, and attributes.

See also
ossia::net::parameter_base

Enumerations

enum  ossia_type {
  FLOAT_T , INT_T , VEC2F_T , VEC3F_T ,
  VEC4F_T , IMPULSE_T , BOOL_T , STRING_T ,
  LIST_T , CHAR_T
}
 
enum  ossia_access_mode { BI , GET , SET }
 
enum  ossia_bounding_mode {
  FREE , CLIP , WRAP , FOLD ,
  LOW , HIGH
}
 

Functions

OSSIA_EXPORT ossia_node_t ossia_parameter_get_node (ossia_parameter_t param)
 Return the node a parameter is part of. More...
 
OSSIA_EXPORT void ossia_parameter_set_access_mode (ossia_parameter_t param, ossia_access_mode am)
 
OSSIA_EXPORT ossia_access_mode ossia_parameter_get_access_mode (ossia_parameter_t param)
 
OSSIA_EXPORT void ossia_parameter_set_bounding_mode (ossia_parameter_t param, ossia_bounding_mode bm)
 
OSSIA_EXPORT ossia_bounding_mode ossia_parameter_get_bounding_mode (ossia_parameter_t param)
 
OSSIA_EXPORT void ossia_parameter_set_domain (ossia_parameter_t param, ossia_domain_t domain)
 
OSSIA_EXPORT ossia_domain_t ossia_parameter_get_domain (ossia_parameter_t param)
 
OSSIA_EXPORT void ossia_parameter_set_unit (ossia_parameter_t param, const char *unit)
 
OSSIA_EXPORT const char * ossia_parameter_get_unit (ossia_parameter_t param)
 
OSSIA_EXPORT void ossia_parameter_set_muted (ossia_parameter_t param, int muted)
 
OSSIA_EXPORT int ossia_parameter_get_muted (ossia_parameter_t param)
 
OSSIA_EXPORT void ossia_parameter_set_disabled (ossia_parameter_t param, int disabled)
 
OSSIA_EXPORT int ossia_parameter_get_disabled (ossia_parameter_t param)
 
OSSIA_EXPORT void ossia_parameter_set_critical (ossia_parameter_t param, int critical)
 
OSSIA_EXPORT int ossia_parameter_get_critical (ossia_parameter_t param)
 
OSSIA_EXPORT void ossia_parameter_set_repetition_filter (ossia_parameter_t param, int repetition_filter)
 
OSSIA_EXPORT int ossia_parameter_get_repetition_filter (ossia_parameter_t param)
 
OSSIA_EXPORT void ossia_parameter_set_value (ossia_parameter_t param, ossia_value_t value)
 
OSSIA_EXPORT ossia_value_t ossia_parameter_get_value (ossia_parameter_t param)
 
OSSIA_EXPORT int ossia_parameter_to_int (ossia_parameter_t val)
 Get the value if it is an int. More...
 
OSSIA_EXPORT float ossia_parameter_to_float (ossia_parameter_t val)
 Get the value if it is an float. More...
 
OSSIA_EXPORT struct ossia_vec2f ossia_parameter_to_2f (ossia_parameter_t val)
 Get the value if it is a vec2f. More...
 
OSSIA_EXPORT struct ossia_vec3f ossia_parameter_to_3f (ossia_parameter_t val)
 Get the value if it is a vec3f. More...
 
OSSIA_EXPORT struct ossia_vec4f ossia_parameter_to_4f (ossia_parameter_t val)
 Get the value if it is a vec4f. More...
 
OSSIA_EXPORT int ossia_parameter_to_bool (ossia_parameter_t val)
 Get the value if it is a bool. More...
 
OSSIA_EXPORT void ossia_parameter_to_byte_array (ossia_parameter_t val, char **str, size_t *sz)
 Get the value if it is a byte array. More...
 
OSSIA_EXPORT const char * ossia_parameter_to_string (ossia_parameter_t val)
 Get the value if it is a null-terminated string. More...
 
OSSIA_EXPORT void ossia_parameter_to_list (ossia_parameter_t val_in, ossia_value_t **out, size_t *size)
 Get the value if it is a list. More...
 
OSSIA_EXPORT void ossia_parameter_to_fn (ossia_parameter_t val_in, float **out, size_t *size)
 Get the value if it is a list of floats. More...
 
OSSIA_EXPORT void ossia_parameter_to_in (ossia_parameter_t val_in, int **out, size_t *size)
 Get the value if it is a list of ints. More...
 
OSSIA_EXPORT void ossia_parameter_push_value (ossia_parameter_t param, ossia_value_t value)
 
OSSIA_EXPORT void ossia_parameter_push_impulse (ossia_parameter_t param)
 
OSSIA_EXPORT void ossia_parameter_push_i (ossia_parameter_t param, int value)
 
OSSIA_EXPORT void ossia_parameter_push_b (ossia_parameter_t param, int b)
 
OSSIA_EXPORT void ossia_parameter_push_f (ossia_parameter_t param, float value)
 
OSSIA_EXPORT void ossia_parameter_push_2f (ossia_parameter_t param, float v1, float v2)
 
OSSIA_EXPORT void ossia_parameter_push_3f (ossia_parameter_t param, float v1, float v2, float v3)
 
OSSIA_EXPORT void ossia_parameter_push_4f (ossia_parameter_t param, float v1, float v2, float v3, float v4)
 
OSSIA_EXPORT void ossia_parameter_push_c (ossia_parameter_t param, char value)
 
OSSIA_EXPORT void ossia_parameter_push_s (ossia_parameter_t param, const char *value)
 
OSSIA_EXPORT void ossia_parameter_push_in (ossia_parameter_t param, const int *value, size_t sz)
 Push an array of integers. More...
 
OSSIA_EXPORT void ossia_parameter_push_fn (ossia_parameter_t param, const float *value, size_t sz)
 Push an array of floats. More...
 
OSSIA_EXPORT void ossia_parameter_push_cn (ossia_parameter_t param, const char *value, size_t sz)
 Push a string with known length. More...
 
OSSIA_EXPORT void ossia_parameter_push_list (ossia_parameter_t param, const ossia_value_t *value, size_t sz)
 Push an array of values. More...
 
OSSIA_EXPORT ossia_value_t ossia_parameter_fetch_value (ossia_parameter_t param)
 Fetch the value of a parameter. More...
 
OSSIA_EXPORT void ossia_parameter_set_listening (ossia_parameter_t param, int listening)
 Enable or disable remote updates for a given address. More...
 
OSSIA_EXPORT ossia_value_callback_idx_t ossia_parameter_add_callback (ossia_parameter_t param, ossia_value_callback_t callback, void *ctx)
 Add a callback called when the value of a parameter changes. More...
 
OSSIA_EXPORT void ossia_parameter_push_callback (ossia_parameter_t param, ossia_value_callback_t callback, void *ctx)
 Add a callback called when the value of a parameter changes. More...
 
OSSIA_EXPORT void ossia_parameter_remove_callback (ossia_parameter_t param, ossia_value_callback_idx_t index)
 Remove a callback added with ossia_parameter_add_callback. More...
 
OSSIA_EXPORT void ossia_parameter_free_callback_idx (ossia_value_callback_idx_t)
 Free a callback index. More...
 

Enumeration Type Documentation

◆ ossia_type

◆ ossia_access_mode

◆ ossia_bounding_mode

Function Documentation

◆ ossia_parameter_get_node()

OSSIA_EXPORT ossia_node_t ossia_parameter_get_node ( ossia_parameter_t  param)

Return the node a parameter is part of.

Note
Multithread guarantees: Data-Safe.

◆ ossia_parameter_set_access_mode()

OSSIA_EXPORT void ossia_parameter_set_access_mode ( ossia_parameter_t  param,
ossia_access_mode  am 
)
See also
ossia::net::set_access_mode
Note
Multithread guarantees: Data-Safe.

◆ ossia_parameter_get_access_mode()

OSSIA_EXPORT ossia_access_mode ossia_parameter_get_access_mode ( ossia_parameter_t  param)
See also
ossia::net::get_access_mode
Note
Multithread guarantees: Data-Safe.

◆ ossia_parameter_set_bounding_mode()

OSSIA_EXPORT void ossia_parameter_set_bounding_mode ( ossia_parameter_t  param,
ossia_bounding_mode  bm 
)
See also
ossia::net::set_bounding_mode
Note
Multithread guarantees: Data-Safe.

◆ ossia_parameter_get_bounding_mode()

OSSIA_EXPORT ossia_bounding_mode ossia_parameter_get_bounding_mode ( ossia_parameter_t  param)
See also
ossia::net::get_bounding_mode
Note
Multithread guarantees: Data-Safe.

◆ ossia_parameter_set_domain()

OSSIA_EXPORT void ossia_parameter_set_domain ( ossia_parameter_t  param,
ossia_domain_t  domain 
)
See also
ossia::net::set_domain
Note
Multithread guarantees: Data-Safe.

◆ ossia_parameter_get_domain()

OSSIA_EXPORT ossia_domain_t ossia_parameter_get_domain ( ossia_parameter_t  param)
See also
ossia::net::get_domain
Note
Multithread guarantees: Data-Safe.

◆ ossia_parameter_set_unit()

OSSIA_EXPORT void ossia_parameter_set_unit ( ossia_parameter_t  param,
const char *  unit 
)
See also
ossia::net::set_unit
Note
Multithread guarantees: Data-Safe.

◆ ossia_parameter_get_unit()

OSSIA_EXPORT const char* ossia_parameter_get_unit ( ossia_parameter_t  param)
See also
ossia::net::get_unit
Note
Multithread guarantees: Data-Safe.
No need to free

◆ ossia_parameter_set_muted()

OSSIA_EXPORT void ossia_parameter_set_muted ( ossia_parameter_t  param,
int  muted 
)
See also
ossia::net::set_muted
Note
Multithread guarantees: Data-Safe.

◆ ossia_parameter_get_muted()

OSSIA_EXPORT int ossia_parameter_get_muted ( ossia_parameter_t  param)
See also
ossia::net::get_muted
Note
Multithread guarantees: Data-Safe.

◆ ossia_parameter_set_disabled()

OSSIA_EXPORT void ossia_parameter_set_disabled ( ossia_parameter_t  param,
int  disabled 
)
See also
ossia::net::set_disabled
Note
Multithread guarantees: Data-Safe.

◆ ossia_parameter_get_disabled()

OSSIA_EXPORT int ossia_parameter_get_disabled ( ossia_parameter_t  param)
See also
ossia::net::get_disabled
Note
Multithread guarantees: Data-Safe.

◆ ossia_parameter_set_critical()

OSSIA_EXPORT void ossia_parameter_set_critical ( ossia_parameter_t  param,
int  critical 
)
See also
ossia::net::set_critical
Note
Multithread guarantees: Data-Safe.

◆ ossia_parameter_get_critical()

OSSIA_EXPORT int ossia_parameter_get_critical ( ossia_parameter_t  param)
See also
ossia::net::get_critical
Note
Multithread guarantees: Data-Safe.

◆ ossia_parameter_set_repetition_filter()

OSSIA_EXPORT void ossia_parameter_set_repetition_filter ( ossia_parameter_t  param,
int  repetition_filter 
)
See also
ossia::net::set_repetition_filter
Note
Multithread guarantees: Data-Safe.

repetition_filter is a boolean value.

◆ ossia_parameter_get_repetition_filter()

OSSIA_EXPORT int ossia_parameter_get_repetition_filter ( ossia_parameter_t  param)
See also
ossia::net::get_repetition_filter
Note
Multithread guarantees: Data-Safe.
No need to free

◆ ossia_parameter_set_value()

OSSIA_EXPORT void ossia_parameter_set_value ( ossia_parameter_t  param,
ossia_value_t  value 
)
See also
ossia::net::parameter_base::set_value
Note
Multithread guarantees: Data-Safe.

◆ ossia_parameter_get_value()

OSSIA_EXPORT ossia_value_t ossia_parameter_get_value ( ossia_parameter_t  param)
See also
ossia::net::parameter_base::value
Note
Multithread guarantees: Data-Safe.

◆ ossia_parameter_to_int()

OSSIA_EXPORT int ossia_parameter_to_int ( ossia_parameter_t  val)

Get the value if it is an int.

Returns
Undefined if ossia_value_get_type(ossia_parameter_get_value(val)) != INT_T
Note
Multithread guarantees: Data-Safe.

◆ ossia_parameter_to_float()

OSSIA_EXPORT float ossia_parameter_to_float ( ossia_parameter_t  val)

Get the value if it is an float.

Returns
Undefined if ossia_value_get_type(ossia_parameter_get_value(val)) != FLOAT_T
Note
Multithread guarantees: Data-Safe.

◆ ossia_parameter_to_2f()

OSSIA_EXPORT struct ossia_vec2f ossia_parameter_to_2f ( ossia_parameter_t  val)

Get the value if it is a vec2f.

Returns
Undefined if ossia_value_get_type(ossia_parameter_get_value(val)) != VEC2F_T
Note
Multithread guarantees: Data-Safe.

◆ ossia_parameter_to_3f()

OSSIA_EXPORT struct ossia_vec3f ossia_parameter_to_3f ( ossia_parameter_t  val)

Get the value if it is a vec3f.

Returns
Undefined if ossia_value_get_type(ossia_parameter_get_value(val)) != VEC3F_T
Note
Multithread guarantees: Data-Safe.

◆ ossia_parameter_to_4f()

OSSIA_EXPORT struct ossia_vec4f ossia_parameter_to_4f ( ossia_parameter_t  val)

Get the value if it is a vec4f.

Returns
Undefined if ossia_value_get_type(ossia_parameter_get_value(val)) != VEC4F_T
Note
Multithread guarantees: Data-Safe.

◆ ossia_parameter_to_bool()

OSSIA_EXPORT int ossia_parameter_to_bool ( ossia_parameter_t  val)

Get the value if it is a bool.

Returns
Undefined if ossia_value_get_type(ossia_parameter_get_value(val)) != BOOL_T
Note
Multithread guarantees: Data-Safe.

◆ ossia_parameter_to_byte_array()

OSSIA_EXPORT void ossia_parameter_to_byte_array ( ossia_parameter_t  val,
char **  str,
size_t *  sz 
)

Get the value if it is a byte array.

Returns
Undefined if ossia_value_get_type(ossia_parameter_get_value(val)) != STRING_T
Note
Multithread guarantees: Data-Safe.

Usage:

char* str;
size_t b;
void ossia_parameter_to_byte_array(ossia_parameter_t address, char **out, size_t *size)
Get the value if it is a byte array.
Definition: ossia_parameter.cpp:223
See also
ossia_string_free

◆ ossia_parameter_to_string()

OSSIA_EXPORT const char* ossia_parameter_to_string ( ossia_parameter_t  val)

Get the value if it is a null-terminated string.

Returns
Undefined if ossia_value_get_type(ossia_parameter_get_value(val)) != STRING_T
Note
Multithread guarantees: Data-Safe.
See also
ossia_string_free

◆ ossia_parameter_to_list()

OSSIA_EXPORT void ossia_parameter_to_list ( ossia_parameter_t  val_in,
ossia_value_t **  out,
size_t *  size 
)

Get the value if it is a list.

Returns
Undefined if ossia_value_get_type(ossia_parameter_get_value(val)) != LIST_T
Note
Multithread guarantees: Data-Safe.
See also
ossia_value_free_list

◆ ossia_parameter_to_fn()

OSSIA_EXPORT void ossia_parameter_to_fn ( ossia_parameter_t  val_in,
float **  out,
size_t *  size 
)

Get the value if it is a list of floats.

Returns
Undefined if ossia_value_get_type(ossia_parameter_get_value(val)) != LIST_T or any of the values are not FLOAT_T.
Note
Multithread guarantees: Data-Safe.
See also
ossia_value_free_list

◆ ossia_parameter_to_in()

OSSIA_EXPORT void ossia_parameter_to_in ( ossia_parameter_t  val_in,
int **  out,
size_t *  size 
)

Get the value if it is a list of ints.

Returns
Undefined if ossia_value_get_type(ossia_parameter_get_value(val)) != LIST_T or any of the values are not INT_T.
Note
Multithread guarantees: Data-Safe.
See also
ossia_value_free_list

◆ ossia_parameter_push_value()

OSSIA_EXPORT void ossia_parameter_push_value ( ossia_parameter_t  param,
ossia_value_t  value 
)
See also
ossia::net::parameter_base::push_value
Note
Multithread guarantees: Data-Safe.

◆ ossia_parameter_push_impulse()

OSSIA_EXPORT void ossia_parameter_push_impulse ( ossia_parameter_t  param)
See also
ossia::net::parameter_base::push_value
Note
Multithread guarantees: Data-Safe.

◆ ossia_parameter_push_i()

OSSIA_EXPORT void ossia_parameter_push_i ( ossia_parameter_t  param,
int  value 
)
See also
ossia::net::parameter_base::push_value
Note
Multithread guarantees: Data-Safe.

◆ ossia_parameter_push_b()

OSSIA_EXPORT void ossia_parameter_push_b ( ossia_parameter_t  param,
int  b 
)
See also
ossia::net::parameter_base::push_value
Note
Multithread guarantees: Data-Safe.

b is a boolean, 0 for false, 1 for true.

◆ ossia_parameter_push_f()

OSSIA_EXPORT void ossia_parameter_push_f ( ossia_parameter_t  param,
float  value 
)
See also
ossia::net::parameter_base::push_value
Note
Multithread guarantees: Data-Safe.

◆ ossia_parameter_push_2f()

OSSIA_EXPORT void ossia_parameter_push_2f ( ossia_parameter_t  param,
float  v1,
float  v2 
)
See also
ossia::net::parameter_base::push_value
Note
Multithread guarantees: Data-Safe.

◆ ossia_parameter_push_3f()

OSSIA_EXPORT void ossia_parameter_push_3f ( ossia_parameter_t  param,
float  v1,
float  v2,
float  v3 
)
See also
ossia::net::parameter_base::push_value
Note
Multithread guarantees: Data-Safe.

◆ ossia_parameter_push_4f()

OSSIA_EXPORT void ossia_parameter_push_4f ( ossia_parameter_t  param,
float  v1,
float  v2,
float  v3,
float  v4 
)
See also
ossia::net::parameter_base::push_value
Note
Multithread guarantees: Data-Safe.

◆ ossia_parameter_push_c()

OSSIA_EXPORT void ossia_parameter_push_c ( ossia_parameter_t  param,
char  value 
)
See also
ossia::net::parameter_base::push_value
Note
Multithread guarantees: Data-Safe.

◆ ossia_parameter_push_s()

OSSIA_EXPORT void ossia_parameter_push_s ( ossia_parameter_t  param,
const char *  value 
)
See also
ossia::net::parameter_base::push_value
Note
Multithread guarantees: Data-Safe.

◆ ossia_parameter_push_in()

OSSIA_EXPORT void ossia_parameter_push_in ( ossia_parameter_t  param,
const int *  value,
size_t  sz 
)

Push an array of integers.

See also
ossia::net::parameter_base::push_value
Note
Multithread guarantees: Data-Safe.

◆ ossia_parameter_push_fn()

OSSIA_EXPORT void ossia_parameter_push_fn ( ossia_parameter_t  param,
const float *  value,
size_t  sz 
)

Push an array of floats.

See also
ossia::net::parameter_base::push_value
Note
Multithread guarantees: Data-Safe.

◆ ossia_parameter_push_cn()

OSSIA_EXPORT void ossia_parameter_push_cn ( ossia_parameter_t  param,
const char *  value,
size_t  sz 
)

Push a string with known length.

See also
ossia::net::parameter_base::push_value
Note
Multithread guarantees: Data-Safe.

◆ ossia_parameter_push_list()

OSSIA_EXPORT void ossia_parameter_push_list ( ossia_parameter_t  param,
const ossia_value_t *  value,
size_t  sz 
)

Push an array of values.

See also
ossia::net::parameter_base::push_value
Note
Multithread guarantees: Data-Safe.

◆ ossia_parameter_fetch_value()

OSSIA_EXPORT ossia_value_t ossia_parameter_fetch_value ( ossia_parameter_t  param)

Fetch the value of a parameter.

See also
ossia::net::parameter_base::fetch_value
Returns
Fetched value
Note
Multithread guarantees: Data-Safe.

◆ ossia_parameter_set_listening()

OSSIA_EXPORT void ossia_parameter_set_listening ( ossia_parameter_t  param,
int  listening 
)

Enable or disable remote updates for a given address.

Note
Multithread guarantees: Safe.

◆ ossia_parameter_add_callback()

OSSIA_EXPORT ossia_value_callback_idx_t ossia_parameter_add_callback ( ossia_parameter_t  param,
ossia_value_callback_t  callback,
void *  ctx 
)

Add a callback called when the value of a parameter changes.

Parameters
addressAddress on which the callback must be added.
callbackFunction to be called.
ctxWill be passed to the callback.
Returns
An identifier to be able to remove the callback on a later date.
See also
ossia::net::parameter_base::add_callback
Note
Multithread guarantees: MT-Safe. The callback is called from the thread where the value was changed.

◆ ossia_parameter_push_callback()

OSSIA_EXPORT void ossia_parameter_push_callback ( ossia_parameter_t  param,
ossia_value_callback_t  callback,
void *  ctx 
)

Add a callback called when the value of a parameter changes.

Parameters
addressAddress on which the callback must be added.
callbackFunction to be called.
ctxWill be passed to the callback.
See also
ossia::net::parameter_base::add_callback
Note
Multithread guarantees: MT-Safe. The callback is called from the thread where the value was changed.

◆ ossia_parameter_remove_callback()

OSSIA_EXPORT void ossia_parameter_remove_callback ( ossia_parameter_t  param,
ossia_value_callback_idx_t  index 
)

Remove a callback added with ossia_parameter_add_callback.

Parameters
addressAddress on which the callback must be removed
indexIdentifier of the callback
Note
The callback index must not be used afterwards
Multithread guarantees: MT-Safe.

◆ ossia_parameter_free_callback_idx()

OSSIA_EXPORT void ossia_parameter_free_callback_idx ( ossia_value_callback_idx_t  cb)

Free a callback index.

Note
Multithread guarantees: MT-Safe.