diff options
author | Robin Gareus <robin@gareus.org> | 2015-03-08 17:24:53 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2015-03-08 19:02:31 +0100 |
commit | f89123b28b38cf51193e3dce0bbf9f88fe8de868 (patch) | |
tree | 3ab15eb04575919c23cd0332a0e16307dcb05aaf /libs/ardour/port.cc | |
parent | 0f736feee0f98ab7564c206e991fdab0e98af66d (diff) |
libardour API to exercise get_port_property
Diffstat (limited to 'libs/ardour/port.cc')
-rw-r--r-- | libs/ardour/port.cc | 20 |
1 files changed, 20 insertions, 0 deletions
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 () { |