diff options
author | David Robillard <d@drobilla.net> | 2007-07-04 03:58:49 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2007-07-04 03:58:49 +0000 |
commit | 417623b0033b12969e4e84c61c21922d4ab7f534 (patch) | |
tree | d6ac7058406e42a6e6b894cefaaa60bccee5d987 /src/libs/client/PortModel.h | |
parent | bb79ba74ab813c3126ad905e6453dae56b6192bc (diff) | |
download | ingen-417623b0033b12969e4e84c61c21922d4ab7f534.tar.gz ingen-417623b0033b12969e4e84c61c21922d4ab7f534.tar.bz2 ingen-417623b0033b12969e4e84c61c21922d4ab7f534.zip |
Added metadata (ie integer, toggle) to builtin node control ports.
Treat integer/toggle ports as.... integer ports (still with just a slider though).
Closes ticket #40.
git-svn-id: http://svn.drobilla.net/lad/ingen@571 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/client/PortModel.h')
-rw-r--r-- | src/libs/client/PortModel.h | 26 |
1 files changed, 5 insertions, 21 deletions
diff --git a/src/libs/client/PortModel.h b/src/libs/client/PortModel.h index 139e2a97..4dcf5e7f 100644 --- a/src/libs/client/PortModel.h +++ b/src/libs/client/PortModel.h @@ -41,9 +41,6 @@ class PortModel : public ObjectModel public: enum Direction { INPUT, OUTPUT }; - // FIXME: metadataify - enum Hint { NONE, INTEGER, TOGGLE, LOGARITHMIC }; - inline string type() const { return _type; } inline float value() const { return _current_val; } inline bool connected() const { return (_connections > 0); } @@ -52,10 +49,11 @@ public: inline bool is_audio() const { return (_type == "ingen:audio"); } inline bool is_control() const { return (_type == "ingen:control"); } inline bool is_midi() const { return (_type == "ingen:midi"); } - inline bool is_logarithmic() const { return (_hint == LOGARITHMIC); } - inline bool is_integer() const { return (_hint == INTEGER); } - inline bool is_toggle() const { return (_hint == TOGGLE); } + bool is_logarithmic() const; + bool is_integer() const; + bool is_toggle() const; + inline bool operator==(const PortModel& pm) const { return (_path == pm._path); } inline void value(float val) @@ -74,30 +72,17 @@ public: private: friend class Store; - PortModel(const Path& path, const string& type, Direction dir, Hint hint) - : ObjectModel(path), - _type(type), - _direction(dir), - _hint(hint), - _current_val(0.0f), - _connections(0) - { - if (!is_audio() && !is_control() && !is_input()) - cerr << "[PortModel] Warning: Unknown port type" << endl; - } - PortModel(const Path& path, const string& type, Direction dir) : ObjectModel(path), _type(type), _direction(dir), - _hint(NONE), _current_val(0.0f), _connections(0) { if (!is_audio() && !is_control() && !is_input()) cerr << "[PortModel] Warning: Unknown port type" << endl; } - + void add_child(SharedPtr<ObjectModel> c) { throw; } void remove_child(SharedPtr<ObjectModel> c) { throw; } @@ -106,7 +91,6 @@ private: string _type; Direction _direction; - Hint _hint; float _current_val; size_t _connections; }; |