intJackEngine::ClientNotify(JackClientInterface* client, int refnum, constchar* name, int notify, int sync, constchar* message, int value1, int value2)
{
// Check if notification is needed
if (!client->GetClientControl()->fCallback[notify]) {
jack_log("JackEngine::ClientNotify: no callback for notification = %ld", notify);
// Unregister all ports ==> notifications are sent
jack_int_t ports[PORT_NUM_FOR_CLIENT];
int i;
fGraphManager->GetInputPorts(refnum, ports);
for (i = 0; (i < PORT_NUM_FOR_CLIENT) && (ports[i] != EMPTY); i++) {
PortUnRegister(refnum, ports[i]);
}
fGraphManager->GetOutputPorts(refnum, ports);
for (i = 0; (i < PORT_NUM_FOR_CLIENT) && (ports[i] != EMPTY); i++) {
PortUnRegister(refnum, ports[i]);
}
// Remove the client from the table
ReleaseRefnum(refnum);
// Remove all ports
fGraphManager->RemoveAllPorts(refnum);
// Wait until next cycle to be sure client is not used anymore
if (wait) {
if (!fSignal.LockedTimedWait(fEngineControl->fTimeOutUsecs * 2)) { // Must wait at least until a switch occurs in Process, even in case of graph end failure