summaryrefslogtreecommitdiffstats
path: root/src/client/ClientStore.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/ClientStore.cpp')
-rw-r--r--src/client/ClientStore.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/client/ClientStore.cpp b/src/client/ClientStore.cpp
index 762bb2e6..eb42f6a9 100644
--- a/src/client/ClientStore.cpp
+++ b/src/client/ClientStore.cpp
@@ -313,9 +313,14 @@ ClientStore::put(const URI& uri, const Resource::Properties& properties)
} else if (is_port) {
if (data_type != PortType::UNKNOWN) {
PortModel::Direction pdir = is_output ? PortModel::OUTPUT : PortModel::INPUT;
- SharedPtr<PortModel> p(new PortModel(path, 0, data_type, pdir));
- p->set_properties(properties);
- add_object(p);
+ const Resource::Properties::const_iterator i = properties.find("lv2:index");
+ if (i != properties.end() && i->second.type() == Atom::INT) {
+ SharedPtr<PortModel> p(new PortModel(path, i->second.get_int32(), data_type, pdir));
+ p->set_properties(properties);
+ add_object(p);
+ } else {
+ LOG(error) << "Port " << path << " has no index" << endl;
+ }
} else {
LOG(warn) << "Port " << path << " has no type" << endl;
}