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 */
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 */
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 ()
{
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
{