summaryrefslogtreecommitdiff
path: root/libs/backends/alsa
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2018-10-17 14:10:50 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2018-10-17 14:11:37 -0400
commite047b01aa2560b137d45a131c0168145a27b953e (patch)
treefeab53edc9ae2cda6180d712a502e5b513bad1f9 /libs/backends/alsa
parent319a6a52ba071dd94bd4bf0669c94806df4d3727 (diff)
add new API for retrieving port flags from backend
Diffstat (limited to 'libs/backends/alsa')
-rw-r--r--libs/backends/alsa/alsa_audiobackend.cc10
-rw-r--r--libs/backends/alsa/alsa_audiobackend.h1
2 files changed, 11 insertions, 0 deletions
diff --git a/libs/backends/alsa/alsa_audiobackend.cc b/libs/backends/alsa/alsa_audiobackend.cc
index 42af5a4b92..9594f31d98 100644
--- a/libs/backends/alsa/alsa_audiobackend.cc
+++ b/libs/backends/alsa/alsa_audiobackend.cc
@@ -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
{
diff --git a/libs/backends/alsa/alsa_audiobackend.h b/libs/backends/alsa/alsa_audiobackend.h
index f6887fe346..11623cfcf4 100644
--- a/libs/backends/alsa/alsa_audiobackend.h
+++ b/libs/backends/alsa/alsa_audiobackend.h
@@ -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;