Browse Source

When disconnect of all ports is requested, disconnect ports one by one

* This improves notifications
 * Allows no-self-connect code to be hooked to single place in disconnect code.
(cherry picked from commit ddd38f542c)

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@3556 0c269be4-1314-0410-8aa9-9f06e86f4224
tags/v1.9.3
nedko 16 years ago
parent
commit
d8f4e5d376
1 changed files with 8 additions and 6 deletions
  1. +8
    -6
      common/JackEngine.cpp

+ 8
- 6
common/JackEngine.cpp View File

@@ -803,21 +803,23 @@ int JackEngine::PortDisconnect(int refnum, jack_port_id_t src, jack_port_id_t ds
jack_int_t connections[CONNECTION_NUM_FOR_PORT];
fGraphManager->GetConnections(src, connections);

// Notifications
JackPort* port = fGraphManager->GetPort(src);
int ret = 0;
if (port->GetFlags() & JackPortIsOutput) {
for (int i = 0; (i < CONNECTION_NUM_FOR_PORT) && (connections[i] != EMPTY); i++) {
jack_log("NotifyPortConnect src = %ld dst = %ld false", src, connections[i]);
NotifyPortConnect(src, connections[i], false);
if (PortDisconnect(refnum, src, connections[i]) != 0) {
ret = -1;
}
}
} else {
for (int i = 0; (i < CONNECTION_NUM_FOR_PORT) && (connections[i] != EMPTY); i++) {
jack_log("NotifyPortConnect src = %ld dst = %ld false", connections[i], src);
NotifyPortConnect(connections[i], src, false);
if (PortDisconnect(refnum, connections[i], src) != 0) {
ret = -1;
}
}
}

return fGraphManager->DisconnectAll(src);
return ret;
} else if (fGraphManager->CheckPorts(src, dst) < 0) {
return -1;
} else if (fGraphManager->Disconnect(src, dst) == 0) {


Loading…
Cancel
Save