summaryrefslogtreecommitdiffstats
path: root/src/client
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2015-02-08 07:02:59 +0000
committerDavid Robillard <d@drobilla.net>2015-02-08 07:02:59 +0000
commit0f9c8151d5b42b243a499bb31a1e1f0b2e8c5f6f (patch)
tree1ed4df4df4c3f160120544d92c681f1b4519e1aa /src/client
parent8733afb7ae9a04f46ac6318667182da16eca9fe5 (diff)
downloadingen-0f9c8151d5b42b243a499bb31a1e1f0b2e8c5f6f.tar.gz
ingen-0f9c8151d5b42b243a499bb31a1e1f0b2e8c5f6f.tar.bz2
ingen-0f9c8151d5b42b243a499bb31a1e1f0b2e8c5f6f.zip
Server-side copy paste with LV2 state support.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@5541 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/client')
-rw-r--r--src/client/BlockModel.cpp2
-rw-r--r--src/client/ClientStore.cpp24
2 files changed, 19 insertions, 7 deletions
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<const PortModel> 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<Interface> engine,
SPtr<SigClientInterface> emitter)
: _uris(uris)
, _log(log)
- , _engine(engine)
, _emitter(emitter)
, _plugins(new Plugins())
{
@@ -84,12 +82,13 @@ ClientStore::add_object(SPtr<ObjectModel> 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())
@@ -209,6 +208,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)
{
const iterator top = find(old_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<int32_t>();
- } else {
- _log.error(fmt("Port %1% has no index\n") % path);
}
SPtr<PortModel> 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<PortModel> tail = dynamic_ptr_cast<PortModel>(_object(src_path));
SPtr<PortModel> head = dynamic_ptr_cast<PortModel>(_object(dst_path));