Commit 224c41eb authored by sletz's avatar sletz
Browse files

rebase from trunk 3638:3684

git-svn-id: http://subversion.jackaudio.org/jack/jack2/branches/libjacknet@3685 0c269be4-1314-0410-8aa9-9f06e86f4224
parent 5d29fcff
......@@ -25,35 +25,98 @@ Paul Davis
Jackdmp changes log
---------------------------
2009-08-28 Stephane Letz <letz@grame.fr>
2009-10-30 Stephane Letz <letz@grame.fr>
* Correct monitor port naming in JackAudioDriver and JackCoreAudioDriver.
* Big endian bug fix in memops.c (http://bugs.debian.org/cgi-bin/bugreport.cgi?msg=5;filename=11_be24bit.patch;att=1;bug=486308)
* In JackCoreAudioDriver, improve management of input/output channels: -1 is now used internally to indicate a wanted max value.
* In JackCoreAudioDriver::OpenAUHAL, correct stream format setup and cleanup.
* Correct crash bug in JackAudioAdapterInterface when not input is used in adapter (temporary fix...)
* Sync JackCoreAudioAdapter code on JackCoreAudioDriver one.
* JACK_SCHED_POLICY switched to SCHED_FIFO.
2009-07-31 Stephane Letz <letz@grame.fr>
2009-10-29 Stephane Letz <letz@grame.fr>
* Use SNDCTL_DSP_SYNCGROUP/SNDCTL_DSP_SYNCSTART API to synchronize input and output in Solaris boomer backend.
* In JackCoreAudioDriver::Start, wait for the audio driver to effectively start (use the MeasureCallback).
2009-10-28 Stephane Letz <letz@grame.fr>
* In JackCoreAudioDriver, force the SR value to the wanted one *before* creating aggregate device (otherwise creation will fail).
* In JackCoreAudioDriver, better cleanup of AD when intermediate open failure.
2009-07-29 Stephane Letz <letz@grame.fr>
2009-10-27 Stephane Letz <letz@grame.fr>
* Add a -G parameter in CoreAudio backend (the computation value in RT thread expressed as percent of period).
* Dynamic system version detection in JackCoreAudioDriver to either create public or private aggregate device.
2009-07-28 Stephane Letz <letz@grame.fr>
2009-10-26 Stephane Letz <letz@grame.fr>
* Fix CopyAndConvertIn for Solaris backends.
* Implement "hog mode" (exclusive access of the audio device) in JackCoreAudioDriver.
* Fix jack_set_sample_rate_callback to have he same behavior as in JACK1.
2009-10-25 Stephane Letz <letz@grame.fr>
* Improve aggregate device management in JackCoreAudioDriver : now a "private" device only and cleanup properly.
* Aggregate device code added to JackCoreAudioAdapter.
2009-10-23 Stephane Letz <letz@grame.fr>
* Correct JackProcessSync::LockedTimedWait.
* Correct JACK_MESSAGE_SIZE value, particularly in OSX RPC code.
* Now start server channel thread only when backend has been started (so in JackServer::Start). Should solve race conditions at start time.
* jack_verbose moved to JackGlobals class.
2009-10-22 Stephane Letz <letz@grame.fr>
* Correct jackdmp.cpp (failures case were not correct..). Improve JackCoreAudioDriver code. Raise default port number to 2048.
2009-10-20 Stephane Letz <letz@grame.fr>
* Add a string parameter to server ==> client notification, add a new JackInfoShutdownCallback type.
* CoreAudio backend now issue a JackInfoShutdownCallback when an unrecoverable error is detected (sampling rate change, stream configuration change)
2009-10-17 Stephane Letz <letz@grame.fr>
* Correct server temporary mode : now set a global and quit after server/client message handling is finished.
2009-10-15 Stephane Letz <letz@grame.fr>
* Change CoreAudio notification thread setup for OSX Snow Leopard.
2009-09-18 Stephane Letz <letz@grame.fr>
* Simplify transport in NetJack2: master only can control transport.
2009-09-15 Stephane Letz <letz@grame.fr>
* Correct CPU timing in JackNetDriver, now take cycle begin time after Read.
* Fix issues in JackNetDriver::DecodeTransportData and JackNetDriver::Initialize.
2009-08-28 Stephane Letz <letz@grame.fr>
* Correct monitor port naming in JackAudioDriver and JackCoreAudioDriver.
* Big endian bug fix in memops.c (http://bugs.debian.org/cgi-bin/bugreport.cgi?msg=5;filename=11_be24bit.patch;att=1;bug=486308)
2009-07-31 Stephane Letz <letz@grame.fr>
* Use SNDCTL_DSP_SYNCGROUP/SNDCTL_DSP_SYNCSTART API to synchronize input and output in Solaris boomer backend.
2009-07-29 Stephane Letz <letz@grame.fr>
* Add a -G parameter in CoreAudio backend (the computation value in RT thread expressed as percent of period).
2009-07-28 Stephane Letz <letz@grame.fr>
* Fix CopyAndConvertIn for Solaris backends.
2009-07-22 Stephane Letz <letz@grame.fr>
* Version 1.9.4 started.
* Solaris boomer backend now working in capture or playback only mode.
* Version 1.9.4 started.
* Solaris boomer backend now working in capture or playback only mode.
* Fix control.h for proper compilation on Solaris.
2009-07-17 Stephane Letz <letz@grame.fr>
* Loopback backend reborn as a dynamically loadable separated backend.
* Loopback backend reborn as a dynamically loadable separated backend.
* -L parameter for loopback backend activated again in jackd.
2009-07-17 Stephane Letz <letz@grame.fr>
* Big rewrite of Solaris boomer driver, seems to work in duplex mode at least.
......
......@@ -72,6 +72,8 @@ extern "C"
EXPORT int jack_is_realtime (jack_client_t *client);
EXPORT void jack_on_shutdown (jack_client_t *client,
JackShutdownCallback shutdown_callback, void *arg);
EXPORT void jack_on_info_shutdown (jack_client_t *client,
JackInfoShutdownCallback shutdown_callback, void *arg);
EXPORT int jack_set_process_callback (jack_client_t *client,
JackProcessCallback process_callback,
void *arg);
......@@ -812,6 +814,7 @@ EXPORT void jack_on_shutdown(jack_client_t* ext_client, JackShutdownCallback cal
JackLibGlobals::CheckContext();
#endif
JackClient* client = (JackClient*)ext_client;
jack_error("jack_on_shutdown: deprecated, use jack_on_info_shutdown");
if (client == NULL) {
jack_error("jack_on_shutdown called with a NULL client");
} else {
......@@ -819,6 +822,19 @@ EXPORT void jack_on_shutdown(jack_client_t* ext_client, JackShutdownCallback cal
}
}
EXPORT void jack_on_info_shutdown(jack_client_t* ext_client, JackInfoShutdownCallback callback, void* arg)
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
#endif
JackClient* client = (JackClient*)ext_client;
if (client == NULL) {
jack_error("jack_on_info_shutdown called with a NULL client");
} else {
client->OnInfoShutdown(callback, arg);
}
}
EXPORT int jack_set_process_callback(jack_client_t* ext_client, JackProcessCallback callback, void* arg)
{
#ifdef __CLIENTDEBUG__
......
......@@ -240,10 +240,18 @@ namespace Jack
// Finer estimation of the position in the ringbuffer
int delta_frames = (fPullAndPushTime > 0) ? (int)((float(long(GetMicroSeconds() - fPullAndPushTime)) * float(fAdaptedSampleRate)) / 1000000.f) : 0;
double ratio = fPIControler.GetRatio(fCaptureRingBuffer[0]->GetError() - delta_frames);
double ratio = 1;
// TODO : done like this just to avoid crash when input only or output only...
if (fCaptureChannels > 0)
ratio = fPIControler.GetRatio(fCaptureRingBuffer[0]->GetError() - delta_frames);
else if (fPlaybackChannels > 0)
ratio = fPIControler.GetRatio(fPlaybackRingBuffer[0]->GetError() - delta_frames);
#ifdef JACK_MONITOR
fTable.Write(fCaptureRingBuffer[0]->GetError(), fCaptureRingBuffer[0]->GetError() - delta_frames, ratio, 1/ratio, fCaptureRingBuffer[0]->ReadSpace(), fCaptureRingBuffer[0]->ReadSpace());
if (fCaptureRingBuffer[0] != NULL)
fTable.Write(fCaptureRingBuffer[0]->GetError(), fCaptureRingBuffer[0]->GetError() - delta_frames, ratio, 1/ratio, fCaptureRingBuffer[0]->ReadSpace(), fCaptureRingBuffer[0]->ReadSpace());
#endif
// Push/pull from ringbuffer
......
......@@ -82,7 +82,7 @@ class JackClientChannelInterface
virtual void ClientClose(int refnum, int* result)
{}
virtual void ClientActivate(int refnum, int state, int* result)
virtual void ClientActivate(int refnum, int is_real_time, int* result)
{}
virtual void ClientDeactivate(int refnum, int* result)
{}
......
......@@ -49,6 +49,7 @@ JackClient::JackClient(JackSynchro* table):fThread(this)
fGraphOrder = NULL;
fXrun = NULL;
fShutdown = NULL;
fInfoShutdown = NULL;
fInit = NULL;
fBufferSize = NULL;
fClientRegistration = NULL;
......@@ -63,6 +64,7 @@ JackClient::JackClient(JackSynchro* table):fThread(this)
fGraphOrderArg = NULL;
fXrunArg = NULL;
fShutdownArg = NULL;
fInfoShutdownArg = NULL;
fInitArg = NULL;
fBufferSizeArg = NULL;
fFreewheelArg = NULL;
......@@ -132,12 +134,12 @@ void JackClient::SetupDriverSync(bool freewheel)
\brief Notification received from the server.
*/
int JackClient::ClientNotifyImp(int refnum, const char* name, int notify, int sync, int value1, int value2)
int JackClient::ClientNotifyImp(int refnum, const char* name, int notify, int sync, const char* message, int value1, int value2)
{
return 0;
}
int JackClient::ClientNotify(int refnum, const char* name, int notify, int sync, int value1, int value2)
int JackClient::ClientNotify(int refnum, const char* name, int notify, int sync, const char* message, int value1, int value2)
{
int res = 0;
......@@ -145,11 +147,11 @@ int JackClient::ClientNotify(int refnum, const char* name, int notify, int sync,
switch (notify) {
case kAddClient:
res = ClientNotifyImp(refnum, name, notify, sync, value1, value2);
res = ClientNotifyImp(refnum, name, notify, sync, message, value1, value2);
break;
case kRemoveClient:
res = ClientNotifyImp(refnum, name, notify, sync, value1, value2);
res = ClientNotifyImp(refnum, name, notify, sync, message, value1, value2);
break;
case kActivateClient:
......@@ -247,6 +249,14 @@ int JackClient::ClientNotify(int refnum, const char* name, int notify, int sync,
if (fXrun)
res = fXrun(fXrunArg);
break;
case kShutDownCallback:
jack_log("JackClient::kShutDownCallback");
if (fInfoShutdown) {
fInfoShutdown(value1, message, fInfoShutdownArg);
fInfoShutdown = NULL;
}
break;
}
}
......@@ -582,7 +592,10 @@ void JackClient::ShutDown()
jack_log("ShutDown");
JackGlobals::fServerRunning = false;
if (fShutdown) {
if (fInfoShutdown) {
fInfoShutdown(JackFailure, "JACK server has been closed", fInfoShutdownArg);
fInfoShutdown = NULL;
} else if (fShutdown) {
fShutdown(fShutdownArg);
fShutdown = NULL;
}
......@@ -772,6 +785,17 @@ void JackClient::OnShutdown(JackShutdownCallback callback, void *arg)
fShutdown = callback;
}
}
void JackClient::OnInfoShutdown(JackInfoShutdownCallback callback, void *arg)
{
if (IsActive()) {
jack_error("You cannot set callbacks on an active client");
} else {
GetClientControl()->fCallback[kShutDownCallback] = (callback != NULL);
fInfoShutdownArg = arg;
fInfoShutdown = callback;
}
}
int JackClient::SetProcessCallback(JackProcessCallback callback, void *arg)
{
......@@ -850,6 +874,9 @@ int JackClient::SetSampleRateCallback(JackSampleRateCallback callback, void *arg
GetClientControl()->fCallback[kSampleRateCallback] = (callback != NULL);
fSampleRateArg = arg;
fSampleRate = callback;
// Now invoke it
if (callback)
callback(GetEngineControl()->fSampleRate, arg);
return 0;
}
}
......
......@@ -54,6 +54,7 @@ class JackClient : public JackClientInterface, public JackRunnableInterface
JackGraphOrderCallback fGraphOrder;
JackXRunCallback fXrun;
JackShutdownCallback fShutdown;
JackInfoShutdownCallback fInfoShutdown;
JackThreadInitCallback fInit;
JackBufferSizeCallback fBufferSize;
JackSampleRateCallback fSampleRate;
......@@ -70,6 +71,7 @@ class JackClient : public JackClientInterface, public JackRunnableInterface
void* fGraphOrderArg;
void* fXrunArg;
void* fShutdownArg;
void* fInfoShutdownArg;
void* fInitArg;
void* fBufferSizeArg;
void* fSampleRateArg;
......@@ -95,7 +97,7 @@ class JackClient : public JackClientInterface, public JackRunnableInterface
void CallSyncCallback();
void CallTimebaseCallback();
virtual int ClientNotifyImp(int refnum, const char* name, int notify, int sync, int value1, int value);
virtual int ClientNotifyImp(int refnum, const char* name, int notify, int sync, const char* message, int value1, int value);
inline void DummyCycle();
inline void ExecuteThread();
......@@ -123,7 +125,7 @@ class JackClient : public JackClientInterface, public JackRunnableInterface
virtual JackEngineControl* GetEngineControl() const = 0;
// Notifications
virtual int ClientNotify(int refnum, const char* name, int notify, int sync, int value1, int value2);
virtual int ClientNotify(int refnum, const char* name, int notify, int sync, const char* message, int value1, int value2);
virtual int Activate();
virtual int Deactivate();
......@@ -159,6 +161,7 @@ class JackClient : public JackClientInterface, public JackRunnableInterface
// Callbacks
virtual void OnShutdown(JackShutdownCallback callback, void *arg);
virtual void OnInfoShutdown(JackInfoShutdownCallback callback, void *arg);
virtual int SetProcessCallback(JackProcessCallback callback, void* arg);
virtual int SetXRunCallback(JackXRunCallback callback, void* arg);
virtual int SetInitCallback(JackThreadInitCallback callback, void* arg);
......
......@@ -44,7 +44,7 @@ class SERVER_EXPORT JackClientInterface
virtual int Close() = 0;
virtual int ClientNotify(int refnum, const char* name, int notify, int sync, int value1, int value2) = 0;
virtual int ClientNotify(int refnum, const char* name, int notify, int sync, const char* message, int value1, int value2) = 0;
virtual JackClientControl* GetClientControl() const = 0;
};
......
......@@ -32,9 +32,10 @@
#define JACK_PORT_TYPE_SIZE 32
#define JACK_CLIENT_NAME_SIZE 64
#define JACK_MESSAGE_SIZE 256
#ifndef PORT_NUM
#define PORT_NUM 1024
#define PORT_NUM 2048
#endif
#define DRIVER_PORT_NUM 256
......
......@@ -139,10 +139,10 @@ JackEngineControl* JackDebugClient::GetEngineControl() const
\brief Notification received from the server.
*/
int JackDebugClient::ClientNotify(int refnum, const char* name, int notify, int sync, int value1, int value2)
int JackDebugClient::ClientNotify(int refnum, const char* name, int notify, int sync, const char* message, int value1, int value2)
{
CheckClient();
return fClient->ClientNotify( refnum, name, notify, sync, value1, value2);
return fClient->ClientNotify( refnum, name, notify, sync, message, value1, value2);
}
int JackDebugClient::Activate()
......@@ -416,6 +416,12 @@ void JackDebugClient::OnShutdown(JackShutdownCallback callback, void *arg)
fClient->OnShutdown(callback, arg);
}
void JackDebugClient::OnInfoShutdown(JackInfoShutdownCallback callback, void *arg)
{
CheckClient();
fClient->OnInfoShutdown(callback, arg);
}
int JackDebugClient::TimeCallback(jack_nframes_t nframes, void *arg)
{
JackDebugClient* client = (JackDebugClient*)arg;
......
......@@ -75,7 +75,7 @@ class JackDebugClient : public JackClient
virtual JackEngineControl* GetEngineControl() const;
// Notifications
int ClientNotify(int refnum, const char* name, int notify, int sync, int value1, int value2);
int ClientNotify(int refnum, const char* name, int notify, int sync, const char* message, int value1, int value2);
int Activate();
int Deactivate();
......@@ -110,6 +110,7 @@ class JackDebugClient : public JackClient
// Callbacks
void OnShutdown(JackShutdownCallback callback, void *arg);
void OnInfoShutdown(JackInfoShutdownCallback callback, void *arg);
int SetProcessCallback(JackProcessCallback callback, void* arg);
int SetXRunCallback(JackXRunCallback callback, void* arg);
int SetInitCallback(JackThreadInitCallback callback, void* arg);
......
......@@ -167,11 +167,15 @@ int JackDriver::Open(jack_nframes_t buffer_size,
int JackDriver::Close()
{
jack_log("JackDriver::Close");
fGraphManager->DirectDisconnect(fClientControl.fRefNum, fClientControl.fRefNum); // Disconnect driver from itself for sync
fClientControl.fActive = false;
fEngineControl->fDriverNum--;
return fEngine->ClientInternalClose(fClientControl.fRefNum, false);
if (fClientControl.fRefNum > 0) {
jack_log("JackDriver::Close");
fGraphManager->DirectDisconnect(fClientControl.fRefNum, fClientControl.fRefNum); // Disconnect driver from itself for sync
fClientControl.fActive = false;
fEngineControl->fDriverNum--;
return fEngine->ClientInternalClose(fClientControl.fRefNum, false);
} else {
return -1;
}
}
/*!
......@@ -190,7 +194,7 @@ void JackDriver::SetupDriverSync(int ref, bool freewheel)
}
}
int JackDriver::ClientNotify(int refnum, const char* name, int notify, int sync, int value1, int value2)
int JackDriver::ClientNotify(int refnum, const char* name, int notify, int sync, const char* message, int value1, int value2)
{
switch (notify) {
......@@ -250,6 +254,11 @@ void JackDriver::NotifySampleRate(jack_nframes_t sample_rate)
fEngine->NotifySampleRate(sample_rate);
fEngineControl->InitFrameTime();
}
void JackDriver::NotifyFailure(int code, const char* reason)
{
fEngine->NotifyFailure(code, reason);
}
void JackDriver::SetMaster(bool onoff)
{
......
......@@ -140,6 +140,7 @@ class SERVER_EXPORT JackDriver : public JackDriverClientInterface
void NotifyXRun(jack_time_t callback_usecs, float delayed_usecs); // XRun notification sent by the driver
void NotifyBufferSize(jack_nframes_t buffer_size); // BufferSize notification sent by the driver
void NotifySampleRate(jack_nframes_t sample_rate); // SampleRate notification sent by the driver
void NotifyFailure(int code, const char* reason); // Failure notification sent by the driver
public:
......@@ -199,7 +200,7 @@ class SERVER_EXPORT JackDriver : public JackDriverClientInterface
virtual int SetBufferSize(jack_nframes_t buffer_size);
virtual int SetSampleRate(jack_nframes_t sample_rate);
virtual int ClientNotify(int refnum, const char* name, int notify, int sync, int value1, int value2);
virtual int ClientNotify(int refnum, const char* name, int notify, int sync, const char* message, int value1, int value2);
virtual JackClientControl* GetClientControl() const;
virtual bool IsRealTime() const;
......
......@@ -62,7 +62,7 @@ SERVER_EXPORT void jack_print_driver_options (jack_driver_desc_t* desc, FILE* fi
fprintf (file, "\t-%c, --%s \t%s (default: %s)\n",
desc->params[i].character,
desc->params[i].name,
desc->params[i].short_desc,
desc->params[i].long_desc,
arg_default);
}
}
......
......@@ -119,9 +119,7 @@ void JackEngine::ReleaseRefnum(int ref)
// last client and temporay case: quit the server
jack_log("JackEngine::ReleaseRefnum server quit");
fEngineControl->fTemporary = false;
#ifndef WIN32
exit(0);
#endif
JackServerGlobals::fKilled = true;
}
}
}
......@@ -205,7 +203,7 @@ void JackEngine::CheckXRun(jack_time_t callback_usecs) // REVOIR les conditions
// Notifications
//---------------
void JackEngine::NotifyClient(int refnum, int event, int sync, int value1, int value2)
void JackEngine::NotifyClient(int refnum, int event, int sync, const char* message, int value1, int value2)
{
JackClientInterface* client = fClientTable[refnum];
......@@ -213,20 +211,20 @@ void JackEngine::NotifyClient(int refnum, int event, int sync, int value1, int v
if (!client) {
jack_log("JackEngine::NotifyClient: client not available anymore");
} else if (client->GetClientControl()->fCallback[event]) {
if (client->ClientNotify(refnum, client->GetClientControl()->fName, event, sync, value1, value2) < 0)
if (client->ClientNotify(refnum, client->GetClientControl()->fName, event, sync, message, value1, value2) < 0)
jack_error("NotifyClient fails name = %s event = %ld val1 = %ld val2 = %ld", client->GetClientControl()->fName, event, value1, value2);
} else {
jack_log("JackEngine::NotifyClient: no callback for event = %ld", event);
}
}
void JackEngine::NotifyClients(int event, int sync, int value1, int value2)
void JackEngine::NotifyClients(int event, int sync, const char* message, int value1, int value2)
{
for (int i = 0; i < CLIENT_NUM; i++) {
JackClientInterface* client = fClientTable[i];
if (client) {
if (client->GetClientControl()->fCallback[event]) {
if (client->ClientNotify(i, client->GetClientControl()->fName, event, sync, value1, value2) < 0)
if (client->ClientNotify(i, client->GetClientControl()->fName, event, sync, message, value1, value2) < 0)
jack_error("NotifyClient fails name = %s event = %ld val1 = %ld val2 = %ld", client->GetClientControl()->fName, event, value1, value2);
} else {
jack_log("JackEngine::NotifyClients: no callback for event = %ld", event);
......@@ -242,11 +240,11 @@ int JackEngine::NotifyAddClient(JackClientInterface* new_client, const char* nam
for (int i = 0; i < CLIENT_NUM; i++) {
JackClientInterface* old_client = fClientTable[i];
if (old_client) {
if (old_client->ClientNotify(refnum, name, kAddClient, true, 0, 0) < 0) {
if (old_client->ClientNotify(refnum, name, kAddClient, true, "", 0, 0) < 0) {
jack_error("NotifyAddClient old_client fails name = %s", old_client->GetClientControl()->fName);
return -1;
}
if (new_client->ClientNotify(i, old_client->GetClientControl()->fName, kAddClient, true, 0, 0) < 0) {
if (new_client->ClientNotify(i, old_client->GetClientControl()->fName, kAddClient, true, "", 0, 0) < 0) {
jack_error("NotifyAddClient new_client fails name = %s", name);
return -1;
}
......@@ -262,7 +260,7 @@ void JackEngine::NotifyRemoveClient(const char* name, int refnum)
for (int i = 0; i < CLIENT_NUM; i++) {
JackClientInterface* client = fClientTable[i];
if (client) {
client->ClientNotify(refnum, name, kRemoveClient, true, 0, 0);
client->ClientNotify(refnum, name, kRemoveClient, true, "",0, 0);
}
}
}
......@@ -279,51 +277,56 @@ void JackEngine::NotifyXRun(jack_time_t callback_usecs, float delayed_usecs)
void JackEngine::NotifyXRun(int refnum)
{
if (refnum == ALL_CLIENTS) {
NotifyClients(kXRunCallback, false, 0, 0);
NotifyClients(kXRunCallback, false, "", 0, 0);
} else {
NotifyClient(refnum, kXRunCallback, false, 0, 0);
NotifyClient(refnum, kXRunCallback, false, "", 0, 0);
}
}
void JackEngine::NotifyGraphReorder()
{
NotifyClients(kGraphOrderCallback, false, 0, 0);
NotifyClients(kGraphOrderCallback, false, "", 0, 0);
}
void JackEngine::NotifyBufferSize(jack_nframes_t buffer_size)
{
NotifyClients(kBufferSizeCallback, true, buffer_size, 0);
NotifyClients(kBufferSizeCallback, true, "", buffer_size, 0);
}
void JackEngine::NotifySampleRate(jack_nframes_t sample_rate)
{
NotifyClients(kSampleRateCallback, true, sample_rate, 0);
NotifyClients(kSampleRateCallback, true, "", sample_rate, 0);
}
void JackEngine::NotifyFailure(int code, const char* reason)
{
NotifyClients(kShutDownCallback, false, reason, code, 0);
}
void JackEngine::NotifyFreewheel(bool onoff)
{
fEngineControl->fRealTime = !onoff;
NotifyClients((onoff ? kStartFreewheelCallback : kStopFreewheelCallback), true, 0, 0);
NotifyClients((onoff ? kStartFreewheelCallback : kStopFreewheelCallback), true, "", 0, 0);
}
void JackEngine::NotifyPortRegistation(jack_port_id_t port_index, bool onoff)
{
NotifyClients((onoff ? kPortRegistrationOnCallback : kPortRegistrationOffCallback), false, port_index, 0);
NotifyClients((onoff ? kPortRegistrationOnCallback : kPortRegistrationOffCallback), false, "", port_index, 0);
}
void JackEngine::NotifyPortRename(jack_port_id_t port)
{
NotifyClients(kPortRenameCallback, false, port, 0);
NotifyClients(kPortRenameCallback, false, "", port, 0);
}
void JackEngine::NotifyPortConnect(jack_port_id_t src, jack_port_id_t dst, bool onoff)
{
NotifyClients((onoff ? kPortConnectCallback : kPortDisconnectCallback), false, src, dst);
NotifyClients((onoff ? kPortConnectCallback : kPortDisconnectCallback), false, "", src, dst);
}
void JackEngine::NotifyActivate(int refnum)
{
NotifyClient(refnum, kActivateClient, true, 0, 0);
NotifyClient(refnum, kActivateClient, true, "", 0, 0);
}
//----------------------------
......@@ -481,7 +484,7 @@ int JackEngine::GetClientRefNum(const char* name)
// Used for external clients
int JackEngine::ClientExternalOpen(const char* name, int pid, int* ref, int* shared_engine, int* shared_client, int* shared_graph_manager)
{
jack_log("JackEngine::ClientOpen: name = %s ", name);
jack_log("JackEngine::ClientExternalOpen: name = %s ", name);
int refnum = AllocateRefnum();
if (refnum < 0) {
......@@ -533,7 +536,7 @@ error:
// Used for server driver clients
int JackEngine::ClientInternalOpen(const char* name, int* ref, JackEngineControl** shared_engine, JackGraphManager** shared_manager, JackClientInterface* client, bool wait)
{
jack_log("JackEngine::ClientInternalNew: name = %s", name);
jack_log("JackEngine::ClientInternalOpen: name = %s", name);
int refnum = AllocateRefnum();
if (refnum < 0) {
......@@ -638,14 +641,14 @@ int JackEngine::ClientCloseAux(int refnum, JackClientInterface* client, bool wai
return 0;
}
int JackEngine::ClientActivate(int refnum, bool state)
int JackEngine::ClientActivate(int refnum, bool is_real_time)
{