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 | |
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')
-rw-r--r-- | src/libs/client/Makefile.am | 1 | ||||
-rw-r--r-- | src/libs/client/PortModel.h | 26 | ||||
-rw-r--r-- | src/libs/client/Serializer.cpp | 6 | ||||
-rw-r--r-- | src/libs/client/Serializer.h | 1 |
4 files changed, 8 insertions, 26 deletions
diff --git a/src/libs/client/Makefile.am b/src/libs/client/Makefile.am index 20822e8a..7250de36 100644 --- a/src/libs/client/Makefile.am +++ b/src/libs/client/Makefile.am @@ -35,6 +35,7 @@ libingen_client_la_SOURCES = \ NodeModel.h \ NodeModel.cpp \ PortModel.h \ + PortModel.cpp \ PatchModel.h \ PatchModel.cpp \ PluginModel.h \ 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; }; diff --git a/src/libs/client/Serializer.cpp b/src/libs/client/Serializer.cpp index 92b0ad41..a1d5cc03 100644 --- a/src/libs/client/Serializer.cpp +++ b/src/libs/client/Serializer.cpp @@ -70,7 +70,6 @@ Serializer::start_to_filename(const string& filename) _base_uri = "file://" + filename; _model = new RDF::Model(_world); _mode = TO_FILE; - _filename = filename; } @@ -89,7 +88,6 @@ Serializer::start_to_string() _base_uri = ""; _model = new RDF::Model(_world); _mode = TO_STRING; - _filename = ""; } @@ -104,11 +102,11 @@ Serializer::finish() string ret = ""; if (_mode == TO_FILE) - _model->serialize_to_file(_filename); + _model->serialize_to_file(_base_uri); else ret = _model->serialize_to_string(); - _filename = ""; + _base_uri = ""; _node_map.clear(); return ret; diff --git a/src/libs/client/Serializer.h b/src/libs/client/Serializer.h index ee7d3dff..6095cb25 100644 --- a/src/libs/client/Serializer.h +++ b/src/libs/client/Serializer.h @@ -73,7 +73,6 @@ private: typedef std::map<Path, Raul::RDF::Node> NodeMap; Mode _mode; - std::string _filename; NodeMap _node_map; string _base_uri; Raul::RDF::World& _world; |