diff options
Diffstat (limited to 'src/client')
-rw-r--r-- | src/client/PluginUI.cpp | 2 | ||||
-rw-r--r-- | src/client/PortModel.cpp | 9 | ||||
-rw-r--r-- | src/client/PortModel.hpp | 20 |
3 files changed, 21 insertions, 10 deletions
diff --git a/src/client/PluginUI.cpp b/src/client/PluginUI.cpp index 89adb8da..f943e54f 100644 --- a/src/client/PluginUI.cpp +++ b/src/client/PluginUI.cpp @@ -87,7 +87,7 @@ lv2_ui_write(LV2UI_Controller controller, } else if (format == map->object_transfer.id) { LV2_Object* buf = (LV2_Object*)buffer; Raul::Atom val; - Shared::LV2Object::to_atom(ui->world(), buf, val); + Shared::LV2Object::to_atom(buf, val); ui->world()->engine->set_property(port->path(), map->ingen_value, val); } else { diff --git a/src/client/PortModel.cpp b/src/client/PortModel.cpp index 80b97e61..e23a0e1a 100644 --- a/src/client/PortModel.cpp +++ b/src/client/PortModel.cpp @@ -35,6 +35,13 @@ PortModel::set_property(const Raul::URI& uri, bool +PortModel::supports(const Raul::URI& value_type) const +{ + return has_property(Shared::LV2URIMap::instance().obj_supports, value_type); +} + + +bool PortModel::port_property(const std::string& uri) const { return has_property(Shared::LV2URIMap::instance().lv2_portProperty, Raul::URI(uri)); @@ -47,7 +54,7 @@ PortModel::set(SharedPtr<ObjectModel> model) SharedPtr<PortModel> port = PtrCast<PortModel>(model); if (port) { _index = port->_index; - _type = port->_type; + _types = port->_types; _direction = port->_direction; _current_val = port->_current_val; _connections = port->_connections; diff --git a/src/client/PortModel.hpp b/src/client/PortModel.hpp index 6021ed19..02305e1a 100644 --- a/src/client/PortModel.hpp +++ b/src/client/PortModel.hpp @@ -41,8 +41,11 @@ class PortModel : public ObjectModel, public Ingen::Shared::Port public: enum Direction { INPUT, OUTPUT }; + const PortTypes& types() const { return _types; } + + bool supports(const Raul::URI& value_type) const; + inline uint32_t index() const { return _index; } - inline Shared::PortType type() const { return _type; } inline const Raul::Atom& value() const { return _current_val; } inline bool connected() const { return (_connections > 0); } inline bool is_input() const { return (_direction == INPUT); } @@ -50,6 +53,7 @@ public: bool port_property(const std::string& uri) const; + bool is_numeric() const { return is_a(Shared::PortType::CONTROL); } bool is_logarithmic() const { return port_property("http://drobilla.net/ns/ingen#logarithmic"); } bool is_integer() const { return port_property("http://lv2plug.in/ns/lv2core#integer"); } bool is_toggle() const { return port_property("http://lv2plug.in/ns/lv2core#toggled"); } @@ -83,12 +87,12 @@ private: PortModel(const Raul::Path& path, uint32_t index, Shared::PortType type, Direction dir) : ObjectModel(path) , _index(index) - , _type(type) , _direction(dir) , _current_val(0.0f) , _connections(0) { - if (_type == Shared::PortType::UNKNOWN) + _types.insert(type); + if (type == Shared::PortType::UNKNOWN) Raul::warn << "[PortModel] Unknown port type" << std::endl; } @@ -100,11 +104,11 @@ private: void set(SharedPtr<ObjectModel> model); - uint32_t _index; - Shared::PortType _type; - Direction _direction; - Raul::Atom _current_val; - size_t _connections; + uint32_t _index; + std::set<Shared::PortType> _types; + Direction _direction; + Raul::Atom _current_val; + size_t _connections; }; |