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 --- include/ingen/client/ObjectModel.hpp | 2 ++ include/ingen/client/PortModel.hpp | 15 +++++---------- 2 files changed, 7 insertions(+), 10 deletions(-) (limited to 'include/ingen/client') diff --git a/include/ingen/client/ObjectModel.hpp b/include/ingen/client/ObjectModel.hpp index 50ba2805..6d4fbae5 100644 --- a/include/ingen/client/ObjectModel.hpp +++ b/include/ingen/client/ObjectModel.hpp @@ -55,6 +55,8 @@ class ObjectModel : virtual public GraphObject public: virtual ~ObjectModel(); + bool is_a(const Raul::URI& type) const; + const Raul::Atom& get_property(const Raul::URI& key) const; const Raul::Atom& set_property(const Raul::URI& key, diff --git a/include/ingen/client/PortModel.hpp b/include/ingen/client/PortModel.hpp index 7fd4d746..900d576e 100644 --- a/include/ingen/client/PortModel.hpp +++ b/include/ingen/client/PortModel.hpp @@ -41,8 +41,6 @@ class PortModel : public ObjectModel, public Ingen::Port public: enum Direction { INPUT, OUTPUT }; - const PortTypes& types() const { return _types; } - bool supports(const Raul::URI& value_type) const; inline uint32_t index() const { return _index; } @@ -53,7 +51,7 @@ public: bool port_property(const Raul::URI& uri) const; - bool is_numeric() const { return is_a(PortType::CONTROL); } + bool is_numeric() const { return ObjectModel::is_a("http://lv2plug.in/ns/lv2core#ControlPort"); } bool is_logarithmic() const { return port_property("http://drobilla.net/ns/ingen#logarithmic"); } bool is_integer() const { return port_property("http://lv2plug.in/ns/lv2core#integer"); } bool is_toggle() const { return port_property("http://lv2plug.in/ns/lv2core#toggled"); } @@ -90,17 +88,15 @@ private: friend class ClientStore; PortModel(Shared::LV2URIMap& uris, - const Raul::Path& path, uint32_t index, PortType type, Direction dir) + const Raul::Path& path, + uint32_t index, + Direction dir) : ObjectModel(uris, path) , _index(index) , _direction(dir) , _current_val(0.0f) , _connections(0) - { - _types.insert(type); - if (type == PortType::UNKNOWN) - Raul::warn << "[PortModel] Unknown port type" << std::endl; - } + {} void add_child(SharedPtr c) { throw; } bool remove_child(SharedPtr c) { throw; } @@ -111,7 +107,6 @@ private: void set(SharedPtr model); uint32_t _index; - std::set _types; Direction _direction; Raul::Atom _current_val; size_t _connections; -- cgit v1.2.1