OSSIA
Open Scenario System for Interactive Application
|
The oscquery_server class allows to create a local OSCQuery server. More...
The oscquery_server class allows to create a local OSCQuery server.
A device represents a tree of parameters.
Local devices map to real parameters on the executable libossia is used with. For instance the frequency of a filter, etc.
Devices can be mapped to different protocols: OSC, OSCQuery, Midi, etc.
For the sake of simplicity, the safeC++ (opp) binding ties together device and protocol implementation: OSCQuery protocol here.
Once a device has been created, it is possible to check what's in it by going to http://localhost:5678.
For more information on the OSCQuery protocol, please refer to the proposal: https://github.com/mrRay/OSCQueryProposal
Public Member Functions | |
oscquery_server () | |
declares a (yet to be configured) OSCQuery server More... | |
oscquery_server (std::string name, int oscPort=1234, int wsPort=5678) | |
declares and configures an OSCQuery server More... | |
~oscquery_server () | |
OSCQuery Server default destructor. | |
void | setup (std::string name, int oscPort=1234, int wsPort=5678) |
sets up an OSCQuery Server with the appropriate device name and ports More... | |
node | get_root_node () const |
get this server's root opp::node More... | |
void | set_echo (bool echo) |
enable/disable this server's echo More... | |
bool | get_echo () |
get this server's echo More... | |
void | set_connection_callback (connection_callback c, void *ctx) |
set a callback to be called when a connection is made to this device More... | |
void | remove_connection_callback () |
remove the previously set connection_callback | |
void | set_disconnection_callback (disconnection_callback c, void *ctx) |
set a callback to be called when a connection to this device is closed More... | |
void | remove_disconnection_callback () |
remove the previously set disconnection_callback | |
void | set_add_node_callback (add_node_callback c, void *ctx) |
set a callback to be called when a client request a node creation More... | |
void | remove_add_node_callback () |
void | set_remove_node_callback (remove_node_callback c, void *ctx) |
set a callback to be called when a client request a node deletion More... | |
void | remove_remove_node_callback () |
void | set_rename_node_callback (rename_node_callback c, void *ctx) |
set a callback to be called when a client request a node renaming More... | |
void | remove_rename_node_callback () |
bool | connected () const |
Returns true if the server is connected. | |
ossia::net::device_base * | get_raw_device_pointer () |
Get the raw device pointer. More... | |
opp::oscquery_server::oscquery_server | ( | ) |
declares a (yet to be configured) OSCQuery server
A server can be created without arguments. It will then have to be configured later on with opp::oscquery_server::setup
opp::oscquery_server::oscquery_server | ( | std::string | name, |
int | oscPort = 1234 , |
||
int | wsPort = 5678 |
||
) |
declares and configures an OSCQuery server
A server can be created and directly exposed using the OSCQuery protocol by giving it a name and std::optional OSC and websocket port numbers.
name | the name of the OSCQuery server |
oscPort | the OSC port to receive messages from (defaults to 1234) |
wsPort | the websocket port the server uses to manage queries (defaults to 5678) |
void opp::oscquery_server::setup | ( | std::string | name, |
int | oscPort = 1234 , |
||
int | wsPort = 5678 |
||
) |
sets up an OSCQuery Server with the appropriate device name and ports
When created without arguments, a server can be exposed using the OSCQuery protocol by giving it a name and std::optional OSC and websocket port numbers.
name | the name of the OSCQuery server |
oscPort | the OSC port to receive messages from (defaults to 1234) |
wsPort | the websocket port the server uses to manage queries (defaults to 5678) |
node opp::oscquery_server::get_root_node | ( | ) | const |
get this server's root opp::node
The root node of the server can be useful to create sub_nodes, with opp::node::create_child and all opp::node::create_* methods.
void opp::oscquery_server::set_echo | ( | bool | echo | ) |
enable/disable this server's echo
If echo is on, incoming values from the network will be reflected at the output of the device
bool opp::oscquery_server::get_echo | ( | ) |
get this server's echo
If echo is on, incoming values from the network will be reflected at the output of the device
void opp::oscquery_server::set_connection_callback | ( | connection_callback | c, |
void * | ctx | ||
) |
set a callback to be called when a connection is made to this device
c | the connection_callback |
ctx | the callback context as a void* |
void opp::oscquery_server::set_disconnection_callback | ( | disconnection_callback | c, |
void * | ctx | ||
) |
set a callback to be called when a connection to this device is closed
c | the connection_callback |
ctx | the callback context as a void* |
void opp::oscquery_server::set_add_node_callback | ( | add_node_callback | c, |
void * | ctx | ||
) |
set a callback to be called when a client request a node creation
c | the node removing callback |
ctx | the callback context as void* |
void opp::oscquery_server::set_remove_node_callback | ( | remove_node_callback | c, |
void * | ctx | ||
) |
set a callback to be called when a client request a node deletion
c | the node creation callback |
ctx | the callback context as void* |
void opp::oscquery_server::set_rename_node_callback | ( | rename_node_callback | c, |
void * | ctx | ||
) |
set a callback to be called when a client request a node renaming
c | the node renaming callback |
ctx | the callback context as void* |
|
inline |
Get the raw device 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)