From fa9837f95a2d3be3f5eb94fcbf8222bb208d87db Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 11 Oct 2008 21:50:38 +0000 Subject: Remove duplicated code for getting various hints, add generic hint accessor. Cleanup namespace pollution. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@1650 a436a847-0d15-0410-975c-d299462d15a1 --- src/client/PortModel.hpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/client/PortModel.hpp') diff --git a/src/client/PortModel.hpp b/src/client/PortModel.hpp index a7f52679..cf0d7ddc 100644 --- a/src/client/PortModel.hpp +++ b/src/client/PortModel.hpp @@ -21,15 +21,12 @@ #include #include #include -#include #include #include #include #include "interface/Port.hpp" #include "ObjectModel.hpp" -using std::string; using std::vector; - namespace Ingen { namespace Client { @@ -50,9 +47,11 @@ public: inline bool is_input() const { return (_direction == INPUT); } inline bool is_output() const { return (_direction == OUTPUT); } - bool is_logarithmic() const; - bool is_integer() const; - bool is_toggle() const; + bool has_hint(const std::string& qname) const; + + bool is_logarithmic() const { return has_hint("ingen:logarithmic"); } + bool is_integer() const { return has_hint("ingen:integer"); } + bool is_toggle() const { return has_hint("ingen:toggled"); } inline bool operator==(const PortModel& pm) const { return (_path == pm._path); } -- cgit v1.2.1