diff options
author | David Robillard <d@drobilla.net> | 2014-01-05 22:40:35 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2014-01-05 22:40:35 +0000 |
commit | 01be6fa189d1c36f63b3bfd681299aa30adfea14 (patch) | |
tree | 90022017b2029a1e2530b24abd81394094f13197 /src/server | |
parent | fc0ec26d163cd005baabfaa5a52af21408b06e64 (diff) | |
download | ingen-01be6fa189d1c36f63b3bfd681299aa30adfea14.tar.gz ingen-01be6fa189d1c36f63b3bfd681299aa30adfea14.tar.bz2 ingen-01be6fa189d1c36f63b3bfd681299aa30adfea14.zip |
Update type properties for morph ports so GUI displays correct type.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@5277 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/server')
-rw-r--r-- | src/server/PortImpl.cpp | 16 | ||||
-rw-r--r-- | src/server/PortType.hpp | 2 |
2 files changed, 15 insertions, 3 deletions
diff --git a/src/server/PortImpl.cpp b/src/server/PortImpl.cpp index ca893cc7..e05aa1ce 100644 --- a/src/server/PortImpl.cpp +++ b/src/server/PortImpl.cpp @@ -104,16 +104,28 @@ PortImpl::~PortImpl() void PortImpl::set_type(PortType port_type, LV2_URID buffer_type) { + const Ingen::URIs& uris = _bufs.uris(); + Ingen::World* world = _bufs.engine().world(); + + // Update type properties so clients are aware of current type + remove_property(uris.rdf_type, uris.lv2_AudioPort); + remove_property(uris.rdf_type, uris.lv2_CVPort); + remove_property(uris.rdf_type, uris.lv2_ControlPort); + remove_property(uris.rdf_type, uris.atom_AtomPort); + add_property(uris.rdf_type, + world->forge().alloc_uri(port_type.uri().c_str())); + + // Update audio thread types _type = port_type; _buffer_type = buffer_type; if (!_buffer_type) { switch (_type.id()) { case PortType::CONTROL: - _buffer_type = _bufs.uris().atom_Float; + _buffer_type = uris.atom_Float; break; case PortType::AUDIO: case PortType::CV: - _buffer_type = _bufs.uris().atom_Sound; + _buffer_type = uris.atom_Sound; break; default: break; diff --git a/src/server/PortType.hpp b/src/server/PortType.hpp index 0fd61156..044ac41f 100644 --- a/src/server/PortType.hpp +++ b/src/server/PortType.hpp @@ -59,7 +59,7 @@ public: PortType(ID id) : _id(id) {} inline const Raul::URI& uri() const { return type_uri(_id); } - inline ID id() const { return _id; } + inline ID id() const { return _id; } inline bool operator==(const ID& id) const { return (_id == id); } inline bool operator!=(const ID& id) const { return (_id != id); } |