OSSIA
Open Scenario System for Interactive Application
|
Node creation, removal, finding. More...
Node creation, removal, finding.
Functions | |
OSSIA_EXPORT ossia_node_t | ossia_node_find (ossia_node_t root, const char *path) |
Find a child node. More... | |
OSSIA_EXPORT void | ossia_node_find_pattern (ossia_node_t root, const char *pattern, ossia_node_t **data, size_t *size) |
Find nodes matching a wildcard pattern. More... | |
OSSIA_EXPORT ossia_node_t | ossia_node_create (ossia_node_t root, const char *path) |
Create a child node. More... | |
OSSIA_EXPORT void | ossia_node_create_pattern (ossia_node_t root, const char *pattern, ossia_node_t **data, size_t *size) |
Create nodes matching a brace expansion pattern. More... | |
OSSIA_EXPORT void | ossia_node_array_free (ossia_node_t *) |
Free an array of nodes allocated with ossia_node_find_pattern or ossia_node_create_pattern. More... | |
OSSIA_EXPORT ossia_node_t | ossia_node_add_child (ossia_node_t node, const char *name) |
Create a direct child node. More... | |
OSSIA_EXPORT void | ossia_node_remove_child (ossia_node_t node, ossia_node_t name) |
Removes a direct child node. More... | |
OSSIA_EXPORT const char * | ossia_node_get_name (ossia_node_t node) |
Get the name of a node. More... | |
OSSIA_EXPORT ossia_device_t | ossia_node_get_device (ossia_node_t node) |
Get the root device of a node. More... | |
OSSIA_EXPORT int | ossia_node_child_size (ossia_node_t node) |
Get the number of children of a node. More... | |
OSSIA_EXPORT ossia_node_t | ossia_node_get_child (ossia_node_t node, int child_n) |
Get a specific direct child of a node. More... | |
OSSIA_EXPORT ossia_node_t | ossia_node_find_child (ossia_node_t node, const char *name) |
Find a direct child of a node by name. More... | |
OSSIA_EXPORT ossia_parameter_t | ossia_node_create_parameter (ossia_node_t node, ossia_type type) |
Create a parameter in a node. More... | |
OSSIA_EXPORT ossia_parameter_t | ossia_create_parameter (ossia_node_t node, const char *name, const char *type) |
Create a child parameter. More... | |
OSSIA_EXPORT ossia_parameter_t | ossia_node_get_parameter (ossia_node_t node) |
Get the address contained in a node if any. More... | |
OSSIA_EXPORT void | ossia_node_remove_parameter (ossia_node_t node) |
Remove the address contained in a node if any. More... | |
OSSIA_EXPORT ossia_node_callback_idx_t | ossia_node_add_deleting_callback (ossia_node_t node, ossia_node_callback_t callback, void *ctx) |
Add a callback called when a node is about to be removed. More... | |
OSSIA_EXPORT void | ossia_node_remove_deleting_callback (ossia_node_t node, ossia_node_callback_idx_t index) |
Remove a callback added with ossia_node_add_deleting_callback. More... | |
OSSIA_EXPORT void | ossia_node_set_description (ossia_node_t node, const char *description) |
OSSIA_EXPORT const char * | ossia_node_get_description (ossia_node_t node) |
OSSIA_EXPORT void | ossia_node_set_extended_type (ossia_node_t node, const char *extended_type) |
OSSIA_EXPORT const char * | ossia_node_get_extended_type (ossia_node_t node) |
OSSIA_EXPORT void | ossia_node_set_tags (ossia_node_t node, const char **tags, size_t sz) |
OSSIA_EXPORT void | ossia_node_get_tags (ossia_node_t node, char ***tags, size_t *sz) |
OSSIA_EXPORT void | ossia_tags_free (char **tags, size_t sz) |
Free tags allocated with ossia_node_get_tags. | |
OSSIA_EXPORT void | ossia_node_set_hidden (ossia_node_t node, int hidden) |
OSSIA_EXPORT int | ossia_node_get_hidden (ossia_node_t node) |
OSSIA_EXPORT void | ossia_node_set_refresh_rate (ossia_node_t node, int refresh_rate) |
OSSIA_EXPORT void | ossia_node_unset_refresh_rate (ossia_node_t node) |
OSSIA_EXPORT int | ossia_node_get_refresh_rate (ossia_node_t node, int *ok) |
OSSIA_EXPORT void | ossia_node_set_priority (ossia_node_t node, float priority) |
OSSIA_EXPORT void | ossia_node_unset_priority (ossia_node_t node) |
OSSIA_EXPORT float | ossia_node_get_priority (ossia_node_t node, int *ok) |
OSSIA_EXPORT void | ossia_node_set_value_step_size (ossia_node_t node, double value_step_size) |
OSSIA_EXPORT void | ossia_node_unset_value_step_size (ossia_node_t node) |
OSSIA_EXPORT double | ossia_node_get_value_step_size (ossia_node_t node, int *ok) |
OSSIA_EXPORT void | ossia_node_set_instance_bounds (ossia_node_t node, int min, int max) |
OSSIA_EXPORT void | ossia_node_unset_instance_bounds (ossia_node_t node) |
OSSIA_EXPORT void | ossia_node_get_instance_bounds (ossia_node_t node, int *min, int *max, int *ok) |
OSSIA_EXPORT void | ossia_node_set_default_value (ossia_node_t node, ossia_value_t default_value) |
OSSIA_EXPORT ossia_value_t | ossia_node_get_default_value (ossia_node_t node) |
OSSIA_EXPORT ossia_node_t ossia_node_find | ( | ossia_node_t | root, |
const char * | path | ||
) |
Find a child node.
root | The root node where the search starts from. |
name | An address such as "/foo/bar" |
OSSIA_EXPORT void ossia_node_find_pattern | ( | ossia_node_t | root, |
const char * | pattern, | ||
ossia_node_t ** | data, | ||
size_t * | size | ||
) |
Find nodes matching a wildcard pattern.
root | The root node where the search starts from. |
name | An address such as /foo.[0-5]/{bar,baz}* |
data | Where the found nodes will be stored. Set to NULL if none were found. |
size | Pointer to the number of found nodes. |
Usage:
OSSIA_EXPORT ossia_node_t ossia_node_create | ( | ossia_node_t | root, |
const char * | path | ||
) |
Create a child node.
root | The root node where the search starts from. |
name | An address such as "/foo/bar" |
Node creation follows the instance rules:
will create /foo/bar
, /foo/bar.1
, /foo/bar.2
. *
OSSIA_EXPORT void ossia_node_create_pattern | ( | ossia_node_t | root, |
const char * | pattern, | ||
ossia_node_t ** | data, | ||
size_t * | size | ||
) |
Create nodes matching a brace expansion pattern.
root | The root node where the creation starts from. |
name | An address such as /foo.[0-5]/{bar,baz} |
data | Where the created nodes will be stored. Set to NULL if none were created. |
size | Pointer to the number of created nodes. |
Usage:
OSSIA_EXPORT void ossia_node_array_free | ( | ossia_node_t * | data | ) |
Free an array of nodes allocated with ossia_node_find_pattern or ossia_node_create_pattern.
OSSIA_EXPORT ossia_node_t ossia_node_add_child | ( | ossia_node_t | node, |
const char * | name | ||
) |
Create a direct child node.
node | The parent |
name | The name of the node, e.g. "foo" |
OSSIA_EXPORT void ossia_node_remove_child | ( | ossia_node_t | node, |
ossia_node_t | name | ||
) |
Removes a direct child node.
node | The parent. |
name | The name of the node, e.g. "foo" |
OSSIA_EXPORT const char* ossia_node_get_name | ( | ossia_node_t | node | ) |
Get the name of a node.
OSSIA_EXPORT ossia_device_t ossia_node_get_device | ( | ossia_node_t | node | ) |
Get the root device of a node.
OSSIA_EXPORT int ossia_node_child_size | ( | ossia_node_t | node | ) |
Get the number of children of a node.
OSSIA_EXPORT ossia_node_t ossia_node_get_child | ( | ossia_node_t | node, |
int | child_n | ||
) |
Get a specific direct child of a node.
OSSIA_EXPORT ossia_node_t ossia_node_find_child | ( | ossia_node_t | node, |
const char * | name | ||
) |
Find a direct child of a node by name.
OSSIA_EXPORT ossia_parameter_t ossia_node_create_parameter | ( | ossia_node_t | node, |
ossia_type | type | ||
) |
Create a parameter in a node.
type | Type of the address |
OSSIA_EXPORT ossia_parameter_t ossia_create_parameter | ( | ossia_node_t | node, |
const char * | name, | ||
const char * | type | ||
) |
Create a child parameter.
type | Type of the address ("color.rgba8", "float", "i32"...) |
OSSIA_EXPORT ossia_parameter_t ossia_node_get_parameter | ( | ossia_node_t | node | ) |
Get the address contained in a node if any.
OSSIA_EXPORT void ossia_node_remove_parameter | ( | ossia_node_t | node | ) |
Remove the address contained in a node if any.
OSSIA_EXPORT ossia_node_callback_idx_t ossia_node_add_deleting_callback | ( | ossia_node_t | node, |
ossia_node_callback_t | callback, | ||
void * | ctx | ||
) |
Add a callback called when a node is about to be removed.
node | Node on which the callback is added. |
callback | Function to be called. |
ctx | Will be passed to the callback. |
OSSIA_EXPORT void ossia_node_remove_deleting_callback | ( | ossia_node_t | node, |
ossia_node_callback_idx_t | index | ||
) |
Remove a callback added with ossia_node_add_deleting_callback.
node | Node on which the callback must be removed. |
index | Index of the callback to remove. |
OSSIA_EXPORT void ossia_node_set_description | ( | ossia_node_t | node, |
const char * | description | ||
) |
OSSIA_EXPORT const char* ossia_node_get_description | ( | ossia_node_t | node | ) |
OSSIA_EXPORT void ossia_node_set_extended_type | ( | ossia_node_t | node, |
const char * | extended_type | ||
) |
OSSIA_EXPORT const char* ossia_node_get_extended_type | ( | ossia_node_t | node | ) |
OSSIA_EXPORT void ossia_node_set_tags | ( | ossia_node_t | node, |
const char ** | tags, | ||
size_t | sz | ||
) |
OSSIA_EXPORT void ossia_node_get_tags | ( | ossia_node_t | node, |
char *** | tags, | ||
size_t * | sz | ||
) |
OSSIA_EXPORT void ossia_node_set_hidden | ( | ossia_node_t | node, |
int | hidden | ||
) |
hidden is a boolean value.
OSSIA_EXPORT int ossia_node_get_hidden | ( | ossia_node_t | node | ) |
OSSIA_EXPORT void ossia_node_set_refresh_rate | ( | ossia_node_t | node, |
int | refresh_rate | ||
) |
OSSIA_EXPORT void ossia_node_unset_refresh_rate | ( | ossia_node_t | node | ) |
OSSIA_EXPORT int ossia_node_get_refresh_rate | ( | ossia_node_t | node, |
int * | ok | ||
) |
OSSIA_EXPORT void ossia_node_set_priority | ( | ossia_node_t | node, |
float | priority | ||
) |
OSSIA_EXPORT void ossia_node_unset_priority | ( | ossia_node_t | node | ) |
OSSIA_EXPORT float ossia_node_get_priority | ( | ossia_node_t | node, |
int * | ok | ||
) |
OSSIA_EXPORT void ossia_node_set_value_step_size | ( | ossia_node_t | node, |
double | value_step_size | ||
) |
OSSIA_EXPORT void ossia_node_unset_value_step_size | ( | ossia_node_t | node | ) |
OSSIA_EXPORT double ossia_node_get_value_step_size | ( | ossia_node_t | node, |
int * | ok | ||
) |
OSSIA_EXPORT void ossia_node_set_instance_bounds | ( | ossia_node_t | node, |
int | min, | ||
int | max | ||
) |
OSSIA_EXPORT void ossia_node_unset_instance_bounds | ( | ossia_node_t | node | ) |
OSSIA_EXPORT void ossia_node_get_instance_bounds | ( | ossia_node_t | node, |
int * | min, | ||
int * | max, | ||
int * | ok | ||
) |
OSSIA_EXPORT void ossia_node_set_default_value | ( | ossia_node_t | node, |
ossia_value_t | default_value | ||
) |
OSSIA_EXPORT ossia_value_t ossia_node_get_default_value | ( | ossia_node_t | node | ) |