From f89123b28b38cf51193e3dce0bbf9f88fe8de868 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sun, 8 Mar 2015 17:24:53 +0100 Subject: libardour API to exercise get_port_property --- libs/ardour/port.cc | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'libs/ardour/port.cc') diff --git a/libs/ardour/port.cc b/libs/ardour/port.cc index 8e9db708a8..3252134ac3 100644 --- a/libs/ardour/port.cc +++ b/libs/ardour/port.cc @@ -83,6 +83,26 @@ Port::~Port () drop (); } + +std::string +Port::pretty_name(bool fallback_to_name) const +{ + if (_port_handle) { + std::string value; + std::string type; + if (0 == port_engine.get_port_property (_port_handle, + "http://jackaudio.org/metadata/pretty-name", + value, type)) + { + return value; + } + } + if (fallback_to_name) { + return name (); + } + return ""; +} + void Port::drop () { -- cgit v1.2.3