Add global port matrix dialogs.

git-svn-id: svn://localhost/ardour2/branches/3.0@4434 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Carl Hetherington
2009-01-23 21:24:11 +00:00
parent 9245b7f959
commit f6652f07ae
20 changed files with 434 additions and 153 deletions

View File

@@ -127,6 +127,7 @@ class AudioEngine : public sigc::trackable
int connect (const std::string& source, const std::string& destination);
int disconnect (const std::string& source, const std::string& destination);
int disconnect (Port &);
bool ports_connected (std::string const &, std::string const &);
const char ** get_ports (const std::string& port_name_pattern, const std::string& type_name_pattern, uint32_t flags);

View File

@@ -695,28 +695,13 @@ AudioEngine::connect (const string& source, const string& destination)
Port* src = get_port_by_name_locked (s);
Port* dst = get_port_by_name_locked (d);
if (src && dst) {
/* both ports are known to us, so do the internal connect stuff */
ret = src->connect (dst);
} else if (src || dst) {
/* one port is known to us, try to connect it to something external */
if (src) {
ret = src->connect (d);
} else {
} else if (dst) {
ret = dst->connect (s);
}
} else {
/* neither port is known to us, and this API isn't intended for use as a general patch bay */
ret = -1;
}
if (ret > 0) {
@@ -754,30 +739,14 @@ AudioEngine::disconnect (const string& source, const string& destination)
Port* src = get_port_by_name_locked (s);
Port* dst = get_port_by_name_locked (d);
if (src && dst) {
/* both ports are known to us, so do the internal disconnect stuff */
ret = src->disconnect (dst);
} else if (src || dst) {
/* one port is known to us, try to disconnect it from something external */
if (src) {
ret = src->disconnect (d);
} else {
} else if (dst) {
ret = dst->disconnect (s);
}
} else {
/* neither port is known to us, and this API isn't intended for use as a general patch bay */
ret = -1;
}
return ret;
}