summaryrefslogtreecommitdiffstats
path: root/src/server/JackDriver.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2014-04-06 06:14:04 +0000
committerDavid Robillard <d@drobilla.net>2014-04-06 06:14:04 +0000
commit898aff4f18131c19e659e8e0c04ab020e9e66bea (patch)
treef8a206db354abe26c55e7f0ae746657a4212266e /src/server/JackDriver.cpp
parent5ef495e58358dcf28d45e69574f189ac51376a39 (diff)
downloadingen-898aff4f18131c19e659e8e0c04ab020e9e66bea.tar.gz
ingen-898aff4f18131c19e659e8e0c04ab020e9e66bea.tar.bz2
ingen-898aff4f18131c19e659e8e0c04ab020e9e66bea.zip
Support port pretty names via new Jack metadata API.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@5357 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/server/JackDriver.cpp')
-rw-r--r--src/server/JackDriver.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/server/JackDriver.cpp b/src/server/JackDriver.cpp
index 94183e42..9b1bf512 100644
--- a/src/server/JackDriver.cpp
+++ b/src/server/JackDriver.cpp
@@ -25,6 +25,9 @@
#include <boost/format.hpp>
#include "ingen/serialisation/Serialiser.hpp"
#endif
+#ifdef HAVE_JACK_METADATA
+#include <jack/metadata.h>
+#endif
#include "ingen/Configuration.hpp"
#include "ingen/LV2Features.hpp"
@@ -231,6 +234,10 @@ JackDriver::register_port(EnginePort& port)
}
port.set_handle(jack_port);
+
+ for (const auto& p : port.graph_port()->properties()) {
+ port_property_internal(jack_port, p.first, p.second);
+ }
}
void
@@ -252,6 +259,33 @@ JackDriver::rename_port(const Raul::Path& old_path,
}
}
+void
+JackDriver::port_property(const Raul::Path& path,
+ const Raul::URI& uri,
+ const Atom& value)
+{
+#ifdef HAVE_JACK_METADATA
+ EnginePort* eport = get_port(path);
+ if (eport) {
+ const jack_port_t* const jport = (const jack_port_t*)eport->handle();
+ port_property_internal(jport, uri, value);
+ }
+#endif
+}
+
+void
+JackDriver::port_property_internal(const jack_port_t* jport,
+ const Raul::URI& uri,
+ const Atom& value)
+{
+#ifdef HAVE_JACK_METADATA
+ if (uri == _engine.world()->uris().lv2_name) {
+ jack_set_property(_client, jack_port_uuid(jport),
+ JACK_METADATA_PRETTY_NAME, value.ptr<char>(), NULL);
+ }
+#endif
+}
+
EnginePort*
JackDriver::create_port(DuplexPort* graph_port)
{