summaryrefslogtreecommitdiffstats
path: root/src/libs/client/PortModel.hpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2008-01-25 06:55:57 +0000
committerDavid Robillard <d@drobilla.net>2008-01-25 06:55:57 +0000
commitdf8ee18c0139f889bf7c697713a2205364845464 (patch)
tree2d3d2389504676b194fcb47a9ed3e7b1da8f94c4 /src/libs/client/PortModel.hpp
parentf3f08e248a96f2a6d75d4fc6ee3dc34985805e58 (diff)
downloadingen-df8ee18c0139f889bf7c697713a2205364845464.tar.gz
ingen-df8ee18c0139f889bf7c697713a2205364845464.tar.bz2
ingen-df8ee18c0139f889bf7c697713a2205364845464.zip
Overhaul SLV2 API to return/take SLV2Value (instead of strings or primitives) wherever possible.
Make 'index' a fundemental property of ingen ports. git-svn-id: http://svn.drobilla.net/lad/ingen@1113 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/client/PortModel.hpp')
-rw-r--r--src/libs/client/PortModel.hpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/libs/client/PortModel.hpp b/src/libs/client/PortModel.hpp
index 5455c1f9..940b967e 100644
--- a/src/libs/client/PortModel.hpp
+++ b/src/libs/client/PortModel.hpp
@@ -43,11 +43,12 @@ class PortModel : public ObjectModel, public Ingen::Shared::Port
public:
enum Direction { INPUT, OUTPUT };
- inline DataType type() const { return _type; }
- inline Atom value() const { return Atom(_current_val); }
- inline bool connected() const { return (_connections > 0); }
- inline bool is_input() const { return (_direction == INPUT); }
- inline bool is_output() const { return (_direction == OUTPUT); }
+ inline uint32_t index() const { return _index; }
+ inline DataType type() const { return _type; }
+ inline const Atom& value() const { return _current_val; }
+ inline bool connected() const { return (_connections > 0); }
+ inline bool is_input() const { return (_direction == INPUT); }
+ inline bool is_output() const { return (_direction == OUTPUT); }
bool is_logarithmic() const;
bool is_integer() const;
@@ -74,8 +75,9 @@ public:
private:
friend class Store;
- PortModel(Store& store, const Path& path, DataType type, Direction dir)
+ PortModel(Store& store, const Path& path, uint32_t index, DataType type, Direction dir)
: ObjectModel(store, path, true),
+ _index(index),
_type(type),
_direction(dir),
_current_val(0.0f),
@@ -91,9 +93,10 @@ private:
void connected_to(SharedPtr<PortModel> p) { ++_connections; signal_connection.emit(p); }
void disconnected_from(SharedPtr<PortModel> p) { --_connections; signal_disconnection.emit(p); }
+ uint32_t _index;
DataType _type;
Direction _direction;
- float _current_val;
+ Atom _current_val;
size_t _connections;
};