diff options
author | Robin Gareus <robin@gareus.org> | 2016-04-26 14:35:47 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2016-04-26 18:16:14 +0200 |
commit | 5227f57f2eeb66b01756f1d2d26db96c358b2af1 (patch) | |
tree | 7b8507e2f7bc60620abdcdb5282ee03b31e73548 /libs/ardour/port_manager.cc | |
parent | 7f8c7d8647293b7511bdecbc2cfcb6531fde0c74 (diff) |
implement missing PortManager methods and lua-bind them
Diffstat (limited to 'libs/ardour/port_manager.cc')
-rw-r--r-- | libs/ardour/port_manager.cc | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/libs/ardour/port_manager.cc b/libs/ardour/port_manager.cc index 874d36d882..93cb5fbb1a 100644 --- a/libs/ardour/port_manager.cc +++ b/libs/ardour/port_manager.cc @@ -158,6 +158,7 @@ void PortManager::get_physical_outputs (DataType type, std::vector<std::string>& s) { if (!_backend) { + s.clear (); return; } _backend->get_physical_outputs (type, s); @@ -167,6 +168,7 @@ void PortManager::get_physical_inputs (DataType type, std::vector<std::string>& s) { if (!_backend) { + s.clear (); return; } @@ -385,6 +387,40 @@ PortManager::connected (const string& port_name) return _backend->connected (handle); } +bool +PortManager::physically_connected (const string& port_name) +{ + if (!_backend) { + return false; + } + + PortEngine::PortHandle handle = _backend->get_port_by_name (port_name); + + if (!handle) { + return false; + } + + return _backend->physically_connected (handle); +} + +int +PortManager::get_connections (const string& port_name, std::vector<std::string>& s) +{ + if (!_backend) { + s.clear (); + return 0; + } + + PortEngine::PortHandle handle = _backend->get_port_by_name (port_name); + + if (!handle) { + s.clear (); + return 0; + } + + return _backend->get_connections (handle, s); +} + int PortManager::connect (const string& source, const string& destination) { |