summaryrefslogtreecommitdiffstats
path: root/src/server/DuplexPort.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/DuplexPort.cpp')
-rw-r--r--src/server/DuplexPort.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/server/DuplexPort.cpp b/src/server/DuplexPort.cpp
index 6049e001..0e19e939 100644
--- a/src/server/DuplexPort.cpp
+++ b/src/server/DuplexPort.cpp
@@ -53,6 +53,40 @@ DuplexPort::~DuplexPort()
}
}
+void
+DuplexPort::inherit_neighbour(const PortImpl* port,
+ Resource::Properties& remove,
+ Resource::Properties& add)
+{
+ /* TODO: This needs to become more sophisticated, and correct the situation
+ if the port is disconnected. */
+ if (_type == PortType::CONTROL || _type == PortType::CV) {
+ if (port->minimum().get<float>() < _min.get<float>()) {
+ _min = port->minimum();
+ remove.insert(std::make_pair(_bufs.uris().lv2_minimum,
+ Property(_bufs.uris().wildcard)));
+ add.insert(std::make_pair(_bufs.uris().lv2_minimum,
+ port->minimum()));
+ }
+ if (port->maximum().get<float>() > _max.get<float>()) {
+ _max = port->maximum();
+ remove.insert(std::make_pair(_bufs.uris().lv2_maximum,
+ Property(_bufs.uris().wildcard)));
+ add.insert(std::make_pair(_bufs.uris().lv2_maximum,
+ port->maximum()));
+ }
+ } else if (_type == PortType::ATOM) {
+ for (Resource::Properties::const_iterator i = port->properties().find(
+ _bufs.uris().atom_supports);
+ i != port->properties().end() &&
+ i->first == _bufs.uris().atom_supports;
+ ++i) {
+ set_property(i->first, i->second);
+ add.insert(*i);
+ }
+ }
+}
+
bool
DuplexPort::get_buffers(BufferFactory& bufs,
Raul::Array<BufferRef>* buffers,