summaryrefslogtreecommitdiffstats
path: root/src/libs/client/PortModel.h
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2006-09-13 06:11:25 +0000
committerDavid Robillard <d@drobilla.net>2006-09-13 06:11:25 +0000
commite5675ebfeb93175e16762d0a078bd51d15d05f63 (patch)
tree189249ed9014e4c482cfaed0d6af28ced68570ca /src/libs/client/PortModel.h
parent23b7568ab7a87a79c186b8ddf3d3db4f1f934b06 (diff)
downloadingen-e5675ebfeb93175e16762d0a078bd51d15d05f63.tar.gz
ingen-e5675ebfeb93175e16762d0a078bd51d15d05f63.tar.bz2
ingen-e5675ebfeb93175e16762d0a078bd51d15d05f63.zip
Heavy-duty redesign of client library and GUI (now fully signal driven with clean Model/View separation).
Smarter, centralized window creation/management (should make window unification easy (panes?)). Typed metadata system, no more fugly string conversion of floats. Supports OSC fundamental types string, int, float, blob for now (though blob isn't working over the wire yet). git-svn-id: http://svn.drobilla.net/lad/ingen@131 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/client/PortModel.h')
-rw-r--r--src/libs/client/PortModel.h31
1 files changed, 4 insertions, 27 deletions
diff --git a/src/libs/client/PortModel.h b/src/libs/client/PortModel.h
index 1f816748..dd0a208b 100644
--- a/src/libs/client/PortModel.h
+++ b/src/libs/client/PortModel.h
@@ -35,22 +35,17 @@ namespace Client {
class PortModel : public ObjectModel
{
public:
+ // FIXME: metadataify
enum Type { CONTROL, AUDIO, MIDI };
enum Direction { INPUT, OUTPUT };
enum Hint { NONE, INTEGER, TOGGLE, LOGARITHMIC };
- PortModel(const string& path, Type type, Direction dir, Hint hint,
- float default_val, float min, float max)
+ PortModel(const string& path, Type type, Direction dir, Hint hint)
: ObjectModel(path),
m_type(type),
m_direction(dir),
m_hint(hint),
- m_default_val(default_val),
- m_min_val(min),
- //m_user_min(min),
- m_max_val(max),
- //m_user_max(max),
- m_current_val(default_val),
+ m_current_val(0.0f),
m_connections(0)
{
}
@@ -60,11 +55,6 @@ public:
m_type(type),
m_direction(dir),
m_hint(NONE),
- m_default_val(0.0f),
- m_min_val(0.0f),
- //m_user_min(0.0f),
- m_max_val(0.0f),
- //m_user_max(0.0f),
m_current_val(0.0f),
m_connections(0)
{
@@ -73,14 +63,6 @@ public:
void add_child(CountedPtr<ObjectModel> c) { throw; }
void remove_child(CountedPtr<ObjectModel> c) { throw; }
- inline float min_val() const { return m_min_val; }
- inline float user_min() const { return atof(get_metadata("min").c_str()); } // FIXME: haaack
- //inline void user_min(float f) { m_user_min = f; }
- inline float default_val() const { return m_default_val; }
- inline void default_val(float f) { m_default_val = f; }
- inline float max_val() const { return m_max_val; }
- inline float user_max() const { return atof(get_metadata("max").c_str()); }
- //inline void user_max(float f) { m_user_max = f; }
inline float value() const { return m_current_val; }
inline void value(float f) { m_current_val = f; control_change_sig.emit(f); }
inline bool connected() { return (m_connections > 0); }
@@ -96,7 +78,7 @@ public:
inline bool is_toggle() const { return (m_hint == TOGGLE); }
inline bool operator==(const PortModel& pm)
- { return (m_path == pm.m_path); }
+ { return (_path == pm._path); }
void connected_to(CountedPtr<PortModel> p) { ++m_connections; connection_sig.emit(p); }
void disconnected_from(CountedPtr<PortModel> p) { --m_connections; disconnection_sig.emit(p); }
@@ -114,11 +96,6 @@ private:
Type m_type;
Direction m_direction;
Hint m_hint;
- float m_default_val;
- float m_min_val;
- //float m_user_min;
- float m_max_val;
- //float m_user_max;
float m_current_val;
size_t m_connections;
};