From 01be6fa189d1c36f63b3bfd681299aa30adfea14 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 5 Jan 2014 22:40:35 +0000 Subject: 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 --- src/server/PortImpl.cpp | 16 ++++++++++++++-- src/server/PortType.hpp | 2 +- 2 files changed, 15 insertions(+), 3 deletions(-) (limited to 'src') 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); } -- cgit v1.2.1