implement metadata-set for remaining backends
This commit is contained in:
parent
78c915f5eb
commit
9840a11537
|
@ -1251,8 +1251,8 @@ AlsaAudioBackend::set_port_property (PortHandle port, const std::string& key, co
|
|||
return -1;
|
||||
}
|
||||
if (key == "http://jackaudio.org/metadata/pretty-name" && type.empty ()) {
|
||||
static_cast<AlsaPort*>(port)->set_pretty_name (value);
|
||||
return 0;
|
||||
static_cast<AlsaPort*>(port)->set_pretty_name (value);
|
||||
return 0;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
|
|
@ -935,6 +935,20 @@ CoreAudioBackend::get_port_property (PortHandle port, const std::string& key, st
|
|||
return -1;
|
||||
}
|
||||
|
||||
int
|
||||
CoreAudioBackend::set_port_property (PortHandle port, const std::string& key, const std::string& value, const std::string& type)
|
||||
{
|
||||
if (!valid_port (port)) {
|
||||
PBD::warning << _("CoreAudioBackend::set_port_property: Invalid Port(s)") << endmsg;
|
||||
return -1;
|
||||
}
|
||||
if (key == "http://jackaudio.org/metadata/pretty-name" && type.empty ()) {
|
||||
static_cast<CoreBackendPort*>(port)->set_pretty_name (value);
|
||||
return 0;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
PortEngine::PortHandle
|
||||
CoreAudioBackend::get_port_by_name (const std::string& name) const
|
||||
{
|
||||
|
|
|
@ -330,6 +330,7 @@ class CoreAudioBackend : public AudioBackend {
|
|||
std::string get_port_name (PortHandle) const;
|
||||
PortHandle get_port_by_name (const std::string&) const;
|
||||
int get_port_property (PortHandle, const std::string& key, std::string& value, std::string& type) const;
|
||||
int set_port_property (PortHandle, const std::string& key, const std::string& value, const std::string& type);
|
||||
|
||||
int get_ports (const std::string& port_name_pattern, DataType type, PortFlags flags, std::vector<std::string>&) const;
|
||||
|
||||
|
|
|
@ -684,13 +684,12 @@ DummyAudioBackend::set_port_property (PortHandle port, const std::string& key, c
|
|||
return -1;
|
||||
}
|
||||
if (key == "http://jackaudio.org/metadata/pretty-name" && type.empty ()) {
|
||||
static_cast<DummyPort*>(port)->set_pretty_name (value);
|
||||
return 0;
|
||||
static_cast<DummyPort*>(port)->set_pretty_name (value);
|
||||
return 0;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
PortEngine::PortHandle
|
||||
DummyAudioBackend::get_port_by_name (const std::string& name) const
|
||||
{
|
||||
|
|
|
@ -133,6 +133,7 @@ class JACKAudioBackend : public AudioBackend {
|
|||
std::string get_port_name (PortHandle) const;
|
||||
PortHandle get_port_by_name (const std::string&) const;
|
||||
int get_port_property (PortHandle, const std::string& key, std::string& value, std::string& type) const;
|
||||
int set_port_property (PortHandle, const std::string& key, const std::string& value, const std::string& type);
|
||||
|
||||
int get_ports (const std::string& port_name_pattern, DataType type, PortFlags flags, std::vector<std::string>&) const;
|
||||
|
||||
|
|
|
@ -147,6 +147,20 @@ JACKAudioBackend::get_port_property (PortHandle port, const std::string& key, st
|
|||
#endif
|
||||
}
|
||||
|
||||
int
|
||||
JACKAudioBackend::set_port_property (PortHandle port, const std::string& key, const std::string& value, const std::string& type)
|
||||
{
|
||||
#ifdef HAVE_JACK_METADATA // really everyone ought to have this by now.
|
||||
int rv = -1;
|
||||
jack_client_t* client = _jack_connection->jack();
|
||||
jack_uuid_t uuid = jack_port_uuid((jack_port_t*) port);
|
||||
return jack_set_property(client, uuid, key.c_str(), value.c_str(), type.c_str());
|
||||
return rv;
|
||||
#else
|
||||
return -1;
|
||||
#endif
|
||||
}
|
||||
|
||||
PortEngine::PortHandle
|
||||
JACKAudioBackend:: get_port_by_name (const std::string& name) const
|
||||
{
|
||||
|
|
|
@ -1238,6 +1238,24 @@ PortAudioBackend::get_port_property (PortHandle port,
|
|||
return -1;
|
||||
}
|
||||
|
||||
int
|
||||
PortAudioBackend::set_port_property (PortHandle port,
|
||||
const std::string& key,
|
||||
const std::string& value,
|
||||
const std::string& type)
|
||||
{
|
||||
if (!valid_port (port)) {
|
||||
DEBUG_PORTS("get_port_name: Invalid Port(s)\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (key == "http://jackaudio.org/metadata/pretty-name" && type.empty ()) {
|
||||
static_cast<PamPort*>(port)->set_pretty_name (value);
|
||||
return 0;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
PortEngine::PortHandle
|
||||
PortAudioBackend::get_port_by_name (const std::string& name) const
|
||||
{
|
||||
|
|
|
@ -267,6 +267,7 @@ class PortAudioBackend : public AudioBackend {
|
|||
std::string get_port_name (PortHandle) const;
|
||||
PortHandle get_port_by_name (const std::string&) const;
|
||||
int get_port_property (PortHandle, const std::string& key, std::string& value, std::string& type) const;
|
||||
int set_port_property (PortHandle, const std::string& key, const std::string& value, const std::string& type);
|
||||
|
||||
int get_ports (const std::string& port_name_pattern, DataType type, PortFlags flags, std::vector<std::string>&) const;
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user