From 8768c927968c2541bcac763d9a4f237081eaca4b Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 3 Oct 2011 02:18:42 +0000 Subject: Remove static PortType enumeration from public/client side interface. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@3523 a436a847-0d15-0410-975c-d299462d15a1 --- src/client/ClientStore.cpp | 27 +++++++++++---------------- src/client/ObjectModel.cpp | 6 ++++++ src/client/PortModel.cpp | 1 - 3 files changed, 17 insertions(+), 17 deletions(-) (limited to 'src/client') 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 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 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 model) SharedPtr port = PtrCast(model); if (port) { _index = port->_index; - _types = port->_types; _direction = port->_direction; _current_val = port->_current_val; _connections = port->_connections; -- cgit v1.2.1