From fa067527fe00b66b85d71955e152e9ef9215c9cd Mon Sep 17 00:00:00 2001
From: David Robillard
\b /ingen/polyphonic - Notification an object's polyphonic property has changed. - * \arg \b path (string) - Path of object - * \arg \b polyphonic (bool) - Whether or not object is polyphonic (from it's parent's perspective). - * - * \li This is a notification that the object is externally polyphonic, - * i.e. its parent sees several independent buffers for a single port, one for each voice. - * An object can be internally polyphonic but externally not if the voices are mixed down; - * this is true of some instruments and subpatches with mismatched polyphony.
\n \n - */ -void -OSCClientSender::polyphonic(const std::string& path, - bool polyphonic) -{ - if (!_enabled) - return; - - if (polyphonic) - lo_send(_address, "/ingen/polyphonic", "sT", path.c_str()); - else - lo_send(_address, "/ingen/polyphonic", "sF", path.c_str()); -} - - /** \page client_osc_namespace *\b /ingen/destroyed - Notification an object has been destroyed * \arg \b path (string) - Path of object (which no longer exists)
\n \n @@ -297,21 +267,6 @@ OSCClientSender::patch_cleared(const std::string& patch_path) } -/** \page client_osc_namespace - *\b /ingen/patch_polyphony - Notification a patch's DSP processing has been polyphony. - * \arg \b path (string) - Path of polyphony patch
\n \n - */ -void -OSCClientSender::patch_polyphony(const std::string& patch_path, uint32_t poly) -{ - if (!_enabled) - return; - - lo_send(_address, "/ingen/patch_polyphony", "si", patch_path.c_str(), poly); -} - - - /** \page client_osc_namespace *\b /ingen/new_connection - Notification a new connection has been made. * \arg \b src-path (string) - Path of the source port diff --git a/src/libs/engine/OSCClientSender.hpp b/src/libs/engine/OSCClientSender.hpp index 714e17b2..9a79f934 100644 --- a/src/libs/engine/OSCClientSender.hpp +++ b/src/libs/engine/OSCClientSender.hpp @@ -79,20 +79,13 @@ public: virtual void new_patch(const std::string& path, uint32_t poly); virtual void new_node(const std::string& path, - const std::string& plugin_uri, - bool is_polyphonic); + const std::string& plugin_uri); virtual void new_port(const std::string& path, uint32_t index, const std::string& data_type, bool is_output); - virtual void polyphonic(const std::string& path, - bool polyphonic); - - virtual void patch_polyphony(const std::string& path, - uint32_t poly); - virtual void patch_cleared(const std::string& path); virtual void object_destroyed(const std::string& path); diff --git a/src/libs/engine/OSCEngineReceiver.cpp b/src/libs/engine/OSCEngineReceiver.cpp index afac70b0..b9e2a70d 100644 --- a/src/libs/engine/OSCEngineReceiver.cpp +++ b/src/libs/engine/OSCEngineReceiver.cpp @@ -92,10 +92,10 @@ OSCEngineReceiver::OSCEngineReceiver(Engine& engine, size_t queue_size, uint16_t lo_server_add_method(_server, "/ingen/set_polyphonic", "isT", set_polyphonic_cb, this); lo_server_add_method(_server, "/ingen/set_polyphonic", "isF", set_polyphonic_cb, this); lo_server_add_method(_server, "/ingen/new_port", "issi", new_port_cb, this); - lo_server_add_method(_server, "/ingen/new_node", "issssT", new_node_cb, this); - lo_server_add_method(_server, "/ingen/new_node", "issssF", new_node_cb, this); - lo_server_add_method(_server, "/ingen/new_node", "issT", new_node_by_uri_cb, this); - lo_server_add_method(_server, "/ingen/new_node", "issF", new_node_by_uri_cb, this); + lo_server_add_method(_server, "/ingen/new_node", "issss", new_node_cb, this); + lo_server_add_method(_server, "/ingen/new_node", "issss", new_node_cb, this); + lo_server_add_method(_server, "/ingen/new_node", "iss", new_node_by_uri_cb, this); + lo_server_add_method(_server, "/ingen/new_node", "iss", new_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); @@ -477,17 +477,15 @@ OSCEngineReceiver::_new_port_cb(const char* path, const char* types, lo_arg** ar *
\b /ingen/new_node - Add a node into a given patch (load a plugin by URI) * \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 polyphonic (boolean) - Whether node is polyphonic
\n \n + * \arg \b plug-uri (string) - URI of the plugin to load \n \n */ int OSCEngineReceiver::_new_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; - bool polyphonic = (types[3] == 'T'); - new_node(node_path, plug_uri, polyphonic); + new_node(node_path, plug_uri); return 0; } @@ -498,8 +496,7 @@ OSCEngineReceiver::_new_node_by_uri_cb(const char* path, const char* types, lo_a * \arg \b node-path (string) - Full path of the new node (ie. /patch2/subpatch/newnode) * \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 (boolean) - Whether node is polyphonic + * \arg \b plug-label (string) - Label (ID) of plugin (eg "sine_fcaa") \n \n * * \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. @@ -512,9 +509,8 @@ OSCEngineReceiver::_new_node_cb(const char* path, const char* types, lo_arg** ar 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'); - new_node_deprecated(node_path, type, lib_name, plug_label, polyphonic); + new_node_deprecated(node_path, type, lib_name, plug_label); return 0; } diff --git a/src/libs/engine/ObjectSender.cpp b/src/libs/engine/ObjectSender.cpp index 82500446..3a716a28 100644 --- a/src/libs/engine/ObjectSender.cpp +++ b/src/libs/engine/ObjectSender.cpp @@ -36,7 +36,7 @@ ObjectSender::send_patch(ClientInterface* client, const PatchImpl* patch, bool r client->bundle_begin(); client->new_patch(patch->path(), patch->internal_polyphony()); - client->polyphonic(patch->path(), patch->polyphonic()); + client->set_property(patch->path(), "ingen:polyphonic", patch->polyphonic()); // Send variable const GraphObjectImpl::Variables& data = patch->variables(); @@ -94,8 +94,8 @@ ObjectSender::send_node(ClientInterface* client, const NodeImpl* node, bool recu client->bundle_begin(); - client->new_node(node->path(), node->plugin()->uri(), node->polyphonic()); - client->polyphonic(node->path(), node->polyphonic()); + client->new_node(node->path(), node->plugin()->uri()); + client->set_property(node->path(), "ingen:polyphonic", node->polyphonic()); // Send variable const GraphObjectImpl::Variables& data = node->variables(); @@ -120,7 +120,7 @@ ObjectSender::send_port(ClientInterface* client, const PortImpl* port) client->bundle_begin(); client->new_port(port->path(), port->index(), port->type().uri(), port->is_output()); - client->polyphonic(port->path(), port->polyphonic()); + client->set_property(port->path(), "ingen:polyphonic", port->polyphonic()); // Send variable const GraphObjectImpl::Variables& data = port->variables(); diff --git a/src/libs/engine/QueuedEngineInterface.cpp b/src/libs/engine/QueuedEngineInterface.cpp index 6deeb727..23b9c77e 100644 --- a/src/libs/engine/QueuedEngineInterface.cpp +++ b/src/libs/engine/QueuedEngineInterface.cpp @@ -157,11 +157,10 @@ void QueuedEngineInterface::new_port(const string& path, void QueuedEngineInterface::new_node(const string& path, - const string& plugin_uri, - bool polyphonic) + const string& plugin_uri) { push_queued(new CreateNodeEvent(_engine, _responder, now(), - path, plugin_uri, polyphonic)); + path, plugin_uri, true)); // FIXME: polyphonic by default } @@ -169,11 +168,10 @@ void QueuedEngineInterface::new_node_deprecated(const string& path, const string& plugin_type, const string& plugin_lib, - const string& plugin_label, - bool polyphonic) + const string& plugin_label) { push_queued(new CreateNodeEvent(_engine, _responder, now(), - path, plugin_type, plugin_lib, plugin_label, polyphonic)); + path, plugin_type, plugin_lib, plugin_label, true)); // FIXME: polyphonic by default } void @@ -359,12 +357,21 @@ QueuedEngineInterface::request_port_value(const string& port_path) push_queued(new RequestPortValueEvent(_engine, _responder, now(), port_path)); } + void QueuedEngineInterface::request_variable(const string& object_path, const string& key) { - push_queued(new RequestMetadataEvent(_engine, _responder, now(), object_path, key)); + push_queued(new RequestMetadataEvent(_engine, _responder, now(), false, object_path, key)); } + +void +QueuedEngineInterface::request_property(const string& object_path, const string& key) +{ + push_queued(new RequestMetadataEvent(_engine, _responder, now(), true, object_path, key)); +} + + void QueuedEngineInterface::request_plugins() { diff --git a/src/libs/engine/QueuedEngineInterface.hpp b/src/libs/engine/QueuedEngineInterface.hpp index 585f1104..6fea3708 100644 --- a/src/libs/engine/QueuedEngineInterface.hpp +++ b/src/libs/engine/QueuedEngineInterface.hpp @@ -90,15 +90,13 @@ public: bool direction); virtual void new_node(const string& path, - const string& plugin_uri, - bool polyphonic); + const string& plugin_uri); /** FIXME: DEPRECATED, REMOVE */ virtual void new_node_deprecated(const string& path, const string& plugin_type, const string& lib_path, - const string& plug_label, - bool polyphonic); + const string& plug_label); virtual void rename(const string& old_path, const string& new_name); @@ -155,17 +153,12 @@ public: // Requests // virtual void ping(); - virtual void request_plugin(const string& uri); - virtual void request_object(const string& path); - virtual void request_port_value(const string& port_path); - virtual void request_variable(const string& object_path, const string& key); - + virtual void request_property(const string& object_path, const string& key); virtual void request_plugins(); - virtual void request_all_objects(); protected: diff --git a/src/libs/engine/events/RequestMetadataEvent.cpp b/src/libs/engine/events/RequestMetadataEvent.cpp index 23a3ac7b..733a6a82 100644 --- a/src/libs/engine/events/RequestMetadataEvent.cpp +++ b/src/libs/engine/events/RequestMetadataEvent.cpp @@ -28,11 +28,17 @@ using std::string; namespace Ingen { -RequestMetadataEvent::RequestMetadataEvent(Engine& engine, SharedPtr