git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@1327 0c269be4-1314-0410-8aa9-9f06e86f4224tags/0.61
@@ -2,6 +2,10 @@ | |||||
Jackdmp changes log | Jackdmp changes log | ||||
--------------------------- | --------------------------- | ||||
2007-01-04 Stephane Letz <letz@grame.fr> | |||||
* Add call to the init callback (set up using the jack_set_thread_init_callback API) in Real-Time and Notification threads. Define a new 'kActivateClient' notification. | |||||
2006-12-23 Stephane Letz <letz@grame.fr> | 2006-12-23 Stephane Letz <letz@grame.fr> | ||||
* shared_ports renamed to shared_graph. | * shared_ports renamed to shared_graph. | ||||
@@ -138,15 +138,16 @@ class JackNotifyChannelInterface | |||||
typedef enum { | typedef enum { | ||||
kAddClient = 0, | kAddClient = 0, | ||||
kRemoveClient = 1, | kRemoveClient = 1, | ||||
kXRunCallback = 2, | |||||
kGraphOrderCallback = 3, | |||||
kBufferSizeCallback = 4, | |||||
kStartFreewheel = 5, | |||||
kStopFreewheel = 6, | |||||
kPortRegistrationOn = 7, | |||||
kPortRegistrationOff = 8, | |||||
kZombifyClient = 9, | |||||
kDeadClient = 10 | |||||
kActivateClient = 2, | |||||
kXRunCallback = 3, | |||||
kGraphOrderCallback = 4, | |||||
kBufferSizeCallback = 5, | |||||
kStartFreewheel = 6, | |||||
kStopFreewheel = 7, | |||||
kPortRegistrationOn = 8, | |||||
kPortRegistrationOff = 9, | |||||
kZombifyClient = 10, | |||||
kDeadClient = 11 | |||||
} NotificationType; | } NotificationType; | ||||
}; | }; | ||||
@@ -117,7 +117,7 @@ void JackClient::SetupDriverSync(bool freewheel) | |||||
int JackClient::ClientNotifyImp(int refnum, const char* name, int notify, int sync, int value) | int JackClient::ClientNotifyImp(int refnum, const char* name, int notify, int sync, int value) | ||||
{ | { | ||||
return 0; | |||||
return 0; | |||||
} | } | ||||
int JackClient::ClientNotify(int refnum, const char* name, int notify, int sync, int value) | int JackClient::ClientNotify(int refnum, const char* name, int notify, int sync, int value) | ||||
@@ -131,7 +131,12 @@ int JackClient::ClientNotify(int refnum, const char* name, int notify, int sync, | |||||
case JackNotifyChannelInterface::kRemoveClient: | case JackNotifyChannelInterface::kRemoveClient: | ||||
res = ClientNotifyImp(refnum, name, notify, sync, value); | res = ClientNotifyImp(refnum, name, notify, sync, value); | ||||
break; | break; | ||||
} | |||||
case JackNotifyChannelInterface::kActivateClient: | |||||
JackLog("JackClient::kActivateClient name = %s ref = %ld \n", name, refnum); | |||||
Init(); | |||||
break; | |||||
} | |||||
/* | /* | ||||
The current semantic is that notifications can only be received when the client has been activated, | The current semantic is that notifications can only be received when the client has been activated, | ||||
@@ -191,7 +196,7 @@ int JackClient::ClientNotify(int refnum, const char* name, int notify, int sync, | |||||
JackLog("JackClient::kZombifyClient name = %s ref = %ld \n", name, refnum); | JackLog("JackClient::kZombifyClient name = %s ref = %ld \n", name, refnum); | ||||
ShutDown(); | ShutDown(); | ||||
break; | break; | ||||
} | |||||
} | |||||
} | } | ||||
return res; | return res; | ||||
@@ -279,7 +284,7 @@ bool JackClient::Init() | |||||
{ | { | ||||
if (fInit) { | if (fInit) { | ||||
JackLog("JackClient::Init calling client thread init callback\n"); | JackLog("JackClient::Init calling client thread init callback\n"); | ||||
fInit(fInitArg); | |||||
fInit(fInitArg); | |||||
} | } | ||||
return true; | return true; | ||||
} | } | ||||
@@ -323,6 +323,11 @@ void JackEngine::NotifyPortRegistation(jack_port_id_t port_index, bool onoff) | |||||
NotifyClients((onoff ? JackNotifyChannelInterface::kPortRegistrationOn : JackNotifyChannelInterface::kPortRegistrationOff), false, port_index); | NotifyClients((onoff ? JackNotifyChannelInterface::kPortRegistrationOn : JackNotifyChannelInterface::kPortRegistrationOff), false, port_index); | ||||
} | } | ||||
void JackEngine::NotifyActivate(int refnum) | |||||
{ | |||||
NotifyClient(refnum, JackNotifyChannelInterface::kActivateClient, false, 0); | |||||
} | |||||
//------------------- | //------------------- | ||||
// Client management | // Client management | ||||
//------------------- | //------------------- | ||||
@@ -497,6 +502,7 @@ int JackEngine::ClientActivate(int refnum) | |||||
JackLog("JackEngine::ClientActivate wait error ref = %ld name = %s\n", refnum, client->GetClientControl()->fName); | JackLog("JackEngine::ClientActivate wait error ref = %ld name = %s\n", refnum, client->GetClientControl()->fName); | ||||
return -1; | return -1; | ||||
} else { | } else { | ||||
NotifyActivate(refnum); | |||||
return 0; | return 0; | ||||
} | } | ||||
} | } | ||||
@@ -109,6 +109,7 @@ class JackEngine | |||||
void NotifyBufferSize(jack_nframes_t nframes); | void NotifyBufferSize(jack_nframes_t nframes); | ||||
void NotifyFreewheel(bool onoff); | void NotifyFreewheel(bool onoff); | ||||
void NotifyPortRegistation(jack_port_id_t port_index, bool onoff); | void NotifyPortRegistation(jack_port_id_t port_index, bool onoff); | ||||
void NotifyActivate(int refnum); | |||||
void PrintState(); | void PrintState(); | ||||
}; | }; | ||||
@@ -143,7 +143,7 @@ int JackLibClient::ClientNotifyImp(int refnum, const char* name, int notify, int | |||||
if (strcmp(GetClientControl()->fName, name) != 0) | if (strcmp(GetClientControl()->fName, name) != 0) | ||||
res = fSynchroTable[refnum]->Disconnect() ? 0 : -1; | res = fSynchroTable[refnum]->Disconnect() ? 0 : -1; | ||||
break; | break; | ||||
} | |||||
} | |||||
return res; | return res; | ||||
} | } | ||||
@@ -226,7 +226,7 @@ bool JackSocketClientChannel::Init() | |||||
jack_error("JackSocketClientChannel: cannot establish notication socket"); | jack_error("JackSocketClientChannel: cannot establish notication socket"); | ||||
return false; | return false; | ||||
} else { | } else { | ||||
return true; | |||||
return true; | |||||
} | } | ||||
} | } | ||||
@@ -41,7 +41,7 @@ JackMachClientChannel::~JackMachClientChannel() | |||||
// Server <===> client | // Server <===> client | ||||
int JackMachClientChannel::Open(const char* name, JackClient* obj) | |||||
int JackMachClientChannel::Open(const char* name, JackClient* client) | |||||
{ | { | ||||
JackLog("JackMachClientChannel::Open name = %s\n", name); | JackLog("JackMachClientChannel::Open name = %s\n", name); | ||||
@@ -60,7 +60,7 @@ int JackMachClientChannel::Open(const char* name, JackClient* obj) | |||||
return -1; | return -1; | ||||
} | } | ||||
JackLibGlobals::fGlobals->fClientTable[fClientPort.GetPort()] = obj; | |||||
JackLibGlobals::fGlobals->fClientTable[fClientPort.GetPort()] = client; | |||||
return 0; | return 0; | ||||
} | } | ||||
@@ -48,7 +48,7 @@ class JackMachClientChannel : public JackClientChannelInterface, public JackRunn | |||||
JackMachClientChannel(); | JackMachClientChannel(); | ||||
virtual ~JackMachClientChannel(); | virtual ~JackMachClientChannel(); | ||||
int Open(const char* name, JackClient* obj); | |||||
int Open(const char* name, JackClient* client); | |||||
void Close(); | void Close(); | ||||
int Start(); | int Start(); | ||||
@@ -75,7 +75,8 @@ class JackMachClientChannel : public JackClientChannelInterface, public JackRunn | |||||
void ReleaseTimebase(int refnum, int* result); | void ReleaseTimebase(int refnum, int* result); | ||||
void SetTimebaseCallback(int refnum, int conditional, int* result); | void SetTimebaseCallback(int refnum, int conditional, int* result); | ||||
bool Execute(); | |||||
// JackRunnableInterface interface | |||||
bool Execute(); | |||||
}; | }; | ||||
@@ -222,7 +222,7 @@ bool JackWinNamedPipeClientChannel::Init() | |||||
jack_error("JackWinNamedPipeClientChannel: cannot establish notification pipe"); | jack_error("JackWinNamedPipeClientChannel: cannot establish notification pipe"); | ||||
return false; | return false; | ||||
} else { | } else { | ||||
return true; | |||||
return true; | |||||
} | } | ||||
} | } | ||||