diff options
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); } |