mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-08 07:45:00 +01:00
add new API for retrieving port flags from backend
This commit is contained in:
parent
319a6a52ba
commit
e047b01aa2
11 changed files with 57 additions and 1 deletions
|
|
@ -120,6 +120,11 @@ public:
|
|||
*/
|
||||
virtual std::string get_port_name (PortHandle) const = 0;
|
||||
|
||||
/** Return the flags of the port referred to by @param port. If the port
|
||||
* does not exist, return an empty string.
|
||||
*/
|
||||
virtual PortFlags get_port_flags (PortHandle) const = 0;
|
||||
|
||||
/** Return the port-property value and type for a given key.
|
||||
* (eg query a human readable port name)
|
||||
*
|
||||
|
|
|
|||
|
|
@ -1212,6 +1212,16 @@ AlsaAudioBackend::get_port_name (PortEngine::PortHandle port) const
|
|||
return static_cast<AlsaPort*>(port)->name ();
|
||||
}
|
||||
|
||||
PortFlags
|
||||
AlsaAudioBackend::get_port_flags (PortEngine::PortHandle port) const
|
||||
{
|
||||
if (!valid_port (port)) {
|
||||
PBD::warning << _("AlsaBackend::get_port_flags: Invalid Port(s)") << endmsg;
|
||||
return PortFlags (0);
|
||||
}
|
||||
return static_cast<AlsaPort*>(port)->flags ();
|
||||
}
|
||||
|
||||
int
|
||||
AlsaAudioBackend::get_port_property (PortHandle port, const std::string& key, std::string& value, std::string& type) const
|
||||
{
|
||||
|
|
|
|||
|
|
@ -275,6 +275,7 @@ class AlsaAudioBackend : public AudioBackend {
|
|||
|
||||
int set_port_name (PortHandle, const std::string&);
|
||||
std::string get_port_name (PortHandle) const;
|
||||
PortFlags get_port_flags (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;
|
||||
|
|
|
|||
|
|
@ -957,6 +957,16 @@ CoreAudioBackend::get_port_name (PortEngine::PortHandle port) const
|
|||
return static_cast<CoreBackendPort*>(port)->name ();
|
||||
}
|
||||
|
||||
PortFlags
|
||||
CoreAudioBackend::get_port_flags (PortEngine::PortHandle port) const
|
||||
{
|
||||
if (!valid_port (port)) {
|
||||
PBD::warning << _("CoreAudioBackend::get_port_flags: Invalid Port(s)") << endmsg;
|
||||
return PortFlags (0);
|
||||
}
|
||||
return static_cast<CoreBackendPort*>(port)->flags ();
|
||||
}
|
||||
|
||||
int
|
||||
CoreAudioBackend::get_port_property (PortHandle port, const std::string& key, std::string& value, std::string& type) const
|
||||
{
|
||||
|
|
|
|||
|
|
@ -321,6 +321,7 @@ class CoreAudioBackend : public AudioBackend {
|
|||
|
||||
int set_port_name (PortHandle, const std::string&);
|
||||
std::string get_port_name (PortHandle) const;
|
||||
PortFlags get_port_flags (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);
|
||||
|
|
|
|||
|
|
@ -678,6 +678,16 @@ DummyAudioBackend::get_port_name (PortEngine::PortHandle port) const
|
|||
return static_cast<DummyPort*>(port)->name ();
|
||||
}
|
||||
|
||||
PortFlags
|
||||
DummyAudioBackend::get_port_flags (PortEngine::PortHandle port) const
|
||||
{
|
||||
if (!valid_port (port)) {
|
||||
PBD::error << _("DummyBackend::get_port_flags: Invalid Port(s)") << endmsg;
|
||||
return PortFlags (0);
|
||||
}
|
||||
return static_cast<DummyPort*>(port)->flags ();
|
||||
}
|
||||
|
||||
int
|
||||
DummyAudioBackend::get_port_property (PortHandle port, const std::string& key, std::string& value, std::string& type) const
|
||||
{
|
||||
|
|
|
|||
|
|
@ -328,6 +328,7 @@ class DummyAudioBackend : public AudioBackend {
|
|||
|
||||
int set_port_name (PortHandle, const std::string&);
|
||||
std::string get_port_name (PortHandle) const;
|
||||
PortFlags get_port_flags (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;
|
||||
|
|
|
|||
|
|
@ -132,6 +132,7 @@ class JACKAudioBackend : public AudioBackend {
|
|||
|
||||
int set_port_name (PortHandle, const std::string&);
|
||||
std::string get_port_name (PortHandle) const;
|
||||
PortFlags get_port_flags (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);
|
||||
|
|
|
|||
|
|
@ -124,6 +124,12 @@ JACKAudioBackend::get_port_name (PortHandle port) const
|
|||
return jack_port_name ((jack_port_t*) port);
|
||||
}
|
||||
|
||||
PortFlags
|
||||
JACKAudioBackend::get_port_flags (PortHandle port) const
|
||||
{
|
||||
return PortFlags (jack_port_flags ((jack_port_t*) port));
|
||||
}
|
||||
|
||||
int
|
||||
JACKAudioBackend::get_port_property (PortHandle port, const std::string& key, std::string& value, std::string& type) const
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1223,11 +1223,21 @@ PortAudioBackend::get_port_name (PortEngine::PortHandle port) const
|
|||
{
|
||||
if (!valid_port (port)) {
|
||||
DEBUG_PORTS("get_port_name: Invalid Port(s)\n");
|
||||
return std::string ();
|
||||
return PortFlags (0);
|
||||
}
|
||||
return static_cast<PamPort*>(port)->name ();
|
||||
}
|
||||
|
||||
PortFlags
|
||||
PortAudioBackend::get_port_flags (PortEngine::PortHandle port) const
|
||||
{
|
||||
if (!valid_port (port)) {
|
||||
DEBUG_PORTS("get_port_flags: Invalid Port(s)\n");
|
||||
return std::string ();
|
||||
}
|
||||
return static_cast<PamPort*>(port)->flags ();
|
||||
}
|
||||
|
||||
int
|
||||
PortAudioBackend::get_port_property (PortHandle port,
|
||||
const std::string& key,
|
||||
|
|
|
|||
|
|
@ -255,6 +255,7 @@ class PortAudioBackend : public AudioBackend {
|
|||
|
||||
int set_port_name (PortHandle, const std::string&);
|
||||
std::string get_port_name (PortHandle) const;
|
||||
PortFlags get_port_flags (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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue