summaryrefslogtreecommitdiffstats
path: root/src/libs/engine/OSCEngineReceiver.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-09-19 21:16:18 +0000
committerDavid Robillard <d@drobilla.net>2007-09-19 21:16:18 +0000
commit0b8415c61e321d032d62b5b1cbda65bab6f178d7 (patch)
tree7ed101634641999660e697cf2e6a5f1415b9b438 /src/libs/engine/OSCEngineReceiver.cpp
parenta054212abbdb26e03ca42c91d0c86819d445bc5f (diff)
downloadingen-0b8415c61e321d032d62b5b1cbda65bab6f178d7.tar.gz
ingen-0b8415c61e321d032d62b5b1cbda65bab6f178d7.tar.bz2
ingen-0b8415c61e321d032d62b5b1cbda65bab6f178d7.zip
Tidy up OSC namespace to use OSC true/false instead of C style boolean integers.
Fully separate concept of "polyphonic" (boolean node property) from "polyphony" (integer patch/node property). Ability to add "polyphonic" nodes to poly=1 patches (in case poly is changed later). git-svn-id: http://svn.drobilla.net/lad/ingen@732 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/engine/OSCEngineReceiver.cpp')
-rw-r--r--src/libs/engine/OSCEngineReceiver.cpp33
1 files changed, 17 insertions, 16 deletions
diff --git a/src/libs/engine/OSCEngineReceiver.cpp b/src/libs/engine/OSCEngineReceiver.cpp
index d922d3c9..68790300 100644
--- a/src/libs/engine/OSCEngineReceiver.cpp
+++ b/src/libs/engine/OSCEngineReceiver.cpp
@@ -85,8 +85,10 @@ OSCEngineReceiver::OSCEngineReceiver(Engine& engine, size_t queue_size, uint16_t
lo_server_add_method(_server, "/ingen/clear_patch", "is", clear_patch_cb, this);
lo_server_add_method(_server, "/ingen/set_polyphony", "isi", set_polyphony_cb, this);
lo_server_add_method(_server, "/ingen/create_port", "issi", create_port_cb, this);
- lo_server_add_method(_server, "/ingen/create_node", "issssi", create_node_cb, this);
- lo_server_add_method(_server, "/ingen/create_node", "issi", create_node_by_uri_cb, this);
+ lo_server_add_method(_server, "/ingen/create_node", "issssT", create_node_cb, this);
+ lo_server_add_method(_server, "/ingen/create_node", "issssF", create_node_cb, this);
+ lo_server_add_method(_server, "/ingen/create_node", "issT", create_node_by_uri_cb, this);
+ lo_server_add_method(_server, "/ingen/create_node", "issF", create_node_by_uri_cb, this);
lo_server_add_method(_server, "/ingen/destroy", "is", destroy_cb, this);
lo_server_add_method(_server, "/ingen/rename", "iss", rename_cb, this);
lo_server_add_method(_server, "/ingen/connect", "iss", connect_cb, this);
@@ -478,18 +480,17 @@ OSCEngineReceiver::_create_port_cb(const char* path, const char* types, lo_arg**
* \arg \b response-id (integer)
* \arg \b node-path (string) - Full path of the new node (ie. /patch2/subpatch/newnode)
* \arg \b plug-uri (string) - URI of the plugin to load
- * \arg \b poly (integer-boolean) - Whether node is polyphonic (0 = false, 1 = true) </p> \n \n
+ * \arg \b polyphonic (boolean) - Whether node is polyphonic </p> \n \n
*/
int
OSCEngineReceiver::_create_node_by_uri_cb(const char* path, const char* types, lo_arg** argv, int argc, lo_message msg)
{
- const char* node_path = &argv[1]->s;
- const char* plug_uri = &argv[2]->s;
- const int32_t poly = argv[3]->i;
+ const char* node_path = &argv[1]->s;
+ const char* plug_uri = &argv[2]->s;
+ bool polyphonic = (types[3] == 'T');
- // FIXME: make sure poly is valid
-
- create_node(node_path, plug_uri, (poly == 1));
+ create_node(node_path, plug_uri, polyphonic);
+
return 0;
}
@@ -501,7 +502,7 @@ OSCEngineReceiver::_create_node_by_uri_cb(const char* path, const char* types, l
* \arg \b type (string) - Plugin type ("LADSPA" or "Internal")
* \arg \b lib-name (string) - Name of library where plugin resides (eg "cmt.so")
* \arg \b plug-label (string) - Label (ID) of plugin (eg "sine_fcaa")
- * \arg \b poly (integer-boolean) - Whether node is polyphonic (0 = false, 1 = true)
+ * \arg \b poly (boolean) - Whether node is polyphonic
*
* \li This is only here to provide backwards compatibility for old patches that store LADSPA plugin
* references as libname, label. It is to be removed ASAP, don't use it.
@@ -510,13 +511,13 @@ OSCEngineReceiver::_create_node_by_uri_cb(const char* path, const char* types, l
int
OSCEngineReceiver::_create_node_cb(const char* path, const char* types, lo_arg** argv, int argc, lo_message msg)
{
- const char* node_path = &argv[1]->s;
- const char* type = &argv[2]->s;
- const char* lib_name = &argv[3]->s;
- const char* plug_label = &argv[4]->s;
- const int32_t poly = argv[5]->i;
+ const char* node_path = &argv[1]->s;
+ const char* type = &argv[2]->s;
+ const char* lib_name = &argv[3]->s;
+ const char* plug_label = &argv[4]->s;
+ bool polyphonic = (types[5] == 'T');
- create_node(node_path, type, lib_name, plug_label, (poly == 1));
+ create_node(node_path, type, lib_name, plug_label, polyphonic);
return 0;
}