From 0f9c8151d5b42b243a499bb31a1e1f0b2e8c5f6f Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 8 Feb 2015 07:02:59 +0000 Subject: Server-side copy paste with LV2 state support. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@5541 a436a847-0d15-0410-975c-d299462d15a1 --- src/client/BlockModel.cpp | 2 +- src/client/ClientStore.cpp | 24 ++++++++++++++++++------ 2 files changed, 19 insertions(+), 7 deletions(-) (limited to 'src/client') diff --git a/src/client/BlockModel.cpp b/src/client/BlockModel.cpp index f667cb3c..69aa9627 100644 --- a/src/client/BlockModel.cpp +++ b/src/client/BlockModel.cpp @@ -174,7 +174,7 @@ BlockModel::default_port_value_range(SPtr port, max = 1.0; // Get range from client-side LV2 data - if (_plugin && _plugin->type() == PluginModel::LV2) { + if (_plugin && _plugin->type() == PluginModel::LV2 && _plugin->lilv_plugin()) { if (!_min_values) { _num_values = lilv_plugin_get_num_ports(_plugin->lilv_plugin()); _min_values = new float[_num_values]; diff --git a/src/client/ClientStore.cpp b/src/client/ClientStore.cpp index 80f210fe..d6cd4248 100644 --- a/src/client/ClientStore.cpp +++ b/src/client/ClientStore.cpp @@ -33,11 +33,9 @@ namespace Client { ClientStore::ClientStore(URIs& uris, Log& log, - SPtr engine, SPtr emitter) : _uris(uris) , _log(log) - , _engine(engine) , _emitter(emitter) , _plugins(new Plugins()) { @@ -84,12 +82,13 @@ ClientStore::add_object(SPtr object) (*this)[object->path()] = object; _signal_new_object.emit(object); + } else { + _log.error(fmt("Object %1% with no parent\n") % object->path()); } } else { (*this)[object->path()] = object; _signal_new_object.emit(object); } - } for (auto p : object->properties()) @@ -208,6 +207,13 @@ ClientStore::del(const Raul::URI& uri) } } +void +ClientStore::copy(const Raul::Path& old_path, + const Raul::URI& new_uri) +{ + _log.error("Client store copy unsupported\n"); +} + void ClientStore::move(const Raul::Path& old_path, const Raul::Path& new_path) { @@ -291,7 +297,7 @@ ClientStore::put(const Raul::URI& uri, bm->set_properties(properties); add_object(bm); } else { - _log.warn(fmt("Block %1% has no plugin\n") + _log.warn(fmt("Block %1% has no prototype\n") % path.c_str()); } } else if (is_port) { @@ -302,8 +308,6 @@ ClientStore::put(const Raul::URI& uri, const Iterator i = properties.find(_uris.lv2_index); if (i != properties.end() && i->second.type() == _uris.forge.Int) { index = i->second.get(); - } else { - _log.error(fmt("Port %1% has no index\n") % path); } SPtr p(new PortModel(uris(), path, index, pdir)); @@ -443,6 +447,10 @@ void ClientStore::connect(const Raul::Path& src_path, const Raul::Path& dst_path) { +#ifdef INGEN_CLIENT_STORE_DUMP + std::cerr << "Client connect " << src_path << " => " << dst_path << std::endl; +#endif + attempt_connection(src_path, dst_path); } @@ -450,6 +458,10 @@ void ClientStore::disconnect(const Raul::Path& src_path, const Raul::Path& dst_path) { +#ifdef INGEN_CLIENT_STORE_DUMP + std::cerr << "Client disconnect " << src_path << " => " << dst_path << std::endl; +#endif + SPtr tail = dynamic_ptr_cast(_object(src_path)); SPtr head = dynamic_ptr_cast(_object(dst_path)); -- cgit v1.2.1