diff options
author | David Robillard <d@drobilla.net> | 2014-04-06 06:14:04 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2014-04-06 06:14:04 +0000 |
commit | d1678ff80fe301569215904fcd886f257136b062 (patch) | |
tree | 114aecfbd5a9697d76ccd3941103004b5722534a /src/JackDriver.cpp | |
parent | 96442dec20443f41ba75e599fe89eb5dd338919a (diff) | |
download | patchage-d1678ff80fe301569215904fcd886f257136b062.tar.gz patchage-d1678ff80fe301569215904fcd886f257136b062.tar.bz2 patchage-d1678ff80fe301569215904fcd886f257136b062.zip |
Support port pretty names via new Jack metadata API.
git-svn-id: http://svn.drobilla.net/lad/trunk/patchage@5357 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/JackDriver.cpp')
-rw-r--r-- | src/JackDriver.cpp | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/JackDriver.cpp b/src/JackDriver.cpp index 8f80a56..db06480 100644 --- a/src/JackDriver.cpp +++ b/src/JackDriver.cpp @@ -31,6 +31,9 @@ #include "PatchageModule.hpp" #include "Queue.hpp" #include "patchage_config.h" +#ifdef HAVE_JACK_METADATA +#include <jack/metadata.h> +#endif using std::endl; using std::string; @@ -191,10 +194,24 @@ JackDriver::create_port(PatchageModule& parent, jack_port_t* port, PortID id) return NULL; } + std::string label; +#ifdef HAVE_JACK_METADATA + const jack_uuid_t uuid = jack_port_uuid(port); + char* pretty_name = NULL; + char* type = NULL; + jack_get_property(uuid, JACK_METADATA_PRETTY_NAME, &pretty_name, &type); + if (pretty_name) { + label = pretty_name; + } + jack_free(pretty_name); + jack_free(type); +#endif + PatchagePort* ret( - new PatchagePort(parent, port_type, jack_port_short_name(port), + new PatchagePort(parent, port_type, jack_port_short_name(port), label, (jack_port_flags(port) & JackPortIsInput), - _app->conf()->get_port_color(port_type))); + _app->conf()->get_port_color(port_type), + _app->show_human_names())); if (id.type != PortID::NULL_PORT_ID) { dynamic_cast<PatchageCanvas*>(parent.canvas())->index_port(id, ret); |