diff options
author | David Robillard <d@drobilla.net> | 2009-05-27 17:42:51 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2009-05-27 17:42:51 +0000 |
commit | c11ecf0fd10641218326ae384e80413ba3cdf46c (patch) | |
tree | 52ea61f88167a2e7eacc8fa5ff0ee39ee25b2e7e /src/client | |
parent | 8feac4ed0e764c677d4d208377e956c6db94d2dd (diff) | |
download | ingen-c11ecf0fd10641218326ae384e80413ba3cdf46c.tar.gz ingen-c11ecf0fd10641218326ae384e80413ba3cdf46c.tar.bz2 ingen-c11ecf0fd10641218326ae384e80413ba3cdf46c.zip |
Remove 'new_patch', 'new_node', and 'new_port' from interface in favour of generic 'put'.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2011 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/client')
-rw-r--r-- | src/client/ClientStore.cpp | 108 | ||||
-rw-r--r-- | src/client/ClientStore.hpp | 4 | ||||
-rw-r--r-- | src/client/DeprecatedLoader.cpp | 65 | ||||
-rw-r--r-- | src/client/HTTPEngineSender.cpp | 32 | ||||
-rw-r--r-- | src/client/HTTPEngineSender.hpp | 14 | ||||
-rw-r--r-- | src/client/OSCClientReceiver.cpp | 40 | ||||
-rw-r--r-- | src/client/OSCClientReceiver.hpp | 2 | ||||
-rw-r--r-- | src/client/OSCEngineSender.cpp | 66 | ||||
-rw-r--r-- | src/client/OSCEngineSender.hpp | 14 | ||||
-rw-r--r-- | src/client/ObjectModel.cpp | 2 | ||||
-rw-r--r-- | src/client/ObjectModel.hpp | 6 | ||||
-rw-r--r-- | src/client/PluginModel.cpp | 2 | ||||
-rw-r--r-- | src/client/SigClientInterface.hpp | 18 | ||||
-rw-r--r-- | src/client/ThreadedSigClientInterface.cpp | 26 | ||||
-rw-r--r-- | src/client/ThreadedSigClientInterface.hpp | 18 |
15 files changed, 116 insertions, 301 deletions
diff --git a/src/client/ClientStore.cpp b/src/client/ClientStore.cpp index 64b6ae09..c28bdca0 100644 --- a/src/client/ClientStore.cpp +++ b/src/client/ClientStore.cpp @@ -45,11 +45,8 @@ ClientStore::ClientStore(SharedPtr<EngineInterface> engine, SharedPtr<SigClientI emitter->signal_object_destroyed.connect(sigc::mem_fun(this, &ClientStore::destroy)); emitter->signal_object_renamed.connect(sigc::mem_fun(this, &ClientStore::rename)); - emitter->signal_new_object.connect(sigc::mem_fun(this, &ClientStore::new_object)); emitter->signal_new_plugin.connect(sigc::mem_fun(this, &ClientStore::new_plugin)); - emitter->signal_new_patch.connect(sigc::mem_fun(this, &ClientStore::new_patch)); - emitter->signal_new_node.connect(sigc::mem_fun(this, &ClientStore::new_node)); - emitter->signal_new_port.connect(sigc::mem_fun(this, &ClientStore::new_port)); + emitter->signal_put.connect(sigc::mem_fun(this, &ClientStore::put)); emitter->signal_clear_patch.connect(sigc::mem_fun(this, &ClientStore::clear_patch)); emitter->signal_connection.connect(sigc::mem_fun(this, &ClientStore::connect)); emitter->signal_disconnection.connect(sigc::mem_fun(this, &ClientStore::disconnect)); @@ -78,7 +75,6 @@ ClientStore::add_object(SharedPtr<ObjectModel> object) if (existing != end()) { PtrCast<ObjectModel>(existing->second)->set(object); } else { - if (!object->path().is_root()) { SharedPtr<ObjectModel> parent = this->object(object->path().parent()); if (parent) { @@ -271,69 +267,61 @@ ClientStore::new_plugin(const URI& uri, const URI& type_uri, const Symbol& symbo } -bool -ClientStore::new_object(const Shared::GraphObject* object) -{ - using namespace Shared; - - const Patch* patch = dynamic_cast<const Patch*>(object); - if (patch) { - new_patch(patch->path(), patch->internal_polyphony()); - return true; - } - - const Node* node = dynamic_cast<const Node*>(object); - if (node) { - new_node(node->path(), node->plugin()->uri()); - return true; - } - - const Port* port = dynamic_cast<const Port*>(object); - if (port) { - new_port(port->path(), port->type().uri(), port->index(), !port->is_input()); - return true; - } - - return false; -} - - void -ClientStore::new_patch(const Path& path, uint32_t poly) +ClientStore::put(const Path& path, const Resource::Properties& properties) { - SharedPtr<PatchModel> p(new PatchModel(path, poly)); - add_object(p); -} - - -void -ClientStore::new_node(const Path& path, const URI& plugin_uri) -{ - SharedPtr<PluginModel> plug = plugin(plugin_uri); - if (!plug) { - SharedPtr<NodeModel> n(new NodeModel(plugin_uri, path)); - //add_plugin_orphan(n); - add_object(n); + typedef Resource::Properties::const_iterator iterator; + cerr << "CLIENT PUT " << path << " {" << endl; + for (iterator i = properties.begin(); i != properties.end(); ++i) + cerr << "\t" << i->first << " = " << i->second << " :: " << i->second.type() << endl; + cerr << "}" << endl; + + bool is_patch, is_node, is_port, is_output; + DataType data_type(DataType::UNKNOWN); + ResourceImpl::type(properties, is_patch, is_node, is_port, is_output, data_type); + + if (is_patch) { + uint32_t poly = 1; + iterator p = properties.find("ingen:polyphony"); + if (p != properties.end() && p->second.is_valid() && p->second.type() == Atom::INT) + poly = p->second.get_int32(); + SharedPtr<PatchModel> model(new PatchModel(path, poly)); + model->merge_properties(properties); + add_object(model); + } else if (is_node) { + const Resource::Properties::const_iterator p = properties.find("rdf:instanceOf"); + SharedPtr<PluginModel> plug; + if (p->second.is_valid() && p->second.type() == Atom::URI) { + if ((plug = plugin(p->second.get_uri()))) { + SharedPtr<NodeModel> n(new NodeModel(plug, path)); + n->merge_properties(properties); + add_object(n); + } else { + SharedPtr<NodeModel> n(new NodeModel(p->second.get_uri(), path)); + n->merge_properties(properties); + //add_plugin_orphan(n); + add_object(n); + } + } else { + cerr << "ERROR: Plugin with no type" << endl; + } + } else if (is_port) { + if (data_type != DataType::UNKNOWN) { + PortModel::Direction pdir = is_output ? PortModel::OUTPUT : PortModel::INPUT; + SharedPtr<PortModel> p(new PortModel(path, 0, data_type, pdir)); + p->merge_properties(properties); + add_object(p); + } else { + cerr << "WARNING: Illegal port " << path << endl; + } } else { - SharedPtr<NodeModel> n(new NodeModel(plug, path)); - add_object(n); + cerr << "WARNING: Ignoring object " << path << " with unknown type " + << is_patch << " " << is_node << " " << is_port << endl; } } void -ClientStore::new_port(const Path& path, const URI& type, uint32_t index, bool is_output) -{ - PortModel::Direction pdir = is_output ? PortModel::OUTPUT : PortModel::INPUT; - - SharedPtr<PortModel> p(new PortModel(path, index, type, pdir)); - add_object(p); - /*if (p->parent()) - resolve_connection_orphans(p);*/ -} - - -void ClientStore::clear_patch(const Path& path) { iterator i = find(path); diff --git a/src/client/ClientStore.hpp b/src/client/ClientStore.hpp index 63949d1d..68b87889 100644 --- a/src/client/ClientStore.hpp +++ b/src/client/ClientStore.hpp @@ -69,9 +69,7 @@ public: // CommonInterface void new_plugin(const Raul::URI& uri, const Raul::URI& type_uri, const Raul::Symbol& symbol); bool new_object(const Shared::GraphObject* object); - void new_patch(const Raul::Path& path, uint32_t poly); - void new_node(const Raul::Path& path, const Raul::URI& plugin_uri); - void new_port(const Raul::Path& path, const Raul::URI& type, uint32_t index, bool is_output); + void put(const Raul::Path& path, const Shared::Resource::Properties& properties); void rename(const Raul::Path& old_path, const Raul::Path& new_path); void set_variable(const Raul::URI& subject_path, const Raul::URI& predicate, const Raul::Atom& value); void set_property(const Raul::URI& subject_path, const Raul::URI& predicate, const Raul::Atom& value); diff --git a/src/client/DeprecatedLoader.cpp b/src/client/DeprecatedLoader.cpp index 261b1e35..f593c3be 100644 --- a/src/client/DeprecatedLoader.cpp +++ b/src/client/DeprecatedLoader.cpp @@ -50,20 +50,20 @@ namespace Client { class ControlModel { public: - ControlModel(const Raul::Path& port_path, float value) + ControlModel(const Path& port_path, float value) : _port_path(port_path) , _value(value) { assert(_port_path.find("//") == string::npos); } - const Raul::Path& port_path() const { return _port_path; } + const Path& port_path() const { return _port_path; } void port_path(const string& p) { _port_path = p; } float value() const { return _value; } void value(float v) { _value = v; } private: - Raul::Path _port_path; + Path _port_path; float _value; }; @@ -171,9 +171,9 @@ DeprecatedLoader::add_variable(GraphObject::Properties& data, string old_key, st free(locale); if (endptr != c_val && *endptr == '\0') - data[key] = Atom(fval); + data.insert(make_pair(key, Atom(fval))); else - data[key] = Atom(Atom::STRING, value); + data.insert(make_pair(key, Atom(Atom::STRING, value))); free(c_val); } @@ -229,7 +229,7 @@ DeprecatedLoader::load_patch(const Glib::ustring& filename, poly = poly_param->second.get_int32(); if (initial_data.find("filename") == initial_data.end()) - initial_data["filename"] = Atom(filename.c_str()); // FIXME: URL? + initial_data.insert(make_pair("filename", Atom(filename.c_str()))); // FIXME: URL? xmlDocPtr doc = xmlParseFile(filename.c_str()); @@ -292,7 +292,10 @@ DeprecatedLoader::load_patch(const Glib::ustring& filename, // Create it, if we're not merging if (!existing && !path.is_root()) { - _engine->new_patch(path, poly); + Resource::Properties props; + props.insert(make_pair("rdf:type", Atom(Atom::URI, "ingen:Patch"))); + props.insert(make_pair("ingen:polyphony", Atom((int32_t)poly))); + _engine->put(path, props); for (GraphObject::Properties::const_iterator i = initial_data.begin(); i != initial_data.end(); ++i) _engine->set_variable(path, i->first, i->second); } @@ -450,27 +453,37 @@ DeprecatedLoader::load_node(const Path& parent, xmlDocPtr doc, const xmlNodePtr if (plugin_uri == "") { bool is_port = false; + Resource::Properties props; + props.insert(make_pair("rdf:type", Atom(Atom::URI, "ingen:Patch"))); + if (plugin_type == "Internal") { - // FIXME: indices + is_port = true; if (plugin_label == "audio_input") { - _engine->new_port(path, "lv2:AudioPort", 0, false); - is_port = true; + props.insert(make_pair("rdf:type", Atom(Atom::URI, "lv2:AudioPort"))); + props.insert(make_pair("rdf:type", Atom(Atom::URI, "lv2:InputPort"))); + _engine->put(path, props); } else if (plugin_label == "audio_output") { - _engine->new_port(path, "lv2:AudioPort", 0, true); - is_port = true; + props.insert(make_pair("rdf:type", Atom(Atom::URI, "lv2:AudioPort"))); + props.insert(make_pair("rdf:type", Atom(Atom::URI, "lv2:OutputPort"))); + _engine->put(path, props); } else if (plugin_label == "control_input") { - _engine->new_port(path, "lv2:ControlPort", 0, false); - is_port = true; + props.insert(make_pair("rdf:type", Atom(Atom::URI, "lv2:ControlPort"))); + props.insert(make_pair("rdf:type", Atom(Atom::URI, "lv2:InputPort"))); + _engine->put(path, props); } else if (plugin_label == "control_output" ) { - _engine->new_port(path, "lv2:ControlPort", 0, true); - is_port = true; + props.insert(make_pair("rdf:type", Atom(Atom::URI, "lv2:ControlPort"))); + props.insert(make_pair("rdf:type", Atom(Atom::URI, "lv2:OutputPort"))); + _engine->put(path, props); } else if (plugin_label == "midi_input") { - _engine->new_port(path, "lv2ev:EventPort", 0, false); - is_port = true; + props.insert(make_pair("rdf:type", Atom(Atom::URI, "lv2ev:EventPort"))); + props.insert(make_pair("rdf:type", Atom(Atom::URI, "lv2:InputPort"))); + _engine->put(path, props); } else if (plugin_label == "midi_output" ) { - _engine->new_port(path, "lv2ev:EventPort", 0, true); - is_port = true; + props.insert(make_pair("rdf:type", Atom(Atom::URI, "lv2ev:EventPort"))); + props.insert(make_pair("rdf:type", Atom(Atom::URI, "lv2:OutputPort"))); + _engine->put(path, props); } else { + is_port = false; cerr << "WARNING: Unknown internal plugin label \"" << plugin_label << "\"" << endl; } } @@ -491,6 +504,8 @@ DeprecatedLoader::load_node(const Path& parent, xmlDocPtr doc, const xmlNodePtr path = new_path; + _engine->put(path, props); + for (GraphObject::Properties::const_iterator i = initial_data.begin(); i != initial_data.end(); ++i) _engine->set_variable(path, i->first, i->second); @@ -510,7 +525,10 @@ DeprecatedLoader::load_node(const Path& parent, xmlDocPtr doc, const xmlNodePtr if (plugin_uri == "") plugin_uri = "om:" + plugin_type + ":" + library_name + ":" + plugin_label; - _engine->new_node(path, plugin_uri); + Resource::Properties props; + props.insert(make_pair("rdf:type", Atom(Atom::URI, "ingen:Node"))); + props.insert(make_pair("rdf:instanceOf", Atom(Atom::URI, plugin_uri))); + _engine->put(path, props); _engine->set_variable(path, "ingen:polyphonic", bool(polyphonic)); @@ -522,7 +540,10 @@ DeprecatedLoader::load_node(const Path& parent, xmlDocPtr doc, const xmlNodePtr // Not deprecated } else { - _engine->new_node(path, plugin_uri); + Resource::Properties props; + props.insert(make_pair("rdf:type", Atom(Atom::URI, "ingen:Node"))); + props.insert(make_pair("rdf:instanceOf", Atom(Atom::URI, plugin_uri))); + _engine->put(path, props); _engine->set_variable(path, "ingen:polyphonic", bool(polyphonic)); for (GraphObject::Properties::const_iterator i = initial_data.begin(); i != initial_data.end(); ++i) _engine->set_variable(path, i->first, i->second); diff --git a/src/client/HTTPEngineSender.cpp b/src/client/HTTPEngineSender.cpp index 443dcfb6..596793f9 100644 --- a/src/client/HTTPEngineSender.cpp +++ b/src/client/HTTPEngineSender.cpp @@ -102,39 +102,11 @@ HTTPEngineSender::quit() // Object commands -bool -HTTPEngineSender::new_object(const Shared::GraphObject* object) -{ - return false; -} - - -void -HTTPEngineSender::new_patch(const Path& path, - uint32_t poly) -{ -} - - -void -HTTPEngineSender::new_port(const Path& path, - const URI& type, - uint32_t index, - bool is_output) -{ - const string uri = _engine_url.str() + "/patch" + path.str(); - cout << "HTTP " << uri << " NEW PORT: " << path << endl; - SoupMessage* msg = soup_message_new("PUT", uri.c_str()); - string str = string("NEW PORT").append(path.str()).append(type.str()); - soup_message_set_request(msg, "application/x-turtle", - SOUP_MEMORY_COPY, str.c_str(), str.length()); - soup_session_send_message(_session, msg); -} void -HTTPEngineSender::new_node(const Path& path, - const URI& plugin_uri) +HTTPEngineSender::put(const Raul::Path& path, + const Shared::Resource::Properties& properties) { } diff --git a/src/client/HTTPEngineSender.hpp b/src/client/HTTPEngineSender.hpp index f30b9e37..41107cb0 100644 --- a/src/client/HTTPEngineSender.hpp +++ b/src/client/HTTPEngineSender.hpp @@ -74,18 +74,8 @@ public: // Object commands - virtual bool new_object(const Shared::GraphObject* object); - - virtual void new_patch(const Raul::Path& path, - uint32_t poly); - - virtual void new_node(const Raul::Path& path, - const Raul::URI& plugin_uri); - - virtual void new_port(const Raul::Path& path, - const Raul::URI& type, - uint32_t index, - bool is_output); + virtual void put(const Raul::Path& path, + const Shared::Resource::Properties& properties); virtual void clear_patch(const Raul::Path& path); diff --git a/src/client/OSCClientReceiver.cpp b/src/client/OSCClientReceiver.cpp index dac558f5..e8b8c33b 100644 --- a/src/client/OSCClientReceiver.cpp +++ b/src/client/OSCClientReceiver.cpp @@ -149,8 +149,8 @@ OSCClientReceiver::setup_callbacks() lo_server_thread_add_method(_st, "/ingen/rename", "ss", rename_cb, this); lo_server_thread_add_method(_st, "/ingen/new_connection", "ss", connection_cb, this); lo_server_thread_add_method(_st, "/ingen/disconnection", "ss", disconnection_cb, this); - lo_server_thread_add_method(_st, "/ingen/new_node", "ss", new_node_cb, this); lo_server_thread_add_method(_st, "/ingen/new_port", "sisi", new_port_cb, this); + lo_server_thread_add_method(_st, "/ingen/put", NULL, new_port_cb, this); lo_server_thread_add_method(_st, "/ingen/set_variable", NULL, set_variable_cb, this); lo_server_thread_add_method(_st, "/ingen/set_property", NULL, set_property_cb, this); lo_server_thread_add_method(_st, "/ingen/set_port_value", "sf", set_port_value_cb, this); @@ -170,14 +170,6 @@ OSCClientReceiver::_error_cb(const char* path, const char* types, lo_arg** argv, int -OSCClientReceiver::_new_patch_cb(const char* path, const char* types, lo_arg** argv, int argc, lo_message msg) -{ - _target->new_patch(&argv[0]->s, argv[1]->i); // path, poly - return 0; -} - - -int OSCClientReceiver::_destroyed_cb(const char* path, const char* types, lo_arg** argv, int argc, lo_message msg) { _target->destroy((const char*)&argv[0]->s); @@ -225,36 +217,6 @@ OSCClientReceiver::_disconnection_cb(const char* path, const char* types, lo_arg } -/** Notification of a new node creation. - */ -int -OSCClientReceiver::_new_node_cb(const char* path, const char* types, lo_arg** argv, int argc, lo_message msg) -{ - const char* uri = &argv[0]->s; - const char* node_path = &argv[1]->s; - - _target->new_node(uri, node_path); - - return 0; -} - - -/** Notification of a new port creation. - */ -int -OSCClientReceiver::_new_port_cb(const char* path, const char* types, lo_arg** argv, int argc, lo_message msg) -{ - const char* port_path = &argv[0]->s; - const uint32_t index = argv[1]->i; - const char* type = &argv[2]->s; - const bool is_output = (argv[3]->i == 1); - - _target->new_port(port_path, type, index, is_output); - - return 0; -} - - /** Notification of a new or updated variable. */ int diff --git a/src/client/OSCClientReceiver.hpp b/src/client/OSCClientReceiver.hpp index 7608fff3..58f66836 100644 --- a/src/client/OSCClientReceiver.hpp +++ b/src/client/OSCClientReceiver.hpp @@ -89,8 +89,8 @@ private: LO_HANDLER(rename); LO_HANDLER(connection); LO_HANDLER(disconnection); - LO_HANDLER(new_node); LO_HANDLER(new_port); + LO_HANDLER(put); LO_HANDLER(set_variable); LO_HANDLER(set_property); LO_HANDLER(set_port_value); diff --git a/src/client/OSCEngineSender.cpp b/src/client/OSCEngineSender.cpp index 86e9e8a8..23a98934 100644 --- a/src/client/OSCEngineSender.cpp +++ b/src/client/OSCEngineSender.cpp @@ -132,71 +132,11 @@ OSCEngineSender::quit() // Object commands -bool -OSCEngineSender::new_object(const Shared::GraphObject* object) -{ - using namespace Shared; - - const Patch* patch = dynamic_cast<const Patch*>(object); - if (patch) { - new_patch(patch->path(), patch->internal_polyphony()); - return true; - } - - const Node* node = dynamic_cast<const Node*>(object); - if (node) { - new_node(node->path(), node->plugin()->uri()); - return true; - } - - const Port* port = dynamic_cast<const Port*>(object); - if (port) { - new_port(port->path(), port->type().uri(), port->index(), !port->is_input()); - return true; - } - - return false; -} - - void -OSCEngineSender::new_patch(const Path& path, - uint32_t poly) +OSCEngineSender::put(const Raul::Path& path, + const Shared::Resource::Properties& properties) { - send("/ingen/new_patch", "isi", - next_id(), - path.c_str(), - poly, - LO_ARGS_END); -} - - -void -OSCEngineSender::new_port(const Path& path, - const URI& type, - uint32_t index, - bool is_output) -{ - // FIXME: use index - send("/ingen/new_port", "issi", - next_id(), - path.c_str(), - type.c_str(), - (is_output ? 1 : 0), - LO_ARGS_END); -} - - -void -OSCEngineSender::new_node(const Path& path, - const URI& plugin_uri) -{ - - send("/ingen/new_node", "iss", - next_id(), - path.c_str(), - plugin_uri.c_str(), - LO_ARGS_END); + cerr << "OSC ENGINE PUT " << path << endl; } diff --git a/src/client/OSCEngineSender.hpp b/src/client/OSCEngineSender.hpp index 8383dd53..2b02ca6e 100644 --- a/src/client/OSCEngineSender.hpp +++ b/src/client/OSCEngineSender.hpp @@ -77,18 +77,8 @@ public: // Object commands - virtual bool new_object(const Shared::GraphObject* object); - - virtual void new_patch(const Raul::Path& path, - uint32_t poly); - - virtual void new_node(const Raul::Path& path, - const Raul::URI& plugin_uri); - - virtual void new_port(const Raul::Path& path, - const Raul::URI& type, - uint32_t index, - bool is_output); + virtual void put(const Raul::Path& path, + const Shared::Resource::Properties& properties); virtual void clear_patch(const Raul::Path& path); diff --git a/src/client/ObjectModel.cpp b/src/client/ObjectModel.cpp index ef4884e1..2d3251c6 100644 --- a/src/client/ObjectModel.cpp +++ b/src/client/ObjectModel.cpp @@ -105,7 +105,7 @@ ObjectModel::set(SharedPtr<ObjectModel> o) Properties::const_iterator mine = _variables.find(v->first); if (mine != _variables.end()) cerr << "WARNING: " << _path << "Client/Server variable mismatch: " << v->first << endl; - _variables[v->first] = v->second; + _variables.insert(make_pair(v->first, v->second)); signal_variable.emit(v->first, v->second); } } diff --git a/src/client/ObjectModel.hpp b/src/client/ObjectModel.hpp index e30ef2b2..8c7c631d 100644 --- a/src/client/ObjectModel.hpp +++ b/src/client/ObjectModel.hpp @@ -62,8 +62,10 @@ public: signal_property.emit(key, value); } - virtual void set_variable(const Raul::URI& key, const Raul::Atom& value) - { _variables[key] = value; signal_variable.emit(key, value); } + virtual void set_variable(const Raul::URI& key, const Raul::Atom& value) { + _variables.insert(make_pair(key, value)); + signal_variable.emit(key, value); + } const Properties& variables() const { return _variables; } Properties& variables() { return _variables; } diff --git a/src/client/PluginModel.cpp b/src/client/PluginModel.cpp index 9a470346..4db79091 100644 --- a/src/client/PluginModel.cpp +++ b/src/client/PluginModel.cpp @@ -43,7 +43,7 @@ PluginModel::PluginModel(const URI& uri, const URI& type_uri) { Glib::Mutex::Lock lock(_rdf_world->mutex()); assert(_rdf_world); - set_property("rdf:type", Raul::Atom(Raul::Atom::URI, this->type_uri())); + add_property("rdf:type", Raul::Atom(Raul::Atom::URI, this->type_uri())); #ifdef HAVE_SLV2 SLV2Value plugin_uri = slv2_value_new_uri(_slv2_world, uri.c_str()); _slv2_plugin = slv2_plugins_get_by_uri(_slv2_plugins, plugin_uri); diff --git a/src/client/SigClientInterface.hpp b/src/client/SigClientInterface.hpp index 128fddf0..7c3bee05 100644 --- a/src/client/SigClientInterface.hpp +++ b/src/client/SigClientInterface.hpp @@ -45,9 +45,6 @@ public: Raul::URI uri() const { return "ingen:internal"; } - // Signal parameters match up directly with ClientInterface calls - sigc::signal<bool, const Shared::GraphObject*> signal_new_object; - sigc::signal<void, int32_t> signal_response_ok; sigc::signal<void, int32_t, std::string> signal_response_error; sigc::signal<void> signal_bundle_begin; @@ -55,8 +52,8 @@ public: sigc::signal<void, std::string> signal_error; sigc::signal<void, Raul::URI, Raul::URI, Raul::Symbol> signal_new_plugin; sigc::signal<void, Raul::Path, uint32_t> signal_new_patch; - sigc::signal<void, Raul::Path, Raul::URI> signal_new_node; sigc::signal<void, Raul::Path, Raul::URI, uint32_t, bool> signal_new_port; + sigc::signal<void, Raul::Path, Shared::Resource::Properties> signal_put; sigc::signal<void, Raul::Path> signal_clear_patch; sigc::signal<void, Raul::Path, Raul::Path> signal_object_renamed; sigc::signal<void, Raul::Path> signal_object_destroyed; @@ -101,17 +98,8 @@ protected: void new_plugin(const Raul::URI& uri, const Raul::URI& type_uri, const Raul::Symbol& symbol) { if (_enabled) signal_new_plugin.emit(uri, type_uri, symbol); } - bool new_object(const Shared::GraphObject* object) - { if (_enabled) signal_new_object.emit(object); return false; } - - void new_patch(const Raul::Path& path, uint32_t poly) - { if (_enabled) signal_new_patch.emit(path, poly); } - - void new_node(const Raul::Path& path, const Raul::URI& plugin_uri) - { if (_enabled) signal_new_node.emit(path, plugin_uri); } - - void new_port(const Raul::Path& path, const Raul::URI& type, uint32_t index, bool is_output) - { if (_enabled) signal_new_port.emit(path, type, index, is_output); } + void put(const Raul::Path& path, const Shared::Resource::Properties& properties) + { if (_enabled) signal_put.emit(path, properties); } void connect(const Raul::Path& src_port_path, const Raul::Path& dst_port_path) { if (_enabled) signal_connection.emit(src_port_path, dst_port_path); } diff --git a/src/client/ThreadedSigClientInterface.cpp b/src/client/ThreadedSigClientInterface.cpp index c6ddd09e..5bd7e8b3 100644 --- a/src/client/ThreadedSigClientInterface.cpp +++ b/src/client/ThreadedSigClientInterface.cpp @@ -77,31 +77,5 @@ ThreadedSigClientInterface::emit_signals() } -bool -ThreadedSigClientInterface::new_object(const Shared::GraphObject* object) -{ - using namespace Shared; - const Patch* patch = dynamic_cast<const Patch*>(object); - if (patch) { - new_patch(patch->path(), patch->internal_polyphony()); - return true; - } - - const Node* node = dynamic_cast<const Node*>(object); - if (node) { - new_node(node->path(), node->plugin()->uri()); - return true; - } - - const Port* port = dynamic_cast<const Port*>(object); - if (port) { - new_port(port->path(), port->type().uri(), port->index(), !port->is_input()); - return true; - } - - return false; -} - - } // namespace Client } // namespace Ingen diff --git a/src/client/ThreadedSigClientInterface.hpp b/src/client/ThreadedSigClientInterface.hpp index 029a30c1..7b7d11e2 100644 --- a/src/client/ThreadedSigClientInterface.hpp +++ b/src/client/ThreadedSigClientInterface.hpp @@ -51,9 +51,8 @@ public: , response_error_slot(signal_response_error.make_slot()) , error_slot(signal_error.make_slot()) , new_plugin_slot(signal_new_plugin.make_slot()) - , new_patch_slot(signal_new_patch.make_slot()) - , new_node_slot(signal_new_node.make_slot()) , new_port_slot(signal_new_port.make_slot()) + , put_slot(signal_put.make_slot()) , connection_slot(signal_connection.make_slot()) , clear_patch_slot(signal_clear_patch.make_slot()) , object_destroyed_slot(signal_object_destroyed.make_slot()) @@ -93,16 +92,8 @@ public: void new_plugin(const Raul::URI& uri, const Raul::URI& type_uri, const Raul::Symbol& symbol) { push_sig(sigc::bind(new_plugin_slot, uri, type_uri, symbol)); } - bool new_object(const Shared::GraphObject* object); - - void new_patch(const Raul::Path& path, uint32_t poly) - { push_sig(sigc::bind(new_patch_slot, path, poly)); } - - void new_node(const Raul::Path& path, const Raul::URI& plugin_uri) - { push_sig(sigc::bind(new_node_slot, path, plugin_uri)); } - - void new_port(const Raul::Path& path, const Raul::URI& type, uint32_t index, bool is_output) - { push_sig(sigc::bind(new_port_slot, path, type, index, is_output)); } + void put(const Raul::Path& path, const Shared::Resource::Properties& properties) + { push_sig(sigc::bind(put_slot, path, properties)); } void connect(const Raul::Path& src_port_path, const Raul::Path& dst_port_path) { push_sig(sigc::bind(connection_slot, src_port_path, dst_port_path)); } @@ -152,9 +143,8 @@ private: sigc::slot<void, int32_t, std::string> response_error_slot; sigc::slot<void, std::string> error_slot; sigc::slot<void, Raul::URI, Raul::URI, Raul::Symbol> new_plugin_slot; - sigc::slot<void, Raul::Path, uint32_t> new_patch_slot; - sigc::slot<void, Raul::Path, Raul::URI> new_node_slot; sigc::slot<void, Raul::Path, Raul::URI, uint32_t, bool> new_port_slot; + sigc::slot<void, Raul::Path, Shared::Resource::Properties> put_slot; sigc::slot<void, Raul::Path, Raul::Path> connection_slot; sigc::slot<void, Raul::Path> clear_patch_slot; sigc::slot<void, Raul::Path> object_destroyed_slot; |