libardour API to exercise get_port_property
This commit is contained in:
parent
0f736feee0
commit
f89123b28b
|
@ -55,6 +55,9 @@ public:
|
|||
return _name;
|
||||
}
|
||||
|
||||
/** @return Port human readable name */
|
||||
std::string pretty_name (bool fallback_to_name = false) const;
|
||||
|
||||
int set_name (std::string const &);
|
||||
|
||||
/** @return flags */
|
||||
|
|
|
@ -79,6 +79,7 @@ class LIBARDOUR_API PortManager
|
|||
void port_renamed (const std::string&, const std::string&);
|
||||
std::string make_port_name_relative (const std::string& name) const;
|
||||
std::string make_port_name_non_relative (const std::string& name) const;
|
||||
std::string get_pretty_name_by_name (const std::string& portname) const;
|
||||
bool port_is_mine (const std::string& fullname) const;
|
||||
|
||||
/* other Port management */
|
||||
|
|
|
@ -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 ()
|
||||
{
|
||||
|
|
|
@ -108,6 +108,23 @@ PortManager::make_port_name_non_relative (const string& portname) const
|
|||
return str;
|
||||
}
|
||||
|
||||
std::string
|
||||
PortManager::get_pretty_name_by_name(const std::string& portname) const
|
||||
{
|
||||
PortEngine::PortHandle ph = _backend->get_port_by_name (portname);
|
||||
if (ph) {
|
||||
std::string value;
|
||||
std::string type;
|
||||
if (0 == _backend->get_port_property (ph,
|
||||
"http://jackaudio.org/metadata/pretty-name",
|
||||
value, type))
|
||||
{
|
||||
return value;
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
bool
|
||||
PortManager::port_is_mine (const string& portname) const
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue
Block a user