summaryrefslogtreecommitdiffstats
path: root/src/client/PortModel.hpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2008-10-11 21:50:38 +0000
committerDavid Robillard <d@drobilla.net>2008-10-11 21:50:38 +0000
commitfa9837f95a2d3be3f5eb94fcbf8222bb208d87db (patch)
tree2eb8c8eb5a0cf1b27f34ddb141651743b66a2b1e /src/client/PortModel.hpp
parenta18022d4243de7b2093507c574689c7a17c82bb9 (diff)
downloadingen-fa9837f95a2d3be3f5eb94fcbf8222bb208d87db.tar.gz
ingen-fa9837f95a2d3be3f5eb94fcbf8222bb208d87db.tar.bz2
ingen-fa9837f95a2d3be3f5eb94fcbf8222bb208d87db.zip
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
Diffstat (limited to 'src/client/PortModel.hpp')
-rw-r--r--src/client/PortModel.hpp11
1 files changed, 5 insertions, 6 deletions
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 <cstdlib>
#include <iostream>
#include <string>
-#include <vector>
#include <sigc++/sigc++.h>
#include <raul/SharedPtr.hpp>
#include <raul/Path.hpp>
#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); }