diff options
Diffstat (limited to 'src/client')
-rw-r--r-- | src/client/ClientStore.cpp | 27 | ||||
-rw-r--r-- | src/client/ObjectModel.cpp | 6 | ||||
-rw-r--r-- | src/client/PortModel.cpp | 1 |
3 files changed, 17 insertions, 17 deletions
diff --git a/src/client/ClientStore.cpp b/src/client/ClientStore.cpp index fb90f390..ed1fde66 100644 --- a/src/client/ClientStore.cpp +++ b/src/client/ClientStore.cpp @@ -284,10 +284,9 @@ ClientStore::put(const URI& uri, #endif bool is_patch, is_node, is_port, is_output; - PortType data_type(PortType::UNKNOWN); ResourceImpl::type(uris(), properties, - is_patch, is_node, is_port, is_output, - data_type); + is_patch, is_node, is_port, is_output); + // Check if uri is a plugin const Atom& type = properties.find(_uris->rdf_type)->second; if (type.type() == Atom::URI) { @@ -344,20 +343,16 @@ ClientStore::put(const URI& uri, LOG(warn) << "Node " << path << " has no plugin" << endl; } } else if (is_port) { - if (data_type != PortType::UNKNOWN) { - PortModel::Direction pdir = is_output ? PortModel::OUTPUT : PortModel::INPUT; - const Iterator i = properties.find(_uris->lv2_index); - if (i != properties.end() && i->second.type() == Atom::INT) { - const uint32_t index = i->second.get_int32(); - SharedPtr<PortModel> p( - new PortModel(uris(), path, index, data_type, pdir)); - p->set_properties(properties); - add_object(p); - } else { - LOG(error) << "Port " << path << " has no index" << endl; - } + PortModel::Direction pdir = is_output ? PortModel::OUTPUT : PortModel::INPUT; + const Iterator i = properties.find(_uris->lv2_index); + if (i != properties.end() && i->second.type() == Atom::INT) { + const uint32_t index = i->second.get_int32(); + SharedPtr<PortModel> p( + new PortModel(uris(), path, index, pdir)); + p->set_properties(properties); + add_object(p); } else { - LOG(warn) << "Port " << path << " has no type" << endl; + LOG(error) << "Port " << path << " has no index" << endl; } } else { LOG(warn) << "Ignoring object " << path << " with unknown type " diff --git a/src/client/ObjectModel.cpp b/src/client/ObjectModel.cpp index de783ac2..f09af326 100644 --- a/src/client/ObjectModel.cpp +++ b/src/client/ObjectModel.cpp @@ -47,6 +47,12 @@ ObjectModel::~ObjectModel() { } +bool +ObjectModel::is_a(const Raul::URI& type) const +{ + return has_property(_uris.rdf_type, type); +} + const Raul::Atom& ObjectModel::set_property(const Raul::URI& key, const Raul::Atom& value, Resource::Graph ctx) diff --git a/src/client/PortModel.cpp b/src/client/PortModel.cpp index 8404d60e..3d84de53 100644 --- a/src/client/PortModel.cpp +++ b/src/client/PortModel.cpp @@ -51,7 +51,6 @@ PortModel::set(SharedPtr<ObjectModel> model) SharedPtr<PortModel> port = PtrCast<PortModel>(model); if (port) { _index = port->_index; - _types = port->_types; _direction = port->_direction; _current_val = port->_current_val; _connections = port->_connections; |