git-svn-id: http://subversion.jackaudio.org/jack/jack2/branches/libjacknet@4084 0c269be4-1314-0410-8aa9-9f06e86f4224tags/1.9.8
@@ -26,11 +26,42 @@ Josh Green | |||
Mario Lang | |||
Arnold Krille | |||
Jan Engelhardt | |||
Adrian Knoth | |||
Adrian Knoth | |||
David Garcia Garzon | |||
--------------------------- | |||
Jackdmp changes log | |||
--------------------------- | |||
--------------------------- | |||
2010-11-05 Stephane Letz <letz@grame.fr> | |||
* In jackdmp.cpp, jackctl_setup_signals moved before jackctl_server_start. | |||
* Correct symbols export in backends. | |||
2010-11-03 Stephane Letz <letz@grame.fr> | |||
* Improve backend error handling: fatal error returned by Read/Write now cause a Process failure (so a thread exit for blocking backends). Recoverable ones (XRuns..) are now treated internally in ALSA, FreeBob and FFADO backends. | |||
2010-10-30 Stephane Letz <letz@grame.fr> | |||
* Correct JackServer::Open to avoid a race when control API is used on OSX. | |||
2010-10-29 Stephane Letz <letz@grame.fr> | |||
* Correct lsp.c code. | |||
* Add note about unique port-name requirement. | |||
2010-09-08 Stephane Letz <letz@grame.fr> | |||
* Sync JackAlsaDriver::alsa_driver_check_card_type with JACK1 backend. | |||
2010-08-30 Stephane Letz <letz@grame.fr> | |||
* Version 1.9.7 started. | |||
2010-08-25 Stephane Letz <letz@grame.fr> | |||
* In JackCoreAudioDriver, fix an issue when no value is given for input. | |||
2010-08-23 Stephane Letz <letz@grame.fr> | |||
@@ -214,7 +214,8 @@ Note : To experiment with the -S option, jackdmp must be launched in a console. | |||
1.9.2 : Solaris version. New "profiling" tools. Rework the mutex/signal classes. Support for BIG_ENDIAN machines in NetJack2. D-BUS based device reservation to better coexist with PulseAudio on Linux. Add auto_connect parameter in netmanager and netadapter. Use Torben Hohn PI controler code for adapters. Client incorrect re-naming fixed : now done at socket and fifo level. Virtualize and allow overriding of thread creation function, to allow Wine support (from JACK1). | |||
1.9.3 : New JackBoomerDriver class for Boomer driver on Solaris. Add mixed 32/64 bits mode (off by default). Native MIDI backend (JackCoreMidiDriver, JackWinMMEDriver). In ALSA audio card reservation code, tries to open the card even if reservation fails. Clock source setting on Linux. Add jackctl_server_switch_master API. Fix transport callback (timebase master, sync) issue when used after jack_activate (RT thread was not running). D-Bus access for jackctl_server_add_slave/jackctl_server_remove_slave API. Cleanup "loopback" stuff in server. Torben Hohn fix for InitTime and GetMicroSeconds in JackWinTime.c. New jack_free function added in jack.h. Reworked Torben Hohn fix for server restart issue on Windows. Correct jack_set_error_function, jack_set_info_function and jack_set_thread_creator functions. Correct JackFifo::TimedWait for EINTR handling. Move DBus based audio device reservation code in ALSA backend compilation. Correct JackTransportEngine::MakeAllLocating, sync callback has to be called in this case also. NetJack2 code : better error checkout, method renaming. Tim Bechmann patch : hammerfall, only release monitor thread, if it has been created. Tim Bechmann memops.c optimization patches. In combined --dbus and --classic compilation code, use PulseAudio acquire/release code. Big rewrite of Solaris boomer driver, seems to work in duplex mode at least. Loopback backend reborn as a dynamically loadable separated backend. | |||
1.9.4 : Solaris boomer backend now working in capture or playback only mode. Add a -G parameter in CoreAudio backend (the computation value in RT thread expressed as percent of period). Use SNDCTL_DSP_SYNCGROUP/SNDCTL_DSP_SYNCSTART API to synchronize input and output in Solaris boomer backend. Big endian bug fix in memops.c. Fix issues in JackNetDriver::DecodeTransportData and JackNetDriver::Initialize. Correct CPU timing in JackNetDriver, now take cycle begin time after Read. Simplify transport in NetJack2: master only can control transport. Change CoreAudio notification thread setup for OSX Snow Leopard. Correct server temporary mode : now set a global and quit after server/client message handling is finished. 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É). Correct jackdmp.cpp (failures case were not correct..). Improve JackCoreAudioDriver code. Raise default port number to 2048. 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. Improve aggregate device management in JackCoreAudioDriver : now a "private" device only and cleanup properly. Aggregate device code added to JackCoreAudioAdapter. 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. Dynamic system version detection in JackCoreAudioDriver to either create public or private aggregate device. 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. In JackCoreAudioDriver::Start, wait for the audio driver to effectively start (use the MeasureCallback). 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. Now can aggregate device that are themselves AD. No reason to make jack_on_shutdown deprecated, so revert the incorrect change. Thread AcquireRealTime and DropRealTime were (incorrectly) using fThread field. Use pthread_self()) (or GetCurrentThread() on Windows) to get the calling thread. Correctly save and restore RT mode state in freewheel mode. Correct freewheel code on client side. Fix AcquireRealTime and DropRealTime: now distinguish when called from another thread (AcquireRealTime/DropRealTime) and from the thread itself (AcquireSelfRealTime/DropSelfRealTime). Correct JackPosixThread::StartImp : thread priority setting now done in the RT case only. Correct JackGraphManager::GetBuffer for the "client loop with one connection" case : buffer must be copied. Correct JackInfoShutdownCallback prototype, two new JackClientProcessFailure and JackClientZombie JackStatus code. Correct JackCoreAudio driver when empty strings are given as -C, -P or -d parameter. Better memory allocation error checking on client (library) side. Better memory allocation error checking in ringbuffer.c, weak import improvements. Memory allocation error checking for jack_client_new and jack_client_open (server and client side). Memory allocation error checking in server for RPC. Simplify server temporary mode : now use a JackTemporaryException. Lock/Unlock shared memory segments (to test...). Sync with JACK1 : -r parameter now used for no-realtime, realtime (-R) is now default, usable backend given vie platform. In JackCoreAudio driver, (possibly) clock drift compensation when needed in aggregated devices. In JackCoreAudio driver, clock drift compensation in aggregated devices working. In JackCoreAudio driver, clock drift compensation semantic changed a bit : when on, does not activate if not needed (same clock domain). Sync JackCoreAudioAdapter code with JackCoreAudioDriver. | |||
1.9.5 : Dynamic choice of maximum port number. More robust sample rate change handling code in JackCoreAudioDriver. Devin Anderson patch for Jack FFADO driver issues with lost MIDI bytes between periods (and more). Fix port_rename callback : now both old name and new name are given as parameters. Special code in JackCoreAudio driver to handle completely buggy Digidesign CoreAudio user-land driver. Ensure that client-side message buffer thread calls thread_init callback if/when it is set by the client (backport of JACK1 rev 3838). Check dynamic port-max value. Fix JackCoreMidiDriver::ReadProcAux when ring buffer is full (thanks Devin Anderson). Josh Green ALSA driver capture only patch. When threads are cancelled, the exception has to be rethrown. Use a QUIT notification to properly quit the server channel, the server channel thread can then be 'stopped' instead of 'canceled'. Mario Lang alsa_io time calculation overflow patch. Shared memory manager was calling abort in case of fatal error, now return an error in caller. Change JackEngineProfiling and JackAudioAdapterInterface gnuplot scripts to output SVG instead of PDF. | |||
1.9.5 : Dynamic choice of maximum port number. More robust sample rate change handling code in JackCoreAudioDriver. Devin Anderson patch for Jack FFADO driver issues with lost MIDI bytes between periods (and more). Fix port_rename callback : now both old name and new name are given as parameters. Special code in JackCoreAudio driver to handle completely buggy Digidesign CoreAudio user-land driver. Ensure that client-side message buffer thread calls thread_init callback if/when it is set by the client (backport of JACK1 rev 3838). Check dynamic port-max value. Fix JackCoreMidiDriver::ReadProcAux when ring buffer is full (thanks Devin Anderson). Josh Green ALSA driver capture only patch. When threads are cancelled, the exception has to be rethrown. Use a QUIT notification to properly quit the server channel, the server channel thread can then be 'stopped' instead of 'canceled'. Mario Lang alsa_io time calculation overflow patch. Shared memory manager was calling abort in case of fatal error, now return an error in caller. Change JackEngineProfiling and JackAudioAdapterInterface gnuplot scripts to output SVG instead of PDF. | |||
1.9.6 : Improve JackCoreAudioDriver and JackCoreAudioAdapter : when no devices are described, takes default input and output and aggregate them.Correct JackGraphManager::DeactivatePort. Correct JackMachServerChannel::Execute : keep running even in error cases. Raise JACK_PROTOCOL_VERSION number. Arnold Krille firewire patch. Raise JACK_DRIVER_PARAM_STRING_MAX and JACK_PARAM_STRING_MAX to 127 otherwise some audio drivers cannot be loaded on OSX. Fix some file header to have library side code use LGPL. On Windows, now use TRE library for regexp (BSD license instead of GPL license). ffado-portname-sync.patch from ticket #163 applied. Remove call to exit in library code. Make jack_connect/jack_disconnect wait for effective port connection/disconnection. Add tests to validate intclient.h API. On Linux, inter-process synchronization primitive switched to POSIX semaphore. In JackCoreAudioDriver, move code called in MeasureCallback to be called once in IO thread. David Garcia Garzon netone patch. Fix from Fernando Lopez-Lezcano for compilation on fc13. Fix JackPosixSemaphore::TimedWait : same behavior as JackPosixSemaphore::Wait regarding EINTR. David Garcia Garzon unused_pkt_buf_field_jack2 netone patch. Arnold Krille firewire snooping patch. Jan Engelhardt patch for get_cycles on SPARC. Adrian Knoth hurd.patch, kfreebsd-fix.patch and alpha_ia64-sigsegv.patch from ticket 177. Adrian Knoth fix for linux cycle.h (ticket 188). In JackCoreAudioDriver, fix an issue when no value is given for input. | |||
This is a work in progress but the implementation is now stable enough to be tested. jackdmp has been used successfully with the following applications : Ardour, Hydrogen, Jamin, Qjackctl, Jack-Rack, SooperLooper, AlsaPlayer... | |||
@@ -108,8 +108,8 @@ extern "C" | |||
JackPortConnectCallback | |||
connect_callback, void *arg); | |||
EXPORT int jack_set_port_rename_callback (jack_client_t *, | |||
JackPortRenameCallback | |||
rename_callback, void *arg); | |||
JackPortRenameCallback | |||
rename_callback, void *arg); | |||
EXPORT int jack_set_graph_order_callback (jack_client_t *, | |||
JackGraphOrderCallback graph_callback, | |||
void *); | |||
@@ -217,7 +217,7 @@ extern "C" | |||
EXPORT int jack_client_create_thread (jack_client_t* client, | |||
pthread_t *thread, | |||
int priority, | |||
int realtime, // boolean | |||
int realtime, // boolean | |||
thread_routine routine, | |||
void *arg); | |||
EXPORT int jack_drop_real_time_scheduling (pthread_t thread); | |||
@@ -1686,7 +1686,7 @@ EXPORT int jack_acquire_real_time_scheduling(pthread_t thread, int priority) | |||
EXPORT int jack_client_create_thread(jack_client_t* client, | |||
pthread_t *thread, | |||
int priority, | |||
int realtime, /* boolean */ | |||
int realtime, /* boolean */ | |||
thread_routine routine, | |||
void *arg) | |||
{ | |||
@@ -1766,8 +1766,8 @@ EXPORT jack_intclient_t jack_internal_client_handle(jack_client_t* ext_client, c | |||
return 0; | |||
} else { | |||
jack_status_t my_status; | |||
if (status == NULL) /* no status from caller? */ | |||
status = &my_status; /* use local status word */ | |||
if (status == NULL) /* no status from caller? */ | |||
status = &my_status; /* use local status word */ | |||
*status = (jack_status_t)0; | |||
return client->InternalClientHandle(client_name, status); | |||
} | |||
@@ -1786,8 +1786,8 @@ EXPORT jack_intclient_t jack_internal_client_load_aux(jack_client_t* ext_client, | |||
jack_varargs_t va; | |||
jack_status_t my_status; | |||
if (status == NULL) /* no status from caller? */ | |||
status = &my_status; /* use local status word */ | |||
if (status == NULL) /* no status from caller? */ | |||
status = &my_status; /* use local status word */ | |||
*status = (jack_status_t)0; | |||
/* validate parameters */ | |||
@@ -1859,3 +1859,129 @@ EXPORT void jack_free(void* ptr) | |||
free(ptr); | |||
} | |||
} | |||
// session.h | |||
EXPORT int jack_set_session_callback(jack_client_t* ext_client, JackSessionCallback session_callback, void* arg) | |||
{ | |||
#ifdef __CLIENTDEBUG__ | |||
JackGlobals::CheckContext("jack_set_session_callback"); | |||
#endif | |||
JackClient* client = (JackClient*)ext_client; | |||
jack_log("jack_set_session_callback ext_client %x client %x ", ext_client, client); | |||
if (client == NULL) { | |||
jack_error("jack_set_session_callback called with a NULL client"); | |||
return -1; | |||
} else { | |||
return client->SetSessionCallback(session_callback, arg); | |||
} | |||
} | |||
EXPORT jack_session_command_t *jack_session_notify(jack_client_t* ext_client, const char* target, jack_session_event_type_t ev_type, const char *path) | |||
{ | |||
#ifdef __CLIENTDEBUG__ | |||
JackGlobals::CheckContext("jack_session_notify"); | |||
#endif | |||
JackClient* client = (JackClient*)ext_client; | |||
jack_log("jack_session_notify ext_client %x client %x ", ext_client, client); | |||
if (client == NULL) { | |||
jack_error("jack_session_notify called with a NULL client"); | |||
return NULL; | |||
} else { | |||
return client->SessionNotify(target, ev_type, path); | |||
} | |||
} | |||
EXPORT int jack_session_reply(jack_client_t *ext_client, jack_session_event_t *event) | |||
{ | |||
#ifdef __CLIENTDEBUG__ | |||
JackGlobals::CheckContext("jack_session_reply"); | |||
#endif | |||
JackClient* client = (JackClient*)ext_client; | |||
jack_log("jack_session_reply ext_client %x client %x ", ext_client, client); | |||
if (client == NULL) { | |||
jack_error("jack_session_reply called with a NULL client"); | |||
return -1; | |||
} else { | |||
return client->SessionReply(event); | |||
} | |||
} | |||
EXPORT void jack_session_event_free(jack_session_event_t* ev) | |||
{ | |||
if (ev) { | |||
if (ev->session_dir) | |||
free((void *)ev->session_dir); | |||
if (ev->client_uuid) | |||
free((void *)ev->client_uuid); | |||
if (ev->command_line) | |||
free(ev->command_line); | |||
free(ev); | |||
} | |||
} | |||
EXPORT char *jack_get_uuid_for_client_name( jack_client_t *ext_client, const char *client_name ) | |||
{ | |||
#ifdef __CLIENTDEBUG__ | |||
JackGlobals::CheckContext("jack_get_uuid_for_client_name"); | |||
#endif | |||
JackClient* client = (JackClient*)ext_client; | |||
jack_log("jack_get_uuid_for_client_name ext_client %x client %x ", ext_client, client); | |||
if (client == NULL) { | |||
jack_error("jack_get_uuid_for_client_name called with a NULL client"); | |||
return NULL; | |||
} else { | |||
return client->GetUUIDForClientName(client_name); | |||
} | |||
} | |||
EXPORT char *jack_get_client_name_by_uuid( jack_client_t *ext_client, const char *client_uuid ) | |||
{ | |||
#ifdef __CLIENTDEBUG__ | |||
JackGlobals::CheckContext("jack_get_client_name_by_uuid"); | |||
#endif | |||
JackClient* client = (JackClient*)ext_client; | |||
jack_log("jack_get_uuid_for_client_name ext_client %x client %x ", ext_client, client); | |||
if (client == NULL) { | |||
jack_error("jack_get_client_name_by_uuid called with a NULL client"); | |||
return NULL; | |||
} else { | |||
return client->GetClientNameForUUID(client_uuid); | |||
} | |||
} | |||
EXPORT int jack_reserve_client_name( jack_client_t *ext_client, const char *name, const char *uuid ) | |||
{ | |||
#ifdef __CLIENTDEBUG__ | |||
JackGlobals::CheckContext("jack_reserve_client_name"); | |||
#endif | |||
JackClient* client = (JackClient*)ext_client; | |||
jack_log("jack_reserve_client_name ext_client %x client %x ", ext_client, client); | |||
if (client == NULL) { | |||
jack_error("jack_reserve_client_name called with a NULL client"); | |||
return -1; | |||
} else { | |||
return client->ReserveClientName(name, uuid); | |||
} | |||
} | |||
EXPORT void jack_session_commands_free( jack_session_command_t *cmds ) | |||
{ | |||
if (!cmds) | |||
return; | |||
int i=0; | |||
while(1) { | |||
if (cmds[i].client_name) | |||
free ((char *)cmds[i].client_name); | |||
if (cmds[i].command) | |||
free ((char *)cmds[i].command); | |||
if (cmds[i].uuid) | |||
free ((char *)cmds[i].uuid); | |||
else | |||
break; | |||
i += 1; | |||
} | |||
free(cmds); | |||
} |
@@ -195,7 +195,7 @@ int JackAudioDriver::ProcessNull() | |||
ProcessGraphAsync(); | |||
} | |||
// Keep end cycle time | |||
// Keep end cycle time | |||
JackDriver::CycleTakeEndTime(); | |||
WaitUntilNextCycle(); | |||
return 0; | |||
@@ -215,14 +215,14 @@ int JackAudioDriver::ProcessAsync() | |||
{ | |||
// Read input buffers for the current cycle | |||
if (Read() < 0) { | |||
jack_error("JackAudioDriver::ProcessAsync: read error, skip cycle"); | |||
return 0; // Skip cycle, but continue processing... | |||
jack_error("JackAudioDriver::ProcessAsync: read error, stopping..."); | |||
return -1; | |||
} | |||
// Write output buffers from the previous cycle | |||
if (Write() < 0) { | |||
jack_error("JackAudioDriver::ProcessAsync: write error, skip cycle"); | |||
return 0; // Skip cycle, but continue processing... | |||
jack_error("JackAudioDriver::ProcessAsync: write error, stopping..."); | |||
return -1; | |||
} | |||
if (fIsMaster) { | |||
@@ -244,9 +244,9 @@ output buffers computed at the *current cycle* are used. | |||
int JackAudioDriver::ProcessSync() | |||
{ | |||
// Read input buffers for the current cycle | |||
if (Read() < 0) { | |||
jack_error("JackAudioDriver::ProcessSync: read error, skip cycle"); | |||
return 0; // Skip cycle, but continue processing... | |||
if (Read() < 0) { | |||
jack_error("JackAudioDriver::ProcessSync: read error, stopping..."); | |||
return -1; | |||
} | |||
if (fIsMaster) { | |||
@@ -255,10 +255,10 @@ int JackAudioDriver::ProcessSync() | |||
fGraphManager->ResumeRefNum(&fClientControl, fSynchroTable); | |||
} | |||
// Write output buffers for the current cycle | |||
if (Write() < 0) { | |||
jack_error("JackAudioDriver::ProcessSync: write error, skip cycle"); | |||
return 0; // Skip cycle, but continue processing... | |||
// Write output buffers from the current cycle | |||
if (Write() < 0) { | |||
jack_error("JackAudioDriver::ProcessSync: write error, stopping..."); | |||
return -1; | |||
} | |||
// Keep end cycle time | |||
@@ -270,10 +270,10 @@ void JackAudioDriver::ProcessGraphAsync() | |||
{ | |||
// fBeginDateUst is set in the "low level" layer, fEndDateUst is from previous cycle | |||
if (!fEngine->Process(fBeginDateUst, fEndDateUst)) | |||
jack_error("JackAudioDriver::ProcessAsync Process error"); | |||
jack_error("JackAudioDriver::ProcessGraphAsync: Process error"); | |||
fGraphManager->ResumeRefNum(&fClientControl, fSynchroTable); | |||
if (ProcessSlaves() < 0) | |||
jack_error("JackAudioDriver::ProcessAsync ProcessSlaves error"); | |||
jack_error("JackAudioDriver::ProcessGraphAsync: ProcessSlaves error"); | |||
} | |||
void JackAudioDriver::ProcessGraphSync() | |||
@@ -282,11 +282,11 @@ void JackAudioDriver::ProcessGraphSync() | |||
if (fEngine->Process(fBeginDateUst, fEndDateUst)) { | |||
fGraphManager->ResumeRefNum(&fClientControl, fSynchroTable); | |||
if (ProcessSlaves() < 0) | |||
jack_error("JackAudioDriver::ProcessSync ProcessSlaves error, engine may now behave abnormally!!"); | |||
jack_error("JackAudioDriver::ProcessGraphSync: ProcessSlaves error, engine may now behave abnormally!!"); | |||
if (fGraphManager->SuspendRefNum(&fClientControl, fSynchroTable, DRIVER_TIMEOUT_FACTOR * fEngineControl->fTimeOutUsecs) < 0) | |||
jack_error("JackAudioDriver::ProcessSync SuspendRefNum error, engine may now behave abnormally!!"); | |||
jack_error("JackAudioDriver::ProcessGraphSync: SuspendRefNum error, engine may now behave abnormally!!"); | |||
} else { // Graph not finished: do not activate it | |||
jack_error("JackAudioDriver::ProcessSync: error"); | |||
jack_error("JackAudioDriver::ProcessGraphSync: Process error"); | |||
} | |||
} | |||
@@ -21,6 +21,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |||
#define __JackChannel__ | |||
#include "types.h" | |||
#include "session.h" | |||
namespace Jack | |||
{ | |||
@@ -49,7 +50,7 @@ class JackClientChannelInterface | |||
{} | |||
// Open the Server/Client connection | |||
virtual int Open(const char* server_name, const char* name, char* name_res, JackClient* obj, jack_options_t options, jack_status_t* status) | |||
virtual int Open(const char* server_name, const char* name, int uuid, char* name_res, JackClient* obj, jack_options_t options, jack_status_t* status) | |||
{ | |||
return 0; | |||
} | |||
@@ -73,9 +74,9 @@ class JackClientChannelInterface | |||
return -1; | |||
} | |||
virtual void ClientCheck(const char* name, char* name_res, int protocol, int options, int* status, int* result) | |||
virtual void ClientCheck(const char* name, int uuid, char* name_res, int protocol, int options, int* status, int* result) | |||
{} | |||
virtual void ClientOpen(const char* name, int pid, int* shared_engine, int* shared_client, int* shared_graph, int* result) | |||
virtual void ClientOpen(const char* name, int pid, int uuid, int* shared_engine, int* shared_client, int* shared_graph, int* result) | |||
{} | |||
virtual void ClientOpen(const char* name, int* ref, JackEngineControl** shared_engine, JackGraphManager** shared_manager, JackClientInterface* client, int* result) | |||
{} | |||
@@ -120,12 +121,31 @@ class JackClientChannelInterface | |||
virtual void InternalClientHandle(int refnum, const char* client_name, int* status, int* int_ref, int* result) | |||
{} | |||
virtual void InternalClientLoad(int refnum, const char* client_name, const char* so_name, const char* objet_data, int options, int* status, int* int_ref, int* result) | |||
virtual void InternalClientLoad(int refnum, const char* client_name, const char* so_name, const char* objet_data, int options, int* status, int* int_ref, int uuid, int* result) | |||
{} | |||
virtual void InternalClientUnload(int refnum, int int_ref, int* status, int* result) | |||
{} | |||
virtual void SessionNotify(int refnum, const char* target, jack_session_event_type_t type, const char *path, jack_session_command_t **result) | |||
{} | |||
virtual void SessionReply(int refnum, int *result) | |||
{} | |||
virtual void GetUUIDForClientName(int refnum, const char *client_name, char *uuid_res, int *result) | |||
{} | |||
virtual void GetClientNameForUUID(int refnum, const char *uuid, char *name_res, int *result) | |||
{} | |||
virtual void ReserveClientName(int refnum, const char *client_name, const char *uuid, int *result) | |||
{} | |||
virtual bool IsChannelThread() | |||
{ | |||
return false; | |||
} | |||
}; | |||
} | |||
@@ -112,9 +112,9 @@ pthread_t JackClient::GetThreadID() | |||
} | |||
/*! | |||
In "async" mode, the server does not synchronize itself on the output drivers, thus it would never "consume" the activations. | |||
The synchronization primitives for drivers are setup in "flush" mode that to not keep unneeded activations. | |||
Drivers synchro are setup in "flush" mode if server is "async" and NOT freewheel. | |||
In "async" mode, the server does not synchronize itself on the output drivers, thus it would never "consume" the activations. | |||
The synchronization primitives for drivers are setup in "flush" mode that to not keep unneeded activations. | |||
Drivers synchro are setup in "flush" mode if server is "async" and NOT freewheel. | |||
*/ | |||
void JackClient::SetupDriverSync(bool freewheel) | |||
{ | |||
@@ -170,7 +170,7 @@ int JackClient::ClientNotify(int refnum, const char* name, int notify, int sync, | |||
case kAddClient: | |||
jack_log("JackClient::kAddClient fName = %s name = %s", GetClientControl()->fName, name); | |||
if (fClientRegistration && strcmp(GetClientControl()->fName, name) != 0) { // Don't call the callback for the registering client itself | |||
if (fClientRegistration && strcmp(GetClientControl()->fName, name) != 0) { // Don't call the callback for the registering client itself | |||
fClientRegistration(name, 1, fClientRegistrationArg); | |||
} | |||
break; | |||
@@ -272,6 +272,23 @@ int JackClient::ClientNotify(int refnum, const char* name, int notify, int sync, | |||
fInfoShutdown = NULL; | |||
} | |||
break; | |||
case kSessionCallback: | |||
jack_log("JackClient::kSessionCallback"); | |||
if (fSession) { | |||
jack_session_event_t *event = (jack_session_event_t *) malloc( sizeof(jack_session_event_t) ); | |||
char uuid_buf[JACK_UUID_SIZE]; | |||
event->type = (jack_session_event_type_t) value1; | |||
event->session_dir = strdup( message ); | |||
event->command_line = NULL; | |||
event->flags = (jack_session_flags_t) 0; | |||
snprintf( uuid_buf, sizeof(uuid_buf), "%d", GetClientControl()->fSessionID ); | |||
event->client_uuid = strdup( uuid_buf ); | |||
fImmediateSessionReply = false; | |||
fSession(event, fSessionArg); | |||
res = (fImmediateSessionReply) ? 1 : 2; | |||
} | |||
break; | |||
} | |||
} | |||
@@ -280,7 +297,7 @@ int JackClient::ClientNotify(int refnum, const char* name, int notify, int sync, | |||
/*! | |||
\brief We need to start thread before activating in the server, otherwise the FW driver | |||
connected to the client may not be activated. | |||
connected to the client may not be activated. | |||
*/ | |||
int JackClient::Activate() | |||
{ | |||
@@ -410,7 +427,7 @@ inline void JackClient::ExecuteThread() | |||
while (true) { | |||
CycleWaitAux(); | |||
CycleSignalAux(CallProcessCallback()); | |||
} | |||
} | |||
} | |||
inline jack_nframes_t JackClient::CycleWaitAux() | |||
@@ -981,6 +998,19 @@ int JackClient::SetProcessThread(JackThreadCallback fun, void *arg) | |||
} | |||
} | |||
int JackClient::SetSessionCallback(JackSessionCallback callback, void *arg) | |||
{ | |||
if (IsActive()) { | |||
jack_error("You cannot set callbacks on an active client"); | |||
return -1; | |||
} else { | |||
GetClientControl()->fCallback[kSessionCallback] = (callback != NULL); | |||
fSessionArg = arg; | |||
fSession = callback; | |||
return 0; | |||
} | |||
} | |||
//------------------ | |||
// Internal clients | |||
//------------------ | |||
@@ -1027,9 +1057,8 @@ int JackClient::InternalClientLoad(const char* client_name, jack_options_t optio | |||
return 0; | |||
} | |||
int int_ref = 0; | |||
int result = -1; | |||
fChannel->InternalClientLoad(GetClientControl()->fRefNum, client_name, va->load_name, va->load_init, options, (int*)status, &int_ref, &result); | |||
int int_ref, result = -1; | |||
fChannel->InternalClientLoad(GetClientControl()->fRefNum, client_name, va->load_name, va->load_init, options, (int*)status, &int_ref, -1, &result); | |||
return int_ref; | |||
} | |||
@@ -1039,6 +1068,71 @@ void JackClient::InternalClientUnload(int ref, jack_status_t* status) | |||
fChannel->InternalClientUnload(GetClientControl()->fRefNum, ref, (int*)status, &result); | |||
} | |||
//------------------ | |||
// Session API | |||
//------------------ | |||
jack_session_command_t *JackClient::SessionNotify( const char* target, jack_session_event_type_t type, const char* path ) | |||
{ | |||
jack_session_command_t *res; | |||
fChannel->SessionNotify( GetClientControl()->fRefNum, target, type, path, &res ); | |||
return res; | |||
} | |||
int JackClient::SessionReply( jack_session_event_t *ev ) | |||
{ | |||
if (ev->command_line) { | |||
strncpy( GetClientControl()->fSessionCommand, ev->command_line, sizeof(GetClientControl()->fSessionCommand) ); | |||
} else { | |||
GetClientControl()->fSessionCommand[0] = '\0'; | |||
} | |||
GetClientControl()->fSessionFlags = ev->flags; | |||
jack_log( "JackClient::SessionReply... we are here" ); | |||
if (fChannel->IsChannelThread()) { | |||
jack_log( "JackClient::SessionReply... in callback reply" ); | |||
fImmediateSessionReply = true; | |||
return 0; | |||
} | |||
jack_log( "JackClient::SessionReply... out of cb" ); | |||
int res; | |||
fChannel->SessionReply( GetClientControl()->fRefNum, &res); | |||
return res; | |||
} | |||
char* JackClient::GetUUIDForClientName(const char* client_name) | |||
{ | |||
char uuid_res[JACK_UUID_SIZE]; | |||
int result = -1; | |||
fChannel->GetUUIDForClientName( GetClientControl()->fRefNum, client_name, uuid_res, &result); | |||
if (result) | |||
return NULL; | |||
return strdup(uuid_res); | |||
} | |||
char* JackClient::GetClientNameForUUID(const char* uuid) | |||
{ | |||
char name_res[JACK_CLIENT_NAME_SIZE + 1]; | |||
int result = -1; | |||
fChannel->GetClientNameForUUID(GetClientControl()->fRefNum, uuid, name_res, &result); | |||
if (result) | |||
return NULL; | |||
return strdup(name_res); | |||
} | |||
int JackClient::ReserveClientName(const char *name, const char* uuid) | |||
{ | |||
int result = -1; | |||
fChannel->ReserveClientName( GetClientControl()->fRefNum, name, uuid, &result); | |||
return result; | |||
} | |||
} // end of namespace | |||
@@ -28,6 +28,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |||
#include "JackPlatformPlug.h" | |||
#include "JackChannel.h" | |||
#include "types.h" | |||
#include "session.h" | |||
#include "varargs.h" | |||
#include <list> | |||
@@ -66,6 +67,7 @@ class JackClient : public JackClientInterface, public JackRunnableInterface | |||
JackTimebaseCallback fTimebase; | |||
JackSyncCallback fSync; | |||
JackThreadCallback fThreadFun; | |||
JackSessionCallback fSession; | |||
void* fProcessArg; | |||
void* fGraphOrderArg; | |||
@@ -83,12 +85,15 @@ class JackClient : public JackClientInterface, public JackRunnableInterface | |||
void* fTimebaseArg; | |||
void* fSyncArg; | |||
void* fThreadFunArg; | |||
void* fSessionArg; | |||
char fServerName[64]; | |||
JackThread fThread; /*! Thread to execute the Process function */ | |||
detail::JackClientChannelInterface* fChannel; | |||
JackSynchro* fSynchroTable; | |||
std::list<jack_port_id_t> fPortList; | |||
bool fImmediateSessionReply; | |||
int StartThread(); | |||
void SetupDriverSync(bool freewheel); | |||
@@ -118,7 +123,7 @@ class JackClient : public JackClientInterface, public JackRunnableInterface | |||
JackClient(JackSynchro* table); | |||
virtual ~JackClient(); | |||
virtual int Open(const char* server_name, const char* name, jack_options_t options, jack_status_t* status) = 0; | |||
virtual int Open(const char* server_name, const char* name, int uuid, jack_options_t options, jack_status_t* status) = 0; | |||
virtual int Close(); | |||
virtual JackGraphManager* GetGraphManager() const = 0; | |||
@@ -173,6 +178,7 @@ class JackClient : public JackClientInterface, public JackRunnableInterface | |||
virtual int SetPortRegistrationCallback(JackPortRegistrationCallback callback, void* arg); | |||
virtual int SetPortConnectCallback(JackPortConnectCallback callback, void *arg); | |||
virtual int SetPortRenameCallback(JackPortRenameCallback callback, void *arg); | |||
virtual int SetSessionCallback(JackSessionCallback callback, void *arg); | |||
// Internal clients | |||
virtual char* GetInternalClientName(int ref); | |||
@@ -184,6 +190,13 @@ class JackClient : public JackClientInterface, public JackRunnableInterface | |||
void CycleSignal(int status); | |||
int SetProcessThread(JackThreadCallback fun, void *arg); | |||
// Session api | |||
virtual jack_session_command_t *SessionNotify(const char *target, jack_session_event_type_t type, const char *path); | |||
virtual int SessionReply(jack_session_event_t *ev); | |||
char* GetUUIDForClientName(const char* client_name); | |||
char* GetClientNameForUUID(const char* uuid); | |||
int ReserveClientName(const char *name, const char* uuid); | |||
// JackRunnableInterface interface | |||
bool Init(); | |||
bool Execute(); | |||
@@ -26,6 +26,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |||
#include "JackSynchro.h" | |||
#include "JackNotification.h" | |||
#include "jack/session.h" | |||
namespace Jack | |||
{ | |||
@@ -44,22 +46,26 @@ struct JackClientControl : public JackShmMemAble | |||
int fPID; | |||
bool fActive; | |||
JackClientControl(const char* name, int pid, int refnum) | |||
int fSessionID; | |||
char fSessionCommand[JACK_SESSION_COMMAND_SIZE]; | |||
jack_session_flags_t fSessionFlags; | |||
JackClientControl(const char* name, int pid, int refnum, int uuid) | |||
{ | |||
Init(name, pid, refnum); | |||
Init(name, pid, refnum, uuid); | |||
} | |||
JackClientControl(const char* name) | |||
{ | |||
Init(name, 0, -1); | |||
Init(name, 0, -1, -1); | |||
} | |||
JackClientControl() | |||
{ | |||
Init("", 0, -1); | |||
Init("", 0, -1, -1); | |||
} | |||
void Init(const char* name, int pid, int refnum) | |||
void Init(const char* name, int pid, int refnum, int uuid) | |||
{ | |||
strcpy(fName, name); | |||
for (int i = 0; i < kMaxNotification; i++) | |||
@@ -77,6 +83,8 @@ struct JackClientControl : public JackShmMemAble | |||
fTransportSync = false; | |||
fTransportTimebase = false; | |||
fActive = false; | |||
fSessionID = uuid; | |||
} | |||
} POST_PACKED_STRUCTURE; | |||
@@ -24,7 +24,7 @@ | |||
#include "config.h" | |||
#endif | |||
#define VERSION "1.9.6" | |||
#define VERSION "1.9.7" | |||
#define BUFFER_SIZE_MAX 8192 | |||
@@ -33,6 +33,8 @@ | |||
#define JACK_CLIENT_NAME_SIZE 64 | |||
#define JACK_MESSAGE_SIZE 256 | |||
#define JACK_UUID_SIZE 32 | |||
#define JACK_SESSION_COMMAND_SIZE 256 | |||
#ifndef PORT_NUM | |||
#define PORT_NUM 2048 | |||
@@ -71,6 +73,7 @@ | |||
#define FREEWHEEL_DRIVER_TIMEOUT 10 // in sec | |||
#define DRIVER_TIMEOUT_FACTOR 10 | |||
#define NO_PORT 0xFFFE | |||
#define EMPTY 0xFFFD | |||
@@ -450,21 +450,21 @@ sigset_t | |||
jackctl_setup_signals( | |||
unsigned int flags) | |||
{ | |||
if ((waitEvent = CreateEvent(NULL, FALSE, FALSE, NULL)) == NULL) { | |||
if ((waitEvent = CreateEvent(NULL, FALSE, FALSE, NULL)) == NULL) { | |||
jack_error("CreateEvent fails err = %ld", GetLastError()); | |||
return 0; | |||
} | |||
(void) signal(SIGINT, do_nothing_handler); | |||
(void) signal(SIGINT, do_nothing_handler); | |||
(void) signal(SIGABRT, do_nothing_handler); | |||
(void) signal(SIGTERM, do_nothing_handler); | |||
return (sigset_t)waitEvent; | |||
return (sigset_t)waitEvent; | |||
} | |||
void jackctl_wait_signals(sigset_t signals) | |||
{ | |||
if (WaitForSingleObject(waitEvent, INFINITE) != WAIT_OBJECT_0) { | |||
if (WaitForSingleObject(waitEvent, INFINITE) != WAIT_OBJECT_0) { | |||
jack_error("WaitForSingleObject fails err = %ld", GetLastError()); | |||
} | |||
} | |||
@@ -1179,7 +1179,7 @@ EXPORT bool jackctl_server_load_internal( | |||
{ | |||
int status; | |||
if (server_ptr->engine != NULL) { | |||
server_ptr->engine->InternalClientLoad(internal->desc_ptr->name, internal->desc_ptr->name, internal->set_parameters, JackNullOption, &internal->refnum, &status); | |||
server_ptr->engine->InternalClientLoad(internal->desc_ptr->name, internal->desc_ptr->name, internal->set_parameters, JackNullOption, &internal->refnum, -1, &status); | |||
return (internal->refnum > 0); | |||
} else { | |||
return false; | |||
@@ -36,8 +36,8 @@ namespace Jack | |||
JackDebugClient::JackDebugClient(JackClient * client) | |||
{ | |||
fTotalPortNumber = 1; // The total number of port opened and maybe closed. Historical view. | |||
fOpenPortNumber = 0; // The current number of opened port. | |||
fTotalPortNumber = 1; // The total number of port opened and maybe closed. Historical view. | |||
fOpenPortNumber = 0; // The current number of opened port. | |||
fIsActivated = 0; | |||
fIsDeactivated = 0; | |||
fIsClosed = 0; | |||
@@ -78,9 +78,9 @@ JackDebugClient::~JackDebugClient() | |||
delete fClient; | |||
} | |||
int JackDebugClient::Open(const char* server_name, const char* name, jack_options_t options, jack_status_t* status) | |||
int JackDebugClient::Open(const char* server_name, const char* name, int uuid, jack_options_t options, jack_status_t* status) | |||
{ | |||
int res = fClient->Open(server_name, name, options, status); | |||
int res = fClient->Open(server_name, name, uuid, options, status); | |||
char provstr[256]; | |||
char buffer[256]; | |||
time_t curtime; | |||
@@ -210,8 +210,8 @@ int JackDebugClient::PortUnRegister(jack_port_id_t port_index) | |||
int res = fClient->PortUnRegister(port_index); | |||
fOpenPortNumber--; | |||
int i; | |||
for (i = (fTotalPortNumber - 1); i >= 0; i--) { // We search the record into the history | |||
if (fPortList[i].idport == port_index) { // We found the last record | |||
for (i = (fTotalPortNumber - 1); i >= 0; i--) { // We search the record into the history | |||
if (fPortList[i].idport == port_index) { // We found the last record | |||
if (fPortList[i].IsUnregistered != 0) | |||
*fStream << "!!! ERROR !!! : '" << fClientName << "' id deregistering port '" << fPortList[i].name << "' that have already been unregistered !" << endl; | |||
fPortList[i].IsUnregistered++; | |||
@@ -233,8 +233,8 @@ int JackDebugClient::PortConnect(const char* src, const char* dst) | |||
*fStream << "!!! ERROR !!! Trying to connect a port ( " << src << " to " << dst << ") while the client has not been activated !" << endl; | |||
int i; | |||
int res = fClient->PortConnect( src, dst); | |||
for (i = (fTotalPortNumber - 1); i >= 0; i--) { // We search the record into the history | |||
if (strcmp(fPortList[i].name, src) == 0) { // We found the last record in sources | |||
for (i = (fTotalPortNumber - 1); i >= 0; i--) { // We search the record into the history | |||
if (strcmp(fPortList[i].name, src) == 0) { // We found the last record in sources | |||
if (fPortList[i].IsUnregistered != 0) | |||
*fStream << "!!! ERROR !!! Connecting port " << src << " previoulsy unregistered !" << endl; | |||
fPortList[i].IsConnected++; | |||
@@ -293,8 +293,8 @@ int JackDebugClient::PortDisconnect(jack_port_id_t src) | |||
*fStream << "!!! ERROR !!! : Trying to disconnect port " << src << " while that client has not been activated !" << endl; | |||
int res = fClient->PortDisconnect(src); | |||
int i; | |||
for (i = (fTotalPortNumber - 1); i >= 0; i--) { // We search the record into the history | |||
if (fPortList[i].idport == src) { // We found the record in sources | |||
for (i = (fTotalPortNumber - 1); i >= 0; i--) { // We search the record into the history | |||
if (fPortList[i].idport == src) { // We found the record in sources | |||
if (fPortList[i].IsUnregistered != 0) | |||
*fStream << "!!! ERROR !!! : Disconnecting port " << src << " previoulsy unregistered !" << endl; | |||
fPortList[i].IsConnected--; | |||
@@ -53,8 +53,8 @@ class JackDebugClient : public JackClient | |||
JackClient* fClient; | |||
std::ofstream* fStream; | |||
PortFollower fPortList[MAX_PORT_HISTORY]; // Arbitrary value... To be tuned... | |||
int fTotalPortNumber; // The total number of port opened and maybe closed. Historical view. | |||
int fOpenPortNumber; // The current number of opened port. | |||
int fTotalPortNumber; // The total number of port opened and maybe closed. Historical view. | |||
int fOpenPortNumber; // The current number of opened port. | |||
int fIsActivated; | |||
int fIsDeactivated; | |||
int fIsClosed; | |||
@@ -68,7 +68,7 @@ class JackDebugClient : public JackClient | |||
JackDebugClient(JackClient* fTheClient); | |||
virtual ~JackDebugClient(); | |||
virtual int Open(const char* server_name, const char* name, jack_options_t options, jack_status_t* status); | |||
virtual int Open(const char* server_name, const char* name, int uuid, jack_options_t options, jack_status_t* status); | |||
int Close(); | |||
virtual JackGraphManager* GetGraphManager() const; | |||
@@ -32,7 +32,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |||
jack_driver_desc_t * jackctl_driver_get_desc(jackctl_driver_t * driver); | |||
SERVER_EXPORT void jack_print_driver_options (jack_driver_desc_t* desc, FILE* file) | |||
EXPORT void jack_print_driver_options (jack_driver_desc_t* desc, FILE* file) | |||
{ | |||
unsigned long i; | |||
char arg_default[JACK_DRIVER_PARAM_STRING_MAX + 1]; | |||
@@ -75,7 +75,7 @@ jack_print_driver_param_usage (jack_driver_desc_t * desc, unsigned long param, F | |||
fprintf (file, "%s\n", desc->params[param].long_desc); | |||
} | |||
SERVER_EXPORT void jack_free_driver_params(JSList * driver_params) | |||
EXPORT void jack_free_driver_params(JSList * driver_params) | |||
{ | |||
JSList *node_ptr = driver_params; | |||
JSList *next_node_ptr; | |||
@@ -228,7 +228,7 @@ jack_parse_driver_params (jack_driver_desc_t * desc, int argc, char* argv[], JSL | |||
return 0; | |||
} | |||
SERVER_EXPORT int | |||
EXPORT int | |||
jackctl_parse_driver_params (jackctl_driver *driver_ptr, int argc, char* argv[]) | |||
{ | |||
struct option * long_options; | |||
@@ -436,17 +436,17 @@ jack_get_descriptor (JSList * drivers, const char * sofile, const char * symbol) | |||
#ifdef WIN32 | |||
if ((so_get_descriptor == NULL) && (dlerr = GetLastError()) != 0) { | |||
jack_log("jack_get_descriptor : dll is not a driver, err = %ld", dlerr); | |||
jack_error("jack_get_descriptor : dll is not a driver, err = %ld", dlerr); | |||
#else | |||
if ((so_get_descriptor == NULL) && (dlerr = dlerror ()) != NULL) { | |||
jack_log("jack_get_descriptor err = %s", dlerr); | |||
jack_error("jack_get_descriptor err = %s", dlerr); | |||
#endif | |||
UnloadDriverModule(dlhandle); | |||
free(filename); | |||
return NULL; | |||
} | |||
if ((descriptor = so_get_descriptor ()) == NULL) { | |||
jack_error("driver from '%s' returned NULL descriptor", filename); | |||
UnloadDriverModule(dlhandle); | |||
@@ -467,7 +467,7 @@ jack_get_descriptor (JSList * drivers, const char * sofile, const char * symbol) | |||
/* check it doesn't exist already */ | |||
for (node = drivers; node; node = jack_slist_next (node)) { | |||
other_descriptor = (jack_driver_desc_t *) node->data; | |||
if (strcmp(descriptor->name, other_descriptor->name) == 0) { | |||
jack_error("the drivers in '%s' and '%s' both have the name '%s'; using the first", | |||
other_descriptor->file, filename, other_descriptor->name); | |||
@@ -563,6 +563,8 @@ jack_drivers_load (JSList * drivers) { | |||
desc = jack_get_descriptor (drivers, filedata.cFileName, "driver_get_descriptor"); | |||
if (desc) { | |||
driver_list = jack_slist_append (driver_list, desc); | |||
} else { | |||
jack_error ("jack_get_descriptor returns null for \'%s\'", filedata.cFileName); | |||
} | |||
} while (FindNextFile(file, &filedata)); | |||
@@ -601,7 +603,7 @@ jack_drivers_load (JSList * drivers) { | |||
} | |||
while ((dir_entry = readdir(dir_stream))) { | |||
/* check the filename is of the right format */ | |||
if (strncmp ("jack_", dir_entry->d_name, 5) != 0) { | |||
continue; | |||
@@ -617,8 +619,11 @@ jack_drivers_load (JSList * drivers) { | |||
} | |||
desc = jack_get_descriptor (drivers, dir_entry->d_name, "driver_get_descriptor"); | |||
if (desc) { | |||
driver_list = jack_slist_append (driver_list, desc); | |||
} else { | |||
jack_error ("jack_get_descriptor returns null for \'%s\'", dir_entry->d_name); | |||
} | |||
} | |||
@@ -687,6 +692,8 @@ jack_internals_load (JSList * internals) { | |||
desc = jack_get_descriptor (internals, filedata.cFileName, "jack_get_descriptor"); | |||
if (desc) { | |||
driver_list = jack_slist_append (driver_list, desc); | |||
} else { | |||
jack_error ("jack_get_descriptor returns null for \'%s\'", filedata.cFileName); | |||
} | |||
} while (FindNextFile(file, &filedata)); | |||
@@ -743,6 +750,8 @@ jack_internals_load (JSList * internals) { | |||
desc = jack_get_descriptor (internals, dir_entry->d_name, "jack_get_descriptor"); | |||
if (desc) { | |||
driver_list = jack_slist_append (driver_list, desc); | |||
} else { | |||
jack_error ("jack_get_descriptor returns null for \'%s\'", dir_entry->d_name); | |||
} | |||
} | |||
@@ -68,9 +68,9 @@ jack_driver_desc_t * jack_find_driver_descriptor (JSList * drivers, const char * | |||
JSList * jack_drivers_load (JSList * drivers); | |||
JSList * jack_internals_load (JSList * internals); | |||
SERVER_EXPORT int jackctl_parse_driver_params (jackctl_driver * driver_ptr, int argc, char* argv[]); | |||
SERVER_EXPORT void jack_free_driver_params(JSList * param_ptr); | |||
SERVER_EXPORT void jack_print_driver_options(jack_driver_desc_t* desc, FILE* file); | |||
EXPORT int jackctl_parse_driver_params (jackctl_driver * driver_ptr, int argc, char* argv[]); | |||
EXPORT void jack_free_driver_params(JSList * param_ptr); | |||
EXPORT void jack_print_driver_options(jack_driver_desc_t* desc, FILE* file); | |||
#endif | |||
@@ -44,12 +44,15 @@ JackEngine::JackEngine(JackGraphManager* manager, | |||
fEngineControl = control; | |||
for (int i = 0; i < CLIENT_NUM; i++) | |||
fClientTable[i] = NULL; | |||
fLastSwitchUsecs = 0; | |||
fMaxUUID = 0; | |||
fSessionPendingReplies = 0; | |||
fSessionTransaction = NULL; | |||
fSessionResult = NULL; | |||
} | |||
JackEngine::~JackEngine() | |||
{ | |||
jack_log("JackEngine::~JackEngine"); | |||
} | |||
{} | |||
int JackEngine::Open() | |||
{ | |||
@@ -134,7 +137,7 @@ void JackEngine::ReleaseRefnum(int ref) | |||
void JackEngine::ProcessNext(jack_time_t cur_cycle_begin) | |||
{ | |||
fLastSwitchUsecs = cur_cycle_begin; | |||
if (fGraphManager->RunNextGraph()) // True if the graph actually switched to a new state | |||
if (fGraphManager->RunNextGraph()) // True if the graph actually switched to a new state | |||
fChannel.Notify(ALL_CLIENTS, kGraphOrderCallback, 0); | |||
fSignal.Signal(); // Signal for threads waiting for next cycle | |||
} | |||
@@ -386,7 +389,7 @@ int JackEngine::InternalClientUnload(int refnum, int* status) | |||
// Client management | |||
//------------------- | |||
int JackEngine::ClientCheck(const char* name, char* name_res, int protocol, int options, int* status) | |||
int JackEngine::ClientCheck(const char* name, int uuid, char* name_res, int protocol, int options, int* status) | |||
{ | |||
// Clear status | |||
*status = 0; | |||
@@ -400,7 +403,11 @@ int JackEngine::ClientCheck(const char* name, char* name_res, int protocol, int | |||
return -1; | |||
} | |||
if (ClientCheckName(name)) { | |||
std::map<int,std::string>::iterator res = fReservationMap.find(uuid); | |||
if (res != fReservationMap.end()) { | |||
strncpy( name_res, res->second.c_str(), JACK_CLIENT_NAME_SIZE ); | |||
} else if (ClientCheckName(name)) { | |||
*status |= JackNameNotUnique; | |||
@@ -426,7 +433,7 @@ bool JackEngine::GenerateUniqueName(char* name) | |||
if (length > JACK_CLIENT_NAME_SIZE - 4) { | |||
jack_error("%s exists and is too long to make unique", name); | |||
return true; /* failure */ | |||
return true; /* failure */ | |||
} | |||
/* generate a unique name by appending "-01".."-99" */ | |||
@@ -460,9 +467,32 @@ bool JackEngine::ClientCheckName(const char* name) | |||
return true; | |||
} | |||
for (std::map<int,std::string>::iterator i=fReservationMap.begin(); i!=fReservationMap.end(); i++) { | |||
if (i->second == name) | |||
return true; | |||
} | |||
return false; | |||
} | |||
int JackEngine::GetNewUUID() | |||
{ | |||
return fMaxUUID++; | |||
} | |||
void JackEngine::EnsureUUID(int uuid) | |||
{ | |||
if (uuid > fMaxUUID) | |||
fMaxUUID = uuid+1; | |||
for (int i = 0; i < CLIENT_NUM; i++) { | |||
JackClientInterface* client = fClientTable[i]; | |||
if (client && (client->GetClientControl()->fSessionID==uuid)) { | |||
client->GetClientControl()->fSessionID = GetNewUUID(); | |||
} | |||
} | |||
} | |||
int JackEngine::GetClientPID(const char* name) | |||
{ | |||
for (int i = 0; i < CLIENT_NUM; i++) { | |||
@@ -486,9 +516,26 @@ 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) | |||
int JackEngine::ClientExternalOpen(const char* name, int pid, int uuid, int* ref, int* shared_engine, int* shared_client, int* shared_graph_manager) | |||
{ | |||
jack_log("JackEngine::ClientExternalOpen: name = %s ", name); | |||
char real_name[JACK_CLIENT_NAME_SIZE+1]; | |||
if (uuid < 0) { | |||
uuid = GetNewUUID(); | |||
strncpy( real_name, name, JACK_CLIENT_NAME_SIZE ); | |||
} else { | |||
std::map<int,std::string>::iterator res = fReservationMap.find(uuid); | |||
if (res != fReservationMap.end()) { | |||
strncpy( real_name, res->second.c_str(), JACK_CLIENT_NAME_SIZE ); | |||
fReservationMap.erase(uuid); | |||
} else { | |||
strncpy( real_name, name, JACK_CLIENT_NAME_SIZE ); | |||
} | |||
EnsureUUID(uuid); | |||
} | |||
jack_log("JackEngine::ClientExternalOpen: uuid=%d, name = %s ", uuid, real_name); | |||
int refnum = AllocateRefnum(); | |||
if (refnum < 0) { | |||
@@ -498,12 +545,12 @@ int JackEngine::ClientExternalOpen(const char* name, int pid, int* ref, int* sha | |||
JackExternalClient* client = new JackExternalClient(); | |||
if (!fSynchroTable[refnum].Allocate(name, fEngineControl->fServerName, 0)) { | |||
if (!fSynchroTable[refnum].Allocate(real_name, fEngineControl->fServerName, 0)) { | |||
jack_error("Cannot allocate synchro"); | |||
goto error; | |||
} | |||
if (client->Open(name, pid, refnum, shared_client) < 0) { | |||
if (client->Open(real_name, pid, refnum, uuid, shared_client) < 0) { | |||
jack_error("Cannot open client"); | |||
goto error; | |||
} | |||
@@ -516,7 +563,7 @@ int JackEngine::ClientExternalOpen(const char* name, int pid, int* ref, int* sha | |||
fClientTable[refnum] = client; | |||
if (NotifyAddClient(client, name, refnum) < 0) { | |||
if (NotifyAddClient(client, real_name, refnum) < 0) { | |||
jack_error("Cannot notify add client"); | |||
goto error; | |||
} | |||
@@ -863,5 +910,135 @@ int JackEngine::PortRename(int refnum, jack_port_id_t port, const char* name) | |||
return 0; | |||
} | |||
void JackEngine::SessionNotify(int refnum, const char *target, jack_session_event_type_t type, const char *path, JackChannelTransaction *socket) | |||
{ | |||
if (fSessionPendingReplies != 0) { | |||
JackSessionNotifyResult res(-1); | |||
res.Write(socket); | |||
jack_log("JackEngine::SessionNotify ... busy"); | |||
return; | |||
} | |||
for (int i = 0; i < CLIENT_NUM; i++) { | |||
JackClientInterface* client = fClientTable[i]; | |||
if (client && (client->GetClientControl()->fSessionID < 0)) { | |||
client->GetClientControl()->fSessionID = GetNewUUID(); | |||
} | |||
} | |||
fSessionResult = new JackSessionNotifyResult(); | |||
for (int i = 0; i < CLIENT_NUM; i++) { | |||
JackClientInterface* client = fClientTable[i]; | |||
if (client && client->GetClientControl()->fCallback[kSessionCallback]) { | |||
// check if this is a notification to a specific client. | |||
if (target!=NULL && strlen(target)!=0) { | |||
if (strcmp(target, client->GetClientControl()->fName)) { | |||
continue; | |||
} | |||
} | |||
char path_buf[JACK_PORT_NAME_SIZE]; | |||
snprintf( path_buf, sizeof(path_buf), "%s%s%c", path, client->GetClientControl()->fName, DIR_SEPARATOR ); | |||
int res = JackTools::MkDir(path_buf); | |||
if (res) | |||
jack_error( "JackEngine::SessionNotify: can not create session directory '%s'", path_buf ); | |||
int result = client->ClientNotify(i, client->GetClientControl()->fName, kSessionCallback, true, path_buf, (int) type, 0); | |||
if (result == 2) { | |||
fSessionPendingReplies += 1; | |||
} else if (result == 1) { | |||
char uuid_buf[JACK_UUID_SIZE]; | |||
snprintf( uuid_buf, sizeof(uuid_buf), "%d", client->GetClientControl()->fSessionID ); | |||
fSessionResult->fCommandList.push_back( JackSessionCommand( uuid_buf, | |||
client->GetClientControl()->fName, | |||
client->GetClientControl()->fSessionCommand, | |||
client->GetClientControl()->fSessionFlags )); | |||
} | |||
} | |||
} | |||
if (fSessionPendingReplies == 0) { | |||
fSessionResult->Write(socket); | |||
delete fSessionResult; | |||
fSessionResult = NULL; | |||
} else { | |||
fSessionTransaction = socket; | |||
} | |||
} | |||
void JackEngine::SessionReply(int refnum) | |||
{ | |||
JackClientInterface* client = fClientTable[refnum]; | |||
char uuid_buf[JACK_UUID_SIZE]; | |||
snprintf( uuid_buf, sizeof(uuid_buf), "%d", client->GetClientControl()->fSessionID ); | |||
fSessionResult->fCommandList.push_back( JackSessionCommand( uuid_buf, | |||
client->GetClientControl()->fName, | |||
client->GetClientControl()->fSessionCommand, | |||
client->GetClientControl()->fSessionFlags )); | |||
fSessionPendingReplies -= 1; | |||
if (fSessionPendingReplies == 0) { | |||
fSessionResult->Write(fSessionTransaction); | |||
delete fSessionResult; | |||
fSessionResult = NULL; | |||
} | |||
} | |||
void JackEngine::GetUUIDForClientName(const char *client_name, char *uuid_res, int *result) | |||
{ | |||
for (int i = 0; i < CLIENT_NUM; i++) { | |||
JackClientInterface* client = fClientTable[i]; | |||
if (client && (strcmp(client_name, client->GetClientControl()->fName)==0)) { | |||
snprintf(uuid_res, JACK_UUID_SIZE, "%d", client->GetClientControl()->fSessionID); | |||
*result = 0; | |||
return; | |||
} | |||
} | |||
// did not find name. | |||
*result = -1; | |||
return; | |||
} | |||
void JackEngine::GetClientNameForUUID(const char *uuid, char *name_res, int *result) | |||
{ | |||
for (int i = 0; i < CLIENT_NUM; i++) { | |||
JackClientInterface* client = fClientTable[i]; | |||
if (!client) | |||
continue; | |||
char uuid_buf[JACK_UUID_SIZE]; | |||
snprintf(uuid_buf, JACK_UUID_SIZE, "%d", client->GetClientControl()->fSessionID); | |||
if (strcmp(uuid,uuid_buf) == 0) { | |||
strncpy(name_res, client->GetClientControl()->fName, JACK_CLIENT_NAME_SIZE); | |||
*result = 0; | |||
return; | |||
} | |||
} | |||
// did not find uuid. | |||
*result = -1; | |||
return; | |||
} | |||
void JackEngine::ReserveClientName(const char *name, const char *uuid, int *result) | |||
{ | |||
jack_log( "JackEngine::ReserveClientName ( name = %s, uuid = %s )", name, uuid ); | |||
if (ClientCheckName(name)) { | |||
*result = -1; | |||
jack_log( "name already taken" ); | |||
return; | |||
} | |||
EnsureUUID(atoi(uuid)); | |||
fReservationMap[atoi(uuid)] = name; | |||
*result = 0; | |||
} | |||
} // end of namespace | |||
@@ -26,6 +26,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |||
#include "JackMutex.h" | |||
#include "JackTransportEngine.h" | |||
#include "JackPlatformPlug.h" | |||
#include <map> | |||
namespace Jack | |||
{ | |||
@@ -41,7 +42,7 @@ class JackExternalClient; | |||
class SERVER_EXPORT JackEngine : public JackLockAble | |||
{ | |||
friend class JackLockedEngine; | |||
private: | |||
JackGraphManager* fGraphManager; | |||
@@ -52,6 +53,12 @@ class SERVER_EXPORT JackEngine : public JackLockAble | |||
JackProcessSync fSignal; | |||
jack_time_t fLastSwitchUsecs; | |||
int fSessionPendingReplies; | |||
JackChannelTransaction *fSessionTransaction; | |||
JackSessionNotifyResult *fSessionResult; | |||
std::map<int,std::string> fReservationMap; | |||
int fMaxUUID; | |||
int ClientCloseAux(int refnum, JackClientInterface* client, bool wait); | |||
void CheckXRun(jack_time_t callback_usecs); | |||
@@ -69,12 +76,15 @@ class SERVER_EXPORT JackEngine : public JackLockAble | |||
void NotifyClient(int refnum, int event, int sync, const char* message, int value1, int value2); | |||
void NotifyClients(int event, int sync, const char* message, int value1, int value2); | |||
void NotifyPortRegistation(jack_port_id_t port_index, bool onoff); | |||
void NotifyPortConnect(jack_port_id_t src, jack_port_id_t dst, bool onoff); | |||
void NotifyPortRename(jack_port_id_t src, const char* old_name); | |||
void NotifyActivate(int refnum); | |||
int GetNewUUID(); | |||
void EnsureUUID(int uuid); | |||
bool CheckClient(int refnum) | |||
{ | |||
return (refnum >= 0 && refnum < CLIENT_NUM && fClientTable[refnum] != NULL); | |||
@@ -87,10 +97,10 @@ class SERVER_EXPORT JackEngine : public JackLockAble | |||
int Open(); | |||
int Close(); | |||
// Client management | |||
int ClientCheck(const char* name, char* name_res, int protocol, int options, int* status); | |||
int ClientExternalOpen(const char* name, int pid, int* ref, int* shared_engine, int* shared_client, int* shared_graph_manager); | |||
int ClientCheck(const char* name, int uuid, char* name_res, int protocol, int options, int* status); | |||
int ClientExternalOpen(const char* name, int pid, int uuid, int* ref, int* shared_engine, int* shared_client, int* shared_graph_manager); | |||
int ClientInternalOpen(const char* name, int* ref, JackEngineControl** shared_engine, JackGraphManager** shared_manager, JackClientInterface* client, bool wait); | |||
int ClientExternalClose(int refnum); | |||
@@ -98,10 +108,10 @@ class SERVER_EXPORT JackEngine : public JackLockAble | |||
int ClientActivate(int refnum, bool is_real_time); | |||
int ClientDeactivate(int refnum); | |||
int GetClientPID(const char* name); | |||
int GetClientRefNum(const char* name); | |||
// Internal client management | |||
int GetInternalClientName(int int_ref, char* name_res); | |||
int InternalClientHandle(const char* client_name, int* status, int* int_ref); | |||
@@ -116,7 +126,7 @@ class SERVER_EXPORT JackEngine : public JackLockAble | |||
int PortConnect(int refnum, jack_port_id_t src, jack_port_id_t dst); | |||
int PortDisconnect(int refnum, jack_port_id_t src, jack_port_id_t dst); | |||
int PortRename(int refnum, jack_port_id_t port, const char* name); | |||
// Graph | |||
@@ -131,6 +141,13 @@ class SERVER_EXPORT JackEngine : public JackLockAble | |||
void NotifySampleRate(jack_nframes_t sample_rate); | |||
void NotifyFreewheel(bool onoff); | |||
void NotifyQuit(); | |||
void SessionNotify( int refnum, const char *target, jack_session_event_type_t type, const char *path, JackChannelTransaction *socket ); | |||
void SessionReply( int refnum ); | |||
void GetUUIDForClientName(const char *client_name, char *uuid_res, int *result); | |||
void GetClientNameForUUID(const char *uuid, char *name_res, int *result); | |||
void ReserveClientName(const char *name, const char *uuid, int *result); | |||
}; | |||
@@ -33,7 +33,7 @@ static bool change_thread_log_function(jack_log_function_t log_function) | |||
&& jack_tls_set(JackGlobals::fKeyLogFunction, (void*)log_function)); | |||
} | |||
SERVER_EXPORT int set_threaded_log_function() | |||
EXPORT int set_threaded_log_function() | |||
{ | |||
return change_thread_log_function(JackMessageBufferAdd); | |||
} | |||
@@ -88,7 +88,7 @@ static void jack_format_and_log(int level, const char *prefix, const char *fmt, | |||
log_function(level, buffer); | |||
} | |||
SERVER_EXPORT void jack_error(const char *fmt, ...) | |||
EXPORT void jack_error(const char *fmt, ...) | |||
{ | |||
va_list ap; | |||
va_start(ap, fmt); | |||
@@ -96,7 +96,7 @@ SERVER_EXPORT void jack_error(const char *fmt, ...) | |||
va_end(ap); | |||
} | |||
SERVER_EXPORT void jack_info(const char *fmt, ...) | |||
EXPORT void jack_info(const char *fmt, ...) | |||
{ | |||
va_list ap; | |||
va_start(ap, fmt); | |||
@@ -104,7 +104,7 @@ SERVER_EXPORT void jack_info(const char *fmt, ...) | |||
va_end(ap); | |||
} | |||
SERVER_EXPORT void jack_log(const char *fmt,...) | |||
EXPORT void jack_log(const char *fmt,...) | |||
{ | |||
if (JackGlobals::fVerbose) { | |||
va_list ap; | |||
@@ -114,23 +114,23 @@ SERVER_EXPORT void jack_log(const char *fmt,...) | |||
} | |||
} | |||
SERVER_EXPORT void default_jack_error_callback(const char *desc) | |||
EXPORT void default_jack_error_callback(const char *desc) | |||
{ | |||
fprintf(stderr, "%s\n", desc); | |||
fflush(stderr); | |||
} | |||
SERVER_EXPORT void default_jack_info_callback(const char *desc) | |||
EXPORT void default_jack_info_callback(const char *desc) | |||
{ | |||
fprintf(stdout, "%s\n", desc); | |||
fflush(stdout); | |||
} | |||
SERVER_EXPORT void silent_jack_error_callback(const char *desc) | |||
EXPORT void silent_jack_error_callback(const char *desc) | |||
{} | |||
SERVER_EXPORT void silent_jack_info_callback(const char *desc) | |||
EXPORT void silent_jack_info_callback(const char *desc) | |||
{} | |||
SERVER_EXPORT void (*jack_error_callback)(const char *desc) = &default_jack_error_callback; | |||
SERVER_EXPORT void (*jack_info_callback)(const char *desc) = &default_jack_info_callback; | |||
EXPORT void (*jack_error_callback)(const char *desc) = &default_jack_error_callback; | |||
EXPORT void (*jack_info_callback)(const char *desc) = &default_jack_info_callback; |
@@ -35,27 +35,27 @@ extern "C" | |||
#define LOG_LEVEL_INFO 1 | |||
#define LOG_LEVEL_ERROR 2 | |||
SERVER_EXPORT void jack_error(const char *fmt, ...); | |||
EXPORT void jack_error(const char *fmt, ...); | |||
SERVER_EXPORT void jack_info(const char *fmt, ...); | |||
EXPORT void jack_info(const char *fmt, ...); | |||
// like jack_info() but only if verbose mode is enabled | |||
SERVER_EXPORT void jack_log(const char *fmt, ...); | |||
EXPORT void jack_log(const char *fmt, ...); | |||
SERVER_EXPORT extern void (*jack_error_callback)(const char *desc); | |||
SERVER_EXPORT extern void (*jack_info_callback)(const char *desc); | |||
EXPORT extern void (*jack_error_callback)(const char *desc); | |||
EXPORT extern void (*jack_info_callback)(const char *desc); | |||
SERVER_EXPORT extern void default_jack_error_callback(const char *desc); | |||
SERVER_EXPORT extern void default_jack_info_callback(const char *desc); | |||
EXPORT extern void default_jack_error_callback(const char *desc); | |||
EXPORT extern void default_jack_info_callback(const char *desc); | |||
SERVER_EXPORT extern void silent_jack_error_callback(const char *desc); | |||
SERVER_EXPORT extern void silent_jack_info_callback(const char *desc); | |||
EXPORT extern void silent_jack_error_callback(const char *desc); | |||
EXPORT extern void silent_jack_info_callback(const char *desc); | |||
typedef void (* jack_log_function_t)(int level, const char *message); | |||
void jack_log_function(int level, const char *message); | |||
SERVER_EXPORT int set_threaded_log_function(); | |||
EXPORT int set_threaded_log_function(); | |||
#ifdef __cplusplus | |||
} | |||
@@ -41,7 +41,7 @@ int JackExternalClient::ClientNotify(int refnum, const char* name, int notify, i | |||
return result; | |||
} | |||
int JackExternalClient::Open(const char* name, int pid, int refnum, int* shared_client) | |||
int JackExternalClient::Open(const char* name, int pid, int refnum, int uuid, int* shared_client) | |||
{ | |||
try { | |||
@@ -53,7 +53,7 @@ int JackExternalClient::Open(const char* name, int pid, int refnum, int* shared_ | |||
// Use "placement new" to allocate object in shared memory | |||
JackShmMemAble* shared_mem = static_cast<JackShmMemAble*>(JackShmMem::operator new(sizeof(JackClientControl))); | |||
shared_mem->Init(); | |||
fClientControl = new(shared_mem) JackClientControl(name, pid, refnum); | |||
fClientControl = new(shared_mem) JackClientControl(name, pid, refnum, uuid); | |||
if (!fClientControl) { | |||
jack_error("Cannot allocate client shared memory segment"); | |||
@@ -39,14 +39,14 @@ class JackExternalClient : public JackClientInterface | |||
private: | |||
JackNotifyChannel fChannel; /*! Server/client communication channel */ | |||
JackClientControl* fClientControl; /*! Client control in shared memory */ | |||
JackClientControl* fClientControl; /*! Client control in shared memory */ | |||
public: | |||
JackExternalClient(); | |||
virtual ~JackExternalClient(); | |||
int Open(const char* name, int pid, int refnum, int* shared_client); | |||
int Open(const char* name, int pid, int refnum, int uuid, int* shared_client); | |||
int Close(); | |||
int ClientNotify(int refnum, const char* name, int notify, int sync, const char* message, int value1, int value2); | |||
@@ -63,7 +63,7 @@ JackInternalClient::~JackInternalClient() | |||
delete fChannel; | |||
} | |||
int JackInternalClient::Open(const char* server_name, const char* name, jack_options_t options, jack_status_t* status) | |||
int JackInternalClient::Open(const char* server_name, const char* name, int uuid, jack_options_t options, jack_status_t* status) | |||
{ | |||
int result; | |||
char name_res[JACK_CLIENT_NAME_SIZE + 1]; | |||
@@ -71,7 +71,7 @@ int JackInternalClient::Open(const char* server_name, const char* name, jack_opt | |||
strncpy(fServerName, server_name, sizeof(fServerName)); | |||
fChannel->ClientCheck(name, name_res, JACK_PROTOCOL_VERSION, (int)options, (int*)status, &result); | |||
fChannel->ClientCheck(name, uuid, name_res, JACK_PROTOCOL_VERSION, (int)options, (int*)status, &result); | |||
if (result < 0) { | |||
int status1 = *status; | |||
if (status1 & JackVersionError) | |||
@@ -198,11 +198,11 @@ JackLoadableInternalClient::~JackLoadableInternalClient() | |||
UnloadJackModule(fHandle); | |||
} | |||
int JackLoadableInternalClient1::Open(const char* server_name, const char* name, jack_options_t options, jack_status_t* status) | |||
int JackLoadableInternalClient1::Open(const char* server_name, const char* name, int uuid, jack_options_t options, jack_status_t* status) | |||
{ | |||
int res = -1; | |||
if (JackInternalClient::Open(server_name, name, options, status) == 0) { | |||
if (JackInternalClient::Open(server_name, name, uuid, options, status) == 0) { | |||
if (fInitialize((jack_client_t*)this, fObjectData) == 0) { | |||
res = 0; | |||
} else { | |||
@@ -214,11 +214,11 @@ int JackLoadableInternalClient1::Open(const char* server_name, const char* name, | |||
return res; | |||
} | |||
int JackLoadableInternalClient2::Open(const char* server_name, const char* name, jack_options_t options, jack_status_t* status) | |||
int JackLoadableInternalClient2::Open(const char* server_name, const char* name, int uuid, jack_options_t options, jack_status_t* status) | |||
{ | |||
int res = -1; | |||
if (JackInternalClient::Open(server_name, name, options, status) == 0) { | |||
if (JackInternalClient::Open(server_name, name, uuid, options, status) == 0) { | |||
if (fInitialize((jack_client_t*)this, fParameters) == 0) { | |||
res = 0; | |||
} else { | |||
@@ -46,14 +46,14 @@ class JackInternalClient : public JackClient | |||
JackInternalClient(JackServer* server, JackSynchro* table); | |||
virtual ~JackInternalClient(); | |||
int Open(const char* server_name, const char* name, jack_options_t options, jack_status_t* status); | |||
int Open(const char* server_name, const char* name, int uuid, jack_options_t options, jack_status_t* status); | |||
JackGraphManager* GetGraphManager() const; | |||
JackEngineControl* GetEngineControl() const; | |||
JackClientControl* GetClientControl() const; | |||
static JackGraphManager* fGraphManager; /*! Shared memory Port manager */ | |||
static JackEngineControl* fEngineControl; /*! Shared engine cotrol */ | |||
static JackGraphManager* fGraphManager; /*! Shared memory Port manager */ | |||
static JackEngineControl* fEngineControl; /*! Shared engine cotrol */ | |||
}; | |||
/*! | |||
@@ -100,7 +100,7 @@ class JackLoadableInternalClient1 : public JackLoadableInternalClient | |||
{} | |||
int Init(const char* so_name); | |||
int Open(const char* server_name, const char* name, jack_options_t options, jack_status_t* status); | |||
int Open(const char* server_name, const char* name, int uuid, jack_options_t options, jack_status_t* status); | |||
}; | |||
@@ -119,7 +119,7 @@ class JackLoadableInternalClient2 : public JackLoadableInternalClient | |||
{} | |||
int Init(const char* so_name); | |||
int Open(const char* server_name, const char* name, jack_options_t options, jack_status_t* status); | |||
int Open(const char* server_name, const char* name, int uuid, jack_options_t options, jack_status_t* status); | |||
}; | |||
@@ -50,9 +50,9 @@ class JackInternalClientChannel : public detail::JackClientChannelInterface | |||
return 0; | |||
} | |||
void ClientCheck(const char* name, char* name_res, int protocol, int options, int* status, int* result) | |||
void ClientCheck(const char* name, int uuid, char* name_res, int protocol, int options, int* status, int* result) | |||
{ | |||
*result = fEngine->ClientCheck(name, name_res, protocol, options, status); | |||
*result = fEngine->ClientCheck(name, uuid, name_res, protocol, options, status); | |||
} | |||
void ClientOpen(const char* name, int* ref, JackEngineControl** shared_engine, JackGraphManager** shared_manager, JackClientInterface* client, int* result) | |||
{ | |||
@@ -112,6 +112,11 @@ class JackInternalClientChannel : public detail::JackClientChannelInterface | |||
*result = fServer->SetFreewheel(onoff); | |||
} | |||
void SessionNotify( int refnum, const char *target, jack_session_event_type_t type, const char *path, jack_session_command_t **result ) | |||
{ | |||
*result = NULL; | |||
} | |||
void ReleaseTimebase(int refnum, int* result) | |||
{ | |||
*result = fServer->ReleaseTimebase(refnum); | |||
@@ -132,9 +137,9 @@ class JackInternalClientChannel : public detail::JackClientChannelInterface | |||
*result = fEngine->InternalClientHandle(client_name, status, int_ref); | |||
} | |||
void InternalClientLoad(int refnum, const char* client_name, const char* so_name, const char* objet_data, int options, int* status, int* int_ref, int* result) | |||
void InternalClientLoad(int refnum, const char* client_name, const char* so_name, const char* objet_data, int options, int* status, int* int_ref, int uuid, int* result) | |||
{ | |||
*result = fServer->InternalClientLoad(client_name, so_name, objet_data, options, int_ref, status); | |||
*result = fServer->InternalClientLoad(client_name, so_name, objet_data, options, int_ref, uuid, status); | |||
} | |||
void InternalClientUnload(int refnum, int int_ref, int* status, int* result) | |||
@@ -57,7 +57,7 @@ int JackLibGlobals::fClientCount = 0; | |||
jack_client_t* jack_client_new_aux(const char* client_name, jack_options_t options, jack_status_t* status) | |||
{ | |||
jack_varargs_t va; /* variable arguments */ | |||
jack_varargs_t va; /* variable arguments */ | |||
jack_status_t my_status; | |||
JackClient* client; | |||
@@ -68,8 +68,8 @@ jack_client_t* jack_client_new_aux(const char* client_name, jack_options_t optio | |||
jack_log("jack_client_new %s", client_name); | |||
if (status == NULL) /* no status from caller? */ | |||
status = &my_status; /* use local status word */ | |||
if (status == NULL) /* no status from caller? */ | |||
status = &my_status; /* use local status word */ | |||
*status = (jack_status_t)0; | |||
/* validate parameters */ | |||
@@ -96,7 +96,7 @@ jack_client_t* jack_client_new_aux(const char* client_name, jack_options_t optio | |||
client = new JackLibClient(GetSynchroTable()); | |||
} | |||
int res = client->Open(va.server_name, client_name, options, status); | |||
int res = client->Open(va.server_name, client_name, va.session_id, options, status); | |||
if (res < 0) { | |||
delete client; | |||
JackLibGlobals::Destroy(); // jack library destruction | |||
@@ -149,7 +149,7 @@ jack_client_t* jack_client_open_aux(const char* client_name, jack_options_t opti | |||
client = new JackLibClient(GetSynchroTable()); | |||
} | |||
int res = client->Open(va.server_name, client_name, options, status); | |||
int res = client->Open(va.server_name, client_name, va.session_id, options, status); | |||
if (res < 0) { | |||
delete client; | |||
JackLibGlobals::Destroy(); // jack library destruction | |||
@@ -67,7 +67,7 @@ JackLibClient::~JackLibClient() | |||
delete fChannel; | |||
} | |||
int JackLibClient::Open(const char* server_name, const char* name, jack_options_t options, jack_status_t* status) | |||
int JackLibClient::Open(const char* server_name, const char* name, int uuid, jack_options_t options, jack_status_t* status) | |||
{ | |||
int shared_engine, shared_client, shared_graph, result; | |||
jack_log("JackLibClient::Open name = %s", name); | |||
@@ -76,7 +76,7 @@ int JackLibClient::Open(const char* server_name, const char* name, jack_options_ | |||
// Open server/client channel | |||
char name_res[JACK_CLIENT_NAME_SIZE + 1]; | |||
if (fChannel->Open(server_name, name, name_res, this, options, status) < 0) { | |||
if (fChannel->Open(server_name, name, uuid, name_res, this, options, status) < 0) { | |||
jack_error("Cannot connect to the server"); | |||
goto error; | |||
} | |||
@@ -88,7 +88,7 @@ int JackLibClient::Open(const char* server_name, const char* name, jack_options_ | |||
} | |||
// Require new client | |||
fChannel->ClientOpen(name_res, JackTools::GetPID(), &shared_engine, &shared_client, &shared_graph, &result); | |||
fChannel->ClientOpen(name_res, JackTools::GetPID(), uuid, &shared_engine, &shared_client, &shared_graph, &result); | |||
if (result < 0) { | |||
jack_error("Cannot open %s client", name_res); | |||
goto error; | |||
@@ -37,14 +37,14 @@ class JackLibClient : public JackClient | |||
private: | |||
JackShmReadWritePtr1<JackClientControl> fClientControl; /*! Shared client control */ | |||
JackShmReadWritePtr1<JackClientControl> fClientControl; /*! Shared client control */ | |||
public: | |||
JackLibClient(JackSynchro* table); | |||
virtual ~JackLibClient(); | |||
int Open(const char* server_name, const char* name, jack_options_t options, jack_status_t* status); | |||
int Open(const char* server_name, const char* name, int uuid, jack_options_t options, jack_status_t* status); | |||
int ClientNotifyImp(int refnum, const char* name, int notify, int sync, const char* message, int value1, int value2); | |||
@@ -96,18 +96,18 @@ class SERVER_EXPORT JackLockedEngine | |||
} | |||
// Client management | |||
int ClientCheck(const char* name, char* name_res, int protocol, int options, int* status) | |||
int ClientCheck(const char* name, int uuid, char* name_res, int protocol, int options, int* status) | |||
{ | |||
TRY_CALL | |||
JackLock lock(&fEngine); | |||
return fEngine.ClientCheck(name, name_res, protocol, options, status); | |||
return fEngine.ClientCheck(name, uuid, name_res, protocol, options, status); | |||
CATCH_EXCEPTION_RETURN | |||
} | |||
int ClientExternalOpen(const char* name, int pid, int* ref, int* shared_engine, int* shared_client, int* shared_graph_manager) | |||
int ClientExternalOpen(const char* name, int pid, int uuid, int* ref, int* shared_engine, int* shared_client, int* shared_graph_manager) | |||
{ | |||
TRY_CALL | |||
JackLock lock(&fEngine); | |||
return fEngine.ClientExternalOpen(name, pid, ref, shared_engine, shared_client, shared_graph_manager); | |||
return fEngine.ClientExternalOpen(name, pid, uuid, ref, shared_engine, shared_client, shared_graph_manager); | |||
CATCH_EXCEPTION_RETURN | |||
} | |||
int ClientInternalOpen(const char* name, int* ref, JackEngineControl** shared_engine, JackGraphManager** shared_manager, JackClientInterface* client, bool wait) | |||
@@ -306,7 +306,44 @@ class SERVER_EXPORT JackLockedEngine | |||
return fEngine.NotifyQuit(); | |||
CATCH_EXCEPTION | |||
} | |||
void SessionNotify(int refnum, const char* target, jack_session_event_type_t type, const char *path, JackChannelTransaction *socket) | |||
{ | |||
TRY_CALL | |||
JackLock lock(&fEngine); | |||
fEngine.SessionNotify(refnum, target, type, path, socket); | |||
CATCH_EXCEPTION | |||
} | |||
void SessionReply(int refnum) | |||
{ | |||
TRY_CALL | |||
JackLock lock(&fEngine); | |||
fEngine.SessionReply(refnum); | |||
CATCH_EXCEPTION | |||
} | |||
void GetUUIDForClientName(const char *client_name, char *uuid_res, int *result) | |||
{ | |||
TRY_CALL | |||
JackLock lock(&fEngine); | |||
fEngine.GetUUIDForClientName(client_name, uuid_res, result); | |||
CATCH_EXCEPTION | |||
} | |||
void GetClientNameForUUID(const char *uuid, char *name_res, int *result) | |||
{ | |||
TRY_CALL | |||
JackLock lock(&fEngine); | |||
fEngine.GetClientNameForUUID(uuid, name_res, result); | |||
CATCH_EXCEPTION | |||
} | |||
void ReserveClientName(const char *name, const char *uuid, int *result) | |||
{ | |||
TRY_CALL | |||
JackLock lock(&fEngine); | |||
fEngine.ReserveClientName(name, uuid, result); | |||
CATCH_EXCEPTION | |||
} | |||
}; | |||
} // end of namespace | |||
@@ -54,36 +54,36 @@ namespace Jack | |||
{ | |||
jack_log ( "JackNetOneDriver::JackNetOneDriver port %d", port ); | |||
#ifdef WIN32 | |||
WSADATA wsa; | |||
int rc = WSAStartup(MAKEWORD(2,0),&wsa); | |||
#endif | |||
netjack_init( & (this->netj), | |||
NULL, // client | |||
name, | |||
capture_ports, | |||
playback_ports, | |||
midi_input_ports, | |||
midi_output_ports, | |||
sample_rate, | |||
period_size, | |||
port, | |||
transport_sync, | |||
resample_factor, | |||
0, | |||
bitdepth, | |||
use_autoconfig, | |||
latency, | |||
redundancy, | |||
dont_htonl_floats, | |||
always_deadline, | |||
jitter_val); | |||
#ifdef WIN32 | |||
WSADATA wsa; | |||
int rc = WSAStartup(MAKEWORD(2,0),&wsa); | |||
#endif | |||
netjack_init( & (this->netj), | |||
NULL, // client | |||
name, | |||
capture_ports, | |||
playback_ports, | |||
midi_input_ports, | |||
midi_output_ports, | |||
sample_rate, | |||
period_size, | |||
port, | |||
transport_sync, | |||
resample_factor, | |||
0, | |||
bitdepth, | |||
use_autoconfig, | |||
latency, | |||
redundancy, | |||
dont_htonl_floats, | |||
always_deadline, | |||
jitter_val); | |||
} | |||
JackNetOneDriver::~JackNetOneDriver() | |||
{ | |||
// No destructor yet. | |||
// No destructor yet. | |||
} | |||
//open, close, attach and detach------------------------------------------------------ | |||
@@ -135,49 +135,49 @@ namespace Jack | |||
int JackNetOneDriver::AllocPorts() | |||
{ | |||
jack_port_id_t port_id; | |||
char buf[64]; | |||
unsigned int chn; | |||
jack_port_id_t port_id; | |||
char buf[64]; | |||
unsigned int chn; | |||
//if (netj.handle_transport_sync) | |||
// jack_set_sync_callback(netj.client, (JackSyncCallback) net_driver_sync_cb, NULL); | |||
//if (netj.handle_transport_sync) | |||
// jack_set_sync_callback(netj.client, (JackSyncCallback) net_driver_sync_cb, NULL); | |||
for (chn = 0; chn < netj.capture_channels_audio; chn++) { | |||
snprintf (buf, sizeof(buf) - 1, "system:capture_%u", chn + 1); | |||
for (chn = 0; chn < netj.capture_channels_audio; chn++) { | |||
snprintf (buf, sizeof(buf) - 1, "system:capture_%u", chn + 1); | |||
if ( ( port_id = fGraphManager->AllocatePort ( fClientControl.fRefNum, buf, JACK_DEFAULT_AUDIO_TYPE, | |||
CaptureDriverFlags, fEngineControl->fBufferSize ) ) == NO_PORT ) | |||
{ | |||
jack_error ( "driver: cannot register port for %s", buf ); | |||
return -1; | |||
if ( ( port_id = fGraphManager->AllocatePort ( fClientControl.fRefNum, buf, JACK_DEFAULT_AUDIO_TYPE, | |||
CaptureDriverFlags, fEngineControl->fBufferSize ) ) == NO_PORT ) | |||
{ | |||
jack_error ( "driver: cannot register port for %s", buf ); | |||
return -1; | |||
} | |||
//port = fGraphManager->GetPort ( port_id ); | |||
netj.capture_ports = | |||
jack_slist_append (netj.capture_ports, (void *)(intptr_t)port_id); | |||
if( netj.bitdepth == CELT_MODE ) { | |||
#if HAVE_CELT | |||
#if HAVE_CELT_API_0_7 | |||
celt_int32 lookahead; | |||
CELTMode *celt_mode = celt_mode_create( netj.sample_rate, netj.period_size, NULL ); | |||
netj.capture_srcs = jack_slist_append(netj.capture_srcs, celt_decoder_create( celt_mode, 1, NULL ) ); | |||
#else | |||
celt_int32_t lookahead; | |||
CELTMode *celt_mode = celt_mode_create( netj.sample_rate, 1, netj.period_size, NULL ); | |||
netj.capture_srcs = jack_slist_append(netj.capture_srcs, celt_decoder_create( celt_mode ) ); | |||
#endif | |||
celt_mode_info( celt_mode, CELT_GET_LOOKAHEAD, &lookahead ); | |||
netj.codec_latency = 2*lookahead; | |||
#endif | |||
} else { | |||
#if HAVE_SAMPLERATE | |||
netj.capture_srcs = jack_slist_append(netj.capture_srcs, (void *)src_new(SRC_LINEAR, 1, NULL)); | |||
#endif | |||
} | |||
//port = fGraphManager->GetPort ( port_id ); | |||
netj.capture_ports = | |||
jack_slist_append (netj.capture_ports, (void *)(intptr_t)port_id); | |||
if( netj.bitdepth == CELT_MODE ) { | |||
#if HAVE_CELT | |||
#if HAVE_CELT_API_0_7 | |||
celt_int32 lookahead; | |||
CELTMode *celt_mode = celt_mode_create( netj.sample_rate, netj.period_size, NULL ); | |||
netj.capture_srcs = jack_slist_append(netj.capture_srcs, celt_decoder_create( celt_mode, 1, NULL ) ); | |||
#else | |||
celt_int32_t lookahead; | |||
CELTMode *celt_mode = celt_mode_create( netj.sample_rate, 1, netj.period_size, NULL ); | |||
netj.capture_srcs = jack_slist_append(netj.capture_srcs, celt_decoder_create( celt_mode ) ); | |||
#endif | |||
celt_mode_info( celt_mode, CELT_GET_LOOKAHEAD, &lookahead ); | |||
netj.codec_latency = 2*lookahead; | |||
#endif | |||
} else { | |||
#if HAVE_SAMPLERATE | |||
netj.capture_srcs = jack_slist_append(netj.capture_srcs, (void *)src_new(SRC_LINEAR, 1, NULL)); | |||
#endif | |||
} | |||
} | |||
for (chn = netj.capture_channels_audio; chn < netj.capture_channels; chn++) { | |||
snprintf (buf, sizeof(buf) - 1, "system:capture_%u", chn + 1); | |||
} | |||
for (chn = netj.capture_channels_audio; chn < netj.capture_channels; chn++) { | |||
snprintf (buf, sizeof(buf) - 1, "system:capture_%u", chn + 1); | |||
if ( ( port_id = fGraphManager->AllocatePort ( fClientControl.fRefNum, buf, JACK_DEFAULT_MIDI_TYPE, | |||
CaptureDriverFlags, fEngineControl->fBufferSize ) ) == NO_PORT ) | |||
@@ -187,12 +187,12 @@ namespace Jack | |||
} | |||
//port = fGraphManager->GetPort ( port_id ); | |||
netj.capture_ports = | |||
jack_slist_append (netj.capture_ports, (void *)(intptr_t)port_id); | |||
} | |||
netj.capture_ports = | |||
jack_slist_append (netj.capture_ports, (void *)(intptr_t)port_id); | |||
} | |||
for (chn = 0; chn < netj.playback_channels_audio; chn++) { | |||
snprintf (buf, sizeof(buf) - 1, "system:playback_%u", chn + 1); | |||
for (chn = 0; chn < netj.playback_channels_audio; chn++) { | |||
snprintf (buf, sizeof(buf) - 1, "system:playback_%u", chn + 1); | |||
if ( ( port_id = fGraphManager->AllocatePort ( fClientControl.fRefNum, buf, JACK_DEFAULT_AUDIO_TYPE, | |||
PlaybackDriverFlags, fEngineControl->fBufferSize ) ) == NO_PORT ) | |||
@@ -202,27 +202,27 @@ namespace Jack | |||
} | |||
//port = fGraphManager->GetPort ( port_id ); | |||
netj.playback_ports = | |||
jack_slist_append (netj.playback_ports, (void *)(intptr_t)port_id); | |||
if( netj.bitdepth == CELT_MODE ) { | |||
#if HAVE_CELT | |||
#if HAVE_CELT_API_0_7 | |||
CELTMode *celt_mode = celt_mode_create( netj.sample_rate, netj.period_size, NULL ); | |||
netj.playback_srcs = jack_slist_append(netj.playback_srcs, celt_encoder_create( celt_mode, 1, NULL ) ); | |||
#else | |||
CELTMode *celt_mode = celt_mode_create( netj.sample_rate, 1, netj.period_size, NULL ); | |||
netj.playback_srcs = jack_slist_append(netj.playback_srcs, celt_encoder_create( celt_mode ) ); | |||
#endif | |||
#endif | |||
} else { | |||
#if HAVE_SAMPLERATE | |||
netj.playback_srcs = jack_slist_append(netj.playback_srcs, (void *)src_new(SRC_LINEAR, 1, NULL)); | |||
#endif | |||
} | |||
} | |||
for (chn = netj.playback_channels_audio; chn < netj.playback_channels; chn++) { | |||
snprintf (buf, sizeof(buf) - 1, "system:playback_%u", chn + 1); | |||
netj.playback_ports = | |||
jack_slist_append (netj.playback_ports, (void *)(intptr_t)port_id); | |||
if( netj.bitdepth == CELT_MODE ) { | |||
#if HAVE_CELT | |||
#if HAVE_CELT_API_0_7 | |||
CELTMode *celt_mode = celt_mode_create( netj.sample_rate, netj.period_size, NULL ); | |||
netj.playback_srcs = jack_slist_append(netj.playback_srcs, celt_encoder_create( celt_mode, 1, NULL ) ); | |||
#else | |||
CELTMode *celt_mode = celt_mode_create( netj.sample_rate, 1, netj.period_size, NULL ); | |||
netj.playback_srcs = jack_slist_append(netj.playback_srcs, celt_encoder_create( celt_mode ) ); | |||
#endif | |||
#endif | |||
} else { | |||
#if HAVE_SAMPLERATE | |||
netj.playback_srcs = jack_slist_append(netj.playback_srcs, (void *)src_new(SRC_LINEAR, 1, NULL)); | |||
#endif | |||
} | |||
} | |||
for (chn = netj.playback_channels_audio; chn < netj.playback_channels; chn++) { | |||
snprintf (buf, sizeof(buf) - 1, "system:playback_%u", chn + 1); | |||
if ( ( port_id = fGraphManager->AllocatePort ( fClientControl.fRefNum, buf, JACK_DEFAULT_MIDI_TYPE, | |||
PlaybackDriverFlags, fEngineControl->fBufferSize ) ) == NO_PORT ) | |||
@@ -232,10 +232,10 @@ namespace Jack | |||
} | |||
//port = fGraphManager->GetPort ( port_id ); | |||
netj.playback_ports = | |||
jack_slist_append (netj.playback_ports, (void *)(intptr_t)port_id); | |||
} | |||
return 0; | |||
netj.playback_ports = | |||
jack_slist_append (netj.playback_ports, (void *)(intptr_t)port_id); | |||
} | |||
return 0; | |||
} | |||
//init and restart-------------------------------------------------------------------- | |||
@@ -243,16 +243,16 @@ namespace Jack | |||
{ | |||
jack_log ( "JackNetOneDriver::Init()" ); | |||
if( global_packcache != NULL ) { | |||
FreePorts(); | |||
netjack_release( &netj ); | |||
} | |||
if( global_packcache != NULL ) { | |||
FreePorts(); | |||
netjack_release( &netj ); | |||
} | |||
//display some additional infos | |||
jack_info ( "NetOne driver started" ); | |||
if( netjack_startup( &netj ) ) { | |||
return false; | |||
} | |||
if( netjack_startup( &netj ) ) { | |||
return false; | |||
} | |||
//register jack ports | |||
if ( AllocPorts() != 0 ) | |||
@@ -261,7 +261,6 @@ namespace Jack | |||
return false; | |||
} | |||
//monitor | |||
//driver parametering | |||
JackAudioDriver::SetBufferSize ( netj.period_size ); | |||
@@ -281,161 +280,160 @@ namespace Jack | |||
//driver processes-------------------------------------------------------------------- | |||
int JackNetOneDriver::Read() | |||
{ | |||
int delay; | |||
delay = netjack_wait( &netj ); | |||
if( delay ) { | |||
NotifyXRun(fBeginDateUst, (float) delay); | |||
jack_error( "netxruns... duration: %dms", delay/1000 ); | |||
} | |||
int delay; | |||
delay = netjack_wait( &netj ); | |||
if( delay ) { | |||
NotifyXRun(fBeginDateUst, (float) delay); | |||
jack_error( "netxruns... duration: %dms", delay/1000 ); | |||
} | |||
if( (netj.num_lost_packets * netj.period_size / netj.sample_rate) > 2 ) | |||
JackTools::ThrowJackNetException(); | |||
if( (netj.num_lost_packets * netj.period_size / netj.sample_rate) > 2 ) | |||
JackTools::ThrowJackNetException(); | |||
//netjack_read( &netj, netj.period_size ); | |||
//netjack_read( &netj, netj.period_size ); | |||
JackDriver::CycleTakeBeginTime(); | |||
jack_position_t local_trans_pos; | |||
jack_transport_state_t local_trans_state; | |||
jack_position_t local_trans_pos; | |||
jack_transport_state_t local_trans_state; | |||
unsigned int *packet_buf, *packet_bufX; | |||
unsigned int *packet_buf, *packet_bufX; | |||
if( ! netj.packet_data_valid ) { | |||
if( ! netj.packet_data_valid ) { | |||
jack_log( "data not valid" ); | |||
render_payload_to_jack_ports (netj.bitdepth, NULL, netj.net_period_down, netj.capture_ports, netj.capture_srcs, netj.period_size, netj.dont_htonl_floats ); | |||
return 0; | |||
} | |||
packet_buf = netj.rx_buf; | |||
render_payload_to_jack_ports (netj.bitdepth, NULL, netj.net_period_down, netj.capture_ports, netj.capture_srcs, netj.period_size, netj.dont_htonl_floats ); | |||
return 0; | |||
} | |||
packet_buf = netj.rx_buf; | |||
jacknet_packet_header *pkthdr = (jacknet_packet_header *)packet_buf; | |||
jacknet_packet_header *pkthdr = (jacknet_packet_header *)packet_buf; | |||
packet_bufX = packet_buf + sizeof(jacknet_packet_header) / sizeof(jack_default_audio_sample_t); | |||
packet_bufX = packet_buf + sizeof(jacknet_packet_header) / sizeof(jack_default_audio_sample_t); | |||
netj.reply_port = pkthdr->reply_port; | |||
netj.latency = pkthdr->latency; | |||
netj.reply_port = pkthdr->reply_port; | |||
netj.latency = pkthdr->latency; | |||
// Special handling for latency=0 | |||
if( netj.latency == 0 ) | |||
netj.resync_threshold = 0; | |||
else | |||
netj.resync_threshold = MIN( 15, pkthdr->latency-1 ); | |||
// Special handling for latency=0 | |||
if( netj.latency == 0 ) | |||
netj.resync_threshold = 0; | |||
else | |||
netj.resync_threshold = MIN( 15, pkthdr->latency-1 ); | |||
// check whether, we should handle the transport sync stuff, or leave trnasports untouched. | |||
if (netj.handle_transport_sync) { | |||
#if 1 | |||
unsigned int compensated_tranport_pos = (pkthdr->transport_frame + (pkthdr->latency * netj.period_size) + netj.codec_latency); | |||
// check whether, we should handle the transport sync stuff, or leave trnasports untouched. | |||
if (netj.handle_transport_sync) { | |||
#if 1 | |||
unsigned int compensated_tranport_pos = (pkthdr->transport_frame + (pkthdr->latency * netj.period_size) + netj.codec_latency); | |||
// read local transport info.... | |||
//local_trans_state = jack_transport_query(netj.client, &local_trans_pos); | |||
// read local transport info.... | |||
//local_trans_state = jack_transport_query(netj.client, &local_trans_pos); | |||
local_trans_state = fEngineControl->fTransport.Query ( &local_trans_pos ); | |||
// Now check if we have to start or stop local transport to sync to remote... | |||
switch (pkthdr->transport_state) { | |||
case JackTransportStarting: | |||
// the master transport is starting... so we set our reply to the sync_callback; | |||
if (local_trans_state == JackTransportStopped) { | |||
fEngineControl->fTransport.SetCommand ( TransportCommandStart ); | |||
//jack_transport_start(netj.client); | |||
//last_transport_state = JackTransportStopped; | |||
netj.sync_state = 0; | |||
jack_info("locally stopped... starting..."); | |||
} | |||
if (local_trans_pos.frame != compensated_tranport_pos) | |||
{ | |||
jack_position_t new_pos = local_trans_pos; | |||
new_pos.frame = compensated_tranport_pos + 2*netj.period_size; | |||
new_pos.valid = (jack_position_bits_t) 0; | |||
fEngineControl->fTransport.RequestNewPos ( &new_pos ); | |||
//jack_transport_locate(netj.client, compensated_tranport_pos); | |||
//last_transport_state = JackTransportRolling; | |||
netj.sync_state = 0; | |||
jack_info("starting locate to %d", compensated_tranport_pos ); | |||
} | |||
break; | |||
case JackTransportStopped: | |||
netj.sync_state = 1; | |||
if (local_trans_pos.frame != (pkthdr->transport_frame)) { | |||
jack_position_t new_pos = local_trans_pos; | |||
new_pos.frame = pkthdr->transport_frame; | |||
new_pos.valid = (jack_position_bits_t)0; | |||
fEngineControl->fTransport.RequestNewPos ( &new_pos ); | |||
//jack_transport_locate(netj.client, (pkthdr->transport_frame)); | |||
jack_info("transport is stopped locate to %d", pkthdr->transport_frame); | |||
} | |||
if (local_trans_state != JackTransportStopped) | |||
//jack_transport_stop(netj.client); | |||
fEngineControl->fTransport.SetCommand ( TransportCommandStop ); | |||
break; | |||
case JackTransportRolling: | |||
netj.sync_state = 1; | |||
// if(local_trans_pos.frame != (pkthdr->transport_frame + (pkthdr->latency) * netj.period_size)) { | |||
// jack_transport_locate(netj.client, (pkthdr->transport_frame + (pkthdr->latency + 2) * netj.period_size)); | |||
// jack_info("running locate to %d", pkthdr->transport_frame + (pkthdr->latency)*netj.period_size); | |||
// } | |||
if (local_trans_state != JackTransportRolling) | |||
fEngineControl->fTransport.SetState ( JackTransportRolling ); | |||
break; | |||
case JackTransportLooping: | |||
break; | |||
} | |||
// Now check if we have to start or stop local transport to sync to remote... | |||
switch (pkthdr->transport_state) { | |||
case JackTransportStarting: | |||
// the master transport is starting... so we set our reply to the sync_callback; | |||
if (local_trans_state == JackTransportStopped) { | |||
fEngineControl->fTransport.SetCommand ( TransportCommandStart ); | |||
//jack_transport_start(netj.client); | |||
//last_transport_state = JackTransportStopped; | |||
netj.sync_state = 0; | |||
jack_info("locally stopped... starting..."); | |||
} | |||
if (local_trans_pos.frame != compensated_tranport_pos) | |||
{ | |||
jack_position_t new_pos = local_trans_pos; | |||
new_pos.frame = compensated_tranport_pos + 2*netj.period_size; | |||
new_pos.valid = (jack_position_bits_t) 0; | |||
fEngineControl->fTransport.RequestNewPos ( &new_pos ); | |||
//jack_transport_locate(netj.client, compensated_tranport_pos); | |||
//last_transport_state = JackTransportRolling; | |||
netj.sync_state = 0; | |||
jack_info("starting locate to %d", compensated_tranport_pos ); | |||
} | |||
break; | |||
case JackTransportStopped: | |||
netj.sync_state = 1; | |||
if (local_trans_pos.frame != (pkthdr->transport_frame)) { | |||
jack_position_t new_pos = local_trans_pos; | |||
new_pos.frame = pkthdr->transport_frame; | |||
new_pos.valid = (jack_position_bits_t)0; | |||
fEngineControl->fTransport.RequestNewPos ( &new_pos ); | |||
//jack_transport_locate(netj.client, (pkthdr->transport_frame)); | |||
jack_info("transport is stopped locate to %d", pkthdr->transport_frame); | |||
} | |||
if (local_trans_state != JackTransportStopped) | |||
//jack_transport_stop(netj.client); | |||
fEngineControl->fTransport.SetCommand ( TransportCommandStop ); | |||
break; | |||
case JackTransportRolling: | |||
netj.sync_state = 1; | |||
// if(local_trans_pos.frame != (pkthdr->transport_frame + (pkthdr->latency) * netj.period_size)) { | |||
// jack_transport_locate(netj.client, (pkthdr->transport_frame + (pkthdr->latency + 2) * netj.period_size)); | |||
// jack_info("running locate to %d", pkthdr->transport_frame + (pkthdr->latency)*netj.period_size); | |||
// } | |||
if (local_trans_state != JackTransportRolling) | |||
fEngineControl->fTransport.SetState ( JackTransportRolling ); | |||
break; | |||
case JackTransportLooping: | |||
break; | |||
} | |||
#endif | |||
} | |||
} | |||
render_payload_to_jack_ports (netj.bitdepth, packet_bufX, netj.net_period_down, netj.capture_ports, netj.capture_srcs, netj.period_size, netj.dont_htonl_floats ); | |||
packet_cache_release_packet(global_packcache, netj.expected_framecnt ); | |||
return 0; | |||
render_payload_to_jack_ports (netj.bitdepth, packet_bufX, netj.net_period_down, netj.capture_ports, netj.capture_srcs, netj.period_size, netj.dont_htonl_floats ); | |||
packet_cache_release_packet(global_packcache, netj.expected_framecnt ); | |||
return 0; | |||
} | |||
int JackNetOneDriver::Write() | |||
{ | |||
int syncstate = netj.sync_state | ((fEngineControl->fTransport.GetState() == JackTransportNetStarting) ? 1 : 0 ); | |||
uint32_t *packet_buf, *packet_bufX; | |||
int packet_size = get_sample_size(netj.bitdepth) * netj.playback_channels * netj.net_period_up + sizeof(jacknet_packet_header); | |||
jacknet_packet_header *pkthdr; | |||
int syncstate = netj.sync_state | ((fEngineControl->fTransport.GetState() == JackTransportNetStarting) ? 1 : 0 ); | |||
uint32_t *packet_buf, *packet_bufX; | |||
packet_buf = (uint32_t *) alloca(packet_size); | |||
pkthdr = (jacknet_packet_header *)packet_buf; | |||
int packet_size = get_sample_size(netj.bitdepth) * netj.playback_channels * netj.net_period_up + sizeof(jacknet_packet_header); | |||
jacknet_packet_header *pkthdr; | |||
if( netj.running_free ) { | |||
return 0; | |||
} | |||
packet_buf = (uint32_t *) alloca(packet_size); | |||
pkthdr = (jacknet_packet_header *)packet_buf; | |||
// offset packet_bufX by the packetheader. | |||
packet_bufX = packet_buf + sizeof(jacknet_packet_header) / sizeof(jack_default_audio_sample_t); | |||
if( netj.running_free ) { | |||
return 0; | |||
} | |||
pkthdr->sync_state = syncstate;; | |||
pkthdr->latency = netj.time_to_deadline; | |||
//printf( "time to deadline = %d goodness=%d\n", (int)netj.time_to_deadline, netj.deadline_goodness ); | |||
pkthdr->framecnt = netj.expected_framecnt; | |||
// offset packet_bufX by the packetheader. | |||
packet_bufX = packet_buf + sizeof(jacknet_packet_header) / sizeof(jack_default_audio_sample_t); | |||
pkthdr->sync_state = syncstate;; | |||
pkthdr->latency = netj.time_to_deadline; | |||
//printf( "time to deadline = %d goodness=%d\n", (int)netj.time_to_deadline, netj.deadline_goodness ); | |||
pkthdr->framecnt = netj.expected_framecnt; | |||
render_jack_ports_to_payload(netj.bitdepth, netj.playback_ports, netj.playback_srcs, netj.period_size, packet_bufX, netj.net_period_up, netj.dont_htonl_floats ); | |||
render_jack_ports_to_payload(netj.bitdepth, netj.playback_ports, netj.playback_srcs, netj.period_size, packet_bufX, netj.net_period_up, netj.dont_htonl_floats ); | |||
packet_header_hton(pkthdr); | |||
if (netj.srcaddress_valid) | |||
{ | |||
unsigned int r; | |||
packet_header_hton(pkthdr); | |||
if (netj.srcaddress_valid) | |||
{ | |||
unsigned int r; | |||
#ifdef __APPLE__ | |||
static const int flag = 0; | |||
#else | |||
static const int flag = 0; | |||
#endif | |||
#ifdef __APPLE__ | |||
static const int flag = 0; | |||
#else | |||
static const int flag = 0; | |||
#endif | |||
if (netj.reply_port) | |||
netj.syncsource_address.sin_port = htons(netj.reply_port); | |||
if (netj.reply_port) | |||
netj.syncsource_address.sin_port = htons(netj.reply_port); | |||
for( r=0; r<netj.redundancy; r++ ) | |||
netjack_sendto(netj.sockfd, (char *)packet_buf, packet_size, | |||
flag, (struct sockaddr*)&(netj.syncsource_address), sizeof(struct sockaddr_in), netj.mtu); | |||
} | |||
return 0; | |||
for( r=0; r<netj.redundancy; r++ ) | |||
netjack_sendto(netj.sockfd, (char *)packet_buf, packet_size, | |||
flag, (struct sockaddr*)&(netj.syncsource_address), sizeof(struct sockaddr_in), netj.mtu); | |||
} | |||
return 0; | |||
} | |||
void | |||
@@ -444,21 +442,21 @@ JackNetOneDriver::FreePorts () | |||
JSList *node = netj.capture_ports; | |||
while( node != NULL ) { | |||
JSList *this_node = node; | |||
jack_port_id_t port_id = (jack_port_id_t)(intptr_t) node->data; | |||
node = jack_slist_remove_link( node, this_node ); | |||
jack_slist_free_1( this_node ); | |||
fGraphManager->ReleasePort( fClientControl.fRefNum, port_id ); | |||
JSList *this_node = node; | |||
jack_port_id_t port_id = (jack_port_id_t)(intptr_t) node->data; | |||
node = jack_slist_remove_link( node, this_node ); | |||
jack_slist_free_1( this_node ); | |||
fGraphManager->ReleasePort( fClientControl.fRefNum, port_id ); | |||
} | |||
netj.capture_ports = NULL; | |||
node = netj.playback_ports; | |||
while( node != NULL ) { | |||
JSList *this_node = node; | |||
jack_port_id_t port_id = (jack_port_id_t)(intptr_t) node->data; | |||
node = jack_slist_remove_link( node, this_node ); | |||
jack_slist_free_1( this_node ); | |||
fGraphManager->ReleasePort( fClientControl.fRefNum, port_id ); | |||
JSList *this_node = node; | |||
jack_port_id_t port_id = (jack_port_id_t)(intptr_t) node->data; | |||
node = jack_slist_remove_link( node, this_node ); | |||
jack_slist_free_1( this_node ); | |||
fGraphManager->ReleasePort( fClientControl.fRefNum, port_id ); | |||
} | |||
netj.playback_ports = NULL; | |||
@@ -523,7 +521,7 @@ JackNetOneDriver::render_payload_to_jack_ports_float ( void *packet_payload, jac | |||
uint32_t *packet_bufX = (uint32_t *)packet_payload; | |||
if( !packet_payload ) | |||
return; | |||
return; | |||
while (node != NULL) | |||
{ | |||
@@ -532,9 +530,8 @@ JackNetOneDriver::render_payload_to_jack_ports_float ( void *packet_payload, jac | |||
#if HAVE_SAMPLERATE | |||
SRC_DATA src; | |||
#endif | |||
jack_port_id_t port_id = (jack_port_id_t)(intptr_t) node->data; | |||
JackPort *port = fGraphManager->GetPort( port_id ); | |||
jack_port_id_t port_id = (jack_port_id_t)(intptr_t) node->data; | |||
JackPort *port = fGraphManager->GetPort( port_id ); | |||
jack_default_audio_sample_t* buf = | |||
(jack_default_audio_sample_t*)fGraphManager->GetBuffer(port_id, fEngineControl->fBufferSize); | |||
@@ -569,19 +566,19 @@ JackNetOneDriver::render_payload_to_jack_ports_float ( void *packet_payload, jac | |||
else | |||
#endif | |||
{ | |||
if( dont_htonl_floats ) | |||
{ | |||
memcpy( buf, packet_bufX, net_period_down*sizeof(jack_default_audio_sample_t)); | |||
} | |||
else | |||
{ | |||
for (i = 0; i < net_period_down; i++) | |||
{ | |||
val.i = packet_bufX[i]; | |||
val.i = ntohl (val.i); | |||
buf[i] = val.f; | |||
} | |||
} | |||
if( dont_htonl_floats ) | |||
{ | |||
memcpy( buf, packet_bufX, net_period_down*sizeof(jack_default_audio_sample_t)); | |||
} | |||
else | |||
{ | |||
for (i = 0; i < net_period_down; i++) | |||
{ | |||
val.i = packet_bufX[i]; | |||
val.i = ntohl (val.i); | |||
buf[i] = val.f; | |||
} | |||
} | |||
} | |||
} | |||
else if (strncmp (porttype, JACK_DEFAULT_MIDI_TYPE, jack_port_type_size()) == 0) | |||
@@ -616,8 +613,8 @@ JackNetOneDriver::render_jack_ports_to_payload_float (JSList *playback_ports, JS | |||
#endif | |||
unsigned int i; | |||
int_float_t val; | |||
jack_port_id_t port_id = (jack_port_id_t)(intptr_t) node->data; | |||
JackPort *port = fGraphManager->GetPort( port_id ); | |||
jack_port_id_t port_id = (jack_port_id_t)(intptr_t) node->data; | |||
JackPort *port = fGraphManager->GetPort( port_id ); | |||
jack_default_audio_sample_t* buf = | |||
(jack_default_audio_sample_t*)fGraphManager->GetBuffer(port_id, fEngineControl->fBufferSize); | |||
@@ -652,19 +649,19 @@ JackNetOneDriver::render_jack_ports_to_payload_float (JSList *playback_ports, JS | |||
else | |||
#endif | |||
{ | |||
if( dont_htonl_floats ) | |||
{ | |||
memcpy( packet_bufX, buf, net_period_up*sizeof(jack_default_audio_sample_t) ); | |||
} | |||
else | |||
{ | |||
for (i = 0; i < net_period_up; i++) | |||
{ | |||
val.f = buf[i]; | |||
val.i = htonl (val.i); | |||
packet_bufX[i] = val.i; | |||
} | |||
} | |||
if( dont_htonl_floats ) | |||
{ | |||
memcpy( packet_bufX, buf, net_period_up*sizeof(jack_default_audio_sample_t) ); | |||
} | |||
else | |||
{ | |||
for (i = 0; i < net_period_up; i++) | |||
{ | |||
val.f = buf[i]; | |||
val.i = htonl (val.i); | |||
packet_bufX[i] = val.i; | |||
} | |||
} | |||
} | |||
} | |||
else if (strncmp(porttype, JACK_DEFAULT_MIDI_TYPE, jack_port_type_size()) == 0) | |||
@@ -694,26 +691,24 @@ JackNetOneDriver::render_payload_to_jack_ports_celt (void *packet_payload, jack_ | |||
while (node != NULL) | |||
{ | |||
jack_port_id_t port_id = (jack_port_id_t) (intptr_t)node->data; | |||
JackPort *port = fGraphManager->GetPort( port_id ); | |||
jack_port_id_t port_id = (jack_port_id_t) (intptr_t)node->data; | |||
JackPort *port = fGraphManager->GetPort( port_id ); | |||
jack_default_audio_sample_t* buf = | |||
(jack_default_audio_sample_t*)fGraphManager->GetBuffer(port_id, fEngineControl->fBufferSize); | |||
const char *portname = port->GetType(); | |||
if (strncmp(portname, JACK_DEFAULT_AUDIO_TYPE, jack_port_type_size()) == 0) | |||
{ | |||
// audio port, decode celt data. | |||
CELTDecoder *decoder = (CELTDecoder *)src_node->data; | |||
if( !packet_payload ) | |||
celt_decode_float( decoder, NULL, net_period_down, buf ); | |||
else | |||
celt_decode_float( decoder, packet_bufX, net_period_down, buf ); | |||
CELTDecoder *decoder = (CELTDecoder *)src_node->data; | |||
if( !packet_payload ) | |||
celt_decode_float( decoder, NULL, net_period_down, buf ); | |||
else | |||
celt_decode_float( decoder, packet_bufX, net_period_down, buf ); | |||
src_node = jack_slist_next (src_node); | |||
src_node = jack_slist_next (src_node); | |||
} | |||
else if (strncmp(portname, JACK_DEFAULT_MIDI_TYPE, jack_port_type_size()) == 0) | |||
{ | |||
@@ -722,7 +717,7 @@ JackNetOneDriver::render_payload_to_jack_ports_celt (void *packet_payload, jack_ | |||
unsigned int buffer_size_uint32 = net_period_down / 2; | |||
uint32_t * buffer_uint32 = (uint32_t*) packet_bufX; | |||
if( packet_payload ) | |||
decode_midi_buffer (buffer_uint32, buffer_size_uint32, buf); | |||
decode_midi_buffer (buffer_uint32, buffer_size_uint32, buf); | |||
} | |||
packet_bufX = (packet_bufX + net_period_down); | |||
node = jack_slist_next (node); | |||
@@ -741,8 +736,8 @@ JackNetOneDriver::render_jack_ports_to_payload_celt (JSList *playback_ports, JSL | |||
while (node != NULL) | |||
{ | |||
jack_port_id_t port_id = (jack_port_id_t) (intptr_t) node->data; | |||
JackPort *port = fGraphManager->GetPort( port_id ); | |||
jack_port_id_t port_id = (jack_port_id_t) (intptr_t) node->data; | |||
JackPort *port = fGraphManager->GetPort( port_id ); | |||
jack_default_audio_sample_t* buf = | |||
(jack_default_audio_sample_t*)fGraphManager->GetBuffer(port_id, fEngineControl->fBufferSize); | |||
@@ -800,8 +795,6 @@ JackNetOneDriver::render_jack_ports_to_payload (int bitdepth, JSList *playback_p | |||
render_jack_ports_to_payload_float (playback_ports, playback_srcs, nframes, packet_payload, net_period_up, dont_htonl_floats); | |||
} | |||
//driver loader----------------------------------------------------------------------- | |||
#ifdef __cplusplus | |||
@@ -982,28 +975,26 @@ JackNetOneDriver::render_jack_ports_to_payload (int bitdepth, JSList *playback_p | |||
SERVER_EXPORT Jack::JackDriverClientInterface* driver_initialize ( Jack::JackLockedEngine* engine, Jack::JackSynchro* table, const JSList* params ) | |||
{ | |||
jack_nframes_t sample_rate = 48000; | |||
jack_nframes_t resample_factor = 1; | |||
jack_nframes_t period_size = 1024; | |||
unsigned int capture_ports = 2; | |||
unsigned int playback_ports = 2; | |||
unsigned int capture_ports_midi = 1; | |||
unsigned int playback_ports_midi = 1; | |||
unsigned int listen_port = 3000; | |||
unsigned int resample_factor_up = 0; | |||
unsigned int bitdepth = 0; | |||
unsigned int handle_transport_sync = 1; | |||
unsigned int use_autoconfig = 1; | |||
unsigned int latency = 5; | |||
unsigned int redundancy = 1; | |||
unsigned int mtu = 1400; | |||
int dont_htonl_floats = 0; | |||
int always_deadline = 0; | |||
int jitter_val = 0; | |||
const JSList * node; | |||
const jack_driver_param_t * param; | |||
jack_nframes_t sample_rate = 48000; | |||
jack_nframes_t resample_factor = 1; | |||
jack_nframes_t period_size = 1024; | |||
unsigned int capture_ports = 2; | |||
unsigned int playback_ports = 2; | |||
unsigned int capture_ports_midi = 1; | |||
unsigned int playback_ports_midi = 1; | |||
unsigned int listen_port = 3000; | |||
unsigned int bitdepth = 0; | |||
unsigned int handle_transport_sync = 1; | |||
unsigned int use_autoconfig = 1; | |||
unsigned int latency = 5; | |||
unsigned int redundancy = 1; | |||
unsigned int mtu = 1400; | |||
unsigned int resample_factor_up = 1; | |||
int dont_htonl_floats = 0; | |||
int always_deadline = 0; | |||
int jitter_val = 0; | |||
const JSList * node; | |||
const jack_driver_param_t * param; | |||
for ( node = params; node; node = jack_slist_next ( node ) ) | |||
{ | |||
@@ -1102,7 +1093,6 @@ JackNetOneDriver::render_jack_ports_to_payload (int bitdepth, JSList *playback_p | |||
try | |||
{ | |||
Jack::JackDriverClientInterface* driver = | |||
new Jack::JackWaitThreadedDriver ( | |||
new Jack::JackNetOneDriver ( "system", "net_pcm", engine, table, listen_port, mtu, | |||
@@ -45,6 +45,7 @@ enum NotificationType { | |||
kRealTimeCallback = 14, | |||
kShutDownCallback = 15, | |||
kQUIT = 16, | |||
kSessionCallback = 17, | |||
kMaxNotification | |||
}; | |||
@@ -26,6 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |||
#include "types.h" | |||
#include <string.h> | |||
#include <stdio.h> | |||
#include <list> | |||
namespace Jack | |||
{ | |||
@@ -65,7 +66,12 @@ struct JackRequest | |||
kInternalClientLoad = 29, | |||
kInternalClientUnload = 30, | |||
kPortRename = 31, | |||
kNotification = 32 | |||
kNotification = 32, | |||
kSessionNotify = 33, | |||
kSessionReply = 34, | |||
kGetClientByUUID = 35, | |||
kReserveClientName = 36, | |||
kGetUUIDByClient = 37 | |||
}; | |||
RequestType fType; | |||
@@ -98,7 +104,7 @@ struct JackRequest | |||
struct JackResult | |||
{ | |||
int fResult; | |||
int fResult; | |||
JackResult(): fResult( -1) | |||
{} | |||
@@ -129,31 +135,34 @@ struct JackClientCheckRequest : public JackRequest | |||
char fName[JACK_CLIENT_NAME_SIZE + 1]; | |||
int fProtocol; | |||
int fOptions; | |||
int fUUID; | |||
JackClientCheckRequest() | |||
{} | |||
JackClientCheckRequest(const char* name, int protocol, int options) | |||
: JackRequest(JackRequest::kClientCheck), fProtocol(protocol), fOptions(options) | |||
JackClientCheckRequest(const char* name, int protocol, int options, int uuid) | |||
: JackRequest(JackRequest::kClientCheck), fProtocol(protocol), fOptions(options), fUUID(uuid) | |||
{ | |||
snprintf(fName, sizeof(fName), "%s", name); | |||
} | |||
int Read(JackChannelTransaction* trans) | |||
{ | |||
CheckRes(trans->Read(&fName, JACK_CLIENT_NAME_SIZE + 1)); | |||
CheckRes(trans->Read(&fName, sizeof(fName))); | |||
CheckRes(trans->Read(&fProtocol, sizeof(int))); | |||
return trans->Read(&fOptions, sizeof(int)); | |||
CheckRes(trans->Read(&fOptions, sizeof(int))); | |||
return trans->Read(&fUUID, sizeof(int)); | |||
} | |||
int Write(JackChannelTransaction* trans) | |||
{ | |||
CheckRes(JackRequest::Write(trans)); | |||
CheckRes(trans->Write(&fName, JACK_CLIENT_NAME_SIZE + 1)); | |||
CheckRes(trans->Write(&fName, sizeof(fName))); | |||
CheckRes(trans->Write(&fProtocol, sizeof(int))); | |||
return trans->Write(&fOptions, sizeof(int)); | |||
CheckRes(trans->Write(&fOptions, sizeof(int))); | |||
return trans->Write(&fUUID, sizeof(int)); | |||
} | |||
} POST_PACKED_STRUCTURE; | |||
}; | |||
/*! | |||
\brief CheckClient result. | |||
@@ -176,7 +185,7 @@ struct JackClientCheckResult : public JackResult | |||
int Read(JackChannelTransaction* trans) | |||
{ | |||
CheckRes(JackResult::Read(trans)); | |||
CheckRes(trans->Read(&fName, JACK_CLIENT_NAME_SIZE + 1)); | |||
CheckRes(trans->Read(&fName, sizeof(fName))); | |||
CheckRes(trans->Read(&fStatus, sizeof(int))); | |||
return 0; | |||
} | |||
@@ -184,12 +193,12 @@ struct JackClientCheckResult : public JackResult | |||
int Write(JackChannelTransaction* trans) | |||
{ | |||
CheckRes(JackResult::Write(trans)); | |||
CheckRes(trans->Write(&fName, JACK_CLIENT_NAME_SIZE + 1)); | |||
CheckRes(trans->Write(&fName, sizeof(fName))); | |||
CheckRes(trans->Write(&fStatus, sizeof(int))); | |||
return 0; | |||
} | |||
} POST_PACKED_STRUCTURE; | |||
}; | |||
/*! | |||
\brief NewClient request. | |||
@@ -199,30 +208,34 @@ struct JackClientOpenRequest : public JackRequest | |||
{ | |||
int fPID; | |||
int fUUID; | |||
char fName[JACK_CLIENT_NAME_SIZE + 1]; | |||
JackClientOpenRequest() | |||
{} | |||
JackClientOpenRequest(const char* name, int pid): JackRequest(JackRequest::kClientOpen) | |||
JackClientOpenRequest(const char* name, int pid, int uuid): JackRequest(JackRequest::kClientOpen) | |||
{ | |||
snprintf(fName, sizeof(fName), "%s", name); | |||
fPID = pid; | |||
fUUID = uuid; | |||
} | |||
int Read(JackChannelTransaction* trans) | |||
{ | |||
CheckRes(trans->Read(&fPID, sizeof(int))); | |||
return trans->Read(&fName, JACK_CLIENT_NAME_SIZE + 1); | |||
CheckRes(trans->Read(&fUUID, sizeof(int))); | |||
return trans->Read(&fName, sizeof(fName)); | |||
} | |||
int Write(JackChannelTransaction* trans) | |||
{ | |||
CheckRes(JackRequest::Write(trans)); | |||
CheckRes(trans->Write(&fPID, sizeof(int))); | |||
return trans->Write(&fName, JACK_CLIENT_NAME_SIZE + 1); | |||
CheckRes(trans->Write(&fUUID, sizeof(int))); | |||
return trans->Write(&fName, sizeof(fName)); | |||
} | |||
} POST_PACKED_STRUCTURE; | |||
}; | |||
/*! | |||
\brief NewClient result. | |||
@@ -260,7 +273,7 @@ struct JackClientOpenResult : public JackResult | |||
return 0; | |||
} | |||
} POST_PACKED_STRUCTURE; | |||
}; | |||
/*! | |||
\brief CloseClient request. | |||
@@ -287,7 +300,7 @@ struct JackClientCloseRequest : public JackRequest | |||
return trans->Write(&fRefNum, sizeof(int)); | |||
} | |||
} POST_PACKED_STRUCTURE; | |||
}; | |||
/*! | |||
\brief Activate request. | |||
@@ -318,7 +331,7 @@ struct JackActivateRequest : public JackRequest | |||
return trans->Write(&fIsRealTime, sizeof(int)); | |||
} | |||
} POST_PACKED_STRUCTURE; | |||
}; | |||
/*! | |||
\brief Deactivate request. | |||
@@ -345,7 +358,7 @@ struct JackDeactivateRequest : public JackRequest | |||
return trans->Write(&fRefNum, sizeof(int)); | |||
} | |||
} POST_PACKED_STRUCTURE; | |||
}; | |||
/*! | |||
\brief PortRegister request. | |||
@@ -372,8 +385,8 @@ struct JackPortRegisterRequest : public JackRequest | |||
int Read(JackChannelTransaction* trans) | |||
{ | |||
CheckRes(trans->Read(&fRefNum, sizeof(int))); | |||
CheckRes(trans->Read(&fName, JACK_PORT_NAME_SIZE + 1)); | |||
CheckRes(trans->Read(&fPortType, JACK_PORT_TYPE_SIZE + 1)); | |||
CheckRes(trans->Read(&fName, sizeof(fName))); | |||
CheckRes(trans->Read(&fPortType, sizeof(fPortType))); | |||
CheckRes(trans->Read(&fFlags, sizeof(unsigned int))); | |||
CheckRes(trans->Read(&fBufferSize, sizeof(unsigned int))); | |||
return 0; | |||
@@ -383,14 +396,14 @@ struct JackPortRegisterRequest : public JackRequest | |||
{ | |||
CheckRes(JackRequest::Write(trans)); | |||
CheckRes(trans->Write(&fRefNum, sizeof(int))); | |||
CheckRes(trans->Write(&fName, JACK_PORT_NAME_SIZE + 1)); | |||
CheckRes(trans->Write(&fPortType, JACK_PORT_TYPE_SIZE + 1)); | |||
CheckRes(trans->Write(&fName, sizeof(fName))); | |||
CheckRes(trans->Write(&fPortType, sizeof(fPortType))); | |||
CheckRes(trans->Write(&fFlags, sizeof(unsigned int))); | |||
CheckRes(trans->Write(&fBufferSize, sizeof(unsigned int))); | |||
return 0; | |||
} | |||
} POST_PACKED_STRUCTURE; | |||
}; | |||
/*! | |||
\brief PortRegister result. | |||
@@ -416,7 +429,7 @@ struct JackPortRegisterResult : public JackResult | |||
return trans->Write(&fPortIndex, sizeof(jack_port_id_t)); | |||
} | |||
} POST_PACKED_STRUCTURE; | |||
}; | |||
/*! | |||
\brief PortUnregister request. | |||
@@ -449,7 +462,7 @@ struct JackPortUnRegisterRequest : public JackRequest | |||
return 0; | |||
} | |||
} POST_PACKED_STRUCTURE; | |||
}; | |||
/*! | |||
\brief PortConnectName request. | |||
@@ -474,8 +487,8 @@ struct JackPortConnectNameRequest : public JackRequest | |||
int Read(JackChannelTransaction* trans) | |||
{ | |||
CheckRes(trans->Read(&fRefNum, sizeof(int))); | |||
CheckRes(trans->Read(&fSrc, JACK_PORT_NAME_SIZE + 1)); | |||
CheckRes(trans->Read(&fDst, JACK_PORT_NAME_SIZE + 1)); | |||
CheckRes(trans->Read(&fSrc, sizeof(fSrc))); | |||
CheckRes(trans->Read(&fDst, sizeof(fDst))); | |||
return 0; | |||
} | |||
@@ -484,12 +497,12 @@ struct JackPortConnectNameRequest : public JackRequest | |||
{ | |||
CheckRes(JackRequest::Write(trans)); | |||
CheckRes(trans->Write(&fRefNum, sizeof(int))); | |||
CheckRes(trans->Write(&fSrc, JACK_PORT_NAME_SIZE + 1)); | |||
CheckRes(trans->Write(&fDst, JACK_PORT_NAME_SIZE + 1)); | |||
CheckRes(trans->Write(&fSrc, sizeof(fSrc))); | |||
CheckRes(trans->Write(&fDst, sizeof(fDst))); | |||
return 0; | |||
} | |||
} POST_PACKED_STRUCTURE; | |||
}; | |||
/*! | |||
\brief PortDisconnectName request. | |||
@@ -514,8 +527,8 @@ struct JackPortDisconnectNameRequest : public JackRequest | |||
int Read(JackChannelTransaction* trans) | |||
{ | |||
CheckRes(trans->Read(&fRefNum, sizeof(int))); | |||
CheckRes(trans->Read(&fSrc, JACK_PORT_NAME_SIZE + 1)); | |||
CheckRes(trans->Read(&fDst, JACK_PORT_NAME_SIZE + 1)); | |||
CheckRes(trans->Read(&fSrc, sizeof(fSrc))); | |||
CheckRes(trans->Read(&fDst, sizeof(fDst))); | |||
return 0; | |||
} | |||
@@ -523,12 +536,12 @@ struct JackPortDisconnectNameRequest : public JackRequest | |||
{ | |||
CheckRes(JackRequest::Write(trans)); | |||
CheckRes(trans->Write(&fRefNum, sizeof(int))); | |||
CheckRes(trans->Write(&fSrc, JACK_PORT_NAME_SIZE + 1)); | |||
CheckRes(trans->Write(&fDst, JACK_PORT_NAME_SIZE + 1)); | |||
CheckRes(trans->Write(&fSrc, sizeof(fSrc))); | |||
CheckRes(trans->Write(&fDst, sizeof(fDst))); | |||
return 0; | |||
} | |||
} POST_PACKED_STRUCTURE; | |||
}; | |||
/*! | |||
\brief PortConnect request. | |||
@@ -564,7 +577,7 @@ struct JackPortConnectRequest : public JackRequest | |||
return 0; | |||
} | |||
} POST_PACKED_STRUCTURE; | |||
}; | |||
/*! | |||
\brief PortDisconnect request. | |||
@@ -598,10 +611,9 @@ struct JackPortDisconnectRequest : public JackRequest | |||
CheckRes(trans->Write(&fSrc, sizeof(jack_port_id_t))); | |||
CheckRes(trans->Write(&fDst, sizeof(jack_port_id_t))); | |||
return 0; | |||
} | |||
} POST_PACKED_STRUCTURE; | |||
}; | |||
/*! | |||
\brief PortRename request. | |||
@@ -626,7 +638,7 @@ struct JackPortRenameRequest : public JackRequest | |||
{ | |||
CheckRes(trans->Read(&fRefNum, sizeof(int))); | |||
CheckRes(trans->Read(&fPort, sizeof(jack_port_id_t))); | |||
CheckRes(trans->Read(&fName, JACK_PORT_NAME_SIZE + 1)); | |||
CheckRes(trans->Read(&fName, sizeof(fName))); | |||
return 0; | |||
} | |||
@@ -635,12 +647,12 @@ struct JackPortRenameRequest : public JackRequest | |||
CheckRes(JackRequest::Write(trans)); | |||
CheckRes(trans->Write(&fRefNum, sizeof(int))); | |||
CheckRes(trans->Write(&fPort, sizeof(jack_port_id_t))); | |||
CheckRes(trans->Write(&fName, JACK_PORT_NAME_SIZE + 1)); | |||
CheckRes(trans->Write(&fName, sizeof(fName))); | |||
return 0; | |||
} | |||
} POST_PACKED_STRUCTURE; | |||
}; | |||
/*! | |||
\brief SetBufferSize request. | |||
@@ -668,7 +680,7 @@ struct JackSetBufferSizeRequest : public JackRequest | |||
return trans->Write(&fBufferSize, sizeof(jack_nframes_t)); | |||
} | |||
} POST_PACKED_STRUCTURE; | |||
}; | |||
/*! | |||
\brief SetFreeWheel request. | |||
@@ -696,7 +708,7 @@ struct JackSetFreeWheelRequest : public JackRequest | |||
return trans->Write(&fOnOff, sizeof(int)); | |||
} | |||
} POST_PACKED_STRUCTURE; | |||
}; | |||
/*! | |||
\brief ReleaseTimebase request. | |||
@@ -724,7 +736,7 @@ struct JackReleaseTimebaseRequest : public JackRequest | |||
return trans->Write(&fRefNum, sizeof(int)); | |||
} | |||
} POST_PACKED_STRUCTURE; | |||
}; | |||
/*! | |||
\brief SetTimebaseCallback request. | |||
@@ -755,7 +767,7 @@ struct JackSetTimebaseCallbackRequest : public JackRequest | |||
return trans->Write(&fConditionnal, sizeof(int)); | |||
} | |||
} POST_PACKED_STRUCTURE; | |||
}; | |||
/*! | |||
\brief GetInternalClientName request. | |||
@@ -786,7 +798,7 @@ struct JackGetInternalClientNameRequest : public JackRequest | |||
return trans->Write(&fIntRefNum, sizeof(int)); | |||
} | |||
} POST_PACKED_STRUCTURE; | |||
}; | |||
/*! | |||
\brief GetInternalClient result. | |||
@@ -808,18 +820,18 @@ struct JackGetInternalClientNameResult : public JackResult | |||
int Read(JackChannelTransaction* trans) | |||
{ | |||
CheckRes(JackResult::Read(trans)); | |||
CheckRes(trans->Read(&fName, JACK_CLIENT_NAME_SIZE + 1)); | |||
CheckRes(trans->Read(&fName, sizeof(fName))); | |||
return 0; | |||
} | |||
int Write(JackChannelTransaction* trans) | |||
{ | |||
CheckRes(JackResult::Write(trans)); | |||
CheckRes(trans->Write(&fName, JACK_CLIENT_NAME_SIZE + 1)); | |||
CheckRes(trans->Write(&fName, sizeof(fName))); | |||
return 0; | |||
} | |||
} POST_PACKED_STRUCTURE; | |||
}; | |||
/*! | |||
\brief InternalClientHandle request. | |||
@@ -842,17 +854,17 @@ struct JackInternalClientHandleRequest : public JackRequest | |||
int Read(JackChannelTransaction* trans) | |||
{ | |||
CheckRes(trans->Read(&fRefNum, sizeof(int))); | |||
return trans->Read(&fName, JACK_CLIENT_NAME_SIZE + 1); | |||
return trans->Read(&fName, sizeof(fName)); | |||
} | |||
int Write(JackChannelTransaction* trans) | |||
{ | |||
CheckRes(JackRequest::Write(trans)); | |||
CheckRes(trans->Write(&fRefNum, sizeof(int))); | |||
return trans->Write(&fName, JACK_CLIENT_NAME_SIZE + 1); | |||
return trans->Write(&fName, sizeof(fName)); | |||
} | |||
} POST_PACKED_STRUCTURE; | |||
}; | |||
/*! | |||
\brief InternalClientHandle result. | |||
@@ -886,7 +898,7 @@ struct JackInternalClientHandleResult : public JackResult | |||
return 0; | |||
} | |||
} POST_PACKED_STRUCTURE; | |||
}; | |||
/*! | |||
\brief InternalClientLoad request. | |||
@@ -904,23 +916,26 @@ struct JackInternalClientLoadRequest : public JackRequest | |||
char fDllName[MAX_PATH + 1]; | |||
char fLoadInitName[JACK_LOAD_INIT_LIMIT + 1]; | |||
int fOptions; | |||
int fUUID; | |||
JackInternalClientLoadRequest() | |||
{} | |||
JackInternalClientLoadRequest(int refnum, const char* client_name, const char* so_name, const char* objet_data, int options) | |||
: JackRequest(JackRequest::kInternalClientLoad), fRefNum(refnum), fOptions(options) | |||
JackInternalClientLoadRequest(int refnum, const char* client_name, const char* so_name, const char* objet_data, int options, int uuid ) | |||
: JackRequest(JackRequest::kInternalClientLoad), fRefNum(refnum), fOptions(options), fUUID(uuid) | |||
{ | |||
snprintf(fName, sizeof(fName), "%s", client_name); | |||
snprintf(fDllName, sizeof(fDllName), "%s", so_name); | |||
snprintf(fLoadInitName, sizeof(fLoadInitName), "%s", objet_data); | |||
snprintf(fLoadInitName, sizeof(fLoadInitName), "%s", objet_data); | |||
} | |||
int Read(JackChannelTransaction* trans) | |||
{ | |||
CheckRes(trans->Read(&fRefNum, sizeof(int))); | |||
CheckRes(trans->Read(&fName, JACK_CLIENT_NAME_SIZE + 1)); | |||
CheckRes(trans->Read(&fDllName, MAX_PATH + 1)); | |||
CheckRes(trans->Read(&fLoadInitName, JACK_LOAD_INIT_LIMIT + 1)); | |||
CheckRes(trans->Read(&fName, sizeof(fName))); | |||
CheckRes(trans->Read(&fDllName, sizeof(fDllName))); | |||
CheckRes(trans->Read(&fLoadInitName, sizeof(fLoadInitName))); | |||
CheckRes(trans->Read(&fUUID, sizeof(int))); | |||
return trans->Read(&fOptions, sizeof(int)); | |||
} | |||
@@ -928,13 +943,14 @@ struct JackInternalClientLoadRequest : public JackRequest | |||
{ | |||
CheckRes(JackRequest::Write(trans)); | |||
CheckRes(trans->Write(&fRefNum, sizeof(int))); | |||
CheckRes(trans->Write(&fName, JACK_CLIENT_NAME_SIZE + 1)); | |||
CheckRes(trans->Write(&fDllName, MAX_PATH + 1)); | |||
CheckRes(trans->Write(&fLoadInitName, JACK_LOAD_INIT_LIMIT + 1)); | |||
CheckRes(trans->Write(&fName, sizeof(fName))); | |||
CheckRes(trans->Write(&fDllName, sizeof(fDllName))); | |||
CheckRes(trans->Write(&fLoadInitName, sizeof(fLoadInitName))); | |||
CheckRes(trans->Write(&fUUID, sizeof(int))); | |||
return trans->Write(&fOptions, sizeof(int)); | |||
} | |||
} POST_PACKED_STRUCTURE; | |||
}; | |||
/*! | |||
\brief InternalClientLoad result. | |||
@@ -968,7 +984,7 @@ struct JackInternalClientLoadResult : public JackResult | |||
return 0; | |||
} | |||
} POST_PACKED_STRUCTURE; | |||
}; | |||
/*! | |||
\brief InternalClientUnload request. | |||
@@ -998,7 +1014,7 @@ struct JackInternalClientUnloadRequest : public JackRequest | |||
CheckRes(trans->Write(&fRefNum, sizeof(int))); | |||
return trans->Write(&fIntRefNum, sizeof(int)); | |||
} | |||
} POST_PACKED_STRUCTURE; | |||
}; | |||
/*! | |||
\brief InternalClientLoad result. | |||
@@ -1029,7 +1045,7 @@ struct JackInternalClientUnloadResult : public JackResult | |||
return 0; | |||
} | |||
} POST_PACKED_STRUCTURE; | |||
}; | |||
/*! | |||
\brief ClientNotification request. | |||
@@ -1065,7 +1081,292 @@ struct JackClientNotificationRequest : public JackRequest | |||
return 0; | |||
} | |||
} POST_PACKED_STRUCTURE; | |||
}; | |||
struct JackSessionCommand | |||
{ | |||
char fUUID[JACK_UUID_SIZE]; | |||
char fClientName[JACK_CLIENT_NAME_SIZE+1]; | |||
char fCommand[JACK_SESSION_COMMAND_SIZE]; | |||
jack_session_flags_t fFlags; | |||
JackSessionCommand() | |||
{} | |||
JackSessionCommand( const char *uuid, const char *clientname, const char *command, jack_session_flags_t flags ) | |||
{ | |||
strncpy( fUUID, uuid, sizeof(fUUID)); | |||
strncpy( fClientName, clientname, sizeof(fClientName)); | |||
strncpy( fCommand, command, sizeof(fCommand)); | |||
fFlags = flags; | |||
} | |||
}; | |||
struct JackSessionNotifyResult : public JackResult | |||
{ | |||
std::list<JackSessionCommand> fCommandList; | |||
JackSessionNotifyResult(): JackResult() | |||
{} | |||
JackSessionNotifyResult(int32_t result) | |||
: JackResult(result) | |||
{} | |||
int Read(JackChannelTransaction* trans) | |||
{ | |||
CheckRes(JackResult::Read(trans)); | |||
while(1) { | |||
JackSessionCommand buffer; | |||
CheckRes(trans->Read(buffer.fUUID, sizeof(buffer.fUUID))); | |||
if (buffer.fUUID[0] == '\0') | |||
break; | |||
CheckRes(trans->Read(buffer.fClientName, sizeof(buffer.fClientName))); | |||
CheckRes(trans->Read(buffer.fCommand, sizeof(buffer.fCommand))); | |||
CheckRes(trans->Read(&(buffer.fFlags), sizeof(buffer.fFlags))); | |||
fCommandList.push_back(buffer); | |||
} | |||
return 0; | |||
} | |||
int Write(JackChannelTransaction* trans) | |||
{ | |||
char terminator[JACK_UUID_SIZE]; | |||
terminator[0] = '\0'; | |||
CheckRes(JackResult::Write(trans)); | |||
for (std::list<JackSessionCommand>::iterator i=fCommandList.begin(); i!=fCommandList.end(); i++) { | |||
CheckRes(trans->Write(i->fUUID, sizeof(i->fUUID))); | |||
CheckRes(trans->Write(i->fClientName, sizeof(i->fClientName))); | |||
CheckRes(trans->Write(i->fCommand, sizeof(i->fCommand))); | |||
CheckRes(trans->Write(&(i->fFlags), sizeof(i->fFlags))); | |||
} | |||
CheckRes(trans->Write(terminator, sizeof(terminator))); | |||
return 0; | |||
} | |||
}; | |||
/*! | |||
\brief SessionNotify request. | |||
*/ | |||
struct JackSessionNotifyRequest : public JackRequest | |||
{ | |||
char fPath[JACK_MESSAGE_SIZE + 1]; | |||
char fDst[JACK_CLIENT_NAME_SIZE + 1]; | |||
jack_session_event_type_t fEventType; | |||
int fRefNum; | |||
JackSessionNotifyRequest() | |||
{} | |||
JackSessionNotifyRequest(int refnum, const char *path, jack_session_event_type_t type, const char *dst) | |||
: JackRequest(JackRequest::kSessionNotify), fEventType(type), fRefNum(refnum) | |||
{ | |||
snprintf(fPath, sizeof(fPath), "%s", path); | |||
if (dst) | |||
snprintf(fDst, sizeof(fDst), "%s", dst); | |||
else | |||
fDst[0] = '\0'; | |||
} | |||
int Read(JackChannelTransaction* trans) | |||
{ | |||
CheckRes(trans->Read(&fRefNum, sizeof(fRefNum))); | |||
CheckRes(trans->Read(&fPath, sizeof(fPath))); | |||
CheckRes(trans->Read(&fDst, sizeof(fDst))); | |||
CheckRes(trans->Read(&fEventType, sizeof(fEventType))); | |||
return 0; | |||
} | |||
int Write(JackChannelTransaction* trans) | |||
{ | |||
CheckRes(JackRequest::Write(trans)); | |||
CheckRes(trans->Write(&fRefNum, sizeof(fRefNum))); | |||
CheckRes(trans->Write(&fPath, sizeof(fPath))); | |||
CheckRes(trans->Write(&fDst, sizeof(fDst))); | |||
CheckRes(trans->Write(&fEventType, sizeof(fEventType))); | |||
return 0; | |||
} | |||
}; | |||
struct JackSessionReplyRequest : public JackRequest | |||
{ | |||
int fRefNum; | |||
JackSessionReplyRequest() | |||
{} | |||
JackSessionReplyRequest(int refnum) | |||
: JackRequest(JackRequest::kSessionReply), fRefNum(refnum) | |||
{} | |||
int Read(JackChannelTransaction* trans) | |||
{ | |||
CheckRes(trans->Read(&fRefNum, sizeof(fRefNum))); | |||
return 0; | |||
} | |||
int Write(JackChannelTransaction* trans) | |||
{ | |||
CheckRes(JackRequest::Write(trans)); | |||
CheckRes(trans->Write(&fRefNum, sizeof(fRefNum))); | |||
return 0; | |||
} | |||
}; | |||
struct JackClientNameResult : public JackResult | |||
{ | |||
char fName[JACK_CLIENT_NAME_SIZE + 1]; | |||
JackClientNameResult(): JackResult() | |||
{} | |||
JackClientNameResult(int32_t result, const char* name) | |||
: JackResult(result) | |||
{ | |||
snprintf(fName, sizeof(fName), "%s", name); | |||
} | |||
int Read(JackChannelTransaction* trans) | |||
{ | |||
CheckRes(JackResult::Read(trans)); | |||
CheckRes(trans->Read(&fName, sizeof(fName))); | |||
return 0; | |||
} | |||
int Write(JackChannelTransaction* trans) | |||
{ | |||
CheckRes(JackResult::Write(trans)); | |||
CheckRes(trans->Write(&fName, sizeof(fName))); | |||
return 0; | |||
} | |||
}; | |||
struct JackUUIDResult : public JackResult | |||
{ | |||
char fUUID[JACK_UUID_SIZE]; | |||
JackUUIDResult(): JackResult() | |||
{} | |||
JackUUIDResult(int32_t result, const char* uuid) | |||
: JackResult(result) | |||
{ | |||
snprintf(fUUID, sizeof(fUUID), "%s", uuid); | |||
} | |||
int Read(JackChannelTransaction* trans) | |||
{ | |||
CheckRes(JackResult::Read(trans)); | |||
CheckRes(trans->Read(&fUUID, sizeof(fUUID))); | |||
return 0; | |||
} | |||
int Write(JackChannelTransaction* trans) | |||
{ | |||
CheckRes(JackResult::Write(trans)); | |||
CheckRes(trans->Write(&fUUID, sizeof(fUUID))); | |||
return 0; | |||
} | |||
}; | |||
struct JackGetUUIDRequest : public JackRequest | |||
{ | |||
char fName[JACK_CLIENT_NAME_SIZE + 1]; | |||
JackGetUUIDRequest() | |||
{} | |||
JackGetUUIDRequest(const char* client_name) | |||
: JackRequest(JackRequest::kGetUUIDByClient) | |||
{ | |||
strncpy(fName, client_name, sizeof(fName)); | |||
} | |||
int Read(JackChannelTransaction* trans) | |||
{ | |||
CheckRes(trans->Read(&fName, sizeof(fName))); | |||
return 0; | |||
} | |||
int Write(JackChannelTransaction* trans) | |||
{ | |||
CheckRes(JackRequest::Write(trans)); | |||
CheckRes(trans->Write(&fName, sizeof(fName))); | |||
return 0; | |||
} | |||
}; | |||
struct JackGetClientNameRequest : public JackRequest | |||
{ | |||
char fUUID[JACK_UUID_SIZE]; | |||
JackGetClientNameRequest() | |||
{} | |||
JackGetClientNameRequest(const char* uuid) | |||
: JackRequest(JackRequest::kGetClientByUUID) | |||
{ | |||
strncpy(fUUID, uuid, sizeof(fUUID)); | |||
} | |||
int Read(JackChannelTransaction* trans) | |||
{ | |||
CheckRes(trans->Read(&fUUID, sizeof(fUUID))); | |||
return 0; | |||
} | |||
int Write(JackChannelTransaction* trans) | |||
{ | |||
CheckRes(JackRequest::Write(trans)); | |||
CheckRes(trans->Write(&fUUID, sizeof(fUUID))); | |||
return 0; | |||
} | |||
}; | |||
struct JackReserveNameRequest : public JackRequest | |||
{ | |||
int fRefNum; | |||
char fName[JACK_CLIENT_NAME_SIZE + 1]; | |||
char fUUID[JACK_UUID_SIZE]; | |||
JackReserveNameRequest() | |||
{} | |||
JackReserveNameRequest(int refnum, const char *name, const char* uuid) | |||
: JackRequest(JackRequest::kReserveClientName), fRefNum(refnum) | |||
{ | |||
strncpy(fName, name, sizeof(fName)); | |||
strncpy(fUUID, uuid, sizeof(fUUID)); | |||
} | |||
int Read(JackChannelTransaction* trans) | |||
{ | |||
CheckRes(trans->Read(&fUUID, sizeof(fUUID))); | |||
CheckRes(trans->Read(&fName, sizeof(fName))); | |||
CheckRes(trans->Read(&fRefNum, sizeof(fRefNum))); | |||
return 0; | |||
} | |||
int Write(JackChannelTransaction* trans) | |||
{ | |||
CheckRes(JackRequest::Write(trans)); | |||
CheckRes(trans->Write(&fUUID, sizeof(fUUID))); | |||
CheckRes(trans->Write(&fName, sizeof(fName))); | |||
CheckRes(trans->Write(&fRefNum, sizeof(fRefNum))); | |||
return 0; | |||
} | |||
}; | |||
/*! | |||
\brief ClientNotification. | |||
@@ -1092,29 +1393,29 @@ struct JackClientNotification | |||
int Read(JackChannelTransaction* trans) | |||
{ | |||
CheckRes(trans->Read(&fName, JACK_CLIENT_NAME_SIZE + 1)); | |||
CheckRes(trans->Read(&fName, sizeof(fName))); | |||
CheckRes(trans->Read(&fRefNum, sizeof(int))); | |||
CheckRes(trans->Read(&fNotify, sizeof(int))); | |||
CheckRes(trans->Read(&fValue1, sizeof(int))); | |||
CheckRes(trans->Read(&fValue2, sizeof(int))); | |||
CheckRes(trans->Read(&fSync, sizeof(int))); | |||
CheckRes(trans->Read(&fMessage, JACK_MESSAGE_SIZE + 1)); | |||
CheckRes(trans->Read(&fMessage, sizeof(fName))); | |||
return 0; | |||
} | |||
int Write(JackChannelTransaction* trans) | |||
{ | |||
CheckRes(trans->Write(&fName, JACK_CLIENT_NAME_SIZE + 1)); | |||
CheckRes(trans->Write(&fName, sizeof(fName))); | |||
CheckRes(trans->Write(&fRefNum, sizeof(int))); | |||
CheckRes(trans->Write(&fNotify, sizeof(int))); | |||
CheckRes(trans->Write(&fValue1, sizeof(int))); | |||
CheckRes(trans->Write(&fValue2, sizeof(int))); | |||
CheckRes(trans->Write(&fSync, sizeof(int))); | |||
CheckRes(trans->Write(&fMessage, JACK_MESSAGE_SIZE + 1)); | |||
CheckRes(trans->Write(&fMessage, sizeof(fName))); | |||
return 0; | |||
} | |||
} POST_PACKED_STRUCTURE; | |||
}; | |||
} // end of namespace | |||
@@ -72,22 +72,22 @@ int JackServer::Open(jack_driver_desc_t* driver_desc, JSList* driver_params) | |||
{ | |||
// TODO: move that in reworked JackServerGlobals::Init() | |||
JackMessageBuffer::Create(); | |||
if ((fAudioDriver = fDriverInfo->Open(driver_desc, fEngine, GetSynchroTable(), driver_params)) == NULL) { | |||
jack_error("Cannot initialize driver"); | |||
goto fail_close1; | |||
} | |||
if (fChannel.Open(fEngineControl->fServerName, this) < 0) { | |||
jack_error("Server channel open error"); | |||
goto fail_close1; | |||
goto fail_close2; | |||
} | |||
if (fEngine->Open() < 0) { | |||
jack_error("Cannot open engine"); | |||
goto fail_close2; | |||
} | |||
if ((fAudioDriver = fDriverInfo->Open(driver_desc, fEngine, GetSynchroTable(), driver_params)) == NULL) { | |||
jack_error("Cannot initialize driver"); | |||
goto fail_close3; | |||
} | |||
if (fFreewheelDriver->Open() < 0) { // before engine open | |||
jack_error("Cannot open driver"); | |||
goto fail_close4; | |||
@@ -109,13 +109,13 @@ fail_close5: | |||
fFreewheelDriver->Close(); | |||
fail_close4: | |||
fAudioDriver->Close(); | |||
fEngine->Close(); | |||
fail_close3: | |||
fEngine->Close(); | |||
fChannel.Close(); | |||
fail_close2: | |||
fChannel.Close(); | |||
fAudioDriver->Close(); | |||
fail_close1: | |||
JackMessageBuffer::Destroy(); | |||
@@ -136,25 +136,25 @@ int JackServer::Close() | |||
return 0; | |||
} | |||
int JackServer::InternalClientLoad(const char* client_name, const char* so_name, const char* objet_data, int options, int* int_ref, int* status) | |||
int JackServer::InternalClientLoad(const char* client_name, const char* so_name, const char* objet_data, int options, int* int_ref, int uuid, int* status) | |||
{ | |||
JackLoadableInternalClient* client = new JackLoadableInternalClient1(JackServerGlobals::fInstance, GetSynchroTable(), objet_data); | |||
assert(client); | |||
return InternalClientLoadAux(client, so_name, client_name, options, int_ref, status); | |||
return InternalClientLoadAux(client, so_name, client_name, options, int_ref, uuid, status); | |||
} | |||
int JackServer::InternalClientLoad(const char* client_name, const char* so_name, const JSList * parameters, int options, int* int_ref, int* status) | |||
int JackServer::InternalClientLoad(const char* client_name, const char* so_name, const JSList * parameters, int options, int* int_ref, int uuid, int* status) | |||
{ | |||
JackLoadableInternalClient* client = new JackLoadableInternalClient2(JackServerGlobals::fInstance, GetSynchroTable(), parameters); | |||
assert(client); | |||
return InternalClientLoadAux(client, so_name, client_name, options, int_ref, status); | |||
return InternalClientLoadAux(client, so_name, client_name, options, int_ref, uuid, status); | |||
} | |||
int JackServer::InternalClientLoadAux(JackLoadableInternalClient* client, const char* so_name, const char* client_name, int options, int* int_ref, int* status) | |||
int JackServer::InternalClientLoadAux(JackLoadableInternalClient* client, const char* so_name, const char* client_name, int options, int* int_ref, int uuid, int* status) | |||
{ | |||
// Clear status | |||
*status = 0; | |||
if ((client->Init(so_name) < 0) || (client->Open(JACK_DEFAULT_SERVER_NAME, client_name, (jack_options_t)options, (jack_status_t*)status) < 0)) { | |||
if ((client->Init(so_name) < 0) || (client->Open(JACK_DEFAULT_SERVER_NAME, client_name, uuid, (jack_options_t)options, (jack_status_t*)status) < 0)) { | |||
delete client; | |||
int my_status1 = *status | JackFailure; | |||
*status = (jack_status_t)my_status1; | |||
@@ -58,7 +58,7 @@ class SERVER_EXPORT JackServer | |||
JackSynchro fSynchroTable[CLIENT_NUM]; | |||
bool fFreewheel; | |||
int InternalClientLoadAux(JackLoadableInternalClient* client, const char* so_name, const char* client_name, int options, int* int_ref, int* status); | |||
int InternalClientLoadAux(JackLoadableInternalClient* client, const char* so_name, const char* client_name, int options, int* int_ref, int uuid, int* status); | |||
public: | |||
@@ -77,8 +77,8 @@ class SERVER_EXPORT JackServer | |||
// Command thread : API | |||
int SetBufferSize(jack_nframes_t buffer_size); | |||
int SetFreewheel(bool onoff); | |||
int InternalClientLoad(const char* client_name, const char* so_name, const char* objet_data, int options, int* int_ref, int* status); | |||
int InternalClientLoad(const char* client_name, const char* so_name, const JSList * parameters, int options, int* int_ref, int* status); | |||
int InternalClientLoad(const char* client_name, const char* so_name, const char* objet_data, int options, int* int_ref, int uuid, int* status); | |||
int InternalClientLoad(const char* client_name, const char* so_name, const JSList * parameters, int options, int* int_ref, int uuid, int* status); | |||
void ClientKill(int refnum); | |||
// Transport management | |||
@@ -53,7 +53,7 @@ using namespace Jack; | |||
jack_client_t* jack_client_new_aux(const char* client_name, jack_options_t options, jack_status_t* status) | |||
{ | |||
jack_varargs_t va; /* variable arguments */ | |||
jack_varargs_t va; /* variable arguments */ | |||
jack_status_t my_status; | |||
JackClient* client; | |||
@@ -64,8 +64,8 @@ jack_client_t* jack_client_new_aux(const char* client_name, jack_options_t optio | |||
jack_log("jack_client_new %s", client_name); | |||
if (status == NULL) /* no status from caller? */ | |||
status = &my_status; /* use local status word */ | |||
if (status == NULL) /* no status from caller? */ | |||
status = &my_status; /* use local status word */ | |||
*status = (jack_status_t)0; | |||
/* validate parameters */ | |||
@@ -90,7 +90,7 @@ jack_client_t* jack_client_new_aux(const char* client_name, jack_options_t optio | |||
client = new JackInternalClient(JackServerGlobals::fInstance, GetSynchroTable()); | |||
} | |||
int res = client->Open(va.server_name, client_name, options, status); | |||
int res = client->Open(va.server_name, client_name, va.session_id, options, status); | |||
if (res < 0) { | |||
delete client; | |||
JackServerGlobals::Destroy(); // jack server destruction | |||
@@ -141,7 +141,7 @@ jack_client_t* jack_client_open_aux(const char* client_name, jack_options_t opti | |||
client = new JackInternalClient(JackServerGlobals::fInstance, GetSynchroTable()); | |||
} | |||
int res = client->Open(va.server_name, client_name, options, status); | |||
int res = client->Open(va.server_name, client_name, va.session_id, options, status); | |||
if (res < 0) { | |||
delete client; | |||
JackServerGlobals::Destroy(); // jack server destruction | |||
@@ -191,7 +191,7 @@ EXPORT int jack_client_close(jack_client_t* ext_client) | |||
} else { | |||
res = client->Close(); | |||
delete client; | |||
JackServerGlobals::Destroy(); // jack server destruction | |||
JackServerGlobals::Destroy(); // jack server destruction | |||
jack_log("jack_client_close res = %d", res); | |||
} | |||
JackGlobals::fOpenMutex->Unlock(); | |||
@@ -106,6 +106,7 @@ class SERVER_EXPORT JackThreadInterface | |||
int DropSelfRealTime(); // Used when called from thread itself | |||
pthread_t GetThreadID(); | |||
bool IsThread(); | |||
static int AcquireRealTimeImp(pthread_t thread, int priority); | |||
static int AcquireRealTimeImp(pthread_t thread, int priority, UInt64 period, UInt64 computation, UInt64 constraint); | |||
@@ -20,6 +20,7 @@ | |||
#include "JackConstants.h" | |||
#include "JackDriverLoader.h" | |||
#include "JackTools.h" | |||
#include "JackError.h" | |||
#include <stdlib.h> | |||
#include <stdio.h> | |||
#include <assert.h> | |||
@@ -46,6 +47,15 @@ namespace Jack { | |||
{ | |||
throw JackNetException(); | |||
} | |||
int JackTools::MkDir(const char* path) | |||
{ | |||
#ifdef WIN32 | |||
return CreateDirectory(path, NULL) == 0; | |||
#else | |||
return mkdir(path, 0777) != 0; | |||
#endif | |||
} | |||
#define DEFAULT_TMP_DIR "/tmp" | |||
char* jack_tmpdir = (char*)DEFAULT_TMP_DIR; | |||
@@ -22,7 +22,10 @@ | |||
#ifdef WIN32 | |||
#include <windows.h> | |||
#define DIR_SEPARATOR '\\' | |||
#else | |||
#define DIR_SEPARATOR '/' | |||
#include <sys/stat.h> | |||
#include <sys/types.h> | |||
#include <unistd.h> | |||
#include <dirent.h> | |||
@@ -58,6 +61,7 @@ namespace Jack | |||
static void KillServer(); | |||
static int MkDir(const char* path); | |||
static char* UserDir(); | |||
static char* ServerDir ( const char* server_name, char* server_dir ); | |||
static const char* DefaultServerName(); | |||
@@ -196,7 +196,7 @@ int main(int argc, char* argv[]) | |||
{ "help", 0, 0, 'h' }, | |||
{ "port-max", 1, 0, 'p' }, | |||
{ "no-mlock", 0, 0, 'm' }, | |||
{ "name", 0, 0, 'n' }, | |||
{ "name", 1, 0, 'n' }, | |||
{ "unlock", 0, 0, 'u' }, | |||
{ "realtime", 0, 0, 'R' }, | |||
{ "no-realtime", 0, 0, 'r' }, | |||
@@ -439,7 +439,9 @@ int main(int argc, char* argv[]) | |||
goto fail_free1; | |||
} | |||
// Start server | |||
// Setup signals then start server | |||
signals = jackctl_setup_signals(0); | |||
if (!jackctl_server_start(server_ctl, audio_driver_ctl)) { | |||
fprintf(stderr, "Failed to start server\n"); | |||
goto fail_free1; | |||
@@ -474,7 +476,6 @@ int main(int argc, char* argv[]) | |||
notify_server_start(server_name); | |||
// Waits for signal | |||
signals = jackctl_setup_signals(0); | |||
jackctl_wait_signals(signals); | |||
if (!jackctl_server_stop(server_ctl)) | |||
@@ -625,13 +625,16 @@ float jack_cpu_load (jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT; | |||
* name. Exceeding that will cause the port registration to fail and | |||
* return NULL. | |||
* | |||
* The @a port_name must be unique among all ports owned by this client. | |||
* If the name is not unique, the registration will fail. | |||
* | |||
* All ports have a type, which may be any non-NULL and non-zero | |||
* length string, passed as an argument. Some port types are built | |||
* into the JACK API, currently only JACK_DEFAULT_AUDIO_TYPE. | |||
* | |||
* @param client pointer to JACK client structure. | |||
* @param port_name non-empty short name for the new port (not | |||
* including the leading @a "client_name:"). | |||
* including the leading @a "client_name:"). Must be unique. | |||
* @param port_type port type name. If longer than | |||
* jack_port_type_size(), only that many characters are significant. | |||
* @param flags @ref JackPortFlags bit mask. | |||
@@ -105,6 +105,10 @@ jack_midi_max_event_size(void* port_buffer) JACK_OPTIONAL_WEAK_EXPORT; | |||
* messages interspersed with other messages (realtime messages are fine | |||
* when they occur on their own, like other messages). | |||
* | |||
* Events must be written in order, sorted by their sample offsets. | |||
* JACK will not sort the events for you, and will refuse to store | |||
* out-of-order events. | |||
* | |||
* @param port_buffer Buffer to write event to. | |||
* @param time Sample offset of event. | |||
* @param data_size Length of event's raw data in bytes. | |||
@@ -122,6 +126,16 @@ jack_midi_event_reserve(void *port_buffer, | |||
* This function is simply a wrapper for @ref jack_midi_event_reserve | |||
* which writes the event data into the space reserved in the buffer. | |||
* The same restrictions on the MIDI data apply. | |||
* | |||
* Clients must not write more than | |||
* @a data_size bytes into this buffer. Clients must write normalised | |||
* MIDI data to the port - no running status and no (1-byte) realtime | |||
* messages interspersed with other messages (realtime messages are fine | |||
* when they occur on their own, like other messages). | |||
* | |||
* Events must be written in order, sorted by their sample offsets. | |||
* JACK will not sort the events for you, and will refuse to store | |||
* out-of-order events. | |||
* | |||
* @param port_buffer Buffer to write event to. | |||
* @param time Sample offset of event. | |||
@@ -0,0 +1,229 @@ | |||
/* | |||
Copyright (C) 2001 Paul Davis | |||
Copyright (C) 2004 Jack O'Quin | |||
Copyright (C) 2010 Torben Hohn | |||
This program is free software; you can redistribute it and/or modify | |||
it under the terms of the GNU Lesser General Public License as published by | |||
the Free Software Foundation; either version 2.1 of the License, or | |||
(at your option) any later version. | |||
This program is distributed in the hope that it will be useful, | |||
but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
GNU Lesser General Public License for more details. | |||
You should have received a copy of the GNU Lesser General Public License | |||
along with this program; if not, write to the Free Software | |||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |||
*/ | |||
#ifndef __jack_session_h__ | |||
#define __jack_session_h__ | |||
#ifdef __cplusplus | |||
extern "C" { | |||
#endif | |||
#include <jack/types.h> | |||
#include <jack/weakmacros.h> | |||
/** | |||
* @defgroup SessionClientFunctions Session API for clients. | |||
* @{ | |||
*/ | |||
/** | |||
* session event types. | |||
* | |||
* if a client cant save templates, i might just do a normal save. | |||
* | |||
* the rationale, why there is no quit without save, is that a client | |||
* might refuse to quit when it has unsaved data. | |||
* however some other clients might have already quit. | |||
* this results in too much confusion, so we just dont support that. | |||
* the session manager can check, if the saved state is different from a previous | |||
* save, and just remove the saved stuff. | |||
* | |||
* (an inquiry function, whether a quit is ok, followed by a quit event | |||
* would have a race) | |||
*/ | |||
enum JackSessionEventType { | |||
JackSessionSave = 1, | |||
JackSessionSaveAndQuit = 2, | |||
JackSessionSaveTemplate = 3 | |||
}; | |||
typedef enum JackSessionEventType jack_session_event_type_t; | |||
enum JackSessionFlags { | |||
/** | |||
* an error occured while saving. | |||
*/ | |||
JackSessionSaveError = 0x01, | |||
/** | |||
* this reply indicates that a client is part of a multiclient application. | |||
* the command reply is left empty. but the session manager should still | |||
* consider this client part of a session. it will come up due to invocation of another | |||
* client. | |||
*/ | |||
JackSessionChildClient = 0x02 | |||
}; | |||
typedef enum JackSessionFlags jack_session_flags_t; | |||
struct _jack_session_event { | |||
/** | |||
* the actual type of this session event. | |||
*/ | |||
jack_session_event_type_t type; | |||
/** | |||
* session_directory with trailing separator | |||
* this is per client. so the client can do whatever it likes in here. | |||
*/ | |||
const char *session_dir; | |||
/** | |||
* client_uuid which must be specified to jack_client_open on session reload. | |||
* client can specify it in the returned commandline as an option, or just save it | |||
* with the state file. | |||
*/ | |||
const char *client_uuid; | |||
/** | |||
* the command_line is the reply of the client. | |||
* it specifies in a platform dependent way, how the client must be restarted upon session reload. | |||
* | |||
* probably it should contain ${SESSION_DIR} instead of the actual session dir. | |||
* this would basically make the session dir moveable. | |||
* | |||
* ownership of the memory is handed to jack. | |||
* initially set to NULL by jack; | |||
*/ | |||
char *command_line; | |||
/** | |||
* flags to be set by the client. normally left 0. | |||
*/ | |||
jack_session_flags_t flags; | |||
}; | |||
typedef struct _jack_session_event jack_session_event_t; | |||
/** | |||
* Prototype for the client supplied function that is called | |||
* whenever a session notification is sent via jack_session_notify(). | |||
* | |||
* The session_id must be passed to jack_client_open on session reload (this can be | |||
* done by specifying it somehow on the returned command line). | |||
* | |||
* @param event the event_structure. | |||
* @param arg pointer to a client supplied structure | |||
*/ | |||
typedef void (*JackSessionCallback)(jack_session_event_t *event, void *arg); | |||
/** | |||
* Tell the JACK server to call @a save_callback the session handler wants | |||
* to save. | |||
* | |||
* @return 0 on success, otherwise a non-zero error code | |||
*/ | |||
int jack_set_session_callback(jack_client_t *client, | |||
JackSessionCallback session_callback, | |||
void *arg) JACK_WEAK_EXPORT; | |||
/** | |||
* reply to a session_event | |||
* | |||
* this can either be called directly from the callback, or later from a different thread. | |||
* so its possible to just stick the event pointer into a pipe and execute the save code | |||
* from the gui thread. | |||
* | |||
* @return 0 on success, otherwise a non-zero error code | |||
*/ | |||
int jack_session_reply( jack_client_t *client, jack_session_event_t *event ) JACK_WEAK_EXPORT; | |||
/** | |||
* free memory used by a jack_session_event_t | |||
* this also frees the memory used by the command_line pointer. | |||
* if its non NULL. | |||
*/ | |||
void jack_session_event_free (jack_session_event_t *event); | |||
/*@}*/ | |||
/** | |||
* @defgroup JackSessionManagerAPI this API is intended for a sessionmanager. | |||
* this API could be server specific. if we dont reach consensus here, | |||
* we can just drop it. | |||
* i know its a bit clumsy. | |||
* but this api isnt required to be as stable as the client api. | |||
* @{ | |||
*/ | |||
typedef struct { | |||
const char *uuid; | |||
const char *client_name; | |||
const char *command; | |||
jack_session_flags_t flags; | |||
} jack_session_command_t; | |||
/** | |||
* send a save or quit event, to all clients listening for session | |||
* callbacks. the returned strings of the clients are accumulated and | |||
* returned as an array of jack_session_command_t. | |||
* its terminated by ret[i].uuid == NULL | |||
* target == NULL means send to all interested clients. otherwise a clientname | |||
*/ | |||
jack_session_command_t *jack_session_notify (jack_client_t* client, | |||
const char *target, | |||
jack_session_event_type_t type, | |||
const char *path ) JACK_WEAK_EXPORT; | |||
/** | |||
* free the memory allocated by a session command. | |||
*/ | |||
void jack_session_commands_free (jack_session_command_t *cmds) JACK_WEAK_EXPORT; | |||
/** | |||
* get the sessionid for a client name. | |||
* the sessionmanager needs this to reassociate a client_name to the session_id. | |||
*/ | |||
char *jack_get_uuid_for_client_name( jack_client_t *client, const char *client_name ) JACK_WEAK_EXPORT; | |||
/** | |||
* get the client name for a session_id. | |||
* in order to snapshot the graph connections, the sessionmanager needs to map | |||
* session_ids to client names. | |||
*/ | |||
char *jack_get_client_name_by_uuid( jack_client_t *client, const char *client_uuid ) JACK_WEAK_EXPORT; | |||
/** | |||
* reserve a client name and associate it to a uuid. | |||
* when a client later call jack_client_open() and specifies the uuid, | |||
* jackd will assign the reserved name. | |||
* this allows a session manager to know in advance under which client name | |||
* its managed clients will appear. | |||
* | |||
* @return 0 on success, otherwise a non-zero error code | |||
*/ | |||
int | |||
jack_reserve_client_name( jack_client_t *client, const char *name, const char *uuid ) JACK_WEAK_EXPORT; | |||
#ifdef __cplusplus | |||
} | |||
#endif | |||
#endif |
@@ -23,18 +23,17 @@ | |||
#include <jack/systemdeps.h> | |||
typedef int32_t jack_shmsize_t; | |||
/** | |||
* Type used to represent sample frame counts. | |||
*/ | |||
typedef uint32_t jack_nframes_t; | |||
typedef uint32_t jack_nframes_t; | |||
/** | |||
* Maximum value that can be stored in jack_nframes_t | |||
*/ | |||
#define JACK_MAX_FRAMES (4294967295U) /* This should be UINT32_MAX, but C++ has a problem with that. */ | |||
#define JACK_MAX_FRAMES (4294967295U) /* This should be UINT32_MAX, but C++ has a problem with that. */ | |||
/** | |||
* Type used to represent the value of free running | |||
@@ -284,9 +283,9 @@ enum JackPortFlags { | |||
/** | |||
* JackPortIsTerminal means: | |||
* | |||
* for an input port: the data received by the port | |||
* for an input port: the data received by the port | |||
* will not be passed on or made | |||
* available at any other port | |||
* available at any other port | |||
* | |||
* for an output port: the data available at the port | |||
* does not originate from any other port | |||
@@ -345,11 +344,16 @@ enum JackOptions { | |||
* Pass optional <em>(char *) load_init</em> string to the | |||
* jack_initialize() entry point of an internal client. | |||
*/ | |||
JackLoadInit = 0x10 | |||
JackLoadInit = 0x10, | |||
/** | |||
* pass a SessionID Token this allows the sessionmanager to identify the client again. | |||
*/ | |||
JackSessionID = 0x20 | |||
}; | |||
/** Valid options for opening an external client. */ | |||
#define JackOpenOptions (JackServerName|JackNoStartServer|JackUseExactName) | |||
#define JackOpenOptions (JackSessionID|JackServerName|JackNoStartServer|JackUseExactName) | |||
/** Valid options for loading an internal client. */ | |||
#define JackLoadOptions (JackLoadInit|JackLoadName|JackUseExactName) | |||
@@ -456,20 +460,20 @@ typedef enum { | |||
JackTransportRolling = 1, /**< Transport playing */ | |||
JackTransportLooping = 2, /**< For OLD_TRANSPORT, now ignored */ | |||
JackTransportStarting = 3, /**< Waiting for sync ready */ | |||
JackTransportNetStarting = 4, /**< Waiting for sync ready on the network*/ | |||
JackTransportNetStarting = 4, /**< Waiting for sync ready on the network*/ | |||
} jack_transport_state_t; | |||
typedef uint64_t jack_unique_t; /**< Unique ID (opaque) */ | |||
typedef uint64_t jack_unique_t; /**< Unique ID (opaque) */ | |||
/** | |||
* Optional struct jack_position_t fields. | |||
*/ | |||
typedef enum { | |||
JackPositionBBT = 0x10, /**< Bar, Beat, Tick */ | |||
JackPositionTimecode = 0x20, /**< External timecode */ | |||
JackBBTFrameOffset = 0x40, /**< Frame offset of BBT information */ | |||
JackPositionBBT = 0x10, /**< Bar, Beat, Tick */ | |||
JackPositionTimecode = 0x20, /**< External timecode */ | |||
JackBBTFrameOffset = 0x40, /**< Frame offset of BBT information */ | |||
JackAudioVideoRatio = 0x80, /**< audio frames per video frame */ | |||
JackVideoFrameOffset = 0x100 /**< frame offset of first video frame */ | |||
@@ -482,31 +486,31 @@ typedef enum { | |||
typedef struct { | |||
/* these four cannot be set from clients: the server sets them */ | |||
jack_unique_t unique_1; /**< unique ID */ | |||
jack_time_t usecs; /**< monotonic, free-rolling */ | |||
jack_nframes_t frame_rate; /**< current frame rate (per second) */ | |||
jack_nframes_t frame; /**< frame number, always present */ | |||
jack_unique_t unique_1; /**< unique ID */ | |||
jack_time_t usecs; /**< monotonic, free-rolling */ | |||
jack_nframes_t frame_rate; /**< current frame rate (per second) */ | |||
jack_nframes_t frame; /**< frame number, always present */ | |||
jack_position_bits_t valid; /**< which other fields are valid */ | |||
jack_position_bits_t valid; /**< which other fields are valid */ | |||
/* JackPositionBBT fields: */ | |||
int32_t bar; /**< current bar */ | |||
int32_t beat; /**< current beat-within-bar */ | |||
int32_t tick; /**< current tick-within-beat */ | |||
double bar_start_tick; | |||
float beats_per_bar; /**< time signature "numerator" */ | |||
float beat_type; /**< time signature "denominator" */ | |||
double ticks_per_beat; | |||
double beats_per_minute; | |||
/* JackPositionTimecode fields: (EXPERIMENTAL: could change) */ | |||
double frame_time; /**< current time in seconds */ | |||
double next_time; /**< next sequential frame_time | |||
int32_t bar; /**< current bar */ | |||
int32_t beat; /**< current beat-within-bar */ | |||
int32_t tick; /**< current tick-within-beat */ | |||
double bar_start_tick; | |||
float beats_per_bar; /**< time signature "numerator" */ | |||
float beat_type; /**< time signature "denominator" */ | |||
double ticks_per_beat; | |||
double beats_per_minute; | |||
/* JackPositionTimecode fields: (EXPERIMENTAL: could change) */ | |||
double frame_time; /**< current time in seconds */ | |||
double next_time; /**< next sequential frame_time | |||
(unless repositioned) */ | |||
/* JackBBTFrameOffset fields: */ | |||
jack_nframes_t bbt_offset; /**< frame offset for the BBT fields | |||
jack_nframes_t bbt_offset; /**< frame offset for the BBT fields | |||
(the given bar, beat, and tick | |||
values actually refer to a time | |||
frame_offset frames before the | |||
@@ -540,10 +544,10 @@ typedef struct { | |||
/* For binary compatibility, new fields should be allocated from | |||
* this padding area with new valid bits controlling access, so | |||
* the existing structure size and offsets are preserved. */ | |||
int32_t padding[7]; | |||
int32_t padding[7]; | |||
/* When (unique_1 == unique_2) the contents are consistent. */ | |||
jack_unique_t unique_2; /**< unique ID */ | |||
jack_unique_t unique_2; /**< unique ID */ | |||
} jack_position_t; | |||
@@ -620,11 +624,11 @@ typedef void (*JackTimebaseCallback)(jack_transport_state_t state, | |||
*/ | |||
typedef enum { | |||
JackTransportState = 0x1, /**< Transport state */ | |||
JackTransportPosition = 0x2, /**< Frame number */ | |||
JackTransportLoop = 0x4, /**< Loop boundaries (ignored) */ | |||
JackTransportSMPTE = 0x8, /**< SMPTE (ignored) */ | |||
JackTransportBBT = 0x10 /**< Bar, Beat, Tick */ | |||
JackTransportState = 0x1, /**< Transport state */ | |||
JackTransportPosition = 0x2, /**< Frame number */ | |||
JackTransportLoop = 0x4, /**< Loop boundaries (ignored) */ | |||
JackTransportSMPTE = 0x8, /**< SMPTE (ignored) */ | |||
JackTransportBBT = 0x10 /**< Bar, Beat, Tick */ | |||
} jack_transport_bits_t; | |||
@@ -638,17 +642,17 @@ typedef struct { | |||
/* these two cannot be set from clients: the server sets them */ | |||
jack_nframes_t frame_rate; /**< current frame rate (per second) */ | |||
jack_time_t usecs; /**< monotonic, free-rolling */ | |||
jack_nframes_t frame_rate; /**< current frame rate (per second) */ | |||
jack_time_t usecs; /**< monotonic, free-rolling */ | |||
jack_transport_bits_t valid; /**< which fields are legal to read */ | |||
jack_transport_bits_t valid; /**< which fields are legal to read */ | |||
jack_transport_state_t transport_state; | |||
jack_nframes_t frame; | |||
jack_nframes_t loop_start; | |||
jack_nframes_t loop_end; | |||
long smpte_offset; /**< SMPTE offset (from frame 0) */ | |||
float smpte_frame_rate; /**< 29.97, 30, 24 etc. */ | |||
long smpte_offset; /**< SMPTE offset (from frame 0) */ | |||
float smpte_frame_rate; /**< 29.97, 30, 24 etc. */ | |||
int bar; | |||
int beat; | |||
@@ -32,14 +32,15 @@ extern "C" | |||
/* variable argument structure */ | |||
typedef struct { | |||
char *server_name; /* server name */ | |||
char *load_name; /* load module name */ | |||
char *load_init; /* initialization string */ | |||
char *server_name; /* server name */ | |||
char *load_name; /* load module name */ | |||
char *load_init; /* initialization string */ | |||
int session_id; /* requested session_id */ | |||
} | |||
jack_varargs_t; | |||
static const char* jack_default_server_name (void) | |||
{ | |||
{ | |||
const char *server_name; | |||
if ((server_name = getenv("JACK_DEFAULT_SERVER")) == NULL) | |||
server_name = "default"; | |||
@@ -47,13 +48,14 @@ extern "C" | |||
} | |||
static inline void jack_varargs_init (jack_varargs_t *va) | |||
{ | |||
{ | |||
memset (va, 0, sizeof(jack_varargs_t)); | |||
va->server_name = (char*)jack_default_server_name(); | |||
va->session_id = -1; | |||
} | |||
static inline void jack_varargs_parse (jack_options_t options, va_list ap, jack_varargs_t *va) | |||
{ | |||
{ | |||
// initialize default settings | |||
jack_varargs_init (va); | |||
@@ -66,6 +68,11 @@ extern "C" | |||
va->load_name = va_arg(ap, char *); | |||
if ((options & JackLoadInit)) | |||
va->load_init = va_arg(ap, char *); | |||
if ((options & JackSessionID)) { | |||
char *sid = va_arg(ap, char *); | |||
if (sid) | |||
va->session_id = atoi( sid ); | |||
} | |||
} | |||
#ifdef __cplusplus | |||
@@ -97,7 +97,7 @@ def build(bld): | |||
'../posix/JackPosixThread.cpp', | |||
'../macosx/JackMachThread.cpp', | |||
'../macosx/JackMachSemaphore.cpp', | |||
'../macosx/JackMachPort.cpp', | |||
'../posix/JackSocket.cpp', | |||
'../macosx/JackMachTime.c', | |||
] | |||
includes = ['../macosx', '../macosx/RPC', '../posix'] + includes | |||
@@ -152,11 +152,9 @@ def build(bld): | |||
if bld.env['IS_MACOSX']: | |||
serverlib.source += [ | |||
'../macosx/JackMachServerChannel.cpp', | |||
'../macosx/JackMachNotifyChannel.cpp', | |||
'../macosx/JackMachServerNotifyChannel.cpp', | |||
'../macosx/JackMacEngineRPC.cpp', | |||
'../macosx/RPC/JackRPCClientUser.c', | |||
'../posix/JackSocketServerChannel.cpp', | |||
'../posix/JackSocketNotifyChannel.cpp', | |||
'../posix/JackSocketServerNotifyChannel.cpp', | |||
'../posix/JackNetUnixSocket.cpp', | |||
] | |||
@@ -237,9 +235,7 @@ def build(bld): | |||
if bld.env['IS_MACOSX']: | |||
clientlib.source += [ | |||
'../macosx/JackMachClientChannel.cpp', | |||
'../macosx/RPC/JackRPCEngineUser.c', | |||
'../macosx/JackMacLibClientRPC.cpp', | |||
'../posix/JackSocketClientChannel.cpp', | |||
'../posix/JackPosixServerLaunch.cpp', | |||
] | |||
@@ -323,7 +323,7 @@ jack_controller_patchbay_find_client( | |||
list_for_each(node_ptr, &patchbay_ptr->graph.clients) | |||
{ | |||
client_ptr = list_entry(node_ptr, struct jack_graph_client, siblings); | |||
if (strncmp(client_ptr->name, client_name, client_name_len) == 0) | |||
if (strlen(client_ptr->name) == client_name_len && strncmp(client_ptr->name, client_name, client_name_len) == 0) | |||
{ | |||
return client_ptr; | |||
} | |||
@@ -1,6 +1,6 @@ | |||
/* -*- Mode: C ; c-basic-offset: 4 -*- */ | |||
/* | |||
Copyright (C) 2007,2008 Nedko Arnaudov | |||
Copyright (C) 2007,2008,2010 Nedko Arnaudov | |||
Copyright (C) 2007-2008 Juuso Alasuutari | |||
Copyright (C) 2008 Marc-Olivier Barre | |||
@@ -44,6 +44,8 @@ | |||
#include "sigsegv.h" | |||
#include "svnversion.h" | |||
static char * g_log_filename; | |||
static ino_t g_log_file_ino; | |||
FILE *g_logfile; | |||
char *g_jackdbus_config_dir; | |||
size_t g_jackdbus_config_dir_len; /* without terminating '\0' char */ | |||
@@ -550,6 +552,49 @@ fail: | |||
jack_error ("Ran out of memory trying to construct method return"); | |||
} | |||
static bool jack_dbus_log_open(void) | |||
{ | |||
struct stat st; | |||
int ret; | |||
int retry; | |||
if (g_logfile != NULL) | |||
{ | |||
ret = stat(g_log_filename, &st); | |||
if (ret != 0 || g_log_file_ino != st.st_ino) | |||
{ | |||
fclose(g_logfile); | |||
} | |||
else | |||
{ | |||
return true; | |||
} | |||
} | |||
for (retry = 0; retry < 10; retry++) | |||
{ | |||
g_logfile = fopen(g_log_filename, "a"); | |||
if (g_logfile == NULL) | |||
{ | |||
fprintf(stderr, "Cannot open jackdbus log file \"%s\": %d (%s)\n", g_log_filename, errno, strerror(errno)); | |||
return false; | |||
} | |||
ret = stat(g_log_filename, &st); | |||
if (ret == 0) | |||
{ | |||
g_log_file_ino = st.st_ino; | |||
return true; | |||
} | |||
fclose(g_logfile); | |||
g_logfile = NULL; | |||
} | |||
fprintf(stderr, "Cannot stat just opened jackdbus log file \"%s\": %d (%s). %d retries\n", g_log_filename, errno, strerror(errno), retry); | |||
return false; | |||
} | |||
void | |||
jack_dbus_info_callback(const char *msg) | |||
{ | |||
@@ -560,8 +605,11 @@ jack_dbus_info_callback(const char *msg) | |||
ctime_r(×tamp, timestamp_str); | |||
timestamp_str[24] = 0; | |||
fprintf(g_logfile, "%s: %s\n", timestamp_str, msg); | |||
fflush(g_logfile); | |||
if (jack_dbus_log_open()) | |||
{ | |||
fprintf(g_logfile, "%s: %s\n", timestamp_str, msg); | |||
fflush(g_logfile); | |||
} | |||
} | |||
#define ANSI_BOLD_ON "\033[1m" | |||
@@ -579,8 +627,11 @@ jack_dbus_error_callback(const char *msg) | |||
ctime_r(×tamp, timestamp_str); | |||
timestamp_str[24] = 0; | |||
fprintf(g_logfile, "%s: " ANSI_BOLD_ON ANSI_COLOR_RED "ERROR: %s" ANSI_RESET "\n", timestamp_str, msg); | |||
fflush(g_logfile); | |||
if (jack_dbus_log_open()) | |||
{ | |||
fprintf(g_logfile, "%s: " ANSI_BOLD_ON ANSI_COLOR_RED "ERROR: %s" ANSI_RESET "\n", timestamp_str, msg); | |||
fflush(g_logfile); | |||
} | |||
} | |||
bool | |||
@@ -695,42 +746,39 @@ paths_uninit() | |||
free(g_jackdbus_log_dir); | |||
} | |||
int | |||
log_init() | |||
static bool log_init(void) | |||
{ | |||
char *log_filename; | |||
size_t log_len; | |||
log_len = strlen(JACKDBUS_LOG); | |||
log_filename = malloc(g_jackdbus_log_dir_len + log_len + 1); | |||
if (log_filename == NULL) | |||
g_log_filename = malloc(g_jackdbus_log_dir_len + log_len + 1); | |||
if (g_log_filename == NULL) | |||
{ | |||
fprintf(stderr, "Out of memory\n"); | |||
return FALSE; | |||
return false; | |||
} | |||
memcpy(log_filename, g_jackdbus_log_dir, g_jackdbus_log_dir_len); | |||
memcpy(log_filename + g_jackdbus_log_dir_len, JACKDBUS_LOG, log_len); | |||
log_filename[g_jackdbus_log_dir_len + log_len] = 0; | |||
memcpy(g_log_filename, g_jackdbus_log_dir, g_jackdbus_log_dir_len); | |||
memcpy(g_log_filename + g_jackdbus_log_dir_len, JACKDBUS_LOG, log_len); | |||
g_log_filename[g_jackdbus_log_dir_len + log_len] = 0; | |||
g_logfile = fopen(log_filename, "a"); | |||
if (g_logfile == NULL) | |||
if (!jack_dbus_log_open()) | |||
{ | |||
fprintf(stderr, "Cannot open jackdbus log file \"%s\": %d (%s)\n", log_filename, errno, strerror(errno)); | |||
free(log_filename); | |||
return FALSE; | |||
return false; | |||
} | |||
free(log_filename); | |||
return TRUE; | |||
return true; | |||
} | |||
void | |||
log_uninit() | |||
static void log_uninit(void) | |||
{ | |||
fclose(g_logfile); | |||
if (g_logfile != NULL) | |||
{ | |||
fclose(g_logfile); | |||
} | |||
free(g_log_filename); | |||
} | |||
void | |||
@@ -23,7 +23,7 @@ PROJECT_NAME = "Jack2" | |||
# This could be handy for archiving the generated documentation or | |||
# if some version control system is used. | |||
PROJECT_NUMBER = 1.9.6 | |||
PROJECT_NUMBER = 1.9.7 | |||
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) | |||
# base path where the generated documentation will be put. | |||
@@ -146,7 +146,7 @@ main (int argc, char *argv[]) | |||
if (!ports) | |||
goto error; | |||
for (i = 0; ports[i]; ++i) { | |||
for (i = 0; ports && ports[i]; ++i) { | |||
// skip over any that don't match ALL of the strings presented at command line | |||
skip_port = 0; | |||
for(k = optind; k < argc; k++){ | |||
@@ -227,6 +227,8 @@ main (int argc, char *argv[]) | |||
} | |||
error: | |||
if (ports) | |||
jack_free (ports); | |||
jack_client_close (client); | |||
exit (0); | |||
} |
@@ -266,7 +266,7 @@ process (jack_nframes_t nframes, void *arg) | |||
jack_position_t local_trans_pos; | |||
uint32_t *packet_buf, *packet_bufX; | |||
uint32_t *packet_buf_tx, *packet_bufX; | |||
uint32_t *rx_packet_ptr; | |||
jack_time_t packet_recv_timestamp; | |||
@@ -280,9 +280,9 @@ process (jack_nframes_t nframes, void *arg) | |||
/* Allocate a buffer where both In and Out Buffer will fit */ | |||
packet_buf = alloca ((rx_bufsize > tx_bufsize) ? rx_bufsize : tx_bufsize); | |||
packet_buf_tx = alloca (tx_bufsize); | |||
jacknet_packet_header *pkthdr = (jacknet_packet_header *) packet_buf; | |||
jacknet_packet_header *pkthdr_tx = (jacknet_packet_header *) packet_buf_tx; | |||
/* | |||
* for latency==0 we need to send out the packet before we wait on the reply. | |||
@@ -293,38 +293,38 @@ process (jack_nframes_t nframes, void *arg) | |||
if( latency == 0 ) { | |||
/* reset packet_bufX... */ | |||
packet_bufX = packet_buf + sizeof (jacknet_packet_header) / sizeof (jack_default_audio_sample_t); | |||
packet_bufX = packet_buf_tx + sizeof (jacknet_packet_header) / sizeof (jack_default_audio_sample_t); | |||
/* ---------- Send ---------- */ | |||
render_jack_ports_to_payload (bitdepth, playback_ports, playback_srcs, nframes, | |||
packet_bufX, net_period, dont_htonl_floats); | |||
/* fill in packet hdr */ | |||
pkthdr->transport_state = jack_transport_query (client, &local_trans_pos); | |||
pkthdr->transport_frame = local_trans_pos.frame; | |||
pkthdr->framecnt = framecnt; | |||
pkthdr->latency = latency; | |||
pkthdr->reply_port = reply_port; | |||
pkthdr->sample_rate = jack_get_sample_rate (client); | |||
pkthdr->period_size = nframes; | |||
pkthdr_tx->transport_state = jack_transport_query (client, &local_trans_pos); | |||
pkthdr_tx->transport_frame = local_trans_pos.frame; | |||
pkthdr_tx->framecnt = framecnt; | |||
pkthdr_tx->latency = latency; | |||
pkthdr_tx->reply_port = reply_port; | |||
pkthdr_tx->sample_rate = jack_get_sample_rate (client); | |||
pkthdr_tx->period_size = nframes; | |||
/* playback for us is capture on the other side */ | |||
pkthdr->capture_channels_audio = playback_channels_audio; | |||
pkthdr->playback_channels_audio = capture_channels_audio; | |||
pkthdr->capture_channels_midi = playback_channels_midi; | |||
pkthdr->playback_channels_midi = capture_channels_midi; | |||
pkthdr->mtu = mtu; | |||
pkthdr_tx->capture_channels_audio = playback_channels_audio; | |||
pkthdr_tx->playback_channels_audio = capture_channels_audio; | |||
pkthdr_tx->capture_channels_midi = playback_channels_midi; | |||
pkthdr_tx->playback_channels_midi = capture_channels_midi; | |||
pkthdr_tx->mtu = mtu; | |||
if( freewheeling!= 0 ) | |||
pkthdr->sync_state = (jack_nframes_t)MASTER_FREEWHEELS; | |||
pkthdr_tx->sync_state = (jack_nframes_t)MASTER_FREEWHEELS; | |||
else | |||
pkthdr->sync_state = (jack_nframes_t)deadline_goodness; | |||
pkthdr_tx->sync_state = (jack_nframes_t)deadline_goodness; | |||
//printf("goodness=%d\n", deadline_goodness ); | |||
packet_header_hton (pkthdr); | |||
packet_header_hton (pkthdr_tx); | |||
if (cont_miss < 3*latency+5) { | |||
int r; | |||
for( r=0; r<redundancy; r++ ) | |||
netjack_sendto (outsockfd, (char *) packet_buf, tx_bufsize, 0, &destaddr, sizeof (destaddr), mtu); | |||
netjack_sendto (outsockfd, (char *) packet_buf_tx, tx_bufsize, 0, &destaddr, sizeof (destaddr), mtu); | |||
} | |||
else if (cont_miss > 50+5*latency) | |||
{ | |||
@@ -340,8 +340,6 @@ process (jack_nframes_t nframes, void *arg) | |||
* | |||
*/ | |||
/* reset packet_bufX... */ | |||
packet_bufX = packet_buf + sizeof (jacknet_packet_header) / sizeof (jack_default_audio_sample_t); | |||
if( reply_port ) | |||
input_fd = insockfd; | |||
@@ -374,14 +372,14 @@ process (jack_nframes_t nframes, void *arg) | |||
* to the JACK ports so it can be played. */ | |||
if (size == rx_bufsize) | |||
{ | |||
packet_buf = rx_packet_ptr; | |||
pkthdr = (jacknet_packet_header *) packet_buf; | |||
packet_bufX = packet_buf + sizeof (jacknet_packet_header) / sizeof (jack_default_audio_sample_t); | |||
uint32_t *packet_buf_rx = rx_packet_ptr; | |||
jacknet_packet_header *pkthdr_rx = (jacknet_packet_header *) packet_buf_rx; | |||
packet_bufX = packet_buf_rx + sizeof (jacknet_packet_header) / sizeof (jack_default_audio_sample_t); | |||
// calculate how much time there would have been, if this packet was sent at the deadline. | |||
int recv_time_offset = (int) (jack_get_time() - packet_recv_timestamp); | |||
packet_header_ntoh (pkthdr); | |||
deadline_goodness = recv_time_offset - (int)pkthdr->latency; | |||
packet_header_ntoh (pkthdr_rx); | |||
deadline_goodness = recv_time_offset - (int)pkthdr_rx->latency; | |||
//printf( "deadline goodness = %d ---> off: %d\n", deadline_goodness, recv_time_offset ); | |||
if (cont_miss) | |||
@@ -395,7 +393,7 @@ process (jack_nframes_t nframes, void *arg) | |||
state_currentframe = framecnt; | |||
state_recv_packet_queue_time = recv_time_offset; | |||
state_connected = 1; | |||
sync_state = pkthdr->sync_state; | |||
sync_state = pkthdr_rx->sync_state; | |||
packet_cache_release_packet( global_packcache, framecnt - latency ); | |||
} | |||
/* Second alternative : we've received something that's not | |||
@@ -434,38 +432,38 @@ process (jack_nframes_t nframes, void *arg) | |||
} | |||
if( latency != 0 ) { | |||
/* reset packet_bufX... */ | |||
packet_bufX = packet_buf + sizeof (jacknet_packet_header) / sizeof (jack_default_audio_sample_t); | |||
packet_bufX = packet_buf_tx + sizeof (jacknet_packet_header) / sizeof (jack_default_audio_sample_t); | |||
/* ---------- Send ---------- */ | |||
render_jack_ports_to_payload (bitdepth, playback_ports, playback_srcs, nframes, | |||
packet_bufX, net_period, dont_htonl_floats); | |||
/* fill in packet hdr */ | |||
pkthdr->transport_state = jack_transport_query (client, &local_trans_pos); | |||
pkthdr->transport_frame = local_trans_pos.frame; | |||
pkthdr->framecnt = framecnt; | |||
pkthdr->latency = latency; | |||
pkthdr->reply_port = reply_port; | |||
pkthdr->sample_rate = jack_get_sample_rate (client); | |||
pkthdr->period_size = nframes; | |||
pkthdr_tx->transport_state = jack_transport_query (client, &local_trans_pos); | |||
pkthdr_tx->transport_frame = local_trans_pos.frame; | |||
pkthdr_tx->framecnt = framecnt; | |||
pkthdr_tx->latency = latency; | |||
pkthdr_tx->reply_port = reply_port; | |||
pkthdr_tx->sample_rate = jack_get_sample_rate (client); | |||
pkthdr_tx->period_size = nframes; | |||
/* playback for us is capture on the other side */ | |||
pkthdr->capture_channels_audio = playback_channels_audio; | |||
pkthdr->playback_channels_audio = capture_channels_audio; | |||
pkthdr->capture_channels_midi = playback_channels_midi; | |||
pkthdr->playback_channels_midi = capture_channels_midi; | |||
pkthdr->mtu = mtu; | |||
pkthdr_tx->capture_channels_audio = playback_channels_audio; | |||
pkthdr_tx->playback_channels_audio = capture_channels_audio; | |||
pkthdr_tx->capture_channels_midi = playback_channels_midi; | |||
pkthdr_tx->playback_channels_midi = capture_channels_midi; | |||
pkthdr_tx->mtu = mtu; | |||
if( freewheeling!= 0 ) | |||
pkthdr->sync_state = (jack_nframes_t)MASTER_FREEWHEELS; | |||
pkthdr_tx->sync_state = (jack_nframes_t)MASTER_FREEWHEELS; | |||
else | |||
pkthdr->sync_state = (jack_nframes_t)deadline_goodness; | |||
pkthdr_tx->sync_state = (jack_nframes_t)deadline_goodness; | |||
//printf("goodness=%d\n", deadline_goodness ); | |||
packet_header_hton (pkthdr); | |||
packet_header_hton (pkthdr_tx); | |||
if (cont_miss < 3*latency+5) { | |||
int r; | |||
for( r=0; r<redundancy; r++ ) | |||
netjack_sendto (outsockfd, (char *) packet_buf, tx_bufsize, 0, &destaddr, sizeof (destaddr), mtu); | |||
netjack_sendto (outsockfd, (char *) packet_buf_tx, tx_bufsize, 0, &destaddr, sizeof (destaddr), mtu); | |||
} | |||
else if (cont_miss > 50+5*latency) | |||
{ | |||
@@ -0,0 +1,184 @@ | |||
/* | |||
* session_notify.c -- ultra minimal session manager | |||
* | |||
* Copyright (C) 2010 Torben Hohn. | |||
* | |||
* This program is free software; you can redistribute it and/or modify | |||
* it under the terms of the GNU General Public License as published by | |||
* the Free Software Foundation; either version 2 of the License, or | |||
* (at your option) any later version. | |||
* | |||
* This program is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* GNU General Public License for more details. | |||
* | |||
* You should have received a copy of the GNU General Public License | |||
* along with this program; if not, write to the Free Software | |||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |||
*/ | |||
#include <stdio.h> | |||
#include <errno.h> | |||
#include <unistd.h> | |||
#include <signal.h> | |||
#include <stdlib.h> | |||
#include <string.h> | |||
#include <jack/jack.h> | |||
#include <jack/types.h> | |||
#include <jack/jslist.h> | |||
#include <jack/transport.h> | |||
#include <jack/session.h> | |||
char *package; /* program name */ | |||
jack_client_t *client; | |||
jack_session_event_type_t notify_type; | |||
char *save_path = NULL; | |||
void jack_shutdown(void *arg) | |||
{ | |||
fprintf(stderr, "JACK shut down, exiting ...\n"); | |||
exit(1); | |||
} | |||
void signal_handler(int sig) | |||
{ | |||
jack_client_close(client); | |||
fprintf(stderr, "signal received, exiting ...\n"); | |||
exit(0); | |||
} | |||
void parse_arguments(int argc, char *argv[]) | |||
{ | |||
/* basename $0 */ | |||
package = strrchr(argv[0], '/'); | |||
if (package == 0) | |||
package = argv[0]; | |||
else | |||
package++; | |||
if (argc==2) { | |||
if( !strcmp( argv[1], "quit" ) ) { | |||
notify_type = JackSessionSaveAndQuit; | |||
return; | |||
} | |||
} | |||
if (argc==3) { | |||
if( !strcmp( argv[1], "save" ) ) { | |||
notify_type = JackSessionSave; | |||
save_path = argv[2]; | |||
return; | |||
} | |||
} | |||
fprintf(stderr, "usage: %s quit|save [path]\n", package); | |||
exit(9); | |||
} | |||
typedef struct { | |||
char name[32]; | |||
char uuid[16]; | |||
} uuid_map_t; | |||
JSList *uuid_map = NULL; | |||
void add_uuid_mapping( const char *uuid ) { | |||
char *clientname = jack_get_client_name_by_uuid( client, uuid ); | |||
if( !clientname ) { | |||
printf( "error... cant find client for uuid %s", uuid ); | |||
return; | |||
} | |||
uuid_map_t *mapping = malloc( sizeof(uuid_map_t) ); | |||
snprintf( mapping->uuid, sizeof(mapping->uuid), "%s", uuid ); | |||
snprintf( mapping->name, sizeof(mapping->name), "%s", clientname ); | |||
uuid_map = jack_slist_append( uuid_map, mapping ); | |||
} | |||
char *map_port_name_to_uuid_port( const char *port_name ) | |||
{ | |||
JSList *node; | |||
char retval[300]; | |||
char *port_component = strchr( port_name,':' ); | |||
char *client_component = strdup( port_name ); | |||
strchr( client_component, ':' )[0] = '\0'; | |||
sprintf( retval, "%s", port_name ); | |||
for( node=uuid_map; node; node=jack_slist_next(node) ) { | |||
uuid_map_t *mapping = node->data; | |||
if( !strcmp( mapping->name, client_component ) ) { | |||
sprintf( retval, "%s%s", mapping->uuid, port_component ); | |||
break; | |||
} | |||
} | |||
return strdup(retval); | |||
} | |||
int main(int argc, char *argv[]) | |||
{ | |||
parse_arguments(argc, argv); | |||
jack_session_command_t *retval; | |||
int k,i,j; | |||
/* become a JACK client */ | |||
if ((client = jack_client_open(package, JackNullOption, NULL)) == 0) { | |||
fprintf(stderr, "JACK server not running?\n"); | |||
exit(1); | |||
} | |||
signal(SIGQUIT, signal_handler); | |||
signal(SIGTERM, signal_handler); | |||
signal(SIGHUP, signal_handler); | |||
signal(SIGINT, signal_handler); | |||
jack_on_shutdown(client, jack_shutdown, 0); | |||
jack_activate(client); | |||
retval = jack_session_notify( client, NULL, notify_type, save_path ); | |||
printf( "retval = %p\n", retval ); | |||
for(i=0; retval[i].uuid; i++ ) { | |||
printf( "export SESSION_DIR=\"%s%s/\"\n", save_path, retval[i].client_name ); | |||
printf( "%s &\n", retval[i].command ); | |||
add_uuid_mapping(retval[i].uuid); | |||
} | |||
printf( "sleep 10\n" ); | |||
for(k=0; retval[k].uuid; k++ ) { | |||
char* port_regexp = alloca( jack_client_name_size()+3 ); | |||
char* client_name = jack_get_client_name_by_uuid( client, retval[k].uuid ); | |||
snprintf( port_regexp, jack_client_name_size()+3, "%s:.*", client_name ); | |||
jack_free(client_name); | |||
const char **ports = jack_get_ports( client, port_regexp, NULL, 0 ); | |||
if( !ports ) { | |||
continue; | |||
} | |||
for (i = 0; ports[i]; ++i) { | |||
const char **connections; | |||
if ((connections = jack_port_get_all_connections (client, jack_port_by_name(client, ports[i]))) != 0) { | |||
for (j = 0; connections[j]; j++) { | |||
char *src = map_port_name_to_uuid_port( ports[i] ); | |||
char *dst = map_port_name_to_uuid_port( connections[j] ); | |||
printf( "jack_connect -u \"%s\" \"%s\"\n", src, dst ); | |||
} | |||
jack_free (connections); | |||
} | |||
} | |||
jack_free(ports); | |||
} | |||
jack_session_commands_free(retval); | |||
jack_client_close(client); | |||
return 0; | |||
} |
@@ -0,0 +1,202 @@ | |||
/** @file simple_session_client.c | |||
* | |||
* @brief This simple client demonstrates the most basic features of JACK | |||
* as they would be used by many applications. | |||
* this version also adds session manager functionality. | |||
*/ | |||
#include <stdio.h> | |||
#include <errno.h> | |||
#include <unistd.h> | |||
#include <stdlib.h> | |||
#include <string.h> | |||
#include <jack/jack.h> | |||
#include <jack/types.h> | |||
#include <jack/session.h> | |||
jack_port_t *input_port; | |||
jack_port_t *output_port; | |||
jack_client_t *client; | |||
int simple_quit = 0; | |||
/** | |||
* The process callback for this JACK application is called in a | |||
* special realtime thread once for each audio cycle. | |||
* | |||
* This client does nothing more than copy data from its input | |||
* port to its output port. It will exit when stopped by | |||
* the user (e.g. using Ctrl-C on a unix-ish operating system) | |||
*/ | |||
int | |||
process (jack_nframes_t nframes, void *arg) | |||
{ | |||
jack_default_audio_sample_t *in, *out; | |||
in = jack_port_get_buffer (input_port, nframes); | |||
out = jack_port_get_buffer (output_port, nframes); | |||
memcpy (out, in, | |||
sizeof (jack_default_audio_sample_t) * nframes); | |||
return 0; | |||
} | |||
void | |||
session_callback (jack_session_event_t *event, void *arg) | |||
{ | |||
char retval[100]; | |||
printf ("session notification\n"); | |||
printf ("path %s, uuid %s, type: %s\n", event->session_dir, event->client_uuid, event->type == JackSessionSave ? "save" : "quit"); | |||
snprintf (retval, 100, "jack_simple_session_client %s", event->client_uuid); | |||
event->command_line = strdup (retval); | |||
jack_session_reply( client, event ); | |||
if (event->type == JackSessionSaveAndQuit) { | |||
simple_quit = 1; | |||
} | |||
jack_session_event_free (event); | |||
} | |||
/** | |||
* JACK calls this shutdown_callback if the server ever shuts down or | |||
* decides to disconnect the client. | |||
*/ | |||
void | |||
jack_shutdown (void *arg) | |||
{ | |||
exit (1); | |||
} | |||
int | |||
main (int argc, char *argv[]) | |||
{ | |||
const char **ports; | |||
const char *client_name = "simple"; | |||
jack_status_t status; | |||
/* open a client connection to the JACK server */ | |||
if( argc == 1 ) | |||
client = jack_client_open (client_name, JackNullOption, &status ); | |||
else if( argc == 2 ) | |||
client = jack_client_open (client_name, JackSessionID, &status, argv[1] ); | |||
if (client == NULL) { | |||
fprintf (stderr, "jack_client_open() failed, " | |||
"status = 0x%2.0x\n", status); | |||
if (status & JackServerFailed) { | |||
fprintf (stderr, "Unable to connect to JACK server\n"); | |||
} | |||
exit (1); | |||
} | |||
if (status & JackServerStarted) { | |||
fprintf (stderr, "JACK server started\n"); | |||
} | |||
if (status & JackNameNotUnique) { | |||
client_name = jack_get_client_name(client); | |||
fprintf (stderr, "unique name `%s' assigned\n", client_name); | |||
} | |||
/* tell the JACK server to call `process()' whenever | |||
there is work to be done. | |||
*/ | |||
jack_set_process_callback (client, process, 0); | |||
/* tell the JACK server to call `jack_shutdown()' if | |||
it ever shuts down, either entirely, or if it | |||
just decides to stop calling us. | |||
*/ | |||
jack_on_shutdown (client, jack_shutdown, 0); | |||
/* tell the JACK server to call `session_callback()' if | |||
the session is saved. | |||
*/ | |||
jack_set_session_callback (client, session_callback, NULL); | |||
/* display the current sample rate. | |||
*/ | |||
printf ("engine sample rate: %" PRIu32 "\n", | |||
jack_get_sample_rate (client)); | |||
/* create two ports */ | |||
input_port = jack_port_register (client, "input", | |||
JACK_DEFAULT_AUDIO_TYPE, | |||
JackPortIsInput, 0); | |||
output_port = jack_port_register (client, "output", | |||
JACK_DEFAULT_AUDIO_TYPE, | |||
JackPortIsOutput, 0); | |||
if ((input_port == NULL) || (output_port == NULL)) { | |||
fprintf(stderr, "no more JACK ports available\n"); | |||
exit (1); | |||
} | |||
/* Tell the JACK server that we are ready to roll. Our | |||
* process() callback will start running now. */ | |||
if (jack_activate (client)) { | |||
fprintf (stderr, "cannot activate client"); | |||
exit (1); | |||
} | |||
/* Connect the ports. You can't do this before the client is | |||
* activated, because we can't make connections to clients | |||
* that aren't running. Note the confusing (but necessary) | |||
* orientation of the driver backend ports: playback ports are | |||
* "input" to the backend, and capture ports are "output" from | |||
* it. | |||
*/ | |||
/* only do the autoconnect when not reloading from a session. | |||
* in case of a session reload, the SM will restore our connections | |||
*/ | |||
if (argc==1) { | |||
ports = jack_get_ports (client, NULL, NULL, | |||
JackPortIsPhysical|JackPortIsOutput); | |||
if (ports == NULL) { | |||
fprintf(stderr, "no physical capture ports\n"); | |||
exit (1); | |||
} | |||
if (jack_connect (client, ports[0], jack_port_name (input_port))) { | |||
fprintf (stderr, "cannot connect input ports\n"); | |||
} | |||
free (ports); | |||
ports = jack_get_ports (client, NULL, NULL, | |||
JackPortIsPhysical|JackPortIsInput); | |||
if (ports == NULL) { | |||
fprintf(stderr, "no physical playback ports\n"); | |||
exit (1); | |||
} | |||
if (jack_connect (client, jack_port_name (output_port), ports[0])) { | |||
fprintf (stderr, "cannot connect output ports\n"); | |||
} | |||
free (ports); | |||
} | |||
/* keep running until until we get a quit event */ | |||
while (!simple_quit) | |||
sleep(1); | |||
jack_client_close (client); | |||
exit (0); | |||
} |
@@ -22,6 +22,8 @@ example_programs = { | |||
'jack_monitor_client' : 'monitor_client.c', | |||
'jack_thru' : 'thru_client.c', | |||
'jack_cpu_load' : 'cpu_load.c', | |||
'jack_simple_session_client' : 'simple_session_client.c', | |||
'jack_session_notify' : 'session_notify.c', | |||
'jack_server_control' : 'server_control.cpp', | |||
'jack_net_slave' : 'netslave.c', | |||
'jack_net_master' : 'netmaster.c', | |||
@@ -120,7 +120,7 @@ get_control_device_name (const char * device_name) | |||
char tmp[5]; | |||
strncpy(tmp, strstr(device_name, "hw"), 4); | |||
tmp[4] = '\0'; | |||
//jack_log("control device %s", tmp); | |||
jack_info("control device %s",tmp); | |||
ctl_name = strdup(tmp); | |||
} else { | |||
ctl_name = strdup(device_name); | |||
@@ -151,21 +151,16 @@ JackAlsaDriver::alsa_driver_check_card_type (alsa_driver_t *driver) | |||
if ((err = snd_ctl_open (&driver->ctl_handle, ctl_name, 0)) < 0) { | |||
jack_error ("control open \"%s\" (%s)", ctl_name, | |||
snd_strerror(err)); | |||
return -1; | |||
} | |||
if ((err = snd_ctl_card_info(driver->ctl_handle, card_info)) < 0) { | |||
} else if ((err = snd_ctl_card_info(driver->ctl_handle, card_info)) < 0) { | |||
jack_error ("control hardware info \"%s\" (%s)", | |||
driver->alsa_name_playback, snd_strerror (err)); | |||
snd_ctl_close (driver->ctl_handle); | |||
return -1; | |||
} | |||
driver->alsa_driver = strdup(snd_ctl_card_info_get_driver (card_info)); | |||
jack_info("Using ALSA driver %s running on card %i - %s", driver->alsa_driver, snd_ctl_card_info_get_card(card_info), snd_ctl_card_info_get_longname(card_info)); | |||
free(ctl_name); | |||
return alsa_driver_check_capabilities (driver); | |||
} | |||
@@ -1171,7 +1166,6 @@ JackAlsaDriver::alsa_driver_restart (alsa_driver_t *driver) | |||
if (res && driver->midi) | |||
(driver->midi->stop)(driver->midi); | |||
return res; | |||
} | |||
@@ -1181,8 +1175,6 @@ JackAlsaDriver::alsa_driver_xrun_recovery (alsa_driver_t *driver, float *delayed | |||
snd_pcm_status_t *status; | |||
int res; | |||
jack_error("alsa_driver_xrun_recovery"); | |||
snd_pcm_status_alloca(&status); | |||
if (driver->capture_handle) { | |||
@@ -1205,7 +1197,7 @@ JackAlsaDriver::alsa_driver_xrun_recovery (alsa_driver_t *driver, float *delayed | |||
snd_pcm_status_get_trigger_tstamp(status, &tstamp); | |||
timersub(&now, &tstamp, &diff); | |||
*delayed_usecs = diff.tv_sec * 1000000.0 + diff.tv_usec; | |||
jack_error("\n\n**** alsa_pcm: xrun of at least %.3f msecs\n\n", *delayed_usecs / 1000.0); | |||
jack_error("**** alsa_pcm: xrun of at least %.3f msecs", *delayed_usecs / 1000.0); | |||
} | |||
if (alsa_driver_restart (driver)) { | |||
@@ -1371,7 +1363,7 @@ JackAlsaDriver::alsa_driver_wait (alsa_driver_t *driver, int extra_fd, int *stat | |||
/* if POLLIN was the only bit set, we're OK */ | |||
*status = 0; | |||
if (driver->pfd[nfds-1].revents == POLLIN) { | |||
if (driver->pfd[nfds-1].revents != POLLIN) { | |||
jack_error("driver->pfd[nfds-1].revents == POLLIN"); | |||
} | |||
return (driver->pfd[nfds-1].revents == POLLIN) ? 0 : -1; | |||
@@ -1585,7 +1577,6 @@ JackAlsaDriver::alsa_driver_read (alsa_driver_t *driver, jack_nframes_t nframes) | |||
jack_error ("ALSA: could not complete read of %" | |||
PRIu32 " frames: error = %d\n", contiguous, err); | |||
jack_error ("ALSA: could not complete read of %d frames: error = %d", contiguous, err); | |||
return -1; | |||
} | |||
@@ -1725,7 +1716,6 @@ JackAlsaDriver::alsa_driver_write (alsa_driver_t* driver, jack_nframes_t nframes | |||
offset, contiguous)) < 0) { | |||
jack_error ("ALSA: could not complete playback of %" | |||
PRIu32 " frames: error = %d", contiguous, err); | |||
jack_error ("ALSA: could not complete playback of %d frames: error = %d", contiguous, err); | |||
if (err != EPIPE && err != ESTRPIPE) | |||
return -1; | |||
} | |||
@@ -1750,11 +1740,6 @@ JackAlsaDriver::alsa_driver_delete (alsa_driver_t *driver) | |||
} | |||
jack_slist_free (driver->clock_sync_listeners); | |||
if (driver->ctl_handle) { | |||
snd_ctl_close (driver->ctl_handle); | |||
driver->ctl_handle = 0; | |||
} | |||
if (driver->ctl_handle) { | |||
snd_ctl_close (driver->ctl_handle); | |||
driver->ctl_handle = 0; | |||
@@ -2328,6 +2313,8 @@ int JackAlsaDriver::Read() | |||
jack_nframes_t nframes; | |||
fDelayedUsecs = 0.f; | |||
retry: | |||
nframes = alsa_driver_wait((alsa_driver_t *)fDriver, -1, &wait_status, &fDelayedUsecs); | |||
if (wait_status < 0) | |||
@@ -2339,11 +2326,11 @@ int JackAlsaDriver::Read() | |||
*/ | |||
jack_log("ALSA XRun wait_status = %d", wait_status); | |||
NotifyXRun(fBeginDateUst, fDelayedUsecs); | |||
return -1; | |||
goto retry; /* recoverable error*/ | |||
} | |||
if (nframes != fEngineControl->fBufferSize) | |||
jack_log("JackAlsaDriver::Read error nframes = %ld", nframes); | |||
jack_log("JackAlsaDriver::Read warning nframes = %ld", nframes); | |||
// Has to be done before read | |||
JackDriver::CycleIncTime(); | |||
@@ -2631,352 +2618,352 @@ get_dither_constraint() | |||
return constraint_ptr; | |||
} | |||
static int | |||
dither_opt (char c, DitherAlgorithm* dither) | |||
{ | |||
switch (c) { | |||
case '-': | |||
case 'n': | |||
*dither = None; | |||
break; | |||
case 'r': | |||
*dither = Rectangular; | |||
break; | |||
case 's': | |||
*dither = Shaped; | |||
break; | |||
case 't': | |||
*dither = Triangular; | |||
break; | |||
default: | |||
fprintf (stderr, "ALSA driver: illegal dithering mode %c\n", c); | |||
return -1; | |||
} | |||
return 0; | |||
static int | |||
dither_opt (char c, DitherAlgorithm* dither) | |||
{ | |||
switch (c) { | |||
case '-': | |||
case 'n': | |||
*dither = None; | |||
break; | |||
case 'r': | |||
*dither = Rectangular; | |||
break; | |||
case 's': | |||
*dither = Shaped; | |||
break; | |||
case 't': | |||
*dither = Triangular; | |||
break; | |||
default: | |||
fprintf (stderr, "ALSA driver: illegal dithering mode %c\n", c); | |||
return -1; | |||
} | |||
return 0; | |||
} | |||
SERVER_EXPORT const jack_driver_desc_t* driver_get_descriptor () | |||
{ | |||
jack_driver_desc_t * desc; | |||
jack_driver_param_desc_t * params; | |||
unsigned int i; | |||
desc = (jack_driver_desc_t*)calloc (1, sizeof (jack_driver_desc_t)); | |||
strcpy(desc->name, "alsa"); // size MUST be less then JACK_DRIVER_NAME_MAX + 1 | |||
strcpy(desc->desc, "Linux ALSA API based audio backend"); // size MUST be less then JACK_DRIVER_PARAM_DESC + 1 | |||
desc->nparams = 18; | |||
params = (jack_driver_param_desc_t*)calloc (desc->nparams, sizeof (jack_driver_param_desc_t)); | |||
i = 0; | |||
strcpy (params[i].name, "capture"); | |||
params[i].character = 'C'; | |||
params[i].type = JackDriverParamString; | |||
strcpy (params[i].value.str, "none"); | |||
strcpy (params[i].short_desc, | |||
"Provide capture ports. Optionally set device"); | |||
strcpy (params[i].long_desc, params[i].short_desc); | |||
i++; | |||
strcpy (params[i].name, "playback"); | |||
params[i].character = 'P'; | |||
params[i].type = JackDriverParamString; | |||
strcpy (params[i].value.str, "none"); | |||
strcpy (params[i].short_desc, | |||
"Provide playback ports. Optionally set device"); | |||
strcpy (params[i].long_desc, params[i].short_desc); | |||
i++; | |||
strcpy (params[i].name, "device"); | |||
params[i].character = 'd'; | |||
params[i].type = JackDriverParamString; | |||
strcpy (params[i].value.str, "hw:0"); | |||
strcpy (params[i].short_desc, "ALSA device name"); | |||
strcpy (params[i].long_desc, params[i].short_desc); | |||
params[i].constraint = enum_alsa_devices(); | |||
i++; | |||
strcpy (params[i].name, "rate"); | |||
params[i].character = 'r'; | |||
params[i].type = JackDriverParamUInt; | |||
params[i].value.ui = 48000U; | |||
strcpy (params[i].short_desc, "Sample rate"); | |||
strcpy (params[i].long_desc, params[i].short_desc); | |||
i++; | |||
strcpy (params[i].name, "period"); | |||
params[i].character = 'p'; | |||
params[i].type = JackDriverParamUInt; | |||
params[i].value.ui = 1024U; | |||
strcpy (params[i].short_desc, "Frames per period"); | |||
strcpy (params[i].long_desc, params[i].short_desc); | |||
i++; | |||
strcpy (params[i].name, "nperiods"); | |||
params[i].character = 'n'; | |||
params[i].type = JackDriverParamUInt; | |||
params[i].value.ui = 2U; | |||
strcpy (params[i].short_desc, "Number of periods of playback latency"); | |||
strcpy (params[i].long_desc, params[i].short_desc); | |||
i++; | |||
strcpy (params[i].name, "hwmon"); | |||
params[i].character = 'H'; | |||
params[i].type = JackDriverParamBool; | |||
params[i].value.i = 0; | |||
strcpy (params[i].short_desc, "Hardware monitoring, if available"); | |||
strcpy (params[i].long_desc, params[i].short_desc); | |||
i++; | |||
strcpy (params[i].name, "hwmeter"); | |||
params[i].character = 'M'; | |||
params[i].type = JackDriverParamBool; | |||
params[i].value.i = 0; | |||
strcpy (params[i].short_desc, "Hardware metering, if available"); | |||
strcpy (params[i].long_desc, params[i].short_desc); | |||
i++; | |||
strcpy (params[i].name, "duplex"); | |||
params[i].character = 'D'; | |||
params[i].type = JackDriverParamBool; | |||
params[i].value.i = 1; | |||
strcpy (params[i].short_desc, | |||
"Provide both capture and playback ports"); | |||
strcpy (params[i].long_desc, params[i].short_desc); | |||
i++; | |||
strcpy (params[i].name, "softmode"); | |||
params[i].character = 's'; | |||
params[i].type = JackDriverParamBool; | |||
params[i].value.i = 0; | |||
strcpy (params[i].short_desc, "Soft-mode, no xrun handling"); | |||
strcpy (params[i].long_desc, params[i].short_desc); | |||
i++; | |||
strcpy (params[i].name, "monitor"); | |||
params[i].character = 'm'; | |||
params[i].type = JackDriverParamBool; | |||
params[i].value.i = 0; | |||
strcpy (params[i].short_desc, "Provide monitor ports for the output"); | |||
strcpy (params[i].long_desc, params[i].short_desc); | |||
i++; | |||
strcpy (params[i].name, "dither"); | |||
params[i].character = 'z'; | |||
params[i].type = JackDriverParamChar; | |||
params[i].value.c = 'n'; | |||
strcpy (params[i].short_desc, "Dithering mode"); | |||
strcpy (params[i].long_desc, | |||
"Dithering mode:\n" | |||
" n - none\n" | |||
" r - rectangular\n" | |||
" s - shaped\n" | |||
" t - triangular"); | |||
params[i].constraint = get_dither_constraint(); | |||
i++; | |||
strcpy (params[i].name, "inchannels"); | |||
params[i].character = 'i'; | |||
params[i].type = JackDriverParamUInt; | |||
params[i].value.i = 0; | |||
strcpy (params[i].short_desc, | |||
"Number of capture channels (defaults to hardware max)"); | |||
strcpy (params[i].long_desc, params[i].short_desc); | |||
i++; | |||
strcpy (params[i].name, "outchannels"); | |||
params[i].character = 'o'; | |||
params[i].type = JackDriverParamUInt; | |||
params[i].value.i = 0; | |||
strcpy (params[i].short_desc, | |||
"Number of playback channels (defaults to hardware max)"); | |||
strcpy (params[i].long_desc, params[i].short_desc); | |||
i++; | |||
strcpy (params[i].name, "shorts"); | |||
params[i].character = 'S'; | |||
params[i].type = JackDriverParamBool; | |||
params[i].value.i = FALSE; | |||
strcpy (params[i].short_desc, "Try 16-bit samples before 32-bit"); | |||
strcpy (params[i].long_desc, params[i].short_desc); | |||
i++; | |||
strcpy (params[i].name, "input-latency"); | |||
params[i].character = 'I'; | |||
params[i].type = JackDriverParamUInt; | |||
params[i].value.i = 0; | |||
strcpy (params[i].short_desc, "Extra input latency (frames)"); | |||
strcpy (params[i].long_desc, params[i].short_desc); | |||
i++; | |||
strcpy (params[i].name, "output-latency"); | |||
params[i].character = 'O'; | |||
params[i].type = JackDriverParamUInt; | |||
params[i].value.i = 0; | |||
strcpy (params[i].short_desc, "Extra output latency (frames)"); | |||
strcpy (params[i].long_desc, params[i].short_desc); | |||
i++; | |||
strcpy (params[i].name, "midi-driver"); | |||
params[i].character = 'X'; | |||
params[i].type = JackDriverParamString; | |||
strcpy (params[i].value.str, "none"); | |||
strcpy (params[i].short_desc, "ALSA MIDI driver name (seq|raw)"); | |||
strcpy (params[i].long_desc, | |||
"ALSA MIDI driver:\n" | |||
" none - no MIDI driver\n" | |||
" seq - ALSA Sequencer driver\n" | |||
" raw - ALSA RawMIDI driver\n"); | |||
params[i].constraint = get_midi_driver_constraint(); | |||
desc->params = params; | |||
return desc; | |||
} | |||
SERVER_EXPORT Jack::JackDriverClientInterface* driver_initialize(Jack::JackLockedEngine* engine, Jack::JackSynchro* table, const JSList* params) | |||
{ | |||
jack_nframes_t srate = 48000; | |||
jack_nframes_t frames_per_interrupt = 1024; | |||
unsigned long user_nperiods = 2; | |||
const char *playback_pcm_name = "hw:0"; | |||
const char *capture_pcm_name = "hw:0"; | |||
int hw_monitoring = FALSE; | |||
int hw_metering = FALSE; | |||
int capture = FALSE; | |||
int playback = FALSE; | |||
int soft_mode = FALSE; | |||
int monitor = FALSE; | |||
DitherAlgorithm dither = None; | |||
int user_capture_nchnls = 0; | |||
int user_playback_nchnls = 0; | |||
int shorts_first = FALSE; | |||
jack_nframes_t systemic_input_latency = 0; | |||
jack_nframes_t systemic_output_latency = 0; | |||
const JSList * node; | |||
const jack_driver_param_t * param; | |||
const char *midi_driver = "none"; | |||
for (node = params; node; node = jack_slist_next (node)) { | |||
param = (const jack_driver_param_t *) node->data; | |||
switch (param->character) { | |||
case 'C': | |||
capture = TRUE; | |||
if (strcmp (param->value.str, "none") != 0) { | |||
capture_pcm_name = strdup (param->value.str); | |||
jack_log("capture device %s", capture_pcm_name); | |||
} | |||
break; | |||
SERVER_EXPORT const jack_driver_desc_t* driver_get_descriptor () | |||
{ | |||
jack_driver_desc_t * desc; | |||
jack_driver_param_desc_t * params; | |||
unsigned int i; | |||
case 'P': | |||
playback = TRUE; | |||
if (strcmp (param->value.str, "none") != 0) { | |||
playback_pcm_name = strdup (param->value.str); | |||
jack_log("playback device %s", playback_pcm_name); | |||
} | |||
break; | |||
desc = (jack_driver_desc_t*)calloc (1, sizeof (jack_driver_desc_t)); | |||
strcpy(desc->name, "alsa"); // size MUST be less then JACK_DRIVER_NAME_MAX + 1 | |||
strcpy(desc->desc, "Linux ALSA API based audio backend"); // size MUST be less then JACK_DRIVER_PARAM_DESC + 1 | |||
desc->nparams = 18; | |||
params = (jack_driver_param_desc_t*)calloc (desc->nparams, sizeof (jack_driver_param_desc_t)); | |||
i = 0; | |||
strcpy (params[i].name, "capture"); | |||
params[i].character = 'C'; | |||
params[i].type = JackDriverParamString; | |||
strcpy (params[i].value.str, "none"); | |||
strcpy (params[i].short_desc, | |||
"Provide capture ports. Optionally set device"); | |||
strcpy (params[i].long_desc, params[i].short_desc); | |||
i++; | |||
strcpy (params[i].name, "playback"); | |||
params[i].character = 'P'; | |||
params[i].type = JackDriverParamString; | |||
strcpy (params[i].value.str, "none"); | |||
strcpy (params[i].short_desc, | |||
"Provide playback ports. Optionally set device"); | |||
strcpy (params[i].long_desc, params[i].short_desc); | |||
i++; | |||
strcpy (params[i].name, "device"); | |||
params[i].character = 'd'; | |||
params[i].type = JackDriverParamString; | |||
strcpy (params[i].value.str, "hw:0"); | |||
strcpy (params[i].short_desc, "ALSA device name"); | |||
strcpy (params[i].long_desc, params[i].short_desc); | |||
params[i].constraint = enum_alsa_devices(); | |||
i++; | |||
strcpy (params[i].name, "rate"); | |||
params[i].character = 'r'; | |||
params[i].type = JackDriverParamUInt; | |||
params[i].value.ui = 48000U; | |||
strcpy (params[i].short_desc, "Sample rate"); | |||
strcpy (params[i].long_desc, params[i].short_desc); | |||
i++; | |||
strcpy (params[i].name, "period"); | |||
params[i].character = 'p'; | |||
params[i].type = JackDriverParamUInt; | |||
params[i].value.ui = 1024U; | |||
strcpy (params[i].short_desc, "Frames per period"); | |||
strcpy (params[i].long_desc, params[i].short_desc); | |||
i++; | |||
strcpy (params[i].name, "nperiods"); | |||
params[i].character = 'n'; | |||
params[i].type = JackDriverParamUInt; | |||
params[i].value.ui = 2U; | |||
strcpy (params[i].short_desc, "Number of periods of playback latency"); | |||
strcpy (params[i].long_desc, params[i].short_desc); | |||
i++; | |||
strcpy (params[i].name, "hwmon"); | |||
params[i].character = 'H'; | |||
params[i].type = JackDriverParamBool; | |||
params[i].value.i = 0; | |||
strcpy (params[i].short_desc, "Hardware monitoring, if available"); | |||
strcpy (params[i].long_desc, params[i].short_desc); | |||
i++; | |||
strcpy (params[i].name, "hwmeter"); | |||
params[i].character = 'M'; | |||
params[i].type = JackDriverParamBool; | |||
params[i].value.i = 0; | |||
strcpy (params[i].short_desc, "Hardware metering, if available"); | |||
strcpy (params[i].long_desc, params[i].short_desc); | |||
i++; | |||
strcpy (params[i].name, "duplex"); | |||
params[i].character = 'D'; | |||
params[i].type = JackDriverParamBool; | |||
params[i].value.i = 1; | |||
strcpy (params[i].short_desc, | |||
"Provide both capture and playback ports"); | |||
strcpy (params[i].long_desc, params[i].short_desc); | |||
i++; | |||
strcpy (params[i].name, "softmode"); | |||
params[i].character = 's'; | |||
params[i].type = JackDriverParamBool; | |||
params[i].value.i = 0; | |||
strcpy (params[i].short_desc, "Soft-mode, no xrun handling"); | |||
strcpy (params[i].long_desc, params[i].short_desc); | |||
i++; | |||
strcpy (params[i].name, "monitor"); | |||
params[i].character = 'm'; | |||
params[i].type = JackDriverParamBool; | |||
params[i].value.i = 0; | |||
strcpy (params[i].short_desc, "Provide monitor ports for the output"); | |||
strcpy (params[i].long_desc, params[i].short_desc); | |||
i++; | |||
strcpy (params[i].name, "dither"); | |||
params[i].character = 'z'; | |||
params[i].type = JackDriverParamChar; | |||
params[i].value.c = 'n'; | |||
strcpy (params[i].short_desc, "Dithering mode"); | |||
strcpy (params[i].long_desc, | |||
"Dithering mode:\n" | |||
" n - none\n" | |||
" r - rectangular\n" | |||
" s - shaped\n" | |||
" t - triangular"); | |||
params[i].constraint = get_dither_constraint(); | |||
i++; | |||
strcpy (params[i].name, "inchannels"); | |||
params[i].character = 'i'; | |||
params[i].type = JackDriverParamUInt; | |||
params[i].value.i = 0; | |||
strcpy (params[i].short_desc, | |||
"Number of capture channels (defaults to hardware max)"); | |||
strcpy (params[i].long_desc, params[i].short_desc); | |||
i++; | |||
strcpy (params[i].name, "outchannels"); | |||
params[i].character = 'o'; | |||
params[i].type = JackDriverParamUInt; | |||
params[i].value.i = 0; | |||
strcpy (params[i].short_desc, | |||
"Number of playback channels (defaults to hardware max)"); | |||
strcpy (params[i].long_desc, params[i].short_desc); | |||
i++; | |||
strcpy (params[i].name, "shorts"); | |||
params[i].character = 'S'; | |||
params[i].type = JackDriverParamBool; | |||
params[i].value.i = FALSE; | |||
strcpy (params[i].short_desc, "Try 16-bit samples before 32-bit"); | |||
strcpy (params[i].long_desc, params[i].short_desc); | |||
i++; | |||
strcpy (params[i].name, "input-latency"); | |||
params[i].character = 'I'; | |||
params[i].type = JackDriverParamUInt; | |||
params[i].value.i = 0; | |||
strcpy (params[i].short_desc, "Extra input latency (frames)"); | |||
strcpy (params[i].long_desc, params[i].short_desc); | |||
i++; | |||
strcpy (params[i].name, "output-latency"); | |||
params[i].character = 'O'; | |||
params[i].type = JackDriverParamUInt; | |||
params[i].value.i = 0; | |||
strcpy (params[i].short_desc, "Extra output latency (frames)"); | |||
strcpy (params[i].long_desc, params[i].short_desc); | |||
i++; | |||
strcpy (params[i].name, "midi-driver"); | |||
params[i].character = 'X'; | |||
params[i].type = JackDriverParamString; | |||
strcpy (params[i].value.str, "none"); | |||
strcpy (params[i].short_desc, "ALSA MIDI driver name (seq|raw)"); | |||
strcpy (params[i].long_desc, | |||
"ALSA MIDI driver:\n" | |||
" none - no MIDI driver\n" | |||
" seq - ALSA Sequencer driver\n" | |||
" raw - ALSA RawMIDI driver\n"); | |||
params[i].constraint = get_midi_driver_constraint(); | |||
desc->params = params; | |||
return desc; | |||
} | |||
case 'D': | |||
playback = TRUE; | |||
capture = TRUE; | |||
break; | |||
SERVER_EXPORT Jack::JackDriverClientInterface* driver_initialize(Jack::JackLockedEngine* engine, Jack::JackSynchro* table, const JSList* params) | |||
{ | |||
jack_nframes_t srate = 48000; | |||
jack_nframes_t frames_per_interrupt = 1024; | |||
unsigned long user_nperiods = 2; | |||
const char *playback_pcm_name = "hw:0"; | |||
const char *capture_pcm_name = "hw:0"; | |||
int hw_monitoring = FALSE; | |||
int hw_metering = FALSE; | |||
int capture = FALSE; | |||
int playback = FALSE; | |||
int soft_mode = FALSE; | |||
int monitor = FALSE; | |||
DitherAlgorithm dither = None; | |||
int user_capture_nchnls = 0; | |||
int user_playback_nchnls = 0; | |||
int shorts_first = FALSE; | |||
jack_nframes_t systemic_input_latency = 0; | |||
jack_nframes_t systemic_output_latency = 0; | |||
const JSList * node; | |||
const jack_driver_param_t * param; | |||
const char *midi_driver = "none"; | |||
for (node = params; node; node = jack_slist_next (node)) { | |||
param = (const jack_driver_param_t *) node->data; | |||
switch (param->character) { | |||
case 'C': | |||
capture = TRUE; | |||
if (strcmp (param->value.str, "none") != 0) { | |||
capture_pcm_name = strdup (param->value.str); | |||
jack_log("capture device %s", capture_pcm_name); | |||
} | |||
break; | |||
case 'd': | |||
case 'P': | |||
playback = TRUE; | |||
if (strcmp (param->value.str, "none") != 0) { | |||
playback_pcm_name = strdup (param->value.str); | |||
capture_pcm_name = strdup (param->value.str); | |||
jack_log("playback device %s", playback_pcm_name); | |||
jack_log("capture device %s", capture_pcm_name); | |||
break; | |||
} | |||
break; | |||
case 'H': | |||
hw_monitoring = param->value.i; | |||
break; | |||
case 'D': | |||
playback = TRUE; | |||
capture = TRUE; | |||
break; | |||
case 'm': | |||
monitor = param->value.i; | |||
break; | |||
case 'd': | |||
playback_pcm_name = strdup (param->value.str); | |||
capture_pcm_name = strdup (param->value.str); | |||
jack_log("playback device %s", playback_pcm_name); | |||
jack_log("capture device %s", capture_pcm_name); | |||
break; | |||
case 'M': | |||
hw_metering = param->value.i; | |||
break; | |||
case 'H': | |||
hw_monitoring = param->value.i; | |||
break; | |||
case 'r': | |||
srate = param->value.ui; | |||
jack_log("apparent rate = %d", srate); | |||
break; | |||
case 'm': | |||
monitor = param->value.i; | |||
break; | |||
case 'p': | |||
frames_per_interrupt = param->value.ui; | |||
jack_log("frames per period = %d", frames_per_interrupt); | |||
break; | |||
case 'M': | |||
hw_metering = param->value.i; | |||
break; | |||
case 'n': | |||
user_nperiods = param->value.ui; | |||
if (user_nperiods < 2) /* enforce minimum value */ | |||
user_nperiods = 2; | |||
break; | |||
case 'r': | |||
srate = param->value.ui; | |||
jack_log("apparent rate = %d", srate); | |||
break; | |||
case 's': | |||
soft_mode = param->value.i; | |||
break; | |||
case 'p': | |||
frames_per_interrupt = param->value.ui; | |||
jack_log("frames per period = %d", frames_per_interrupt); | |||
break; | |||
case 'z': | |||
if (dither_opt (param->value.c, &dither)) { | |||
return NULL; | |||
} | |||
break; | |||
case 'n': | |||
user_nperiods = param->value.ui; | |||
if (user_nperiods < 2) /* enforce minimum value */ | |||
user_nperiods = 2; | |||
break; | |||
case 'i': | |||
user_capture_nchnls = param->value.ui; | |||
break; | |||
case 's': | |||
soft_mode = param->value.i; | |||
break; | |||
case 'o': | |||
user_playback_nchnls = param->value.ui; | |||
break; | |||
case 'z': | |||
if (dither_opt (param->value.c, &dither)) { | |||
return NULL; | |||
} | |||
break; | |||
case 'S': | |||
shorts_first = param->value.i; | |||
break; | |||
case 'i': | |||
user_capture_nchnls = param->value.ui; | |||
break; | |||
case 'I': | |||
systemic_input_latency = param->value.ui; | |||
break; | |||
case 'o': | |||
user_playback_nchnls = param->value.ui; | |||
break; | |||
case 'O': | |||
systemic_output_latency = param->value.ui; | |||
break; | |||
case 'S': | |||
shorts_first = param->value.i; | |||
break; | |||
case 'X': | |||
midi_driver = strdup(param->value.str); | |||
break; | |||
} | |||
} | |||
case 'I': | |||
systemic_input_latency = param->value.ui; | |||
break; | |||
/* duplex is the default */ | |||
if (!capture && !playback) { | |||
capture = TRUE; | |||
playback = TRUE; | |||
} | |||
case 'O': | |||
systemic_output_latency = param->value.ui; | |||
break; | |||
Jack::JackAlsaDriver* alsa_driver = new Jack::JackAlsaDriver("system", "alsa_pcm", engine, table); | |||
Jack::JackDriverClientInterface* threaded_driver = new Jack::JackThreadedDriver(alsa_driver); | |||
// Special open for ALSA driver... | |||
if (alsa_driver->Open(frames_per_interrupt, user_nperiods, srate, hw_monitoring, hw_metering, capture, playback, dither, soft_mode, monitor, | |||
user_capture_nchnls, user_playback_nchnls, shorts_first, capture_pcm_name, playback_pcm_name, | |||
systemic_input_latency, systemic_output_latency, midi_driver) == 0) { | |||
return threaded_driver; | |||
} else { | |||
delete threaded_driver; // Delete the decorated driver | |||
return NULL; | |||
case 'X': | |||
midi_driver = strdup(param->value.str); | |||
break; | |||
} | |||
} | |||
/* duplex is the default */ | |||
if (!capture && !playback) { | |||
capture = TRUE; | |||
playback = TRUE; | |||
} | |||
Jack::JackAlsaDriver* alsa_driver = new Jack::JackAlsaDriver("system", "alsa_pcm", engine, table); | |||
Jack::JackDriverClientInterface* threaded_driver = new Jack::JackThreadedDriver(alsa_driver); | |||
// Special open for ALSA driver... | |||
if (alsa_driver->Open(frames_per_interrupt, user_nperiods, srate, hw_monitoring, hw_metering, capture, playback, dither, soft_mode, monitor, | |||
user_capture_nchnls, user_playback_nchnls, shorts_first, capture_pcm_name, playback_pcm_name, | |||
systemic_input_latency, systemic_output_latency, midi_driver) == 0) { | |||
return threaded_driver; | |||
} else { | |||
delete threaded_driver; // Delete the decorated driver | |||
return NULL; | |||
} | |||
} | |||
#ifdef __cplusplus | |||
} | |||
#endif | |||
@@ -664,6 +664,8 @@ int JackFFADODriver::Read() | |||
int wait_status = 0; | |||
fDelayedUsecs = 0.f; | |||
retry: | |||
jack_nframes_t nframes = ffado_driver_wait(driver, -1, &wait_status, | |||
&fDelayedUsecs); | |||
@@ -678,11 +680,11 @@ int JackFFADODriver::Read() | |||
*/ | |||
jack_log("FFADO XRun"); | |||
NotifyXRun(fBeginDateUst, fDelayedUsecs); | |||
return -1; | |||
goto retry; /* recoverable error*/ | |||
} | |||
if (nframes != fEngineControl->fBufferSize) | |||
jack_log("JackFFADODriver::Read nframes = %ld", nframes); | |||
jack_log("JackFFADODriver::Read warning nframes = %ld", nframes); | |||
// Has to be done before read | |||
JackDriver::CycleIncTime(); | |||
@@ -854,6 +854,8 @@ int JackFreebobDriver::Read() | |||
int wait_status = 0; | |||
fDelayedUsecs = 0.f; | |||
retry: | |||
jack_nframes_t nframes = freebob_driver_wait (driver, -1, &wait_status, | |||
&fDelayedUsecs); | |||
@@ -868,11 +870,11 @@ int JackFreebobDriver::Read() | |||
*/ | |||
jack_log("FreeBoB XRun"); | |||
NotifyXRun(fBeginDateUst, fDelayedUsecs); | |||
return -1; | |||
goto retry; /* recoverable error*/ | |||
} | |||
if (nframes != fEngineControl->fBufferSize) | |||
jack_log("JackFreebobDriver::Read nframes = %ld", nframes); | |||
jack_log("JackFreebobDriver::Read warning nframes = %ld", nframes); | |||
// Has to be done before read | |||
JackDriver::CycleIncTime(); | |||
@@ -7,7 +7,7 @@ | |||
<key>CFBundleExecutable</key> | |||
<string>Jackservermp</string> | |||
<key>CFBundleGetInfoString</key> | |||
<string>Jackdmp 1.9.6, @03-10 Paul Davis, Grame</string> | |||
<string>Jackdmp 1.9.7, @03-10 Paul Davis, Grame</string> | |||
<key>CFBundleIdentifier</key> | |||
<string>com.grame.Jackmp</string> | |||
<key>CFBundleInfoDictionaryVersion</key> | |||
@@ -19,6 +19,6 @@ | |||
<key>CFBundleSignature</key> | |||
<string>????</string> | |||
<key>CFBundleVersion</key> | |||
<string>1.9.6</string> | |||
<string>1.9.7</string> | |||
</dict> | |||
</plist> |
@@ -0,0 +1,55 @@ | |||
/* | |||
Copyright (C) 2004-2005 Grame | |||
This program is free software; you can redistribute it and/or modify | |||
it under the terms of the GNU General Public License as published by | |||
the Free Software Foundation; either version 2 of the License, or | |||
(at your option) any later version. | |||
This program is distributed in the hope that it will be useful, | |||
but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
GNU General Public License for more details. | |||
You should have received a copy of the GNU General Public License | |||
along with this program; if not, write to the Free Software | |||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |||
*/ | |||
#ifndef __JackCompilerDeps_APPLE__ | |||
#define __JackCompilerDeps_APPLE__ | |||
#include "JackConstants.h" | |||
#if __GNUC__ | |||
#ifndef POST_PACKED_STRUCTURE | |||
/* POST_PACKED_STRUCTURE needs to be a macro which | |||
expands into a compiler directive. The directive must | |||
tell the compiler to arrange the preceding structure | |||
declaration so that it is packed on byte-boundaries rather | |||
than use the natural alignment of the processor and/or | |||
compiler. | |||
*/ | |||
#if defined(JACK_32_64) | |||
#define POST_PACKED_STRUCTURE __attribute__((__packed__)) | |||
#else | |||
#define POST_PACKED_STRUCTURE | |||
#endif | |||
#endif | |||
#define MEM_ALIGN(x,y) x __attribute__((aligned(y))) | |||
#define EXPORT __attribute__((visibility("default"))) | |||
#ifdef SERVER_SIDE | |||
#define SERVER_EXPORT __attribute__((visibility("default"))) | |||
#else | |||
#define SERVER_EXPORT | |||
#endif | |||
#else | |||
#define MEM_ALIGN(x,y) x | |||
#define EXPORT | |||
#define SERVER_EXPORT | |||
/* Add other things here for non-gcc platforms for POST_PACKED_STRUCTURE */ | |||
#endif | |||
#endif | |||
@@ -1,250 +0,0 @@ | |||
/* | |||
Copyright (C) 2004-2008 Grame | |||
This program is free software; you can redistribute it and/or modify | |||
it under the terms of the GNU General Public License as published by | |||
the Free Software Foundation; either version 2 of the License, or | |||
(at your option) any later version. | |||
This program is distributed in the hope that it will be useful, | |||
but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
GNU General Public License for more details. | |||
You should have received a copy of the GNU General Public License | |||
along with this program; if not, write to the Free Software | |||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |||
*/ | |||
#include "JackServer.h" | |||
#include "JackNotification.h" | |||
#include "JackLockedEngine.h" | |||
#include "JackRPCEngine.h" | |||
#include "JackMachServerChannel.h" | |||
#include "JackException.h" | |||
#include <assert.h> | |||
using namespace Jack; | |||
//------------------- | |||
// Client management | |||
//------------------- | |||
#define rpc_type kern_return_t // for astyle | |||
rpc_type server_rpc_jack_client_check(mach_port_t private_port, client_name_t name, client_name_t name_res, int protocol, int options, int* status, int* result) | |||
{ | |||
jack_log("rpc_jack_client_check"); | |||
JackMachServerChannel* channel = JackMachServerChannel::fPortTable[private_port]; | |||
assert(channel); | |||
channel->ClientCheck((char*)name, (char*)name_res, protocol, options, status, result); | |||
return KERN_SUCCESS; | |||
} | |||
rpc_type server_rpc_jack_client_open(mach_port_t server_port, client_name_t name, int pid, mach_port_t* private_port, int* shared_engine, int* shared_client, int* shared_graph, int* result) | |||
{ | |||
jack_log("rpc_jack_client_open name = %s", name); | |||
JackMachServerChannel* channel = JackMachServerChannel::fPortTable[server_port]; | |||
assert(channel); | |||
channel->ClientOpen((char*)name, pid, private_port, shared_engine, shared_client, shared_graph, result); | |||
return KERN_SUCCESS; | |||
} | |||
rpc_type server_rpc_jack_client_close(mach_port_t private_port, int refnum, int* result) | |||
{ | |||
jack_log("rpc_jack_client_close"); | |||
JackMachServerChannel* channel = JackMachServerChannel::fPortTable[private_port]; | |||
assert(channel); | |||
channel->ClientClose(private_port, refnum); | |||
*result = 0; | |||
return KERN_SUCCESS; | |||
} | |||
rpc_type server_rpc_jack_client_activate(mach_port_t private_port, int refnum, int is_real_time, int* result) | |||
{ | |||
jack_log("rpc_jack_client_activate"); | |||
JackMachServerChannel* channel = JackMachServerChannel::fPortTable[private_port]; | |||
assert(channel); | |||
*result = channel->GetEngine()->ClientActivate(refnum, is_real_time); | |||
return KERN_SUCCESS; | |||
} | |||
rpc_type server_rpc_jack_client_deactivate(mach_port_t private_port, int refnum, int* result) | |||
{ | |||
jack_log("rpc_jack_client_deactivate"); | |||
JackMachServerChannel* channel = JackMachServerChannel::fPortTable[private_port]; | |||
assert(channel); | |||
*result = channel->GetEngine()->ClientDeactivate(refnum); | |||
return KERN_SUCCESS; | |||
} | |||
//----------------- | |||
// Port management | |||
//----------------- | |||
rpc_type server_rpc_jack_port_register(mach_port_t private_port, int refnum, client_port_name_t name, client_port_type_t type, unsigned int flags, unsigned int buffer_size, unsigned int* port_index, int* result) | |||
{ | |||
jack_log("rpc_jack_port_register ref = %d name = %s", refnum, name); | |||
JackMachServerChannel* channel = JackMachServerChannel::fPortTable[private_port]; | |||
assert(channel); | |||
*result = channel->GetEngine()->PortRegister(refnum, name, type, flags, buffer_size, port_index); | |||
return KERN_SUCCESS; | |||
} | |||
rpc_type server_rpc_jack_port_unregister(mach_port_t private_port, int refnum, int port, int* result) | |||
{ | |||
jack_log("rpc_jack_port_unregister ref = %d port = %d ", refnum, port); | |||
JackMachServerChannel* channel = JackMachServerChannel::fPortTable[private_port]; | |||
assert(channel); | |||
*result = channel->GetEngine()->PortUnRegister(refnum, port); | |||
return KERN_SUCCESS; | |||
} | |||
rpc_type server_rpc_jack_port_connect_name(mach_port_t private_port, int refnum, client_port_name_t src, client_port_name_t dst, int* result) | |||
{ | |||
jack_log("rpc_jack_port_connect_name"); | |||
JackMachServerChannel* channel = JackMachServerChannel::fPortTable[private_port]; | |||
assert(channel); | |||
*result = channel->GetEngine()->PortConnect(refnum, src, dst); | |||
return KERN_SUCCESS; | |||
} | |||
rpc_type server_rpc_jack_port_disconnect_name(mach_port_t private_port, int refnum, client_port_name_t src, client_port_name_t dst, int* result) | |||
{ | |||
jack_log("rpc_jack_port_disconnect_name"); | |||
JackMachServerChannel* channel = JackMachServerChannel::fPortTable[private_port]; | |||
assert(channel); | |||
*result = channel->GetEngine()->PortDisconnect(refnum, src, dst); | |||
return KERN_SUCCESS; | |||
} | |||
rpc_type server_rpc_jack_port_connect(mach_port_t private_port, int refnum, int src, int dst, int* result) | |||
{ | |||
jack_log("rpc_jack_port_connect"); | |||
JackMachServerChannel* channel = JackMachServerChannel::fPortTable[private_port]; | |||
assert(channel); | |||
*result = channel->GetEngine()->PortConnect(refnum, src, dst); | |||
return KERN_SUCCESS; | |||
} | |||
rpc_type server_rpc_jack_port_disconnect(mach_port_t private_port, int refnum, int src, int dst, int* result) | |||
{ | |||
jack_log("rpc_jack_port_disconnect"); | |||
JackMachServerChannel* channel = JackMachServerChannel::fPortTable[private_port]; | |||
assert(channel); | |||
*result = channel->GetEngine()->PortDisconnect(refnum, src, dst); | |||
return KERN_SUCCESS; | |||
} | |||
rpc_type server_rpc_jack_port_rename(mach_port_t private_port, int refnum, int port, client_port_name_t name, int* result) | |||
{ | |||
jack_log("server_rpc_jack_port_rename"); | |||
JackMachServerChannel* channel = JackMachServerChannel::fPortTable[private_port]; | |||
assert(channel); | |||
*result = channel->GetEngine()->PortRename(refnum, port, name); | |||
return KERN_SUCCESS; | |||
} | |||
//------------------------ | |||
// Buffer size, freewheel | |||
//------------------------ | |||
rpc_type server_rpc_jack_set_buffer_size(mach_port_t private_port, int buffer_size, int* result) | |||
{ | |||
jack_log("server_rpc_jack_set_buffer_size"); | |||
JackMachServerChannel* channel = JackMachServerChannel::fPortTable[private_port]; | |||
assert(channel); | |||
*result = channel->GetServer()->SetBufferSize(buffer_size); | |||
return KERN_SUCCESS; | |||
} | |||
rpc_type server_rpc_jack_set_freewheel(mach_port_t private_port, int onoff, int* result) | |||
{ | |||
jack_log("server_rpc_jack_set_freewheel"); | |||
JackMachServerChannel* channel = JackMachServerChannel::fPortTable[private_port]; | |||
assert(channel); | |||
*result = channel->GetServer()->SetFreewheel(onoff); | |||
return KERN_SUCCESS; | |||
} | |||
//---------------------- | |||
// Transport management | |||
//---------------------- | |||
rpc_type server_rpc_jack_release_timebase(mach_port_t private_port, int refnum, int* result) | |||
{ | |||
jack_log("server_rpc_jack_release_timebase"); | |||
JackMachServerChannel* channel = JackMachServerChannel::fPortTable[private_port]; | |||
assert(channel); | |||
*result = channel->GetServer()->ReleaseTimebase(refnum); | |||
return KERN_SUCCESS; | |||
} | |||
rpc_type server_rpc_jack_set_timebase_callback(mach_port_t private_port, int refnum, int conditional, int* result) | |||
{ | |||
jack_log("server_rpc_jack_set_timebase_callback"); | |||
JackMachServerChannel* channel = JackMachServerChannel::fPortTable[private_port]; | |||
assert(channel); | |||
*result = channel->GetServer()->SetTimebaseCallback(refnum, conditional); | |||
return KERN_SUCCESS; | |||
} | |||
//------------------ | |||
// Internal clients | |||
//------------------ | |||
rpc_type server_rpc_jack_get_internal_clientname(mach_port_t private_port, int refnum, int int_ref, client_name_t name_res, int* result) | |||
{ | |||
jack_log("server_rpc_jack_get_internal_clientname"); | |||
JackMachServerChannel* channel = JackMachServerChannel::fPortTable[private_port]; | |||
assert(channel); | |||
*result = channel->GetServer()->GetEngine()->GetInternalClientName(int_ref, (char*)name_res); | |||
return KERN_SUCCESS; | |||
} | |||
rpc_type server_rpc_jack_internal_clienthandle(mach_port_t private_port, int refnum, client_name_t client_name, int* status, int* int_ref, int* result) | |||
{ | |||
jack_log("server_rpc_jack_internal_clienthandle"); | |||
JackMachServerChannel* channel = JackMachServerChannel::fPortTable[private_port]; | |||
assert(channel); | |||
*result = channel->GetServer()->GetEngine()->InternalClientHandle(client_name, status, int_ref); | |||
return KERN_SUCCESS; | |||
} | |||
rpc_type server_rpc_jack_internal_clientload(mach_port_t private_port, int refnum, client_name_t client_name, so_name_t so_name, objet_data_t objet_data, int options, int* status, int* int_ref, int* result) | |||
{ | |||
jack_log("server_rpc_jack_internal_clientload"); | |||
JackMachServerChannel* channel = JackMachServerChannel::fPortTable[private_port]; | |||
assert(channel); | |||
*result = channel->GetServer()->InternalClientLoad(client_name, so_name, objet_data, options, int_ref, status); | |||
return KERN_SUCCESS; | |||
} | |||
rpc_type server_rpc_jack_internal_clientunload(mach_port_t private_port, int refnum, int int_ref, int* status, int* result) | |||
{ | |||
jack_log("server_rpc_jack_internal_clientunload"); | |||
JackMachServerChannel* channel = JackMachServerChannel::fPortTable[private_port]; | |||
assert(channel); | |||
*result = channel->GetServer()->GetEngine()->InternalClientUnload(int_ref, status); | |||
return KERN_SUCCESS; | |||
} | |||
//----------------- | |||
// RT notification | |||
//----------------- | |||
rpc_type server_rpc_jack_client_rt_notify(mach_port_t server_port, int refnum, int notify, int value) | |||
{ | |||
jack_log("rpc_jack_client_rt_notify ref = %d notify = %d value = %d", refnum, notify, value); | |||
JackMachServerChannel* channel = JackMachServerChannel::fPortTable[server_port]; | |||
assert(channel); | |||
assert(channel->GetServer()); | |||
if (notify == kQUIT) { | |||
throw JackQuitException(); | |||
} else { | |||
channel->GetServer()->Notify(refnum, notify, value); | |||
return KERN_SUCCESS; | |||
} | |||
} |
@@ -1,47 +0,0 @@ | |||
/* | |||
Copyright (C) 2004-2008 Grame | |||
This program is free software; you can redistribute it and/or modify | |||
it under the terms of the GNU General Public License as published by | |||
the Free Software Foundation; either version 2 of the License, or | |||
(at your option) any later version. | |||
This program is distributed in the hope that it will be useful, | |||
but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
GNU General Public License for more details. | |||
You should have received a copy of the GNU General Public License | |||
along with this program; if not, write to the Free Software | |||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |||
*/ | |||
#include "JackLibClient.h" | |||
#include "JackMachClientChannel.h" | |||
#include "JackRPCEngine.h" | |||
#include "JackLibGlobals.h" | |||
#include <assert.h> | |||
using namespace Jack; | |||
#define rpc_type kern_return_t // for astyle | |||
rpc_type rpc_jack_client_sync_notify(mach_port_t client_port, int refnum, client_name_t name, int notify, message_t message, int value1, int value2, int* result) | |||
{ | |||
jack_log("rpc_jack_client_sync_notify ref = %ld name = %s notify = %ld message %s val1 = %ld val2 = %ld", refnum, name, notify, message, value1, value2); | |||
JackClient* client = gClientTable[client_port]; | |||
assert(client); | |||
*result = client->ClientNotify(refnum, name, notify, true, message, value1, value2); | |||
return KERN_SUCCESS; | |||
} | |||
rpc_type rpc_jack_client_async_notify(mach_port_t client_port, int refnum, client_name_t name, int notify, message_t message, int value1, int value2) | |||
{ | |||
jack_log("rpc_jack_client_async_notify ref = %ld name = %s notify = %ld message %s val1 = %ld val2 = %ld", refnum, name, notify, message, value1, value2); | |||
JackClient* client = gClientTable[client_port]; | |||
assert(client); | |||
client->ClientNotify(refnum, name, notify, false, message, value1, value2); | |||
return KERN_SUCCESS; | |||
} | |||
@@ -1,334 +0,0 @@ | |||
/* | |||
Copyright (C) 2004-2008 Grame | |||
This program is free software; you can redistribute it and/or modify | |||
it under the terms of the GNU Lesser General Public License as published by | |||
the Free Software Foundation; either version 2.1 of the License, or | |||
(at your option) any later version. | |||
This program is distributed in the hope that it will be useful, | |||
but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
GNU Lesser General Public License for more details. | |||
You should have received a copy of the GNU Lesser General Public License | |||
along with this program; if not, write to the Free Software | |||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |||
*/ | |||
#include "JackMachClientChannel.h" | |||
#include "JackRPCEngine.h" | |||
#include "JackTools.h" | |||
#include "JackRPCClientServer.c" | |||
#include "JackError.h" | |||
#include "JackLibClient.h" | |||
#include "JackMachThread.h" | |||
#include "JackConstants.h" | |||
namespace Jack | |||
{ | |||
std::map<mach_port_t, JackClient*> gClientTable; | |||
JackMachClientChannel::JackMachClientChannel():fPrivatePort(0),fThread(this) | |||
{} | |||
JackMachClientChannel::~JackMachClientChannel() | |||
{} | |||
// Server <===> client | |||
int JackMachClientChannel::ServerCheck(const char* server_name) | |||
{ | |||
jack_log("JackMachClientChannel::ServerCheck = %s", server_name); | |||
char jack_server_entry_name[512]; | |||
snprintf(jack_server_entry_name, sizeof(jack_server_entry_name), "%s.%d_%s", jack_server_entry, JackTools::GetUID(), server_name); | |||
// Connect to server | |||
if (!fServerPort.ConnectPort(jack_server_entry_name)) { | |||
jack_error("Cannot connect to server Mach port"); | |||
return -1; | |||
} else { | |||
return 0; | |||
} | |||
} | |||
int JackMachClientChannel::Open(const char* server_name, const char* name, char* name_res, JackClient* client, jack_options_t options, jack_status_t* status) | |||
{ | |||
jack_log("JackMachClientChannel::Open name = %s", name); | |||
char jack_server_entry_name[512]; | |||
snprintf(jack_server_entry_name, sizeof(jack_server_entry_name), "%s.%d_%s", jack_server_entry, JackTools::GetUID(), server_name); | |||
// Connect to server | |||
if (!fServerPort.ConnectPort(jack_server_entry_name)) { | |||
jack_error("Cannot connect to server Mach port"); | |||
return -1; | |||
} | |||
// Check name in server | |||
int result = 0; | |||
ClientCheck(name, name_res, JACK_PROTOCOL_VERSION, (int)options, (int*)status, &result); | |||
if (result < 0) { | |||
int status1 = *status; | |||
if (status1 & JackVersionError) | |||
jack_error("JACK protocol mismatch %d", JACK_PROTOCOL_VERSION); | |||
else | |||
jack_error("Client name = %s conflits with another running client", name); | |||
return -1; | |||
} | |||
// Prepare local port using client name | |||
char buf[JACK_CLIENT_NAME_SIZE + 1]; | |||
snprintf(buf, sizeof(buf) - 1, "%s:%s", jack_client_entry, name_res); | |||
if (!fClientPort.AllocatePort(buf, 16)) { | |||
jack_error("Cannot allocate client Mach port"); | |||
return -1; | |||
} | |||
gClientTable[fClientPort.GetPort()] = client; | |||
return 0; | |||
} | |||
void JackMachClientChannel::Close() | |||
{ | |||
jack_log("JackMachClientChannel::Close"); | |||
gClientTable.erase(fClientPort.GetPort()); | |||
fServerPort.DisconnectPort(); | |||
fClientPort.DestroyPort(); | |||
if (fPrivatePort != 0) { | |||
kern_return_t res; | |||
if ((res = mach_port_destroy(mach_task_self(), fPrivatePort)) != KERN_SUCCESS) { | |||
jack_error("JackMachClientChannel::Close err = %s", mach_error_string(res)); | |||
} | |||
} | |||
} | |||
int JackMachClientChannel::Start() | |||
{ | |||
jack_log("JackMachClientChannel::Start"); | |||
/* | |||
To be sure notification thread is started before ClientOpen is called. | |||
*/ | |||
if (fThread.StartSync() != 0) { | |||
jack_error("Cannot start Jack client listener"); | |||
return -1; | |||
} else { | |||
return 0; | |||
} | |||
} | |||
void JackMachClientChannel::Stop() | |||
{ | |||
jack_log("JackMachClientChannel::Stop"); | |||
fThread.Kill(); | |||
} | |||
void JackMachClientChannel::ClientCheck(const char* name, char* name_res, int protocol, int options, int* status, int* result) | |||
{ | |||
kern_return_t res = rpc_jack_client_check(fServerPort.GetPort(), (char*)name, name_res, protocol, options, status, result); | |||
if (res != KERN_SUCCESS) { | |||
*result = -1; | |||
jack_error("JackMachClientChannel::ClientCheck err = %s", mach_error_string(res)); | |||
} | |||
} | |||
void JackMachClientChannel::ClientOpen(const char* name, int pid, int* shared_engine, int* shared_client, int* shared_graph, int* result) | |||
{ | |||
kern_return_t res = rpc_jack_client_open(fServerPort.GetPort(), (char*)name, pid, &fPrivatePort, shared_engine, shared_client, shared_graph, result); | |||
if (res != KERN_SUCCESS) { | |||
*result = -1; | |||
jack_error("JackMachClientChannel::ClientOpen err = %s", mach_error_string(res)); | |||
} | |||
} | |||
void JackMachClientChannel::ClientClose(int refnum, int* result) | |||
{ | |||
kern_return_t res = rpc_jack_client_close(fPrivatePort, refnum, result); | |||
if (res != KERN_SUCCESS) { | |||
*result = -1; | |||
jack_error("JackMachClientChannel::ClientClose err = %s", mach_error_string(res)); | |||
} | |||
} | |||
void JackMachClientChannel::ClientActivate(int refnum, int is_real_time, int* result) | |||
{ | |||
kern_return_t res = rpc_jack_client_activate(fPrivatePort, refnum, is_real_time, result); | |||
if (res != KERN_SUCCESS) { | |||
*result = -1; | |||
jack_error("JackMachClientChannel::ClientActivate err = %s", mach_error_string(res)); | |||
} | |||
} | |||
void JackMachClientChannel::ClientDeactivate(int refnum, int* result) | |||
{ | |||
kern_return_t res = rpc_jack_client_deactivate(fPrivatePort, refnum, result); | |||
if (res != KERN_SUCCESS) { | |||
*result = -1; | |||
jack_error("JackMachClientChannel::ClientDeactivate err = %s", mach_error_string(res)); | |||
} | |||
} | |||
void JackMachClientChannel::PortRegister(int refnum, const char* name, const char* type, unsigned int flags, unsigned int buffer_size, jack_port_id_t* port_index, int* result) | |||
{ | |||
kern_return_t res = rpc_jack_port_register(fPrivatePort, refnum, (char*)name, (char*)type, flags, buffer_size, port_index, result); | |||
if (res != KERN_SUCCESS) { | |||
*result = -1; | |||
jack_error("JackMachClientChannel::PortRegister err = %s", mach_error_string(res)); | |||
} | |||
} | |||
void JackMachClientChannel::PortUnRegister(int refnum, jack_port_id_t port_index, int* result) | |||
{ | |||
kern_return_t res = rpc_jack_port_unregister(fPrivatePort, refnum, port_index, result); | |||
if (res != KERN_SUCCESS) { | |||
*result = -1; | |||
jack_error("JackMachClientChannel::PortUnRegister err = %s", mach_error_string(res)); | |||
} | |||
} | |||
void JackMachClientChannel::PortConnect(int refnum, const char* src, const char* dst, int* result) | |||
{ | |||
kern_return_t res = rpc_jack_port_connect_name(fPrivatePort, refnum, (char*)src, (char*)dst, result); | |||
if (res != KERN_SUCCESS) { | |||
jack_error("JackMachClientChannel::PortConnect err = %s", mach_error_string(res)); | |||
} | |||
} | |||
void JackMachClientChannel::PortDisconnect(int refnum, const char* src, const char* dst, int* result) | |||
{ | |||
kern_return_t res = rpc_jack_port_disconnect_name(fPrivatePort, refnum, (char*)src, (char*)dst, result); | |||
if (res != KERN_SUCCESS) { | |||
*result = -1; | |||
jack_error("JackMachClientChannel::PortDisconnect err = %s", mach_error_string(res)); | |||
} | |||
} | |||
void JackMachClientChannel::PortConnect(int refnum, jack_port_id_t src, jack_port_id_t dst, int* result) | |||
{ | |||
kern_return_t res = rpc_jack_port_connect(fPrivatePort, refnum, src, dst, result); | |||
if (res != KERN_SUCCESS) { | |||
*result = -1; | |||
jack_error("JackMachClientChannel::PortConnect err = %s", mach_error_string(res)); | |||
} | |||
} | |||
void JackMachClientChannel::PortDisconnect(int refnum, jack_port_id_t src, jack_port_id_t dst, int* result) | |||
{ | |||
kern_return_t res = rpc_jack_port_disconnect(fPrivatePort, refnum, src, dst, result); | |||
if (res != KERN_SUCCESS) { | |||
*result = -1; | |||
jack_error("JackMachClientChannel::PortDisconnect err = %s", mach_error_string(res)); | |||
} | |||
} | |||
void JackMachClientChannel::PortRename(int refnum, jack_port_id_t port, const char* name, int* result) | |||
{ | |||
kern_return_t res = rpc_jack_port_rename(fPrivatePort, refnum, port, (char*)name, result); | |||
if (res != KERN_SUCCESS) { | |||
*result = -1; | |||
jack_error("JackMachClientChannel::PortRename err = %s", mach_error_string(res)); | |||
} | |||
} | |||
void JackMachClientChannel::SetBufferSize(jack_nframes_t buffer_size, int* result) | |||
{ | |||
kern_return_t res = rpc_jack_set_buffer_size(fPrivatePort, buffer_size, result); | |||
if (res != KERN_SUCCESS) { | |||
*result = -1; | |||
jack_error("JackMachClientChannel::SetBufferSize err = %s", mach_error_string(res)); | |||
} | |||
} | |||
void JackMachClientChannel::SetFreewheel(int onoff, int* result) | |||
{ | |||
kern_return_t res = rpc_jack_set_freewheel(fPrivatePort, onoff, result); | |||
if (res != KERN_SUCCESS) { | |||
*result = -1; | |||
jack_error("JackMachClientChannel::SetFreewheel err = %s", mach_error_string(res)); | |||
} | |||
} | |||
void JackMachClientChannel::ReleaseTimebase(int refnum, int* result) | |||
{ | |||
kern_return_t res = rpc_jack_release_timebase(fPrivatePort, refnum, result); | |||
if (res != KERN_SUCCESS) { | |||
*result = -1; | |||
jack_error("JackMachClientChannel::ReleaseTimebase err = %s", mach_error_string(res)); | |||
} | |||
} | |||
void JackMachClientChannel::SetTimebaseCallback(int refnum, int conditional, int* result) | |||
{ | |||
kern_return_t res = rpc_jack_set_timebase_callback(fPrivatePort, refnum, conditional, result); | |||
if (res != KERN_SUCCESS) { | |||
*result = -1; | |||
jack_error("JackMachClientChannel::SetTimebaseCallback err = %s", mach_error_string(res)); | |||
} | |||
} | |||
void JackMachClientChannel::GetInternalClientName(int refnum, int int_ref, char* name_res, int* result) | |||
{ | |||
kern_return_t res = rpc_jack_get_internal_clientname(fPrivatePort, refnum, int_ref, name_res, result); | |||
if (res != KERN_SUCCESS) { | |||
*result = -1; | |||
jack_error("JackMachClientChannel::GetInternalClientName err = %s", mach_error_string(res)); | |||
} | |||
} | |||
void JackMachClientChannel::InternalClientHandle(int refnum, const char* client_name, int* status, int* int_ref, int* result) | |||
{ | |||
kern_return_t res = rpc_jack_internal_clienthandle(fPrivatePort, refnum, (char*)client_name, status, int_ref, result); | |||
if (res != KERN_SUCCESS) { | |||
*result = -1; | |||
jack_error("JackMachClientChannel::InternalClientHandle err = %s", mach_error_string(res)); | |||
} | |||
} | |||
void JackMachClientChannel::InternalClientLoad(int refnum, const char* client_name, const char* so_name, const char* objet_data, int options, int* status, int* int_ref, int* result) | |||
{ | |||
const char* int_client_name = (client_name) ? client_name : ""; | |||
const char* int_so_name = (so_name) ? so_name : ""; | |||
const char* int_objet_data = (objet_data) ? objet_data : ""; | |||
kern_return_t res = rpc_jack_internal_clientload(fPrivatePort, refnum, (char*)int_client_name, (char*)int_so_name, (char*)int_objet_data, options, status, int_ref, result); | |||
if (res != KERN_SUCCESS) { | |||
*result = -1; | |||
jack_error("JackMachClientChannel::InternalClientLoad err = %s", mach_error_string(res)); | |||
} | |||
} | |||
void JackMachClientChannel::InternalClientUnload(int refnum, int int_ref, int* status, int* result) | |||
{ | |||
kern_return_t res = rpc_jack_internal_clientunload(fPrivatePort, refnum, int_ref, status, result); | |||
if (res != KERN_SUCCESS) { | |||
*result = -1; | |||
jack_error("JackMachClientChannel::InternalClientUnload err = %s", mach_error_string(res)); | |||
} | |||
} | |||
bool JackMachClientChannel::Init() | |||
{ | |||
jack_log("JackMachClientChannel::Init"); | |||
JackClient* client = gClientTable[fClientPort.GetPort()]; | |||
return client->Init(); | |||
} | |||
bool JackMachClientChannel::Execute() | |||
{ | |||
kern_return_t res; | |||
if ((res = mach_msg_server(JackRPCClient_server, 1024, fClientPort.GetPort(), 0)) != KERN_SUCCESS) { | |||
jack_error("JackMachClientChannel::Execute err = %s", mach_error_string(res)); | |||
JackClient* client = gClientTable[fClientPort.GetPort()]; | |||
client->ShutDown(); | |||
return false; | |||
} else { | |||
return true; | |||
} | |||
} | |||
} // end of namespace | |||
@@ -1,99 +0,0 @@ | |||
/* | |||
Copyright (C) 2004-2008 Grame | |||
This program is free software; you can redistribute it and/or modify | |||
it under the terms of the GNU Lesser General Public License as published by | |||
the Free Software Foundation; either version 2.1 of the License, or | |||
(at your option) any later version. | |||
This program is distributed in the hope that it will be useful, | |||
but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
GNU Lesser General Public License for more details. | |||
You should have received a copy of the GNU Lesser General Public License | |||
along with this program; if not, write to the Free Software | |||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |||
*/ | |||
#ifndef __JackMachClientChannel__ | |||
#define __JackMachClientChannel__ | |||
#include "JackChannel.h" | |||
#include "JackMachPort.h" | |||
#include "JackPlatformPlug.h" | |||
#include <map> | |||
namespace Jack | |||
{ | |||
/*! | |||
\brief JackClientChannel using Mach IPC. | |||
*/ | |||
class JackMachClientChannel : public detail::JackClientChannelInterface, public JackRunnableInterface | |||
{ | |||
private: | |||
JackMachPort fClientPort; /*! Mach port to communicate with the server : from server to client */ | |||
JackMachPort fServerPort; /*! Mach port to communicate with the server : from client to server */ | |||
mach_port_t fPrivatePort; | |||
JackThread fThread; /*! Thread to execute the event loop */ | |||
public: | |||
JackMachClientChannel(); | |||
~JackMachClientChannel(); | |||
int Open(const char* server_name, const char* name, char* name_res, JackClient* client, jack_options_t options, jack_status_t* status); | |||
void Close(); | |||
int Start(); | |||
void Stop(); | |||
int ServerCheck(const char* server_name); | |||
void ClientCheck(const char* name, char* name_res, int protocol, int options, int* status, int* result); | |||
void ClientOpen(const char* name, int pid, int* shared_engine, int* shared_client, int* shared_graph, int* result); | |||
void ClientOpen(const char* name, int* ref, JackEngineControl** shared_engine, JackGraphManager** shared_manager, JackClientInterface* client, int* result) | |||
{} | |||
void ClientClose(int refnum, int* result); | |||
void ClientActivate(int refnum, int is_real_time, int* result); | |||
void ClientDeactivate(int refnum, int* result); | |||
void PortRegister(int refnum, const char* name, const char* type, unsigned int flags, unsigned int buffer_size, jack_port_id_t* port_index, int* result); | |||
void PortUnRegister(int refnum, jack_port_id_t port_index, int* result); | |||
void PortConnect(int refnum, const char* src, const char* dst, int* result); | |||
void PortDisconnect(int refnum, const char* src, const char* dst, int* result); | |||
void PortConnect(int refnum, jack_port_id_t src, jack_port_id_t dst, int* result); | |||
void PortDisconnect(int refnum, jack_port_id_t src, jack_port_id_t dst, int* result); | |||
void PortRename(int refnum, jack_port_id_t port, const char* name, int* result); | |||
void SetBufferSize(jack_nframes_t buffer_size, int* result); | |||
void SetFreewheel(int onoff, int* result); | |||
void ReleaseTimebase(int refnum, int* result); | |||
void SetTimebaseCallback(int refnum, int conditional, int* result); | |||
void GetInternalClientName(int refnum, int int_ref, char* name_res, int* result); | |||
void InternalClientHandle(int refnum, const char* client_name, int* status, int* int_ref, int* result); | |||
void InternalClientLoad(int refnum, const char* client_name, const char* so_name, const char* objet_data, int options, int* status, int* int_ref, int* result); | |||
void InternalClientUnload(int refnum, int int_ref, int* status, int* result); | |||
// JackRunnableInterface interface | |||
bool Init(); | |||
bool Execute(); | |||
}; | |||
extern std::map<mach_port_t, JackClient*> gClientTable; | |||
} // end of namespace | |||
#endif | |||
@@ -1,67 +0,0 @@ | |||
/* | |||
Copyright (C) 2004-2008 Grame | |||
This program is free software; you can redistribute it and/or modify | |||
it under the terms of the GNU Lesser General Public License as published by | |||
the Free Software Foundation; either version 2.1 of the License, or | |||
(at your option) any later version. | |||
This program is distributed in the hope that it will be useful, | |||
but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
GNU Lesser General Public License for more details. | |||
You should have received a copy of the GNU Lesser General Public License | |||
along with this program; if not, write to the Free Software | |||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |||
*/ | |||
#include "JackMachNotifyChannel.h" | |||
#include "JackRPCClient.h" | |||
#include "JackError.h" | |||
#include "JackConstants.h" | |||
#include <stdio.h> | |||
namespace Jack | |||
{ | |||
// Server side : server to client | |||
int JackMachNotifyChannel::Open(const char* name) | |||
{ | |||
jack_log("JackMachNotifyChannel::Open name = %s", name); | |||
char buf[256]; | |||
snprintf(buf, sizeof(buf) - 1, "%s:%s", jack_client_entry, name); | |||
// Connect to client notification port using client name | |||
if (!fClientPort.ConnectPort(buf)) { | |||
jack_error("Cannot connect client port"); | |||
return -1; | |||
} else { | |||
return 0; | |||
} | |||
} | |||
void JackMachNotifyChannel::Close() | |||
{ | |||
fClientPort.DisconnectPort(); | |||
} | |||
void JackMachNotifyChannel::ClientNotify(int refnum, const char* name, int notify, int sync, const char* message, int value1, int value2, int* result) | |||
{ | |||
kern_return_t res = (sync) | |||
? rpc_jack_client_sync_notify(fClientPort.GetPort(), refnum, (char*)name, notify, (char*)message, value1, value2, result) | |||
: rpc_jack_client_async_notify(fClientPort.GetPort(), refnum, (char*)name, notify, (char*)message, value1, value2); | |||
if (res == KERN_SUCCESS) { | |||
*result = 0; | |||
} else { | |||
jack_error("JackMachNotifyChannel::ClientNotify: name = %s notify = %ld err = %s", name, notify, mach_error_string(res)); | |||
*result = -1; | |||
} | |||
} | |||
} // end of namespace | |||
@@ -1,53 +0,0 @@ | |||
/* | |||
Copyright (C) 2004-2008 Grame | |||
This program is free software; you can redistribute it and/or modify | |||
it under the terms of the GNU Lesser General Public License as published by | |||
the Free Software Foundation; either version 2.1 of the License, or | |||
(at your option) any later version. | |||
This program is distributed in the hope that it will be useful, | |||
but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
GNU Lesser General Public License for more details. | |||
You should have received a copy of the GNU Lesser General Public License | |||
along with this program; if not, write to the Free Software | |||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |||
*/ | |||
#ifndef __JackMachNotifyChannel__ | |||
#define __JackMachNotifyChannel__ | |||
#include "JackMachPort.h" | |||
namespace Jack | |||
{ | |||
/*! | |||
\brief JackNotifyChannel using Mach IPC. | |||
*/ | |||
class JackMachNotifyChannel | |||
{ | |||
private: | |||
JackMachPort fClientPort; /*! Mach port to communicate with the client : from server to client */ | |||
public: | |||
JackMachNotifyChannel() | |||
{} | |||
int Open(const char* name); // Open the Server/Client connection | |||
void Close(); // Close the Server/Client connection | |||
void ClientNotify(int refnum, const char* name, int notify, int sync, const char* message, int value1, int value2, int* result); | |||
}; | |||
} // end of namespace | |||
#endif | |||
@@ -1,295 +0,0 @@ | |||
/* | |||
Copyright (C) 2004-2008 Grame | |||
This program is free software; you can redistribute it and/or modify | |||
it under the terms of the GNU Lesser General Public License as published by | |||
the Free Software Foundation; either version 2.1 of the License, or | |||
(at your option) any later version. | |||
This program is distributed in the hope that it will be useful, | |||
but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
GNU Lesser General Public License for more details. | |||
You should have received a copy of the GNU Lesser General Public License | |||
along with this program; if not, write to the Free Software | |||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |||
*/ | |||
#include "JackMachPort.h" | |||
#include "JackError.h" | |||
namespace Jack | |||
{ | |||
// Server side : port is published to be accessible from other processes (clients) | |||
bool JackMachPort::AllocatePort(const char* name, int queue) | |||
{ | |||
mach_port_t task = mach_task_self(); | |||
kern_return_t res; | |||
if ((res = task_get_bootstrap_port(task, &fBootPort)) != KERN_SUCCESS) { | |||
jack_error("AllocatePort: Can't find bootstrap mach port err = %s", mach_error_string(res)); | |||
return false; | |||
} | |||
if ((res = mach_port_allocate(task, MACH_PORT_RIGHT_RECEIVE, &fServerPort)) != KERN_SUCCESS) { | |||
jack_error("AllocatePort: can't allocate mach port err = %s", mach_error_string(res)); | |||
return false; | |||
} | |||
if ((res = mach_port_insert_right(task, fServerPort, fServerPort, MACH_MSG_TYPE_MAKE_SEND)) != KERN_SUCCESS) { | |||
jack_error("AllocatePort: error inserting mach rights err = %s", mach_error_string(res)); | |||
return false; | |||
} | |||
if ((res = bootstrap_register(fBootPort, (char*)name, fServerPort)) != KERN_SUCCESS) { | |||
jack_error("Allocate: can't check in mach port name = %s err = %s", name, mach_error_string(res)); | |||
return false; | |||
} | |||
mach_port_limits_t qlimits; | |||
mach_msg_type_number_t info_cnt = MACH_PORT_LIMITS_INFO_COUNT; | |||
if ((res = mach_port_get_attributes(task, fServerPort, MACH_PORT_LIMITS_INFO, (mach_port_info_t) & qlimits, &info_cnt)) != KERN_SUCCESS) { | |||
jack_error("Allocate: mach_port_get_attributes error err = %s", name, mach_error_string(res)); | |||
} | |||
jack_log("AllocatePort: queue limit %ld", qlimits.mpl_qlimit); | |||
if (queue > 0) { | |||
qlimits.mpl_qlimit = queue; | |||
if ((res = mach_port_set_attributes(task, fServerPort, MACH_PORT_LIMITS_INFO, (mach_port_info_t) & qlimits, MACH_PORT_LIMITS_INFO_COUNT)) != KERN_SUCCESS) { | |||
jack_error("Allocate: mach_port_set_attributes error name = %s err = %s", name, mach_error_string(res)); | |||
} | |||
} | |||
return true; | |||
} | |||
// Server side : port is published to be accessible from other processes (clients) | |||
bool JackMachPort::AllocatePort(const char* name) | |||
{ | |||
return AllocatePort(name, -1); | |||
} | |||
// Client side : get the published port from server | |||
bool JackMachPort::ConnectPort(const char* name) | |||
{ | |||
kern_return_t res; | |||
jack_log("JackMachPort::ConnectPort %s", name); | |||
if ((res = task_get_bootstrap_port(mach_task_self(), &fBootPort)) != KERN_SUCCESS) { | |||
jack_error("ConnectPort: can't find bootstrap port err = %s", mach_error_string(res)); | |||
return false; | |||
} | |||
if ((res = bootstrap_look_up(fBootPort, (char*)name, &fServerPort)) != KERN_SUCCESS) { | |||
jack_error("ConnectPort: can't find mach server port name = %s err = %s", name, mach_error_string(res)); | |||
return false; | |||
} | |||
return true; | |||
} | |||
bool JackMachPort::DisconnectPort() | |||
{ | |||
jack_log("JackMacRPC::DisconnectPort"); | |||
kern_return_t res; | |||
mach_port_t task = mach_task_self(); | |||
if (fBootPort != 0) { | |||
if ((res = mach_port_deallocate(task, fBootPort)) != KERN_SUCCESS) { | |||
jack_error("JackMacRPC::DisconnectPort mach_port_deallocate fBootPort err = %s", mach_error_string(res)); | |||
} | |||
} | |||
if (fServerPort != 0) { | |||
if ((res = mach_port_deallocate(task, fServerPort)) != KERN_SUCCESS) { | |||
jack_error("JackMacRPC::DisconnectPort mach_port_deallocate fServerPort err = %s", mach_error_string(res)); | |||
} | |||
} | |||
return true; | |||
} | |||
bool JackMachPort::DestroyPort() | |||
{ | |||
jack_log("JackMacRPC::DisconnectPort"); | |||
kern_return_t res; | |||
mach_port_t task = mach_task_self(); | |||
if (fBootPort != 0) { | |||
if ((res = mach_port_deallocate(task, fBootPort)) != KERN_SUCCESS) { | |||
jack_error("JackMacRPC::DisconnectPort mach_port_deallocate fBootPort err = %s", mach_error_string(res)); | |||
} | |||
} | |||
if (fServerPort != 0) { | |||
if ((res = mach_port_destroy(task, fServerPort)) != KERN_SUCCESS) { | |||
jack_error("JackMacRPC::DisconnectPort mach_port_destroy fServerPort err = %s", mach_error_string(res)); | |||
} | |||
} | |||
return true; | |||
} | |||
mach_port_t JackMachPort::GetPort() | |||
{ | |||
return fServerPort; | |||
} | |||
bool JackMachPortSet::AllocatePort(const char* name, int queue) | |||
{ | |||
kern_return_t res; | |||
mach_port_t task = mach_task_self(); | |||
jack_log("JackMachPortSet::AllocatePort"); | |||
if ((res = task_get_bootstrap_port(task, &fBootPort)) != KERN_SUCCESS) { | |||
jack_error("AllocatePort: Can't find bootstrap mach port err = %s", mach_error_string(res)); | |||
return false; | |||
} | |||
if ((res = mach_port_allocate(task, MACH_PORT_RIGHT_RECEIVE, &fServerPort)) != KERN_SUCCESS) { | |||
jack_error("AllocatePort: can't allocate mach port err = %s", mach_error_string(res)); | |||
return false; | |||
} | |||
if ((res = mach_port_insert_right(task, fServerPort, fServerPort, MACH_MSG_TYPE_MAKE_SEND)) != KERN_SUCCESS) { | |||
jack_error("AllocatePort: error inserting mach rights err = %s", mach_error_string(res)); | |||
return false; | |||
} | |||
if ((res = mach_port_allocate(task, MACH_PORT_RIGHT_PORT_SET, &fPortSet)) != KERN_SUCCESS) { | |||
jack_error("AllocatePort: can't allocate mach port err = %s", mach_error_string(res)); | |||
return false; | |||
} | |||
if ((res = mach_port_move_member(task, fServerPort, fPortSet)) != KERN_SUCCESS) { | |||
jack_error("AllocatePort: error in mach_port_move_member err = %s", mach_error_string(res)); | |||
return false; | |||
} | |||
if ((res = bootstrap_register(fBootPort, (char*)name, fServerPort)) != KERN_SUCCESS) { | |||
jack_error("Allocate: can't check in mach port name = %s err = %s", name, mach_error_string(res)); | |||
return false; | |||
} | |||
mach_port_limits_t qlimits; | |||
mach_msg_type_number_t info_cnt = MACH_PORT_LIMITS_INFO_COUNT; | |||
if ((res = mach_port_get_attributes(task, fServerPort, MACH_PORT_LIMITS_INFO, (mach_port_info_t) & qlimits, &info_cnt)) != KERN_SUCCESS) { | |||
jack_error("Allocate: mach_port_get_attributes error name = %s err = %s", name, mach_error_string(res)); | |||
} | |||
jack_log("AllocatePort: queue limit = %ld", qlimits.mpl_qlimit); | |||
if (queue > 0) { | |||
qlimits.mpl_qlimit = queue; | |||
if ((res = mach_port_set_attributes(task, fServerPort, MACH_PORT_LIMITS_INFO, (mach_port_info_t) & qlimits, MACH_PORT_LIMITS_INFO_COUNT)) != KERN_SUCCESS) { | |||
jack_error("Allocate: mach_port_set_attributes error name = %s err = %s", name, mach_error_string(res)); | |||
} | |||
} | |||
return true; | |||
} | |||
// Server side : port is published to be accessible from other processes (clients) | |||
bool JackMachPortSet::AllocatePort(const char* name) | |||
{ | |||
return AllocatePort(name, -1); | |||
} | |||
bool JackMachPortSet::DisconnectPort() | |||
{ | |||
kern_return_t res; | |||
mach_port_t task = mach_task_self(); | |||
jack_log("JackMachPortSet::DisconnectPort"); | |||
if (fBootPort != 0) { | |||
if ((res = mach_port_deallocate(task, fBootPort)) != KERN_SUCCESS) { | |||
jack_error("JackMachPortSet::DisconnectPort mach_port_deallocate fBootPort err = %s", mach_error_string(res)); | |||
} | |||
} | |||
if (fServerPort != 0) { | |||
if ((res = mach_port_deallocate(task, fServerPort)) != KERN_SUCCESS) { | |||
jack_error("JackMachPortSet::DisconnectPort mach_port_deallocate fServerPort err = %s", mach_error_string(res)); | |||
} | |||
} | |||
return true; | |||
} | |||
bool JackMachPortSet::DestroyPort() | |||
{ | |||
kern_return_t res; | |||
mach_port_t task = mach_task_self(); | |||
jack_log("JackMachPortSet::DisconnectPort"); | |||
if (fBootPort != 0) { | |||
if ((res = mach_port_deallocate(task, fBootPort)) != KERN_SUCCESS) { | |||
jack_error("JackMachPortSet::DisconnectPort mach_port_deallocate err = %s", mach_error_string(res)); | |||
} | |||
} | |||
if (fServerPort != 0) { | |||
if ((res = mach_port_destroy(task, fServerPort)) != KERN_SUCCESS) { | |||
jack_error("JackMachPortSet::DisconnectPort mach_port_destroy fServerPort err = %s", mach_error_string(res)); | |||
} | |||
} | |||
return true; | |||
} | |||
mach_port_t JackMachPortSet::GetPortSet() | |||
{ | |||
return fPortSet; | |||
} | |||
mach_port_t JackMachPortSet::AddPort() | |||
{ | |||
kern_return_t res; | |||
mach_port_t task = mach_task_self(); | |||
mach_port_t old_port, result = 0; | |||
jack_log("JackMachPortSet::AddPort"); | |||
if ((res = mach_port_allocate(task, MACH_PORT_RIGHT_RECEIVE, &result)) != KERN_SUCCESS) { | |||
jack_error("AddPort: can't allocate mach port err = %s", mach_error_string(res)); | |||
goto error; | |||
} | |||
if ((res = mach_port_request_notification(task, result, MACH_NOTIFY_NO_SENDERS, | |||
1, result, MACH_MSG_TYPE_MAKE_SEND_ONCE, &old_port)) != KERN_SUCCESS) { | |||
jack_error("AddPort: error in mach_port_request_notification err = %s", mach_error_string(res)); | |||
goto error; | |||
} | |||
if ((res = mach_port_move_member(task, result, fPortSet)) != KERN_SUCCESS) { | |||
jack_error("AddPort: error in mach_port_move_member err = %s", mach_error_string(res)); | |||
goto error; | |||
} | |||
return result; | |||
error: | |||
if (result) { | |||
if ((res = mach_port_destroy(task, result)) != KERN_SUCCESS) { | |||
jack_error("JackMacRPC::DisconnectPort mach_port_destroy err = %s", mach_error_string(res)); | |||
} | |||
} | |||
return 0; | |||
} | |||
} // end of namespace | |||
@@ -1,88 +0,0 @@ | |||
/* | |||
Copyright (C) 2004-2008 Grame | |||
This program is free software; you can redistribute it and/or modify | |||
it under the terms of the GNU Lesser General Public License as published by | |||
the Free Software Foundation; either version 2.1 of the License, or | |||
(at your option) any later version. | |||
This program is distributed in the hope that it will be useful, | |||
but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
GNU Lesser General Public License for more details. | |||
You should have received a copy of the GNU Lesser General Public License | |||
along with this program; if not, write to the Free Software | |||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |||
*/ | |||
#ifndef __JackMachPort__ | |||
#define __JackMachPort__ | |||
#include <mach/mach.h> | |||
#include <mach/mach_types.h> | |||
#include <mach/message.h> | |||
#include <mach/mach_error.h> | |||
#include <servers/bootstrap.h> | |||
namespace Jack | |||
{ | |||
/*! | |||
\brief Mach port. | |||
*/ | |||
class JackMachPort | |||
{ | |||
protected: | |||
mach_port_t fBootPort; | |||
mach_port_t fServerPort; | |||
public: | |||
JackMachPort():fBootPort(0), fServerPort(0) | |||
{} | |||
virtual ~JackMachPort() | |||
{} | |||
virtual bool AllocatePort(const char* name); | |||
virtual bool AllocatePort(const char* name, int queue); | |||
virtual bool ConnectPort(const char* name); | |||
virtual bool DisconnectPort(); | |||
virtual bool DestroyPort(); | |||
virtual mach_port_t GetPort(); | |||
}; | |||
/*! | |||
\brief Mach port set. | |||
*/ | |||
class JackMachPortSet : public JackMachPort | |||
{ | |||
private: | |||
mach_port_t fPortSet; | |||
public: | |||
JackMachPortSet():fPortSet(0) | |||
{} | |||
virtual ~JackMachPortSet() | |||
{} | |||
bool AllocatePort(const char* name); | |||
bool AllocatePort(const char* name, int queue); | |||
bool DisconnectPort(); | |||
bool DestroyPort(); | |||
mach_port_t GetPortSet(); | |||
mach_port_t AddPort(); | |||
}; | |||
} // end of namespace | |||
#endif | |||
@@ -1,174 +0,0 @@ | |||
/* | |||
Copyright (C) 2004-2008 Grame | |||
This program is free software; you can redistribute it and/or modify | |||
it under the terms of the GNU Lesser General Public License as published by | |||
the Free Software Foundation; either version 2.1 of the License, or | |||
(at your option) any later version. | |||
This program is distributed in the hope that it will be useful, | |||
but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
GNU Lesser General Public License for more details. | |||
You should have received a copy of the GNU Lesser General Public License | |||
along with this program; if not, write to the Free Software | |||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |||
*/ | |||
#include "JackTools.h" | |||
#include "JackMachServerChannel.h" | |||
#include "JackRPCEngineServer.c" | |||
#include "JackError.h" | |||
#include "JackServer.h" | |||
#include "JackLockedEngine.h" | |||
#include "JackNotification.h" | |||
#include "JackServerGlobals.h" | |||
using namespace std; | |||
namespace Jack | |||
{ | |||
map<mach_port_t, JackMachServerChannel*> JackMachServerChannel::fPortTable; | |||
JackMachServerChannel::JackMachServerChannel():fThread(this) | |||
{} | |||
JackMachServerChannel::~JackMachServerChannel() | |||
{} | |||
int JackMachServerChannel::Open(const char* server_name, JackServer* server) | |||
{ | |||
jack_log("JackMachServerChannel::Open"); | |||
char jack_server_entry_name[512]; | |||
snprintf(jack_server_entry_name, sizeof(jack_server_entry_name), "%s.%d_%s", jack_server_entry, JackTools::GetUID(), server_name); | |||
if (!fServerPort.AllocatePort(jack_server_entry_name, 16)) { // 16 is the max possible value | |||
jack_error("Cannot check in Jack server"); | |||
return -1; | |||
} | |||
fServer = server; | |||
fPortTable[fServerPort.GetPort()] = this; | |||
return 0; | |||
} | |||
void JackMachServerChannel::Close() | |||
{ | |||
jack_log("JackMachServerChannel::Close"); | |||
#ifdef MAC_OS_X_VERSION_10_5 | |||
// Exception does not work in this case on pre Snow Loopard systems, see JackMachServerNotifyChannel::NotifyQuit() | |||
fThread.Kill(); | |||
#else | |||
fThread.Stop(); | |||
#endif | |||
fServerPort.DestroyPort(); | |||
} | |||
int JackMachServerChannel::Start() | |||
{ | |||
if (fThread.Start() != 0) { | |||
jack_error("Cannot start Jack server listener"); | |||
return -1; | |||
} | |||
return 0; | |||
} | |||
JackLockedEngine* JackMachServerChannel::GetEngine() | |||
{ | |||
return fServer->GetEngine(); | |||
} | |||
JackServer* JackMachServerChannel::GetServer() | |||
{ | |||
return fServer; | |||
} | |||
void JackMachServerChannel::ClientCheck(char* name, char* name_res, int protocol, int options, int* status, int* result) | |||
{ | |||
*result = GetEngine()->ClientCheck(name, name_res, protocol, options, status); | |||
} | |||
void JackMachServerChannel::ClientOpen(char* name, int pid, mach_port_t* private_port, int* shared_engine, int* shared_client, int* shared_graph, int* result) | |||
{ | |||
int refnum = -1; | |||
*result = GetEngine()->ClientExternalOpen(name, pid, &refnum, shared_engine, shared_client, shared_graph); | |||
if (*result == 0) { | |||
mach_port_t port = fServerPort.AddPort(); | |||
if (port != 0) { | |||
fClientTable[port] = refnum; | |||
fPortTable[port] = this; | |||
*private_port = port; | |||
} else { | |||
jack_error("Cannot create private client mach port"); | |||
*result = -1; | |||
} | |||
} else { | |||
jack_error("Cannot create new client"); | |||
} | |||
} | |||
void JackMachServerChannel::ClientClose(mach_port_t private_port, int refnum) | |||
{ | |||
GetEngine()->ClientExternalClose(refnum); | |||
fClientTable.erase(private_port); | |||
// Hum, hum.... | |||
kern_return_t res; | |||
if ((res = mach_port_destroy(mach_task_self(), private_port)) != KERN_SUCCESS) { | |||
jack_error("server_rpc_jack_client_close mach_port_destroy %s", mach_error_string(res)); | |||
} | |||
} | |||
void JackMachServerChannel::ClientKill(mach_port_t private_port) | |||
{ | |||
jack_log("JackMachServerChannel::ClientKill"); | |||
int refnum = fClientTable[private_port]; | |||
assert(refnum > 0); | |||
fServer->ClientKill(refnum); | |||
fClientTable.erase(private_port); | |||
// Hum, hum.... | |||
kern_return_t res; | |||
if ((res = mach_port_destroy(mach_task_self(), private_port)) != KERN_SUCCESS) { | |||
jack_error("server_rpc_jack_client_close mach_port_destroy %s", mach_error_string(res)); | |||
} | |||
} | |||
boolean_t JackMachServerChannel::MessageHandler(mach_msg_header_t* Request, mach_msg_header_t* Reply) | |||
{ | |||
if (Request->msgh_id == MACH_NOTIFY_NO_SENDERS) { | |||
jack_log("MACH_NOTIFY_NO_SENDERS %ld", Request->msgh_local_port); | |||
JackMachServerChannel* channel = JackMachServerChannel::fPortTable[Request->msgh_local_port]; | |||
assert(channel); | |||
channel->ClientKill(Request->msgh_local_port); | |||
} else { | |||
JackRPCEngine_server(Request, Reply); | |||
} | |||
return true; | |||
} | |||
bool JackMachServerChannel::Execute() | |||
{ | |||
try { | |||
kern_return_t res; | |||
if ((res = mach_msg_server(MessageHandler, 1024, fServerPort.GetPortSet(), 0)) != KERN_SUCCESS) { | |||
jack_log("JackMachServerChannel::Execute: err = %s", mach_error_string(res)); | |||
// A recoverable error, so keep running... | |||
} | |||
return true; | |||
} catch (JackQuitException& e) { | |||
jack_log("JackMachServerChannel::Execute JackQuitException"); | |||
return false; | |||
} | |||
} | |||
} // end of namespace | |||
@@ -1,76 +0,0 @@ | |||
/* | |||
Copyright (C) 2004-2008 Grame | |||
This program is free software; you can redistribute it and/or modify | |||
it under the terms of the GNU Lesser General Public License as published by | |||
the Free Software Foundation; either version 2.1 of the License, or | |||
(at your option) any later version. | |||
This program is distributed in the hope that it will be useful, | |||
but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
GNU Lesser General Public License for more details. | |||
You should have received a copy of the GNU Lesser General Public License | |||
along with this program; if not, write to the Free Software | |||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |||
*/ | |||
#ifndef __JackMachServerChannel__ | |||
#define __JackMachServerChannel__ | |||
#include "JackPlatformPlug.h" | |||
#include "JackMachPort.h" | |||
#include <map> | |||
namespace Jack | |||
{ | |||
class JackServer; | |||
class JackLockedEngine; | |||
/*! | |||
\brief JackServerChannel using Mach IPC. | |||
*/ | |||
class JackMachServerChannel : public JackRunnableInterface | |||
{ | |||
private: | |||
JackMachPortSet fServerPort; /*! Mach port to communicate with the server : from client to server */ | |||
JackThread fThread; /*! Thread to execute the event loop */ | |||
JackServer* fServer; | |||
std::map<mach_port_t, int> fClientTable; | |||
static boolean_t MessageHandler(mach_msg_header_t* Request, mach_msg_header_t* Reply); | |||
public: | |||
JackMachServerChannel(); | |||
~JackMachServerChannel(); | |||
int Open(const char* server_name, JackServer* server); // Open the Server/Client connection | |||
void Close(); // Close the Server/Client connection | |||
int Start(); | |||
JackLockedEngine* GetEngine(); | |||
JackServer* GetServer(); | |||
void ClientCheck(char* name, char* name_res, int protocol, int options, int* status, int* result); | |||
void ClientOpen(char* name, int pid, mach_port_t* private_port, int* shared_engine, int* shared_client, int* shared_graph, int* result); | |||
void ClientClose(mach_port_t private_port, int refnum); | |||
void ClientKill(mach_port_t private_port); | |||
bool Execute(); | |||
// Has to be public.. | |||
static std::map<mach_port_t, JackMachServerChannel*> fPortTable; | |||
}; | |||
} // end of namespace | |||
#endif | |||
@@ -1,70 +0,0 @@ | |||
/* | |||
Copyright (C) 2004-2008 Grame | |||
This program is free software; you can redistribute it and/or modify | |||
it under the terms of the GNU Lesser General Public License as published by | |||
the Free Software Foundation; either version 2.1 of the License, or | |||
(at your option) any later version. | |||
This program is distributed in the hope that it will be useful, | |||
but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
GNU Lesser General Public License for more details. | |||
You should have received a copy of the GNU Lesser General Public License | |||
along with this program; if not, write to the Free Software | |||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |||
*/ | |||
#include "JackMachServerNotifyChannel.h" | |||
#include "JackRPCEngineUser.c" | |||
#include "JackNotification.h" | |||
#include "JackTools.h" | |||
#include "JackConstants.h" | |||
#include "JackError.h" | |||
#include <stdio.h> | |||
namespace Jack | |||
{ | |||
int JackMachServerNotifyChannel::Open(const char* server_name) | |||
{ | |||
jack_log("JackMachServerChannel::Open"); | |||
char jack_server_entry_name[512]; | |||
snprintf(jack_server_entry_name, sizeof(jack_server_entry_name), "%s.%d_%s", jack_server_entry, JackTools::GetUID(), server_name); | |||
if (!fClientPort.ConnectPort(jack_server_entry_name)) { | |||
jack_error("Cannot connect to server port"); | |||
return -1; | |||
} else { | |||
return 0; | |||
} | |||
} | |||
void JackMachServerNotifyChannel::Close() | |||
{} | |||
void JackMachServerNotifyChannel::Notify(int refnum, int notify, int value) | |||
{ | |||
kern_return_t res = rpc_jack_client_rt_notify(fClientPort.GetPort(), refnum, notify, value, 0); | |||
if (res != KERN_SUCCESS) { | |||
jack_error("Could not write request ref = %d notify = %d err = %s", refnum, notify, mach_error_string(res)); | |||
} | |||
} | |||
void JackMachServerNotifyChannel::NotifyQuit() | |||
{ | |||
#ifdef MAC_OS_X_VERSION_10_5 | |||
// Nothing : since exception does not work in this case on pre Snow Loopard systems, see JackMachServerChannel::Close() | |||
#else | |||
kern_return_t res = rpc_jack_client_rt_notify(fClientPort.GetPort(), -1, kQUIT, 0, 0); | |||
if (res != KERN_SUCCESS) { | |||
jack_error("Could not write request ref = %d notify = %d err = %s", -1, kQUIT, mach_error_string(res)); | |||
} | |||
#endif | |||
} | |||
} // end of namespace | |||
@@ -1,55 +0,0 @@ | |||
/* | |||
Copyright (C) 2004-2008 Grame | |||
This program is free software; you can redistribute it and/or modify | |||
it under the terms of the GNU Lesser General Public License as published by | |||
the Free Software Foundation; either version 2.1 of the License, or | |||
(at your option) any later version. | |||
This program is distributed in the hope that it will be useful, | |||
but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
GNU Lesser General Public License for more details. | |||
You should have received a copy of the GNU Lesser General Public License | |||
along with this program; if not, write to the Free Software | |||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |||
*/ | |||
#ifndef __JackMachServerNotifyChannel__ | |||
#define __JackMachServerNotifyChannel__ | |||
#include "JackChannel.h" | |||
#include "JackMachPort.h" | |||
namespace Jack | |||
{ | |||
/*! | |||
\brief JackServerNotifyChannel using Mach IPC. | |||
*/ | |||
class JackMachServerNotifyChannel | |||
{ | |||
private: | |||
JackMachPort fClientPort; /*! Mach port to communicate with the server : from client to server */ | |||
public: | |||
JackMachServerNotifyChannel() | |||
{} | |||
int Open(const char* server_name); // Open the Server/Client connection | |||
void Close(); // Close the Server/Client connection | |||
void Notify(int refnum, int notify, int value); | |||
void NotifyQuit(); | |||
}; | |||
} // end of namespace | |||
#endif | |||
@@ -28,14 +28,18 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |||
namespace Jack | |||
{ | |||
struct JackRequest; | |||
struct JackResult; | |||
class JackPosixMutex; | |||
class JackMachThread; | |||
class JackMachSemaphore; | |||
class JackMachServerChannel; | |||
class JackMachClientChannel; | |||
class JackMachServerNotifyChannel; | |||
class JackMachNotifyChannel; | |||
class JackSocketServerChannel; | |||
class JackSocketClientChannel; | |||
class JackSocketServerNotifyChannel; | |||
class JackSocketNotifyChannel; | |||
class JackNetUnixSocket; | |||
#ifdef MY_TARGET_OS_IPHONE | |||
@@ -60,26 +64,29 @@ namespace Jack { typedef JackMachThread JackThread; } | |||
namespace Jack { typedef JackMachSemaphore JackSynchro; } | |||
#endif | |||
#include "JackSocket.h" | |||
namespace Jack { typedef JackClientSocket JackChannelTransaction; } | |||
/* __JackPlatformProcessSync__ */ | |||
#include "JackProcessSync.h" | |||
/* Only on windows a special JackProcessSync is used. It is directly defined by including JackProcessSync.h here */ | |||
#ifndef MY_TARGET_OS_IPHONE | |||
/* __JackPlatformServerChannel__ */ | |||
#include "JackMachServerChannel.h" | |||
namespace Jack { typedef JackMachServerChannel JackServerChannel; } | |||
#include "JackSocketServerChannel.h" | |||
namespace Jack { typedef JackSocketServerChannel JackServerChannel; } | |||
/* __JackPlatformClientChannel__ */ | |||
#include "JackMachClientChannel.h" | |||
namespace Jack { typedef JackMachClientChannel JackClientChannel; } | |||
#include "JackSocketClientChannel.h" | |||
namespace Jack { typedef JackSocketClientChannel JackClientChannel; } | |||
/* __JackPlatformServerNotifyChannel__ */ | |||
#include "JackMachServerNotifyChannel.h" | |||
namespace Jack { typedef JackMachServerNotifyChannel JackServerNotifyChannel; } | |||
#include "JackSocketServerNotifyChannel.h" | |||
namespace Jack { typedef JackSocketServerNotifyChannel JackServerNotifyChannel; } | |||
/* __JackPlatformNotifyChannel__ */ | |||
#include "JackMachNotifyChannel.h" | |||
namespace Jack { typedef JackMachNotifyChannel JackNotifyChannel; } | |||
#include "JackSocketNotifyChannel.h" | |||
namespace Jack { typedef JackSocketNotifyChannel JackNotifyChannel; } | |||
#endif | |||
/* __JackPlatformNetSocket__ */ | |||
@@ -47,6 +47,7 @@ | |||
4BFA833A0DF6AB540087B4E1 /* PBXTargetDependency */, | |||
4BFA833C0DF6AB540087B4E1 /* PBXTargetDependency */, | |||
4B32258F10A31AB400838A8E /* PBXTargetDependency */, | |||
4B66550E127C356E00753A79 /* PBXTargetDependency */, | |||
); | |||
name = "All Universal 32/64 bits"; | |||
productName = All; | |||
@@ -132,7 +133,6 @@ | |||
4B32258010A3195A00838A8E /* netjack_packet.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B3224ED10A315C400838A8E /* netjack_packet.h */; }; | |||
4B32258110A3195B00838A8E /* netsource.c in Sources */ = {isa = PBXBuildFile; fileRef = 4B32256310A318E300838A8E /* netsource.c */; }; | |||
4B35C41E0D4731D1000DE7AE /* Jackdmp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BF8D2250834F06A00C94B91 /* Jackdmp.cpp */; }; | |||
4B35C4290D4731D1000DE7AE /* JackMachPort.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B799AD707899652003F3F15 /* JackMachPort.h */; }; | |||
4B35C42A0D4731D1000DE7AE /* JackError.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BF8D1770834EE4800C94B91 /* JackError.h */; }; | |||
4B35C42B0D4731D1000DE7AE /* JackTime.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BF8D1830834EE5800C94B91 /* JackTime.h */; }; | |||
4B35C42C0D4731D1000DE7AE /* JackShmMem.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BF8D1870834EE7900C94B91 /* JackShmMem.h */; }; | |||
@@ -153,7 +153,6 @@ | |||
4B35C43D0D4731D1000DE7AE /* JackMachSemaphore.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BF6C1D608ACE64C001E2013 /* JackMachSemaphore.h */; }; | |||
4B35C43E0D4731D1000DE7AE /* JackGlobals.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BFB73F608AD291A00DB99B8 /* JackGlobals.h */; }; | |||
4B35C43F0D4731D1000DE7AE /* JackMachThread.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BFB741F08AD2B9900DB99B8 /* JackMachThread.h */; }; | |||
4B35C4400D4731D1000DE7AE /* JackMachClientChannel.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BFB298708AF450200D450D4 /* JackMachClientChannel.h */; }; | |||
4B35C4460D4731D1000DE7AE /* JackSynchro.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BD561C708EEB910006BBC2A /* JackSynchro.h */; }; | |||
4B35C4470D4731D1000DE7AE /* JackDebugClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B98AE010931D30C0091932A /* JackDebugClient.h */; }; | |||
4B35C4480D4731D1000DE7AE /* JackConstants.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B66A8580934964500A89560 /* JackConstants.h */; }; | |||
@@ -170,9 +169,6 @@ | |||
4B35C4530D4731D1000DE7AE /* JackMidiPort.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B80D7E50BA0D17400F035BB /* JackMidiPort.h */; }; | |||
4B35C4540D4731D1000DE7AE /* midiport.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B6B9EF50CD0958B0051EE5A /* midiport.h */; settings = {ATTRIBUTES = (Public, ); }; }; | |||
4B35C4550D4731D1000DE7AE /* JackTools.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BE4CC000CDA153400CCF5BB /* JackTools.h */; }; | |||
4B35C4580D4731D1000DE7AE /* JackMacLibClientRPC.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BF3937C0626BF3600CC67FA /* JackMacLibClientRPC.cpp */; }; | |||
4B35C4590D4731D1000DE7AE /* JackRPCEngineUser.c in Sources */ = {isa = PBXBuildFile; fileRef = 4B89B769076B74D200D170DE /* JackRPCEngineUser.c */; }; | |||
4B35C45A0D4731D1000DE7AE /* JackMachPort.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B799AD607899652003F3F15 /* JackMachPort.cpp */; }; | |||
4B35C45B0D4731D1000DE7AE /* JackShmMem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BF8D1880834EE7900C94B91 /* JackShmMem.cpp */; }; | |||
4B35C45C0D4731D1000DE7AE /* shm.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BF8D1900834EE8400C94B91 /* shm.c */; }; | |||
4B35C45E0D4731D1000DE7AE /* JackActivationCount.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BF8D1A80834EEB400C94B91 /* JackActivationCount.cpp */; }; | |||
@@ -186,7 +182,6 @@ | |||
4B35C4660D4731D1000DE7AE /* JackFrameTimer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BF8FB0D08AC88EF00D1A344 /* JackFrameTimer.cpp */; }; | |||
4B35C4680D4731D1000DE7AE /* JackMachSemaphore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BF6C1D508ACE64C001E2013 /* JackMachSemaphore.cpp */; }; | |||
4B35C4690D4731D1000DE7AE /* JackMachThread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BFB741E08AD2B9900DB99B8 /* JackMachThread.cpp */; }; | |||
4B35C46A0D4731D1000DE7AE /* JackMachClientChannel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BFB29AE08AF45FD00D450D4 /* JackMachClientChannel.cpp */; }; | |||
4B35C4700D4731D1000DE7AE /* JackGlobals.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B2C28F908DAD01E00249230 /* JackGlobals.cpp */; }; | |||
4B35C4720D4731D1000DE7AE /* ringbuffer.c in Sources */ = {isa = PBXBuildFile; fileRef = 4B003AB008E2B2BA0060EFDC /* ringbuffer.c */; }; | |||
4B35C4730D4731D1000DE7AE /* JackDebugClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B98AE000931D30C0091932A /* JackDebugClient.cpp */; }; | |||
@@ -198,7 +193,6 @@ | |||
4B35C47A0D4731D1000DE7AE /* JackMidiAPI.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B80D7E70BA0D17400F035BB /* JackMidiAPI.cpp */; }; | |||
4B35C47B0D4731D1000DE7AE /* JackEngineControl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B6F7AEC0CD0CDBD00F48A9D /* JackEngineControl.cpp */; }; | |||
4B35C47C0D4731D1000DE7AE /* JackTools.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BE4CBFF0CDA153400CCF5BB /* JackTools.cpp */; }; | |||
4B35C4870D4731D1000DE7AE /* JackMachPort.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B799AD707899652003F3F15 /* JackMachPort.h */; }; | |||
4B35C4880D4731D1000DE7AE /* JackError.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BF8D1770834EE4800C94B91 /* JackError.h */; }; | |||
4B35C4890D4731D1000DE7AE /* JackTime.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BF8D1830834EE5800C94B91 /* JackTime.h */; }; | |||
4B35C48A0D4731D1000DE7AE /* JackShmMem.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BF8D1870834EE7900C94B91 /* JackShmMem.h */; }; | |||
@@ -227,9 +221,6 @@ | |||
4B35C4A90D4731D1000DE7AE /* JackEngine.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BF8D2130834F02800C94B91 /* JackEngine.h */; }; | |||
4B35C4AA0D4731D1000DE7AE /* JackExternalClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BF8D1F70834EFBD00C94B91 /* JackExternalClient.h */; }; | |||
4B35C4AB0D4731D1000DE7AE /* JackServer.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BF8D2220834F05C00C94B91 /* JackServer.h */; }; | |||
4B35C4AE0D4731D1000DE7AE /* JackMachNotifyChannel.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BFB298908AF450200D450D4 /* JackMachNotifyChannel.h */; }; | |||
4B35C4AF0D4731D1000DE7AE /* JackMachServerChannel.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BFB297808AF44ED00D450D4 /* JackMachServerChannel.h */; }; | |||
4B35C4B00D4731D1000DE7AE /* JackMachServerNotifyChannel.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BFB297A08AF44ED00D450D4 /* JackMachServerNotifyChannel.h */; }; | |||
4B35C4B20D4731D1000DE7AE /* JackConstants.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B66A8580934964500A89560 /* JackConstants.h */; }; | |||
4B35C4B30D4731D1000DE7AE /* JackTransportEngine.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BD4B4D409BACD9600750C0F /* JackTransportEngine.h */; }; | |||
4B35C4B40D4731D1000DE7AE /* JackServerGlobals.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BC2168D0A444BED00BDA09F /* JackServerGlobals.h */; }; | |||
@@ -246,7 +237,6 @@ | |||
4B35C4BF0D4731D1000DE7AE /* midiport.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B6B9EF50CD0958B0051EE5A /* midiport.h */; settings = {ATTRIBUTES = (Public, ); }; }; | |||
4B35C4C00D4731D1000DE7AE /* JackDebugClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B98AE010931D30C0091932A /* JackDebugClient.h */; }; | |||
4B35C4C10D4731D1000DE7AE /* JackTools.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BE4CC000CDA153400CCF5BB /* JackTools.h */; }; | |||
4B35C4C40D4731D1000DE7AE /* JackMachPort.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B799AD607899652003F3F15 /* JackMachPort.cpp */; }; | |||
4B35C4C50D4731D1000DE7AE /* JackShmMem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BF8D1880834EE7900C94B91 /* JackShmMem.cpp */; }; | |||
4B35C4C60D4731D1000DE7AE /* shm.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BF8D1900834EE8400C94B91 /* shm.c */; }; | |||
4B35C4C80D4731D1000DE7AE /* JackActivationCount.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BF8D1A80834EEB400C94B91 /* JackActivationCount.cpp */; }; | |||
@@ -268,12 +258,7 @@ | |||
4B35C4DD0D4731D1000DE7AE /* JackEngine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BF8D2140834F02800C94B91 /* JackEngine.cpp */; }; | |||
4B35C4DE0D4731D1000DE7AE /* JackExternalClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BF8D1F80834EFBD00C94B91 /* JackExternalClient.cpp */; }; | |||
4B35C4DF0D4731D1000DE7AE /* JackInternalClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BF8D1ED0834EF9200C94B91 /* JackInternalClient.cpp */; }; | |||
4B35C4E00D4731D1000DE7AE /* JackRPCClientUser.c in Sources */ = {isa = PBXBuildFile; fileRef = 4B89B759076B731100D170DE /* JackRPCClientUser.c */; }; | |||
4B35C4E20D4731D1000DE7AE /* JackServer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BF8D2210834F05C00C94B91 /* JackServer.cpp */; }; | |||
4B35C4E60D4731D1000DE7AE /* JackMacEngineRPC.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B4259E5076B635E00C1ECE1 /* JackMacEngineRPC.cpp */; }; | |||
4B35C4E70D4731D1000DE7AE /* JackMachNotifyChannel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BFB298808AF450200D450D4 /* JackMachNotifyChannel.cpp */; }; | |||
4B35C4E80D4731D1000DE7AE /* JackMachServerChannel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BFB297908AF44ED00D450D4 /* JackMachServerChannel.cpp */; }; | |||
4B35C4E90D4731D1000DE7AE /* JackMachServerNotifyChannel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BFB297708AF44ED00D450D4 /* JackMachServerNotifyChannel.cpp */; }; | |||
4B35C4EB0D4731D1000DE7AE /* JackTransportEngine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BD4B4D509BACD9600750C0F /* JackTransportEngine.cpp */; }; | |||
4B35C4EC0D4731D1000DE7AE /* JackServerAPI.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BF8D1F50834EFB000C94B91 /* JackServerAPI.cpp */; }; | |||
4B35C4ED0D4731D1000DE7AE /* JackServerGlobals.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BC216880A444BDE00BDA09F /* JackServerGlobals.cpp */; }; | |||
@@ -322,7 +307,6 @@ | |||
4B43A8CB1014605000E52943 /* JackLoopbackDriver.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B43A8C91014605000E52943 /* JackLoopbackDriver.h */; }; | |||
4B43A8DF1014615800E52943 /* JackLoopbackDriver.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B43A8C91014605000E52943 /* JackLoopbackDriver.h */; }; | |||
4B43A8E11014615800E52943 /* JackLoopbackDriver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B43A8C81014605000E52943 /* JackLoopbackDriver.cpp */; }; | |||
4B47AC8210B5890100469C67 /* JackMachPort.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B799AD707899652003F3F15 /* JackMachPort.h */; }; | |||
4B47AC8310B5890100469C67 /* JackError.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BF8D1770834EE4800C94B91 /* JackError.h */; }; | |||
4B47AC8410B5890100469C67 /* JackTime.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BF8D1830834EE5800C94B91 /* JackTime.h */; }; | |||
4B47AC8510B5890100469C67 /* JackShmMem.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BF8D1870834EE7900C94B91 /* JackShmMem.h */; }; | |||
@@ -343,7 +327,6 @@ | |||
4B47AC9410B5890100469C67 /* JackMachSemaphore.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BF6C1D608ACE64C001E2013 /* JackMachSemaphore.h */; }; | |||
4B47AC9510B5890100469C67 /* JackGlobals.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BFB73F608AD291A00DB99B8 /* JackGlobals.h */; }; | |||
4B47AC9610B5890100469C67 /* JackMachThread.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BFB741F08AD2B9900DB99B8 /* JackMachThread.h */; }; | |||
4B47AC9710B5890100469C67 /* JackMachClientChannel.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BFB298708AF450200D450D4 /* JackMachClientChannel.h */; }; | |||
4B47AC9810B5890100469C67 /* JackSynchro.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BD561C708EEB910006BBC2A /* JackSynchro.h */; }; | |||
4B47AC9910B5890100469C67 /* JackDebugClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B98AE010931D30C0091932A /* JackDebugClient.h */; }; | |||
4B47AC9A10B5890100469C67 /* JackConstants.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B66A8580934964500A89560 /* JackConstants.h */; }; | |||
@@ -364,9 +347,6 @@ | |||
4B47ACA910B5890100469C67 /* JackMessageBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B4F9C8B0DC20C0400706CB0 /* JackMessageBuffer.h */; }; | |||
4B47ACAA10B5890100469C67 /* JackPosixThread.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BC3B6A30E703B2E0066E42F /* JackPosixThread.h */; }; | |||
4B47ACAB10B5890100469C67 /* JackProcessSync.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BECB2F40F4451C10091B70A /* JackProcessSync.h */; }; | |||
4B47ACAE10B5890100469C67 /* JackMacLibClientRPC.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BF3937C0626BF3600CC67FA /* JackMacLibClientRPC.cpp */; }; | |||
4B47ACAF10B5890100469C67 /* JackRPCEngineUser.c in Sources */ = {isa = PBXBuildFile; fileRef = 4B89B769076B74D200D170DE /* JackRPCEngineUser.c */; }; | |||
4B47ACB010B5890100469C67 /* JackMachPort.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B799AD607899652003F3F15 /* JackMachPort.cpp */; }; | |||
4B47ACB110B5890100469C67 /* JackShmMem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BF8D1880834EE7900C94B91 /* JackShmMem.cpp */; }; | |||
4B47ACB210B5890100469C67 /* shm.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BF8D1900834EE8400C94B91 /* shm.c */; }; | |||
4B47ACB310B5890100469C67 /* JackActivationCount.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BF8D1A80834EEB400C94B91 /* JackActivationCount.cpp */; }; | |||
@@ -380,7 +360,6 @@ | |||
4B47ACBB10B5890100469C67 /* JackFrameTimer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BF8FB0D08AC88EF00D1A344 /* JackFrameTimer.cpp */; }; | |||
4B47ACBC10B5890100469C67 /* JackMachSemaphore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BF6C1D508ACE64C001E2013 /* JackMachSemaphore.cpp */; }; | |||
4B47ACBD10B5890100469C67 /* JackMachThread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BFB741E08AD2B9900DB99B8 /* JackMachThread.cpp */; }; | |||
4B47ACBE10B5890100469C67 /* JackMachClientChannel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BFB29AE08AF45FD00D450D4 /* JackMachClientChannel.cpp */; }; | |||
4B47ACBF10B5890100469C67 /* JackGlobals.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B2C28F908DAD01E00249230 /* JackGlobals.cpp */; }; | |||
4B47ACC010B5890100469C67 /* ringbuffer.c in Sources */ = {isa = PBXBuildFile; fileRef = 4B003AB008E2B2BA0060EFDC /* ringbuffer.c */; }; | |||
4B47ACC110B5890100469C67 /* JackDebugClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B98AE000931D30C0091932A /* JackDebugClient.cpp */; }; | |||
@@ -433,8 +412,8 @@ | |||
4B5F253E0DEE9B8F0041E486 /* JackLockedEngine.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B5F253D0DEE9B8F0041E486 /* JackLockedEngine.h */; }; | |||
4B60CE490AAABA31004956AA /* connect.c in Sources */ = {isa = PBXBuildFile; fileRef = 4B60CE480AAABA31004956AA /* connect.c */; }; | |||
4B60CE4A0AAABA31004956AA /* connect.c in Sources */ = {isa = PBXBuildFile; fileRef = 4B60CE480AAABA31004956AA /* connect.c */; }; | |||
4B6654FC127C350100753A79 /* server_control.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B6654FB127C350100753A79 /* server_control.cpp */; }; | |||
4B699BAA097D421600A18468 /* Jackdmp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BF8D2250834F06A00C94B91 /* Jackdmp.cpp */; }; | |||
4B699C02097D421600A18468 /* JackMachPort.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B799AD707899652003F3F15 /* JackMachPort.h */; }; | |||
4B699C03097D421600A18468 /* JackError.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BF8D1770834EE4800C94B91 /* JackError.h */; }; | |||
4B699C04097D421600A18468 /* JackTime.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BF8D1830834EE5800C94B91 /* JackTime.h */; }; | |||
4B699C05097D421600A18468 /* JackShmMem.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BF8D1870834EE7900C94B91 /* JackShmMem.h */; }; | |||
@@ -455,13 +434,9 @@ | |||
4B699C16097D421600A18468 /* JackMachSemaphore.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BF6C1D608ACE64C001E2013 /* JackMachSemaphore.h */; }; | |||
4B699C17097D421600A18468 /* JackGlobals.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BFB73F608AD291A00DB99B8 /* JackGlobals.h */; }; | |||
4B699C18097D421600A18468 /* JackMachThread.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BFB741F08AD2B9900DB99B8 /* JackMachThread.h */; }; | |||
4B699C19097D421600A18468 /* JackMachClientChannel.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BFB298708AF450200D450D4 /* JackMachClientChannel.h */; }; | |||
4B699C20097D421600A18468 /* JackSynchro.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BD561C708EEB910006BBC2A /* JackSynchro.h */; }; | |||
4B699C21097D421600A18468 /* JackDebugClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B98AE010931D30C0091932A /* JackDebugClient.h */; }; | |||
4B699C22097D421600A18468 /* JackConstants.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B66A8580934964500A89560 /* JackConstants.h */; }; | |||
4B699C25097D421600A18468 /* JackMacLibClientRPC.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BF3937C0626BF3600CC67FA /* JackMacLibClientRPC.cpp */; }; | |||
4B699C26097D421600A18468 /* JackRPCEngineUser.c in Sources */ = {isa = PBXBuildFile; fileRef = 4B89B769076B74D200D170DE /* JackRPCEngineUser.c */; }; | |||
4B699C27097D421600A18468 /* JackMachPort.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B799AD607899652003F3F15 /* JackMachPort.cpp */; }; | |||
4B699C28097D421600A18468 /* JackShmMem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BF8D1880834EE7900C94B91 /* JackShmMem.cpp */; }; | |||
4B699C29097D421600A18468 /* shm.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BF8D1900834EE8400C94B91 /* shm.c */; }; | |||
4B699C2B097D421600A18468 /* JackActivationCount.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BF8D1A80834EEB400C94B91 /* JackActivationCount.cpp */; }; | |||
@@ -475,11 +450,9 @@ | |||
4B699C33097D421600A18468 /* JackFrameTimer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BF8FB0D08AC88EF00D1A344 /* JackFrameTimer.cpp */; }; | |||
4B699C35097D421600A18468 /* JackMachSemaphore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BF6C1D508ACE64C001E2013 /* JackMachSemaphore.cpp */; }; | |||
4B699C36097D421600A18468 /* JackMachThread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BFB741E08AD2B9900DB99B8 /* JackMachThread.cpp */; }; | |||
4B699C37097D421600A18468 /* JackMachClientChannel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BFB29AE08AF45FD00D450D4 /* JackMachClientChannel.cpp */; }; | |||
4B699C3D097D421600A18468 /* JackGlobals.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B2C28F908DAD01E00249230 /* JackGlobals.cpp */; }; | |||
4B699C3F097D421600A18468 /* ringbuffer.c in Sources */ = {isa = PBXBuildFile; fileRef = 4B003AB008E2B2BA0060EFDC /* ringbuffer.c */; }; | |||
4B699C40097D421600A18468 /* JackDebugClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B98AE000931D30C0091932A /* JackDebugClient.cpp */; }; | |||
4B699C4E097D421600A18468 /* JackMachPort.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B799AD707899652003F3F15 /* JackMachPort.h */; }; | |||
4B699C4F097D421600A18468 /* JackError.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BF8D1770834EE4800C94B91 /* JackError.h */; }; | |||
4B699C50097D421600A18468 /* JackTime.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BF8D1830834EE5800C94B91 /* JackTime.h */; }; | |||
4B699C51097D421600A18468 /* JackShmMem.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BF8D1870834EE7900C94B91 /* JackShmMem.h */; }; | |||
@@ -508,11 +481,7 @@ | |||
4B699C71097D421600A18468 /* JackEngine.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BF8D2130834F02800C94B91 /* JackEngine.h */; }; | |||
4B699C73097D421600A18468 /* JackExternalClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BF8D1F70834EFBD00C94B91 /* JackExternalClient.h */; }; | |||
4B699C74097D421600A18468 /* JackServer.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BF8D2220834F05C00C94B91 /* JackServer.h */; }; | |||
4B699C77097D421600A18468 /* JackMachNotifyChannel.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BFB298908AF450200D450D4 /* JackMachNotifyChannel.h */; }; | |||
4B699C78097D421600A18468 /* JackMachServerChannel.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BFB297808AF44ED00D450D4 /* JackMachServerChannel.h */; }; | |||
4B699C79097D421600A18468 /* JackMachServerNotifyChannel.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BFB297A08AF44ED00D450D4 /* JackMachServerNotifyChannel.h */; }; | |||
4B699C7B097D421600A18468 /* JackConstants.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B66A8580934964500A89560 /* JackConstants.h */; }; | |||
4B699C7E097D421600A18468 /* JackMachPort.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B799AD607899652003F3F15 /* JackMachPort.cpp */; }; | |||
4B699C7F097D421600A18468 /* JackShmMem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BF8D1880834EE7900C94B91 /* JackShmMem.cpp */; }; | |||
4B699C80097D421600A18468 /* shm.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BF8D1900834EE8400C94B91 /* shm.c */; }; | |||
4B699C82097D421600A18468 /* JackActivationCount.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BF8D1A80834EEB400C94B91 /* JackActivationCount.cpp */; }; | |||
@@ -534,12 +503,7 @@ | |||
4B699C97097D421600A18468 /* JackEngine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BF8D2140834F02800C94B91 /* JackEngine.cpp */; }; | |||
4B699C99097D421600A18468 /* JackExternalClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BF8D1F80834EFBD00C94B91 /* JackExternalClient.cpp */; }; | |||
4B699C9A097D421600A18468 /* JackInternalClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BF8D1ED0834EF9200C94B91 /* JackInternalClient.cpp */; }; | |||
4B699C9B097D421600A18468 /* JackRPCClientUser.c in Sources */ = {isa = PBXBuildFile; fileRef = 4B89B759076B731100D170DE /* JackRPCClientUser.c */; }; | |||
4B699C9D097D421600A18468 /* JackServer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BF8D2210834F05C00C94B91 /* JackServer.cpp */; }; | |||
4B699CA1097D421600A18468 /* JackMacEngineRPC.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B4259E5076B635E00C1ECE1 /* JackMacEngineRPC.cpp */; }; | |||
4B699CA2097D421600A18468 /* JackMachNotifyChannel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BFB298808AF450200D450D4 /* JackMachNotifyChannel.cpp */; }; | |||
4B699CA3097D421600A18468 /* JackMachServerChannel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BFB297908AF44ED00D450D4 /* JackMachServerChannel.cpp */; }; | |||
4B699CA4097D421600A18468 /* JackMachServerNotifyChannel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BFB297708AF44ED00D450D4 /* JackMachServerNotifyChannel.cpp */; }; | |||
4B699CB4097D421600A18468 /* metro.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BF8D16B0834EDF000C94B91 /* metro.c */; }; | |||
4B699CC4097D421600A18468 /* lsp.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BF8D1690834EDE600C94B91 /* lsp.c */; }; | |||
4B699CF6097D421600A18468 /* freewheel.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BF8D1710834EE0F00C94B91 /* freewheel.c */; }; | |||
@@ -584,6 +548,18 @@ | |||
4B88D04411298BEE007A87C1 /* weakmacros.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B88D03A11298BEE007A87C1 /* weakmacros.h */; settings = {ATTRIBUTES = (Public, ); }; }; | |||
4B88D04511298BEE007A87C1 /* weakjack.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B88D03911298BEE007A87C1 /* weakjack.h */; settings = {ATTRIBUTES = (Public, ); }; }; | |||
4B88D04611298BEE007A87C1 /* weakmacros.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B88D03A11298BEE007A87C1 /* weakmacros.h */; settings = {ATTRIBUTES = (Public, ); }; }; | |||
4B8A38A7117B80D300664E07 /* JackSocket.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BC3B6AD0E703B8D0066E42F /* JackSocket.cpp */; }; | |||
4B8A38A8117B80DA00664E07 /* JackSocket.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BC3B6AE0E703B8D0066E42F /* JackSocket.h */; }; | |||
4B8A38AD117B810A00664E07 /* JackSocketNotifyChannel.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BC3B6B20E703B8D0066E42F /* JackSocketNotifyChannel.h */; }; | |||
4B8A38AE117B811100664E07 /* JackSocketNotifyChannel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BC3B6B10E703B8D0066E42F /* JackSocketNotifyChannel.cpp */; }; | |||
4B8A38B0117B812500664E07 /* JackSocketServerChannel.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BC3B6B40E703B8D0066E42F /* JackSocketServerChannel.h */; }; | |||
4B8A38B1117B812D00664E07 /* JackSocketServerChannel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BC3B6B30E703B8D0066E42F /* JackSocketServerChannel.cpp */; }; | |||
4B8A38B2117B813400664E07 /* JackSocketServerNotifyChannel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BC3B6B50E703B8D0066E42F /* JackSocketServerNotifyChannel.cpp */; }; | |||
4B8A38C4117B814000664E07 /* JackSocketServerNotifyChannel.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BC3B6B60E703B8D0066E42F /* JackSocketServerNotifyChannel.h */; }; | |||
4B8A38F0117B827900664E07 /* JackSocket.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BC3B6AE0E703B8D0066E42F /* JackSocket.h */; }; | |||
4B8A38F1117B827E00664E07 /* JackSocketClientChannel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BC3B6AF0E703B8D0066E42F /* JackSocketClientChannel.cpp */; }; | |||
4B8A38F6117B82AB00664E07 /* JackSocket.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BC3B6AD0E703B8D0066E42F /* JackSocket.cpp */; }; | |||
4B8A38F7117B82B200664E07 /* JackSocketClientChannel.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BC3B6B00E703B8D0066E42F /* JackSocketClientChannel.h */; }; | |||
4B93F1990E87992100E4ECCD /* JackPosixThread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BC3B6A20E703B2E0066E42F /* JackPosixThread.cpp */; }; | |||
4B93F19A0E87992200E4ECCD /* JackPosixThread.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BC3B6A30E703B2E0066E42F /* JackPosixThread.h */; }; | |||
4B93F19C0E87998200E4ECCD /* JackPosixServerLaunch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BF5FBBA0E878B9C003D2374 /* JackPosixServerLaunch.cpp */; }; | |||
@@ -604,7 +580,6 @@ | |||
4B9A26610DBF8ADD006E9FBC /* JackError.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B9A25B30DBF8330006E9FBC /* JackError.cpp */; }; | |||
4B9A26640DBF8B14006E9FBC /* JackError.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B9A25B30DBF8330006E9FBC /* JackError.cpp */; }; | |||
4B9A26790DBF8B88006E9FBC /* JackError.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B9A25B30DBF8330006E9FBC /* JackError.cpp */; }; | |||
4BA3393510B2E36800190E3B /* JackMachPort.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B799AD707899652003F3F15 /* JackMachPort.h */; }; | |||
4BA3393610B2E36800190E3B /* JackError.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BF8D1770834EE4800C94B91 /* JackError.h */; }; | |||
4BA3393710B2E36800190E3B /* JackTime.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BF8D1830834EE5800C94B91 /* JackTime.h */; }; | |||
4BA3393810B2E36800190E3B /* JackShmMem.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BF8D1870834EE7900C94B91 /* JackShmMem.h */; }; | |||
@@ -633,9 +608,6 @@ | |||
4BA3394F10B2E36800190E3B /* JackEngine.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BF8D2130834F02800C94B91 /* JackEngine.h */; }; | |||
4BA3395010B2E36800190E3B /* JackExternalClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BF8D1F70834EFBD00C94B91 /* JackExternalClient.h */; }; | |||
4BA3395110B2E36800190E3B /* JackServer.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BF8D2220834F05C00C94B91 /* JackServer.h */; }; | |||
4BA3395210B2E36800190E3B /* JackMachNotifyChannel.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BFB298908AF450200D450D4 /* JackMachNotifyChannel.h */; }; | |||
4BA3395310B2E36800190E3B /* JackMachServerChannel.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BFB297808AF44ED00D450D4 /* JackMachServerChannel.h */; }; | |||
4BA3395410B2E36800190E3B /* JackMachServerNotifyChannel.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BFB297A08AF44ED00D450D4 /* JackMachServerNotifyChannel.h */; }; | |||
4BA3395510B2E36800190E3B /* JackConstants.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B66A8580934964500A89560 /* JackConstants.h */; }; | |||
4BA3395610B2E36800190E3B /* JackTransportEngine.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BD4B4D409BACD9600750C0F /* JackTransportEngine.h */; }; | |||
4BA3395710B2E36800190E3B /* JackServerGlobals.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BC2168D0A444BED00BDA09F /* JackServerGlobals.h */; }; | |||
@@ -663,7 +635,6 @@ | |||
4BA3396D10B2E36800190E3B /* JackMidiDriver.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BF339200F8B873E0080FB5B /* JackMidiDriver.h */; }; | |||
4BA3396E10B2E36800190E3B /* JackWaitThreadedDriver.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BBC93B90DF9736C002DF220 /* JackWaitThreadedDriver.h */; }; | |||
4BA3396F10B2E36800190E3B /* JackArgParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BF284170F31B4BC00B05BE3 /* JackArgParser.h */; }; | |||
4BA3397210B2E36800190E3B /* JackMachPort.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B799AD607899652003F3F15 /* JackMachPort.cpp */; }; | |||
4BA3397310B2E36800190E3B /* JackShmMem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BF8D1880834EE7900C94B91 /* JackShmMem.cpp */; }; | |||
4BA3397410B2E36800190E3B /* shm.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BF8D1900834EE8400C94B91 /* shm.c */; }; | |||
4BA3397510B2E36800190E3B /* JackActivationCount.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BF8D1A80834EEB400C94B91 /* JackActivationCount.cpp */; }; | |||
@@ -685,12 +656,7 @@ | |||
4BA3398510B2E36800190E3B /* JackEngine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BF8D2140834F02800C94B91 /* JackEngine.cpp */; }; | |||
4BA3398610B2E36800190E3B /* JackExternalClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BF8D1F80834EFBD00C94B91 /* JackExternalClient.cpp */; }; | |||
4BA3398710B2E36800190E3B /* JackInternalClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BF8D1ED0834EF9200C94B91 /* JackInternalClient.cpp */; }; | |||
4BA3398810B2E36800190E3B /* JackRPCClientUser.c in Sources */ = {isa = PBXBuildFile; fileRef = 4B89B759076B731100D170DE /* JackRPCClientUser.c */; }; | |||
4BA3398910B2E36800190E3B /* JackServer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BF8D2210834F05C00C94B91 /* JackServer.cpp */; }; | |||
4BA3398A10B2E36800190E3B /* JackMacEngineRPC.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B4259E5076B635E00C1ECE1 /* JackMacEngineRPC.cpp */; }; | |||
4BA3398B10B2E36800190E3B /* JackMachNotifyChannel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BFB298808AF450200D450D4 /* JackMachNotifyChannel.cpp */; }; | |||
4BA3398C10B2E36800190E3B /* JackMachServerChannel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BFB297908AF44ED00D450D4 /* JackMachServerChannel.cpp */; }; | |||
4BA3398D10B2E36800190E3B /* JackMachServerNotifyChannel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BFB297708AF44ED00D450D4 /* JackMachServerNotifyChannel.cpp */; }; | |||
4BA3398E10B2E36800190E3B /* JackTransportEngine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BD4B4D509BACD9600750C0F /* JackTransportEngine.cpp */; }; | |||
4BA3398F10B2E36800190E3B /* JackServerAPI.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BF8D1F50834EFB000C94B91 /* JackServerAPI.cpp */; }; | |||
4BA3399010B2E36800190E3B /* JackServerGlobals.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BC216880A444BDE00BDA09F /* JackServerGlobals.cpp */; }; | |||
@@ -1146,6 +1112,13 @@ | |||
remoteGlobalIDString = 4B5A1BD00CD1CCE10005BF74; | |||
remoteInfo = jack_midisine; | |||
}; | |||
4B66550D127C356E00753A79 /* PBXContainerItemProxy */ = { | |||
isa = PBXContainerItemProxy; | |||
containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; | |||
proxyType = 1; | |||
remoteGlobalIDString = 4B6654ED127C34AE00753A79; | |||
remoteInfo = "jack_server_control 64 bits"; | |||
}; | |||
4B699DB3097D421700A18468 /* PBXContainerItemProxy */ = { | |||
isa = PBXContainerItemProxy; | |||
containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; | |||
@@ -1497,7 +1470,6 @@ | |||
4B37C20406DF1FBE0016E567 /* CALatencyLog.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = CALatencyLog.h; path = /Developer/Examples/CoreAudio/PublicUtility/CALatencyLog.h; sourceTree = "<absolute>"; }; | |||
4B37C20906DF1FE20016E567 /* latency.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = latency.c; path = /Developer/Examples/CoreAudio/PublicUtility/latency.c; sourceTree = "<absolute>"; }; | |||
4B3F49070AD8503300491C6E /* cpu.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = cpu.c; path = ../tests/cpu.c; sourceTree = SOURCE_ROOT; }; | |||
4B4259E5076B635E00C1ECE1 /* JackMacEngineRPC.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JackMacEngineRPC.cpp; sourceTree = SOURCE_ROOT; }; | |||
4B43A8BA10145F6F00E52943 /* jack_loopback.so */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = jack_loopback.so; sourceTree = BUILT_PRODUCTS_DIR; }; | |||
4B43A8C81014605000E52943 /* JackLoopbackDriver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JackLoopbackDriver.cpp; path = ../common/JackLoopbackDriver.cpp; sourceTree = SOURCE_ROOT; }; | |||
4B43A8C91014605000E52943 /* JackLoopbackDriver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JackLoopbackDriver.h; path = ../common/JackLoopbackDriver.h; sourceTree = SOURCE_ROOT; }; | |||
@@ -1520,6 +1492,8 @@ | |||
4B5E08E00E5B676C00BEE4E0 /* JackNetAdapter.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = JackNetAdapter.h; path = ../common/JackNetAdapter.h; sourceTree = SOURCE_ROOT; }; | |||
4B5F253D0DEE9B8F0041E486 /* JackLockedEngine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JackLockedEngine.h; path = ../common/JackLockedEngine.h; sourceTree = SOURCE_ROOT; }; | |||
4B60CE480AAABA31004956AA /* connect.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = connect.c; path = "../example-clients/connect.c"; sourceTree = SOURCE_ROOT; }; | |||
4B6654F7127C34AE00753A79 /* jack_server_control */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = jack_server_control; sourceTree = BUILT_PRODUCTS_DIR; }; | |||
4B6654FB127C350100753A79 /* server_control.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = server_control.cpp; path = "../example-clients/server_control.cpp"; sourceTree = SOURCE_ROOT; }; | |||
4B66A8580934964500A89560 /* JackConstants.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = JackConstants.h; path = ../common/JackConstants.h; sourceTree = SOURCE_ROOT; }; | |||
4B699BB1097D421600A18468 /* jackdmp */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = jackdmp; sourceTree = BUILT_PRODUCTS_DIR; }; | |||
4B699C47097D421600A18468 /* Jackmp.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Jackmp.framework; sourceTree = BUILT_PRODUCTS_DIR; }; | |||
@@ -1549,8 +1523,6 @@ | |||
4B6F7AEC0CD0CDBD00F48A9D /* JackEngineControl.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = JackEngineControl.cpp; path = ../common/JackEngineControl.cpp; sourceTree = SOURCE_ROOT; }; | |||
4B76C7680E5AB2DB00E2AC21 /* JackNetInterface.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JackNetInterface.cpp; path = ../common/JackNetInterface.cpp; sourceTree = SOURCE_ROOT; }; | |||
4B76C7690E5AB2DB00E2AC21 /* JackNetInterface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JackNetInterface.h; path = ../common/JackNetInterface.h; sourceTree = SOURCE_ROOT; }; | |||
4B799AD607899652003F3F15 /* JackMachPort.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JackMachPort.cpp; sourceTree = "<group>"; }; | |||
4B799AD707899652003F3F15 /* JackMachPort.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JackMachPort.h; sourceTree = "<group>"; }; | |||
4B80D7E50BA0D17400F035BB /* JackMidiPort.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = JackMidiPort.h; path = ../common/JackMidiPort.h; sourceTree = SOURCE_ROOT; }; | |||
4B80D7E60BA0D17400F035BB /* JackMidiPort.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = JackMidiPort.cpp; path = ../common/JackMidiPort.cpp; sourceTree = SOURCE_ROOT; }; | |||
4B80D7E70BA0D17400F035BB /* JackMidiAPI.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = JackMidiAPI.cpp; path = ../common/JackMidiAPI.cpp; sourceTree = SOURCE_ROOT; }; | |||
@@ -1559,8 +1531,6 @@ | |||
4B869D7F08C9CB00001CF041 /* JackDriverLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = JackDriverLoader.cpp; path = ../common/JackDriverLoader.cpp; sourceTree = SOURCE_ROOT; }; | |||
4B88D03911298BEE007A87C1 /* weakjack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = weakjack.h; path = ../common/jack/weakjack.h; sourceTree = SOURCE_ROOT; }; | |||
4B88D03A11298BEE007A87C1 /* weakmacros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = weakmacros.h; path = ../common/jack/weakmacros.h; sourceTree = SOURCE_ROOT; }; | |||
4B89B759076B731100D170DE /* JackRPCClientUser.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = JackRPCClientUser.c; path = RPC/JackRPCClientUser.c; sourceTree = SOURCE_ROOT; }; | |||
4B89B769076B74D200D170DE /* JackRPCEngineUser.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = JackRPCEngineUser.c; path = RPC/JackRPCEngineUser.c; sourceTree = SOURCE_ROOT; }; | |||
4B940B9B06DDDE5B00D77F60 /* AudioHardware.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = AudioHardware.h; path = /System/Library/Frameworks/CoreAudio.framework/Versions/A/Headers/AudioHardware.h; sourceTree = "<absolute>"; }; | |||
4B94334910A5E666002A187F /* systemdeps.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = systemdeps.h; path = ../common/jack/systemdeps.h; sourceTree = SOURCE_ROOT; }; | |||
4B95BCAD0D913073000F7695 /* control.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = control.h; path = ../common/jack/control.h; sourceTree = SOURCE_ROOT; }; | |||
@@ -1645,7 +1615,6 @@ | |||
4BF339150F8B86DC0080FB5B /* JackCoreMidiDriver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JackCoreMidiDriver.cpp; path = coremidi/JackCoreMidiDriver.cpp; sourceTree = SOURCE_ROOT; }; | |||
4BF3391F0F8B873E0080FB5B /* JackMidiDriver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JackMidiDriver.cpp; path = ../common/JackMidiDriver.cpp; sourceTree = SOURCE_ROOT; }; | |||
4BF339200F8B873E0080FB5B /* JackMidiDriver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JackMidiDriver.h; path = ../common/JackMidiDriver.h; sourceTree = SOURCE_ROOT; }; | |||
4BF3937C0626BF3600CC67FA /* JackMacLibClientRPC.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JackMacLibClientRPC.cpp; sourceTree = SOURCE_ROOT; }; | |||
4BF4BAB00E3480AB00403CDF /* JackAudioAdapterFactory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JackAudioAdapterFactory.cpp; path = ../common/JackAudioAdapterFactory.cpp; sourceTree = SOURCE_ROOT; }; | |||
4BF520520CB8D0E80037470E /* timestamps.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = timestamps.c; path = ../common/timestamps.c; sourceTree = SOURCE_ROOT; }; | |||
4BF520580CB8D1010037470E /* timestamps.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = timestamps.h; path = ../common/timestamps.h; sourceTree = SOURCE_ROOT; }; | |||
@@ -1718,14 +1687,6 @@ | |||
4BFA82CF0DF6A9E40087B4E1 /* jack_impulse_grabber */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = jack_impulse_grabber; sourceTree = BUILT_PRODUCTS_DIR; }; | |||
4BFA99A20AAAF3B0009E916C /* jdelay */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = jdelay; sourceTree = BUILT_PRODUCTS_DIR; }; | |||
4BFA99A90AAAF40C009E916C /* jdelay.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = jdelay.cpp; path = ../tests/jdelay.cpp; sourceTree = SOURCE_ROOT; }; | |||
4BFB297708AF44ED00D450D4 /* JackMachServerNotifyChannel.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JackMachServerNotifyChannel.cpp; sourceTree = "<group>"; }; | |||
4BFB297808AF44ED00D450D4 /* JackMachServerChannel.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JackMachServerChannel.h; sourceTree = "<group>"; }; | |||
4BFB297908AF44ED00D450D4 /* JackMachServerChannel.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JackMachServerChannel.cpp; sourceTree = "<group>"; }; | |||
4BFB297A08AF44ED00D450D4 /* JackMachServerNotifyChannel.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JackMachServerNotifyChannel.h; sourceTree = "<group>"; }; | |||
4BFB298708AF450200D450D4 /* JackMachClientChannel.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JackMachClientChannel.h; sourceTree = "<group>"; }; | |||
4BFB298808AF450200D450D4 /* JackMachNotifyChannel.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JackMachNotifyChannel.cpp; sourceTree = "<group>"; }; | |||
4BFB298908AF450200D450D4 /* JackMachNotifyChannel.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JackMachNotifyChannel.h; sourceTree = "<group>"; }; | |||
4BFB29AE08AF45FD00D450D4 /* JackMachClientChannel.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JackMachClientChannel.cpp; sourceTree = SOURCE_ROOT; }; | |||
4BFB73F608AD291A00DB99B8 /* JackGlobals.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = JackGlobals.h; path = ../common/JackGlobals.h; sourceTree = SOURCE_ROOT; }; | |||
4BFB741E08AD2B9900DB99B8 /* JackMachThread.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JackMachThread.cpp; sourceTree = SOURCE_ROOT; }; | |||
4BFB741F08AD2B9900DB99B8 /* JackMachThread.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JackMachThread.h; sourceTree = SOURCE_ROOT; }; | |||
@@ -2072,6 +2033,13 @@ | |||
); | |||
runOnlyForDeploymentPostprocessing = 0; | |||
}; | |||
4B6654F1127C34AE00753A79 /* Frameworks */ = { | |||
isa = PBXFrameworksBuildPhase; | |||
buildActionMask = 2147483647; | |||
files = ( | |||
); | |||
runOnlyForDeploymentPostprocessing = 0; | |||
}; | |||
4B699BAB097D421600A18468 /* Frameworks */ = { | |||
isa = PBXFrameworksBuildPhase; | |||
buildActionMask = 2147483647; | |||
@@ -2499,6 +2467,7 @@ | |||
4B32257B10A3190C00838A8E /* jack_netsource */, | |||
4BA339AC10B2E36800190E3B /* Jackservermp.framework */, | |||
4B47ACD710B5890100469C67 /* Jackmp.framework */, | |||
4B6654F7127C34AE00753A79 /* jack_server_control */, | |||
); | |||
name = Products; | |||
sourceTree = "<group>"; | |||
@@ -2506,6 +2475,7 @@ | |||
4B03383E0797E19900686131 /* Simple clients */ = { | |||
isa = PBXGroup; | |||
children = ( | |||
4B6654FB127C350100753A79 /* server_control.cpp */, | |||
4B363F750DEB0D7D001F72D9 /* impulse_grabber.c */, | |||
4B363F220DEB0AB0001F72D9 /* monitor_client.c */, | |||
4B363EED0DEB094B001F72D9 /* capture_client.c */, | |||
@@ -2627,24 +2597,6 @@ | |||
name = Additional; | |||
sourceTree = "<group>"; | |||
}; | |||
4B168CA3076A5319005B2802 /* MIG_RPC */ = { | |||
isa = PBXGroup; | |||
children = ( | |||
4B89B759076B731100D170DE /* JackRPCClientUser.c */, | |||
4B4259E5076B635E00C1ECE1 /* JackMacEngineRPC.cpp */, | |||
); | |||
name = MIG_RPC; | |||
sourceTree = "<group>"; | |||
}; | |||
4B168CA4076A5333005B2802 /* MIG_RPC */ = { | |||
isa = PBXGroup; | |||
children = ( | |||
4B89B769076B74D200D170DE /* JackRPCEngineUser.c */, | |||
4BF3937C0626BF3600CC67FA /* JackMacLibClientRPC.cpp */, | |||
); | |||
name = MIG_RPC; | |||
sourceTree = "<group>"; | |||
}; | |||
4B19B3010E23629800DD4A82 /* Adapter */ = { | |||
isa = PBXGroup; | |||
children = ( | |||
@@ -2818,7 +2770,6 @@ | |||
4BA550F905E241D900569492 /* Library */ = { | |||
isa = PBXGroup; | |||
children = ( | |||
4B168CA4076A5333005B2802 /* MIG_RPC */, | |||
4BF8D1FB0834EFD100C94B91 /* JackLibGlobals.h */, | |||
4BF8D1FC0834EFD100C94B91 /* JackLibClient.h */, | |||
4BF8D1FD0834EFD100C94B91 /* JackLibClient.cpp */, | |||
@@ -2844,7 +2795,6 @@ | |||
4BA550FB05E2420000569492 /* Engine */ = { | |||
isa = PBXGroup; | |||
children = ( | |||
4B168CA3076A5319005B2802 /* MIG_RPC */, | |||
4B5F253D0DEE9B8F0041E486 /* JackLockedEngine.h */, | |||
4BF8D2130834F02800C94B91 /* JackEngine.h */, | |||
4BF8D2140834F02800C94B91 /* JackEngine.cpp */, | |||
@@ -2872,7 +2822,6 @@ | |||
4BB371D40C1AD85A0050C1E4 /* JackNotification.h */, | |||
4BF8D1B30834EED500C94B91 /* JackInternalClientChannel.h */, | |||
4BFB299908AF452300D450D4 /* Socket */, | |||
4BFB299808AF451200D450D4 /* Mach */, | |||
); | |||
name = Channels; | |||
sourceTree = "<group>"; | |||
@@ -2963,23 +2912,6 @@ | |||
name = MIDI; | |||
sourceTree = "<group>"; | |||
}; | |||
4BFB299808AF451200D450D4 /* Mach */ = { | |||
isa = PBXGroup; | |||
children = ( | |||
4B799AD707899652003F3F15 /* JackMachPort.h */, | |||
4B799AD607899652003F3F15 /* JackMachPort.cpp */, | |||
4BFB298708AF450200D450D4 /* JackMachClientChannel.h */, | |||
4BFB29AE08AF45FD00D450D4 /* JackMachClientChannel.cpp */, | |||
4BFB297808AF44ED00D450D4 /* JackMachServerChannel.h */, | |||
4BFB297908AF44ED00D450D4 /* JackMachServerChannel.cpp */, | |||
4BFB297A08AF44ED00D450D4 /* JackMachServerNotifyChannel.h */, | |||
4BFB297708AF44ED00D450D4 /* JackMachServerNotifyChannel.cpp */, | |||
4BFB298908AF450200D450D4 /* JackMachNotifyChannel.h */, | |||
4BFB298808AF450200D450D4 /* JackMachNotifyChannel.cpp */, | |||
); | |||
name = Mach; | |||
sourceTree = "<group>"; | |||
}; | |||
4BFB299908AF452300D450D4 /* Socket */ = { | |||
isa = PBXGroup; | |||
children = ( | |||
@@ -3110,7 +3042,6 @@ | |||
isa = PBXHeadersBuildPhase; | |||
buildActionMask = 2147483647; | |||
files = ( | |||
4B35C4290D4731D1000DE7AE /* JackMachPort.h in Headers */, | |||
4B35C42A0D4731D1000DE7AE /* JackError.h in Headers */, | |||
4B35C42B0D4731D1000DE7AE /* JackTime.h in Headers */, | |||
4B35C42C0D4731D1000DE7AE /* JackShmMem.h in Headers */, | |||
@@ -3131,7 +3062,6 @@ | |||
4B35C43D0D4731D1000DE7AE /* JackMachSemaphore.h in Headers */, | |||
4B35C43E0D4731D1000DE7AE /* JackGlobals.h in Headers */, | |||
4B35C43F0D4731D1000DE7AE /* JackMachThread.h in Headers */, | |||
4B35C4400D4731D1000DE7AE /* JackMachClientChannel.h in Headers */, | |||
4B35C4460D4731D1000DE7AE /* JackSynchro.h in Headers */, | |||
4B35C4470D4731D1000DE7AE /* JackDebugClient.h in Headers */, | |||
4B35C4480D4731D1000DE7AE /* JackConstants.h in Headers */, | |||
@@ -3154,6 +3084,8 @@ | |||
4BECB2FA0F4451C10091B70A /* JackProcessSync.h in Headers */, | |||
4B88D03F11298BEE007A87C1 /* weakjack.h in Headers */, | |||
4B88D04011298BEE007A87C1 /* weakmacros.h in Headers */, | |||
4B8A38F0117B827900664E07 /* JackSocket.h in Headers */, | |||
4B8A38F7117B82B200664E07 /* JackSocketClientChannel.h in Headers */, | |||
); | |||
runOnlyForDeploymentPostprocessing = 0; | |||
}; | |||
@@ -3161,7 +3093,6 @@ | |||
isa = PBXHeadersBuildPhase; | |||
buildActionMask = 2147483647; | |||
files = ( | |||
4B35C4870D4731D1000DE7AE /* JackMachPort.h in Headers */, | |||
4B35C4880D4731D1000DE7AE /* JackError.h in Headers */, | |||
4B35C4890D4731D1000DE7AE /* JackTime.h in Headers */, | |||
4B35C48A0D4731D1000DE7AE /* JackShmMem.h in Headers */, | |||
@@ -3190,9 +3121,6 @@ | |||
4B35C4A90D4731D1000DE7AE /* JackEngine.h in Headers */, | |||
4B35C4AA0D4731D1000DE7AE /* JackExternalClient.h in Headers */, | |||
4B35C4AB0D4731D1000DE7AE /* JackServer.h in Headers */, | |||
4B35C4AE0D4731D1000DE7AE /* JackMachNotifyChannel.h in Headers */, | |||
4B35C4AF0D4731D1000DE7AE /* JackMachServerChannel.h in Headers */, | |||
4B35C4B00D4731D1000DE7AE /* JackMachServerNotifyChannel.h in Headers */, | |||
4B35C4B20D4731D1000DE7AE /* JackConstants.h in Headers */, | |||
4B35C4B30D4731D1000DE7AE /* JackTransportEngine.h in Headers */, | |||
4B35C4B40D4731D1000DE7AE /* JackServerGlobals.h in Headers */, | |||
@@ -3226,6 +3154,10 @@ | |||
4B88D04411298BEE007A87C1 /* weakmacros.h in Headers */, | |||
4BC2CA5A113C6CB80076717C /* JackNetInterface.h in Headers */, | |||
4BC2CA5C113C6CC00076717C /* JackNetUnixSocket.h in Headers */, | |||
4B8A38A8117B80DA00664E07 /* JackSocket.h in Headers */, | |||
4B8A38AD117B810A00664E07 /* JackSocketNotifyChannel.h in Headers */, | |||
4B8A38B0117B812500664E07 /* JackSocketServerChannel.h in Headers */, | |||
4B8A38C4117B814000664E07 /* JackSocketServerNotifyChannel.h in Headers */, | |||
); | |||
runOnlyForDeploymentPostprocessing = 0; | |||
}; | |||
@@ -3464,7 +3396,6 @@ | |||
isa = PBXHeadersBuildPhase; | |||
buildActionMask = 2147483647; | |||
files = ( | |||
4B47AC8210B5890100469C67 /* JackMachPort.h in Headers */, | |||
4B47AC8310B5890100469C67 /* JackError.h in Headers */, | |||
4B47AC8410B5890100469C67 /* JackTime.h in Headers */, | |||
4B47AC8510B5890100469C67 /* JackShmMem.h in Headers */, | |||
@@ -3485,7 +3416,6 @@ | |||
4B47AC9410B5890100469C67 /* JackMachSemaphore.h in Headers */, | |||
4B47AC9510B5890100469C67 /* JackGlobals.h in Headers */, | |||
4B47AC9610B5890100469C67 /* JackMachThread.h in Headers */, | |||
4B47AC9710B5890100469C67 /* JackMachClientChannel.h in Headers */, | |||
4B47AC9810B5890100469C67 /* JackSynchro.h in Headers */, | |||
4B47AC9910B5890100469C67 /* JackDebugClient.h in Headers */, | |||
4B47AC9A10B5890100469C67 /* JackConstants.h in Headers */, | |||
@@ -3536,6 +3466,13 @@ | |||
); | |||
runOnlyForDeploymentPostprocessing = 0; | |||
}; | |||
4B6654EE127C34AE00753A79 /* Headers */ = { | |||
isa = PBXHeadersBuildPhase; | |||
buildActionMask = 2147483647; | |||
files = ( | |||
); | |||
runOnlyForDeploymentPostprocessing = 0; | |||
}; | |||
4B699BA8097D421600A18468 /* Headers */ = { | |||
isa = PBXHeadersBuildPhase; | |||
buildActionMask = 2147483647; | |||
@@ -3547,7 +3484,6 @@ | |||
isa = PBXHeadersBuildPhase; | |||
buildActionMask = 2147483647; | |||
files = ( | |||
4B699C02097D421600A18468 /* JackMachPort.h in Headers */, | |||
4B699C03097D421600A18468 /* JackError.h in Headers */, | |||
4B699C04097D421600A18468 /* JackTime.h in Headers */, | |||
4B699C05097D421600A18468 /* JackShmMem.h in Headers */, | |||
@@ -3568,7 +3504,6 @@ | |||
4B699C16097D421600A18468 /* JackMachSemaphore.h in Headers */, | |||
4B699C17097D421600A18468 /* JackGlobals.h in Headers */, | |||
4B699C18097D421600A18468 /* JackMachThread.h in Headers */, | |||
4B699C19097D421600A18468 /* JackMachClientChannel.h in Headers */, | |||
4B699C20097D421600A18468 /* JackSynchro.h in Headers */, | |||
4B699C21097D421600A18468 /* JackDebugClient.h in Headers */, | |||
4B699C22097D421600A18468 /* JackConstants.h in Headers */, | |||
@@ -3599,7 +3534,6 @@ | |||
isa = PBXHeadersBuildPhase; | |||
buildActionMask = 2147483647; | |||
files = ( | |||
4B699C4E097D421600A18468 /* JackMachPort.h in Headers */, | |||
4B699C4F097D421600A18468 /* JackError.h in Headers */, | |||
4B699C50097D421600A18468 /* JackTime.h in Headers */, | |||
4B699C51097D421600A18468 /* JackShmMem.h in Headers */, | |||
@@ -3628,9 +3562,6 @@ | |||
4B699C71097D421600A18468 /* JackEngine.h in Headers */, | |||
4B699C73097D421600A18468 /* JackExternalClient.h in Headers */, | |||
4B699C74097D421600A18468 /* JackServer.h in Headers */, | |||
4B699C77097D421600A18468 /* JackMachNotifyChannel.h in Headers */, | |||
4B699C78097D421600A18468 /* JackMachServerChannel.h in Headers */, | |||
4B699C79097D421600A18468 /* JackMachServerNotifyChannel.h in Headers */, | |||
4B699C7B097D421600A18468 /* JackConstants.h in Headers */, | |||
4BD4B4D809BACD9600750C0F /* JackTransportEngine.h in Headers */, | |||
4BC2168E0A444BED00BDA09F /* JackServerGlobals.h in Headers */, | |||
@@ -3784,7 +3715,6 @@ | |||
isa = PBXHeadersBuildPhase; | |||
buildActionMask = 2147483647; | |||
files = ( | |||
4BA3393510B2E36800190E3B /* JackMachPort.h in Headers */, | |||
4BA3393610B2E36800190E3B /* JackError.h in Headers */, | |||
4BA3393710B2E36800190E3B /* JackTime.h in Headers */, | |||
4BA3393810B2E36800190E3B /* JackShmMem.h in Headers */, | |||
@@ -3813,9 +3743,6 @@ | |||
4BA3394F10B2E36800190E3B /* JackEngine.h in Headers */, | |||
4BA3395010B2E36800190E3B /* JackExternalClient.h in Headers */, | |||
4BA3395110B2E36800190E3B /* JackServer.h in Headers */, | |||
4BA3395210B2E36800190E3B /* JackMachNotifyChannel.h in Headers */, | |||
4BA3395310B2E36800190E3B /* JackMachServerChannel.h in Headers */, | |||
4BA3395410B2E36800190E3B /* JackMachServerNotifyChannel.h in Headers */, | |||
4BA3395510B2E36800190E3B /* JackConstants.h in Headers */, | |||
4BA3395610B2E36800190E3B /* JackTransportEngine.h in Headers */, | |||
4BA3395710B2E36800190E3B /* JackServerGlobals.h in Headers */, | |||
@@ -4878,6 +4805,25 @@ | |||
productReference = 4B5E08D50E5B66EE00BEE4E0 /* netadapter.so */; | |||
productType = "com.apple.product-type.library.dynamic"; | |||
}; | |||
4B6654ED127C34AE00753A79 /* jack_server_control 64 bits */ = { | |||
isa = PBXNativeTarget; | |||
buildConfigurationList = 4B6654F3127C34AE00753A79 /* Build configuration list for PBXNativeTarget "jack_server_control 64 bits" */; | |||
buildPhases = ( | |||
4B6654EE127C34AE00753A79 /* Headers */, | |||
4B6654EF127C34AE00753A79 /* Sources */, | |||
4B6654F1127C34AE00753A79 /* Frameworks */, | |||
4B6654F2127C34AE00753A79 /* Rez */, | |||
); | |||
buildRules = ( | |||
); | |||
dependencies = ( | |||
); | |||
name = "jack_server_control 64 bits"; | |||
productInstallPath = /usr/local/bin; | |||
productName = testSem; | |||
productReference = 4B6654F7127C34AE00753A79 /* jack_server_control */; | |||
productType = "com.apple.product-type.tool"; | |||
}; | |||
4B699BA7097D421600A18468 /* jackdmp framework Universal */ = { | |||
isa = PBXNativeTarget; | |||
buildConfigurationList = 4B699BAD097D421600A18468 /* Build configuration list for PBXNativeTarget "jackdmp framework Universal" */; | |||
@@ -5642,7 +5588,14 @@ | |||
isa = PBXProject; | |||
buildConfigurationList = 4B699DD5097D427F00A18468 /* Build configuration list for PBXProject "Jackdmp" */; | |||
compatibilityVersion = "Xcode 2.4"; | |||
developmentRegion = English; | |||
hasScannedForEncodings = 1; | |||
knownRegions = ( | |||
English, | |||
Japanese, | |||
French, | |||
German, | |||
); | |||
mainGroup = 08FB7794FE84155DC02AAC07 /* JackServer */; | |||
projectDirPath = ""; | |||
projectRoot = ""; | |||
@@ -5722,6 +5675,7 @@ | |||
4BFA82B90DF6A9E40087B4E1 /* jack_showtime 64 bits */, | |||
4BFA82C50DF6A9E40087B4E1 /* jack_impulse_grabber 64 bits */, | |||
4B32257110A3190C00838A8E /* jack_netsource 64 bits */, | |||
4B6654ED127C34AE00753A79 /* jack_server_control 64 bits */, | |||
4B35C5D80D4731D2000DE7AE /* synchroServer 64 bits */, | |||
4B35C5EC0D4731D2000DE7AE /* synchroClient 64 bits */, | |||
4B35C6000D4731D2000DE7AE /* synchroServerClient 64 bits */, | |||
@@ -6038,6 +5992,13 @@ | |||
); | |||
runOnlyForDeploymentPostprocessing = 0; | |||
}; | |||
4B6654F2127C34AE00753A79 /* Rez */ = { | |||
isa = PBXRezBuildPhase; | |||
buildActionMask = 2147483647; | |||
files = ( | |||
); | |||
runOnlyForDeploymentPostprocessing = 0; | |||
}; | |||
4B699BAC097D421600A18468 /* Rez */ = { | |||
isa = PBXRezBuildPhase; | |||
buildActionMask = 2147483647; | |||
@@ -6325,9 +6286,6 @@ | |||
isa = PBXSourcesBuildPhase; | |||
buildActionMask = 2147483647; | |||
files = ( | |||
4B35C4580D4731D1000DE7AE /* JackMacLibClientRPC.cpp in Sources */, | |||
4B35C4590D4731D1000DE7AE /* JackRPCEngineUser.c in Sources */, | |||
4B35C45A0D4731D1000DE7AE /* JackMachPort.cpp in Sources */, | |||
4B35C45B0D4731D1000DE7AE /* JackShmMem.cpp in Sources */, | |||
4B35C45C0D4731D1000DE7AE /* shm.c in Sources */, | |||
4B35C45E0D4731D1000DE7AE /* JackActivationCount.cpp in Sources */, | |||
@@ -6341,7 +6299,6 @@ | |||
4B35C4660D4731D1000DE7AE /* JackFrameTimer.cpp in Sources */, | |||
4B35C4680D4731D1000DE7AE /* JackMachSemaphore.cpp in Sources */, | |||
4B35C4690D4731D1000DE7AE /* JackMachThread.cpp in Sources */, | |||
4B35C46A0D4731D1000DE7AE /* JackMachClientChannel.cpp in Sources */, | |||
4B35C4700D4731D1000DE7AE /* JackGlobals.cpp in Sources */, | |||
4B35C4720D4731D1000DE7AE /* ringbuffer.c in Sources */, | |||
4B35C4730D4731D1000DE7AE /* JackDebugClient.cpp in Sources */, | |||
@@ -6359,6 +6316,8 @@ | |||
4B93F19D0E87998400E4ECCD /* JackPosixThread.cpp in Sources */, | |||
4B93F1C00E87A35400E4ECCD /* JackMachTime.c in Sources */, | |||
4BECB2F90F4451C10091B70A /* JackProcessSync.cpp in Sources */, | |||
4B8A38F1117B827E00664E07 /* JackSocketClientChannel.cpp in Sources */, | |||
4B8A38F6117B82AB00664E07 /* JackSocket.cpp in Sources */, | |||
); | |||
runOnlyForDeploymentPostprocessing = 0; | |||
}; | |||
@@ -6366,7 +6325,6 @@ | |||
isa = PBXSourcesBuildPhase; | |||
buildActionMask = 2147483647; | |||
files = ( | |||
4B35C4C40D4731D1000DE7AE /* JackMachPort.cpp in Sources */, | |||
4B35C4C50D4731D1000DE7AE /* JackShmMem.cpp in Sources */, | |||
4B35C4C60D4731D1000DE7AE /* shm.c in Sources */, | |||
4B35C4C80D4731D1000DE7AE /* JackActivationCount.cpp in Sources */, | |||
@@ -6388,12 +6346,7 @@ | |||
4B35C4DD0D4731D1000DE7AE /* JackEngine.cpp in Sources */, | |||
4B35C4DE0D4731D1000DE7AE /* JackExternalClient.cpp in Sources */, | |||
4B35C4DF0D4731D1000DE7AE /* JackInternalClient.cpp in Sources */, | |||
4B35C4E00D4731D1000DE7AE /* JackRPCClientUser.c in Sources */, | |||
4B35C4E20D4731D1000DE7AE /* JackServer.cpp in Sources */, | |||
4B35C4E60D4731D1000DE7AE /* JackMacEngineRPC.cpp in Sources */, | |||
4B35C4E70D4731D1000DE7AE /* JackMachNotifyChannel.cpp in Sources */, | |||
4B35C4E80D4731D1000DE7AE /* JackMachServerChannel.cpp in Sources */, | |||
4B35C4E90D4731D1000DE7AE /* JackMachServerNotifyChannel.cpp in Sources */, | |||
4B35C4EB0D4731D1000DE7AE /* JackTransportEngine.cpp in Sources */, | |||
4B35C4EC0D4731D1000DE7AE /* JackServerAPI.cpp in Sources */, | |||
4B35C4ED0D4731D1000DE7AE /* JackServerGlobals.cpp in Sources */, | |||
@@ -6421,6 +6374,10 @@ | |||
4BCBCE6310C4FE3F00450FFE /* JackPhysicalMidiOutput.cpp in Sources */, | |||
4BC2CA59113C6CB60076717C /* JackNetInterface.cpp in Sources */, | |||
4BC2CA5B113C6CBE0076717C /* JackNetUnixSocket.cpp in Sources */, | |||
4B8A38A7117B80D300664E07 /* JackSocket.cpp in Sources */, | |||
4B8A38AE117B811100664E07 /* JackSocketNotifyChannel.cpp in Sources */, | |||
4B8A38B1117B812D00664E07 /* JackSocketServerChannel.cpp in Sources */, | |||
4B8A38B2117B813400664E07 /* JackSocketServerNotifyChannel.cpp in Sources */, | |||
); | |||
runOnlyForDeploymentPostprocessing = 0; | |||
}; | |||
@@ -6686,9 +6643,6 @@ | |||
isa = PBXSourcesBuildPhase; | |||
buildActionMask = 2147483647; | |||
files = ( | |||
4B47ACAE10B5890100469C67 /* JackMacLibClientRPC.cpp in Sources */, | |||
4B47ACAF10B5890100469C67 /* JackRPCEngineUser.c in Sources */, | |||
4B47ACB010B5890100469C67 /* JackMachPort.cpp in Sources */, | |||
4B47ACB110B5890100469C67 /* JackShmMem.cpp in Sources */, | |||
4B47ACB210B5890100469C67 /* shm.c in Sources */, | |||
4B47ACB310B5890100469C67 /* JackActivationCount.cpp in Sources */, | |||
@@ -6702,7 +6656,6 @@ | |||
4B47ACBB10B5890100469C67 /* JackFrameTimer.cpp in Sources */, | |||
4B47ACBC10B5890100469C67 /* JackMachSemaphore.cpp in Sources */, | |||
4B47ACBD10B5890100469C67 /* JackMachThread.cpp in Sources */, | |||
4B47ACBE10B5890100469C67 /* JackMachClientChannel.cpp in Sources */, | |||
4B47ACBF10B5890100469C67 /* JackGlobals.cpp in Sources */, | |||
4B47ACC010B5890100469C67 /* ringbuffer.c in Sources */, | |||
4B47ACC110B5890100469C67 /* JackDebugClient.cpp in Sources */, | |||
@@ -6751,6 +6704,14 @@ | |||
); | |||
runOnlyForDeploymentPostprocessing = 0; | |||
}; | |||
4B6654EF127C34AE00753A79 /* Sources */ = { | |||
isa = PBXSourcesBuildPhase; | |||
buildActionMask = 2147483647; | |||
files = ( | |||
4B6654FC127C350100753A79 /* server_control.cpp in Sources */, | |||
); | |||
runOnlyForDeploymentPostprocessing = 0; | |||
}; | |||
4B699BA9097D421600A18468 /* Sources */ = { | |||
isa = PBXSourcesBuildPhase; | |||
buildActionMask = 2147483647; | |||
@@ -6763,9 +6724,6 @@ | |||
isa = PBXSourcesBuildPhase; | |||
buildActionMask = 2147483647; | |||
files = ( | |||
4B699C25097D421600A18468 /* JackMacLibClientRPC.cpp in Sources */, | |||
4B699C26097D421600A18468 /* JackRPCEngineUser.c in Sources */, | |||
4B699C27097D421600A18468 /* JackMachPort.cpp in Sources */, | |||
4B699C28097D421600A18468 /* JackShmMem.cpp in Sources */, | |||
4B699C29097D421600A18468 /* shm.c in Sources */, | |||
4B699C2B097D421600A18468 /* JackActivationCount.cpp in Sources */, | |||
@@ -6779,7 +6737,6 @@ | |||
4B699C33097D421600A18468 /* JackFrameTimer.cpp in Sources */, | |||
4B699C35097D421600A18468 /* JackMachSemaphore.cpp in Sources */, | |||
4B699C36097D421600A18468 /* JackMachThread.cpp in Sources */, | |||
4B699C37097D421600A18468 /* JackMachClientChannel.cpp in Sources */, | |||
4B699C3D097D421600A18468 /* JackGlobals.cpp in Sources */, | |||
4B699C3F097D421600A18468 /* ringbuffer.c in Sources */, | |||
4B699C40097D421600A18468 /* JackDebugClient.cpp in Sources */, | |||
@@ -6804,7 +6761,6 @@ | |||
isa = PBXSourcesBuildPhase; | |||
buildActionMask = 2147483647; | |||
files = ( | |||
4B699C7E097D421600A18468 /* JackMachPort.cpp in Sources */, | |||
4B699C7F097D421600A18468 /* JackShmMem.cpp in Sources */, | |||
4B699C80097D421600A18468 /* shm.c in Sources */, | |||
4B699C82097D421600A18468 /* JackActivationCount.cpp in Sources */, | |||
@@ -6826,12 +6782,7 @@ | |||
4B699C97097D421600A18468 /* JackEngine.cpp in Sources */, | |||
4B699C99097D421600A18468 /* JackExternalClient.cpp in Sources */, | |||
4B699C9A097D421600A18468 /* JackInternalClient.cpp in Sources */, | |||
4B699C9B097D421600A18468 /* JackRPCClientUser.c in Sources */, | |||
4B699C9D097D421600A18468 /* JackServer.cpp in Sources */, | |||
4B699CA1097D421600A18468 /* JackMacEngineRPC.cpp in Sources */, | |||
4B699CA2097D421600A18468 /* JackMachNotifyChannel.cpp in Sources */, | |||
4B699CA3097D421600A18468 /* JackMachServerChannel.cpp in Sources */, | |||
4B699CA4097D421600A18468 /* JackMachServerNotifyChannel.cpp in Sources */, | |||
4BD4B4D909BACD9600750C0F /* JackTransportEngine.cpp in Sources */, | |||
4BC216850A444BAD00BDA09F /* JackServerAPI.cpp in Sources */, | |||
4BC216890A444BDE00BDA09F /* JackServerGlobals.cpp in Sources */, | |||
@@ -6986,7 +6937,6 @@ | |||
isa = PBXSourcesBuildPhase; | |||
buildActionMask = 2147483647; | |||
files = ( | |||
4BA3397210B2E36800190E3B /* JackMachPort.cpp in Sources */, | |||
4BA3397310B2E36800190E3B /* JackShmMem.cpp in Sources */, | |||
4BA3397410B2E36800190E3B /* shm.c in Sources */, | |||
4BA3397510B2E36800190E3B /* JackActivationCount.cpp in Sources */, | |||
@@ -7008,12 +6958,7 @@ | |||
4BA3398510B2E36800190E3B /* JackEngine.cpp in Sources */, | |||
4BA3398610B2E36800190E3B /* JackExternalClient.cpp in Sources */, | |||
4BA3398710B2E36800190E3B /* JackInternalClient.cpp in Sources */, | |||
4BA3398810B2E36800190E3B /* JackRPCClientUser.c in Sources */, | |||
4BA3398910B2E36800190E3B /* JackServer.cpp in Sources */, | |||
4BA3398A10B2E36800190E3B /* JackMacEngineRPC.cpp in Sources */, | |||
4BA3398B10B2E36800190E3B /* JackMachNotifyChannel.cpp in Sources */, | |||
4BA3398C10B2E36800190E3B /* JackMachServerChannel.cpp in Sources */, | |||
4BA3398D10B2E36800190E3B /* JackMachServerNotifyChannel.cpp in Sources */, | |||
4BA3398E10B2E36800190E3B /* JackTransportEngine.cpp in Sources */, | |||
4BA3398F10B2E36800190E3B /* JackServerAPI.cpp in Sources */, | |||
4BA3399010B2E36800190E3B /* JackServerGlobals.cpp in Sources */, | |||
@@ -7432,6 +7377,11 @@ | |||
target = 4B5A1BD00CD1CCE10005BF74 /* jack_midisine Universal */; | |||
targetProxy = 4B5A1BE10CD1CD730005BF74 /* PBXContainerItemProxy */; | |||
}; | |||
4B66550E127C356E00753A79 /* PBXTargetDependency */ = { | |||
isa = PBXTargetDependency; | |||
target = 4B6654ED127C34AE00753A79 /* jack_server_control 64 bits */; | |||
targetProxy = 4B66550D127C356E00753A79 /* PBXContainerItemProxy */; | |||
}; | |||
4B699DB4097D421700A18468 /* PBXTargetDependency */ = { | |||
isa = PBXTargetDependency; | |||
target = 4B699C4C097D421600A18468 /* Jackservermp.framework Universal */; | |||
@@ -8149,6 +8099,7 @@ | |||
MACOSX_DEPLOYMENT_TARGET = 10.4; | |||
OTHER_CFLAGS = "-DJACK_32_64"; | |||
OTHER_CPLUSPLUSFLAGS = ( | |||
"-DSERVER_SIDE", | |||
"-DHAVE_CELT", | |||
"-DHAVE_CELT_API_0_7", | |||
"-DMACH_RPC_MACH_SEMA", | |||
@@ -10909,6 +10860,7 @@ | |||
MACOSX_DEPLOYMENT_TARGET = 10.4; | |||
OTHER_CFLAGS = "-DJACK_32_64"; | |||
OTHER_CPLUSPLUSFLAGS = ( | |||
"-DSERVER_SIDE", | |||
"-DMACH_RPC_MACH_SEMA", | |||
"-DJACK_32_64", | |||
); | |||
@@ -11206,6 +11158,7 @@ | |||
MACOSX_DEPLOYMENT_TARGET = 10.4; | |||
OTHER_CFLAGS = "-DJACK_32_64"; | |||
OTHER_CPLUSPLUSFLAGS = ( | |||
"-DSERVER_SIDE", | |||
"-DMACH_RPC_MACH_SEMA", | |||
"-DJACK_32_64", | |||
); | |||
@@ -12370,6 +12323,7 @@ | |||
MACOSX_DEPLOYMENT_TARGET = 10.4; | |||
OTHER_CFLAGS = "-DJACK_32_64"; | |||
OTHER_CPLUSPLUSFLAGS = ( | |||
"-DSERVER_SIDE", | |||
"-DMACH_RPC_MACH_SEMA", | |||
"-DJACK_32_64", | |||
); | |||
@@ -12967,6 +12921,94 @@ | |||
}; | |||
name = Default; | |||
}; | |||
4B6654F4127C34AE00753A79 /* Development */ = { | |||
isa = XCBuildConfiguration; | |||
buildSettings = { | |||
ARCHS = "$(ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1)"; | |||
ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "x86_64 i386 ppc"; | |||
COPY_PHASE_STRIP = NO; | |||
GCC_DYNAMIC_NO_PIC = NO; | |||
GCC_ENABLE_FIX_AND_CONTINUE = YES; | |||
GCC_GENERATE_DEBUGGING_SYMBOLS = YES; | |||
GCC_OPTIMIZATION_LEVEL = 0; | |||
HEADER_SEARCH_PATHS = ../common; | |||
OTHER_CFLAGS = ""; | |||
OTHER_LDFLAGS = ( | |||
"-framework", | |||
Jackservermp, | |||
); | |||
OTHER_REZFLAGS = ""; | |||
PRODUCT_NAME = jack_test; | |||
REZ_EXECUTABLE = YES; | |||
SDKROOT = ""; | |||
SECTORDER_FLAGS = ""; | |||
WARNING_CFLAGS = ( | |||
"-Wmost", | |||
"-Wno-four-char-constants", | |||
"-Wno-unknown-pragmas", | |||
); | |||
ZERO_LINK = YES; | |||
}; | |||
name = Development; | |||
}; | |||
4B6654F5127C34AE00753A79 /* Deployment */ = { | |||
isa = XCBuildConfiguration; | |||
buildSettings = { | |||
ARCHS = "$(ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1)"; | |||
ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "x86_64 i386 ppc"; | |||
COPY_PHASE_STRIP = YES; | |||
GCC_ENABLE_FIX_AND_CONTINUE = NO; | |||
GCC_OPTIMIZATION_LEVEL = 3; | |||
HEADER_SEARCH_PATHS = ../common; | |||
MACOSX_DEPLOYMENT_TARGET = 10.4; | |||
OTHER_CFLAGS = ""; | |||
OTHER_LDFLAGS = ( | |||
"-framework", | |||
Jackservermp, | |||
); | |||
OTHER_REZFLAGS = ""; | |||
PRODUCT_NAME = jack_server_control; | |||
REZ_EXECUTABLE = YES; | |||
SDKROOT = ""; | |||
SECTORDER_FLAGS = ""; | |||
WARNING_CFLAGS = ( | |||
"-Wmost", | |||
"-Wno-four-char-constants", | |||
"-Wno-unknown-pragmas", | |||
); | |||
ZERO_LINK = NO; | |||
}; | |||
name = Deployment; | |||
}; | |||
4B6654F6127C34AE00753A79 /* Default */ = { | |||
isa = XCBuildConfiguration; | |||
buildSettings = { | |||
ARCHS = ( | |||
ppc64, | |||
ppc, | |||
i386, | |||
x86_64, | |||
); | |||
GCC_OPTIMIZATION_LEVEL = 3; | |||
HEADER_SEARCH_PATHS = ../common; | |||
OTHER_CFLAGS = ""; | |||
OTHER_LDFLAGS = ( | |||
"-framework", | |||
Jackmp, | |||
); | |||
OTHER_REZFLAGS = ""; | |||
PRODUCT_NAME = jack_test; | |||
REZ_EXECUTABLE = YES; | |||
SDKROOT = ""; | |||
SECTORDER_FLAGS = ""; | |||
WARNING_CFLAGS = ( | |||
"-Wmost", | |||
"-Wno-four-char-constants", | |||
"-Wno-unknown-pragmas", | |||
); | |||
}; | |||
name = Default; | |||
}; | |||
4B699B34097D421600A18468 /* Development */ = { | |||
isa = XCBuildConfiguration; | |||
buildSettings = { | |||
@@ -15959,6 +16001,7 @@ | |||
MACOSX_DEPLOYMENT_TARGET = 10.4; | |||
OTHER_CFLAGS = "-DJACK_32_64"; | |||
OTHER_CPLUSPLUSFLAGS = ( | |||
"-DSERVER_SIDE", | |||
"-DMACH_RPC_MACH_SEMA", | |||
"-DJACK_32_64", | |||
); | |||
@@ -16103,6 +16146,7 @@ | |||
MACOSX_DEPLOYMENT_TARGET = 10.4; | |||
OTHER_CFLAGS = "-DJACK_32_64"; | |||
OTHER_CPLUSPLUSFLAGS = ( | |||
"-DSERVER_SIDE", | |||
"-DMACH_RPC_MACH_SEMA", | |||
"-DJACK_32_64", | |||
); | |||
@@ -16243,7 +16287,10 @@ | |||
MACH_O_TYPE = mh_dylib; | |||
MACOSX_DEPLOYMENT_TARGET = 10.4; | |||
OTHER_CFLAGS = "-DJACK_32_64"; | |||
OTHER_CPLUSPLUSFLAGS = "$(OTHER_CFLAGS)"; | |||
OTHER_CPLUSPLUSFLAGS = ( | |||
"-DSERVER_SIDE", | |||
"$(OTHER_CFLAGS)", | |||
); | |||
OTHER_LDFLAGS = ( | |||
"-framework", | |||
Jackservermp, | |||
@@ -16386,7 +16433,10 @@ | |||
MACH_O_TYPE = mh_dylib; | |||
MACOSX_DEPLOYMENT_TARGET = 10.4; | |||
OTHER_CFLAGS = "-DJACK_32_64"; | |||
OTHER_CPLUSPLUSFLAGS = "$(OTHER_CFLAGS)"; | |||
OTHER_CPLUSPLUSFLAGS = ( | |||
"-DSERVER_SIDE", | |||
"$(OTHER_CFLAGS)", | |||
); | |||
OTHER_LDFLAGS = ( | |||
/opt/local/lib/libsamplerate.a, | |||
"-framework", | |||
@@ -16531,6 +16581,7 @@ | |||
MACOSX_DEPLOYMENT_TARGET = 10.4; | |||
OTHER_CFLAGS = "-DJACK_32_64"; | |||
OTHER_CPLUSPLUSFLAGS = ( | |||
"-DSERVER_SIDE", | |||
"-DMACH_RPC_MACH_SEMA", | |||
"-DJACK_32_64", | |||
); | |||
@@ -18468,6 +18519,16 @@ | |||
defaultConfigurationIsVisible = 0; | |||
defaultConfigurationName = Default; | |||
}; | |||
4B6654F3127C34AE00753A79 /* Build configuration list for PBXNativeTarget "jack_server_control 64 bits" */ = { | |||
isa = XCConfigurationList; | |||
buildConfigurations = ( | |||
4B6654F4127C34AE00753A79 /* Development */, | |||
4B6654F5127C34AE00753A79 /* Deployment */, | |||
4B6654F6127C34AE00753A79 /* Default */, | |||
); | |||
defaultConfigurationIsVisible = 0; | |||
defaultConfigurationName = Default; | |||
}; | |||
4B699B33097D421600A18468 /* Build configuration list for PBXAggregateTarget "All Universal 32 bits" */ = { | |||
isa = XCConfigurationList; | |||
buildConfigurations = ( | |||
@@ -1,47 +0,0 @@ | |||
/* | |||
Copyright (C) 2004 Grame | |||
This program is free software; you can redistribute it and/or modify | |||
it under the terms of the GNU Lesser General Public License as published by | |||
the Free Software Foundation; either version 2.1 of the License, or | |||
(at your option) any later version. | |||
This program is distributed in the hope that it will be useful, | |||
but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
GNU Lesser General Public License for more details. | |||
You should have received a copy of the GNU Lesser General Public License | |||
along with this program; if not, write to the Free Software | |||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |||
*/ | |||
subsystem JackRPCClient 1000; | |||
#include <mach/std_types.defs> | |||
#include <mach/mach_types.defs> | |||
import "Jackdefs.h"; | |||
waittime 5000; | |||
type client_name_t = c_string[64]; | |||
type message_t = c_string[256]; | |||
routine rpc_jack_client_sync_notify( | |||
client_port : mach_port_t; | |||
refnum : int; | |||
client_name : client_name_t; | |||
notify : int; | |||
message : message_t; | |||
value1 : int; | |||
value2 : int; | |||
out result : int); | |||
simpleroutine rpc_jack_client_async_notify( | |||
client_port : mach_port_t; | |||
refnum : int; | |||
client_name : client_name_t; | |||
notify : int; | |||
message : message_t; | |||
value1 : int; | |||
value2 : int); |
@@ -1,194 +0,0 @@ | |||
#ifndef _JackRPCClient_user_ | |||
#define _JackRPCClient_user_ | |||
/* Module JackRPCClient */ | |||
#include <string.h> | |||
#include <mach/ndr.h> | |||
#include <mach/boolean.h> | |||
#include <mach/kern_return.h> | |||
#include <mach/notify.h> | |||
#include <mach/mach_types.h> | |||
#include <mach/message.h> | |||
#include <mach/mig_errors.h> | |||
#include <mach/port.h> | |||
#ifdef AUTOTEST | |||
#ifndef FUNCTION_PTR_T | |||
#define FUNCTION_PTR_T | |||
typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t); | |||
typedef struct { | |||
char *name; | |||
function_ptr_t function; | |||
} function_table_entry; | |||
typedef function_table_entry *function_table_t; | |||
#endif /* FUNCTION_PTR_T */ | |||
#endif /* AUTOTEST */ | |||
#ifndef JackRPCClient_MSG_COUNT | |||
#define JackRPCClient_MSG_COUNT 2 | |||
#endif /* JackRPCClient_MSG_COUNT */ | |||
#include <mach/std_types.h> | |||
#include <mach/mig.h> | |||
#include <mach/mig.h> | |||
#include <mach/mach_types.h> | |||
#include "Jackdefs.h" | |||
#ifdef __BeforeMigUserHeader | |||
__BeforeMigUserHeader | |||
#endif /* __BeforeMigUserHeader */ | |||
#include <sys/cdefs.h> | |||
__BEGIN_DECLS | |||
/* Routine rpc_jack_client_sync_notify */ | |||
#ifdef mig_external | |||
mig_external | |||
#else | |||
extern | |||
#endif /* mig_external */ | |||
kern_return_t rpc_jack_client_sync_notify | |||
( | |||
mach_port_t client_port, | |||
int refnum, | |||
client_name_t client_name, | |||
int notify, | |||
message_t message, | |||
int value1, | |||
int value2, | |||
int *result | |||
); | |||
/* SimpleRoutine rpc_jack_client_async_notify */ | |||
#ifdef mig_external | |||
mig_external | |||
#else | |||
extern | |||
#endif /* mig_external */ | |||
kern_return_t rpc_jack_client_async_notify | |||
( | |||
mach_port_t client_port, | |||
int refnum, | |||
client_name_t client_name, | |||
int notify, | |||
message_t message, | |||
int value1, | |||
int value2 | |||
); | |||
__END_DECLS | |||
/********************** Caution **************************/ | |||
/* The following data types should be used to calculate */ | |||
/* maximum message sizes only. The actual message may be */ | |||
/* smaller, and the position of the arguments within the */ | |||
/* message layout may vary from what is presented here. */ | |||
/* For example, if any of the arguments are variable- */ | |||
/* sized, and less than the maximum is sent, the data */ | |||
/* will be packed tight in the actual message to reduce */ | |||
/* the presence of holes. */ | |||
/********************** Caution **************************/ | |||
/* typedefs for all requests */ | |||
#ifndef __Request__JackRPCClient_subsystem__defined | |||
#define __Request__JackRPCClient_subsystem__defined | |||
#ifdef __MigPackStructs | |||
#pragma pack(4) | |||
#endif | |||
typedef struct { | |||
mach_msg_header_t Head; | |||
NDR_record_t NDR; | |||
int refnum; | |||
client_name_t client_name; | |||
int notify; | |||
message_t message; | |||
int value1; | |||
int value2; | |||
} __Request__rpc_jack_client_sync_notify_t; | |||
#ifdef __MigPackStructs | |||
#pragma pack() | |||
#endif | |||
#ifdef __MigPackStructs | |||
#pragma pack(4) | |||
#endif | |||
typedef struct { | |||
mach_msg_header_t Head; | |||
NDR_record_t NDR; | |||
int refnum; | |||
client_name_t client_name; | |||
int notify; | |||
message_t message; | |||
int value1; | |||
int value2; | |||
} __Request__rpc_jack_client_async_notify_t; | |||
#ifdef __MigPackStructs | |||
#pragma pack() | |||
#endif | |||
#endif /* !__Request__JackRPCClient_subsystem__defined */ | |||
/* union of all requests */ | |||
#ifndef __RequestUnion__JackRPCClient_subsystem__defined | |||
#define __RequestUnion__JackRPCClient_subsystem__defined | |||
union __RequestUnion__JackRPCClient_subsystem { | |||
__Request__rpc_jack_client_sync_notify_t Request_rpc_jack_client_sync_notify; | |||
__Request__rpc_jack_client_async_notify_t Request_rpc_jack_client_async_notify; | |||
}; | |||
#endif /* !__RequestUnion__JackRPCClient_subsystem__defined */ | |||
/* typedefs for all replies */ | |||
#ifndef __Reply__JackRPCClient_subsystem__defined | |||
#define __Reply__JackRPCClient_subsystem__defined | |||
#ifdef __MigPackStructs | |||
#pragma pack(4) | |||
#endif | |||
typedef struct { | |||
mach_msg_header_t Head; | |||
NDR_record_t NDR; | |||
kern_return_t RetCode; | |||
int result; | |||
} __Reply__rpc_jack_client_sync_notify_t; | |||
#ifdef __MigPackStructs | |||
#pragma pack() | |||
#endif | |||
#ifdef __MigPackStructs | |||
#pragma pack(4) | |||
#endif | |||
typedef struct { | |||
mach_msg_header_t Head; | |||
NDR_record_t NDR; | |||
kern_return_t RetCode; | |||
} __Reply__rpc_jack_client_async_notify_t; | |||
#ifdef __MigPackStructs | |||
#pragma pack() | |||
#endif | |||
#endif /* !__Reply__JackRPCClient_subsystem__defined */ | |||
/* union of all replies */ | |||
#ifndef __ReplyUnion__JackRPCClient_subsystem__defined | |||
#define __ReplyUnion__JackRPCClient_subsystem__defined | |||
union __ReplyUnion__JackRPCClient_subsystem { | |||
__Reply__rpc_jack_client_sync_notify_t Reply_rpc_jack_client_sync_notify; | |||
__Reply__rpc_jack_client_async_notify_t Reply_rpc_jack_client_async_notify; | |||
}; | |||
#endif /* !__RequestUnion__JackRPCClient_subsystem__defined */ | |||
#ifndef subsystem_to_name_map_JackRPCClient | |||
#define subsystem_to_name_map_JackRPCClient \ | |||
{ "rpc_jack_client_sync_notify", 1000 },\ | |||
{ "rpc_jack_client_async_notify", 1001 } | |||
#endif | |||
#ifdef __AfterMigUserHeader | |||
__AfterMigUserHeader | |||
#endif /* __AfterMigUserHeader */ | |||
#endif /* _JackRPCClient_user_ */ |
@@ -1,466 +0,0 @@ | |||
/* | |||
* IDENTIFICATION: | |||
* stub generated Fri Oct 23 10:35:08 2009 | |||
* with a MiG generated Mon May 18 09:59:33 PDT 2009 by root@sulitlana.apple.com | |||
* OPTIONS: | |||
*/ | |||
#define __MIG_check__Reply__JackRPCClient_subsystem__ 1 | |||
#define __NDR_convert__Reply__JackRPCClient_subsystem__ 1 | |||
#define __NDR_convert__mig_reply_error_subsystem__ 1 | |||
#include "JackRPCClient.h" | |||
#ifndef mig_internal | |||
#define mig_internal static __inline__ | |||
#endif /* mig_internal */ | |||
#ifndef mig_external | |||
#define mig_external | |||
#endif /* mig_external */ | |||
#if !defined(__MigTypeCheck) && defined(TypeCheck) | |||
#define __MigTypeCheck TypeCheck /* Legacy setting */ | |||
#endif /* !defined(__MigTypeCheck) */ | |||
#if !defined(__MigKernelSpecificCode) && defined(_MIG_KERNEL_SPECIFIC_CODE_) | |||
#define __MigKernelSpecificCode _MIG_KERNEL_SPECIFIC_CODE_ /* Legacy setting */ | |||
#endif /* !defined(__MigKernelSpecificCode) */ | |||
#ifndef LimitCheck | |||
#define LimitCheck 0 | |||
#endif /* LimitCheck */ | |||
#ifndef min | |||
#define min(a,b) ( ((a) < (b))? (a): (b) ) | |||
#endif /* min */ | |||
#if !defined(_WALIGN_) | |||
#define _WALIGN_(x) (((x) + 3) & ~3) | |||
#endif /* !defined(_WALIGN_) */ | |||
#if !defined(_WALIGNSZ_) | |||
#define _WALIGNSZ_(x) _WALIGN_(sizeof(x)) | |||
#endif /* !defined(_WALIGNSZ_) */ | |||
#ifndef UseStaticTemplates | |||
#define UseStaticTemplates 0 | |||
#endif /* UseStaticTemplates */ | |||
#ifndef __MachMsgErrorWithTimeout | |||
#define __MachMsgErrorWithTimeout(_R_) { \ | |||
switch (_R_) { \ | |||
case MACH_SEND_INVALID_DATA: \ | |||
case MACH_SEND_INVALID_DEST: \ | |||
case MACH_SEND_INVALID_HEADER: \ | |||
mig_put_reply_port(InP->Head.msgh_reply_port); \ | |||
break; \ | |||
case MACH_SEND_TIMED_OUT: \ | |||
case MACH_RCV_TIMED_OUT: \ | |||
default: \ | |||
mig_dealloc_reply_port(InP->Head.msgh_reply_port); \ | |||
} \ | |||
} | |||
#endif /* __MachMsgErrorWithTimeout */ | |||
#ifndef __MachMsgErrorWithoutTimeout | |||
#define __MachMsgErrorWithoutTimeout(_R_) { \ | |||
switch (_R_) { \ | |||
case MACH_SEND_INVALID_DATA: \ | |||
case MACH_SEND_INVALID_DEST: \ | |||
case MACH_SEND_INVALID_HEADER: \ | |||
mig_put_reply_port(InP->Head.msgh_reply_port); \ | |||
break; \ | |||
default: \ | |||
mig_dealloc_reply_port(InP->Head.msgh_reply_port); \ | |||
} \ | |||
} | |||
#endif /* __MachMsgErrorWithoutTimeout */ | |||
#ifndef __DeclareSendRpc | |||
#define __DeclareSendRpc(_NUM_, _NAME_) | |||
#endif /* __DeclareSendRpc */ | |||
#ifndef __BeforeSendRpc | |||
#define __BeforeSendRpc(_NUM_, _NAME_) | |||
#endif /* __BeforeSendRpc */ | |||
#ifndef __AfterSendRpc | |||
#define __AfterSendRpc(_NUM_, _NAME_) | |||
#endif /* __AfterSendRpc */ | |||
#ifndef __DeclareSendSimple | |||
#define __DeclareSendSimple(_NUM_, _NAME_) | |||
#endif /* __DeclareSendSimple */ | |||
#ifndef __BeforeSendSimple | |||
#define __BeforeSendSimple(_NUM_, _NAME_) | |||
#endif /* __BeforeSendSimple */ | |||
#ifndef __AfterSendSimple | |||
#define __AfterSendSimple(_NUM_, _NAME_) | |||
#endif /* __AfterSendSimple */ | |||
#define msgh_request_port msgh_remote_port | |||
#define msgh_reply_port msgh_local_port | |||
#if ( __MigTypeCheck || __NDR_convert__ ) | |||
#if __MIG_check__Reply__JackRPCClient_subsystem__ | |||
#if !defined(__MIG_check__Reply__rpc_jack_client_sync_notify_t__defined) | |||
#define __MIG_check__Reply__rpc_jack_client_sync_notify_t__defined | |||
#ifndef __NDR_convert__int_rep__Reply__rpc_jack_client_sync_notify_t__RetCode__defined | |||
#if defined(__NDR_convert__int_rep__JackRPCClient__kern_return_t__defined) | |||
#define __NDR_convert__int_rep__Reply__rpc_jack_client_sync_notify_t__RetCode__defined | |||
#define __NDR_convert__int_rep__Reply__rpc_jack_client_sync_notify_t__RetCode(a, f) \ | |||
__NDR_convert__int_rep__JackRPCClient__kern_return_t((kern_return_t *)(a), f) | |||
#elif defined(__NDR_convert__int_rep__kern_return_t__defined) | |||
#define __NDR_convert__int_rep__Reply__rpc_jack_client_sync_notify_t__RetCode__defined | |||
#define __NDR_convert__int_rep__Reply__rpc_jack_client_sync_notify_t__RetCode(a, f) \ | |||
__NDR_convert__int_rep__kern_return_t((kern_return_t *)(a), f) | |||
#endif /* defined(__NDR_convert__*__defined) */ | |||
#endif /* __NDR_convert__int_rep__Reply__rpc_jack_client_sync_notify_t__RetCode__defined */ | |||
#ifndef __NDR_convert__int_rep__Reply__rpc_jack_client_sync_notify_t__result__defined | |||
#if defined(__NDR_convert__int_rep__JackRPCClient__int__defined) | |||
#define __NDR_convert__int_rep__Reply__rpc_jack_client_sync_notify_t__result__defined | |||
#define __NDR_convert__int_rep__Reply__rpc_jack_client_sync_notify_t__result(a, f) \ | |||
__NDR_convert__int_rep__JackRPCClient__int((int *)(a), f) | |||
#elif defined(__NDR_convert__int_rep__int__defined) | |||
#define __NDR_convert__int_rep__Reply__rpc_jack_client_sync_notify_t__result__defined | |||
#define __NDR_convert__int_rep__Reply__rpc_jack_client_sync_notify_t__result(a, f) \ | |||
__NDR_convert__int_rep__int((int *)(a), f) | |||
#elif defined(__NDR_convert__int_rep__JackRPCClient__int32_t__defined) | |||
#define __NDR_convert__int_rep__Reply__rpc_jack_client_sync_notify_t__result__defined | |||
#define __NDR_convert__int_rep__Reply__rpc_jack_client_sync_notify_t__result(a, f) \ | |||
__NDR_convert__int_rep__JackRPCClient__int32_t((int32_t *)(a), f) | |||
#elif defined(__NDR_convert__int_rep__int32_t__defined) | |||
#define __NDR_convert__int_rep__Reply__rpc_jack_client_sync_notify_t__result__defined | |||
#define __NDR_convert__int_rep__Reply__rpc_jack_client_sync_notify_t__result(a, f) \ | |||
__NDR_convert__int_rep__int32_t((int32_t *)(a), f) | |||
#endif /* defined(__NDR_convert__*__defined) */ | |||
#endif /* __NDR_convert__int_rep__Reply__rpc_jack_client_sync_notify_t__result__defined */ | |||
#ifndef __NDR_convert__char_rep__Reply__rpc_jack_client_sync_notify_t__result__defined | |||
#if defined(__NDR_convert__char_rep__JackRPCClient__int__defined) | |||
#define __NDR_convert__char_rep__Reply__rpc_jack_client_sync_notify_t__result__defined | |||
#define __NDR_convert__char_rep__Reply__rpc_jack_client_sync_notify_t__result(a, f) \ | |||
__NDR_convert__char_rep__JackRPCClient__int((int *)(a), f) | |||
#elif defined(__NDR_convert__char_rep__int__defined) | |||
#define __NDR_convert__char_rep__Reply__rpc_jack_client_sync_notify_t__result__defined | |||
#define __NDR_convert__char_rep__Reply__rpc_jack_client_sync_notify_t__result(a, f) \ | |||
__NDR_convert__char_rep__int((int *)(a), f) | |||
#elif defined(__NDR_convert__char_rep__JackRPCClient__int32_t__defined) | |||
#define __NDR_convert__char_rep__Reply__rpc_jack_client_sync_notify_t__result__defined | |||
#define __NDR_convert__char_rep__Reply__rpc_jack_client_sync_notify_t__result(a, f) \ | |||
__NDR_convert__char_rep__JackRPCClient__int32_t((int32_t *)(a), f) | |||
#elif defined(__NDR_convert__char_rep__int32_t__defined) | |||
#define __NDR_convert__char_rep__Reply__rpc_jack_client_sync_notify_t__result__defined | |||
#define __NDR_convert__char_rep__Reply__rpc_jack_client_sync_notify_t__result(a, f) \ | |||
__NDR_convert__char_rep__int32_t((int32_t *)(a), f) | |||
#endif /* defined(__NDR_convert__*__defined) */ | |||
#endif /* __NDR_convert__char_rep__Reply__rpc_jack_client_sync_notify_t__result__defined */ | |||
#ifndef __NDR_convert__float_rep__Reply__rpc_jack_client_sync_notify_t__result__defined | |||
#if defined(__NDR_convert__float_rep__JackRPCClient__int__defined) | |||
#define __NDR_convert__float_rep__Reply__rpc_jack_client_sync_notify_t__result__defined | |||
#define __NDR_convert__float_rep__Reply__rpc_jack_client_sync_notify_t__result(a, f) \ | |||
__NDR_convert__float_rep__JackRPCClient__int((int *)(a), f) | |||
#elif defined(__NDR_convert__float_rep__int__defined) | |||
#define __NDR_convert__float_rep__Reply__rpc_jack_client_sync_notify_t__result__defined | |||
#define __NDR_convert__float_rep__Reply__rpc_jack_client_sync_notify_t__result(a, f) \ | |||
__NDR_convert__float_rep__int((int *)(a), f) | |||
#elif defined(__NDR_convert__float_rep__JackRPCClient__int32_t__defined) | |||
#define __NDR_convert__float_rep__Reply__rpc_jack_client_sync_notify_t__result__defined | |||
#define __NDR_convert__float_rep__Reply__rpc_jack_client_sync_notify_t__result(a, f) \ | |||
__NDR_convert__float_rep__JackRPCClient__int32_t((int32_t *)(a), f) | |||
#elif defined(__NDR_convert__float_rep__int32_t__defined) | |||
#define __NDR_convert__float_rep__Reply__rpc_jack_client_sync_notify_t__result__defined | |||
#define __NDR_convert__float_rep__Reply__rpc_jack_client_sync_notify_t__result(a, f) \ | |||
__NDR_convert__float_rep__int32_t((int32_t *)(a), f) | |||
#endif /* defined(__NDR_convert__*__defined) */ | |||
#endif /* __NDR_convert__float_rep__Reply__rpc_jack_client_sync_notify_t__result__defined */ | |||
mig_internal kern_return_t __MIG_check__Reply__rpc_jack_client_sync_notify_t(__Reply__rpc_jack_client_sync_notify_t *Out0P) | |||
{ | |||
typedef __Reply__rpc_jack_client_sync_notify_t __Reply; | |||
#if __MigTypeCheck | |||
unsigned int msgh_size; | |||
#endif /* __MigTypeCheck */ | |||
if (Out0P->Head.msgh_id != 1100) { | |||
if (Out0P->Head.msgh_id == MACH_NOTIFY_SEND_ONCE) | |||
{ return MIG_SERVER_DIED; } | |||
else | |||
{ return MIG_REPLY_MISMATCH; } | |||
} | |||
#if __MigTypeCheck | |||
msgh_size = Out0P->Head.msgh_size; | |||
if ((Out0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || | |||
((msgh_size != (mach_msg_size_t)sizeof(__Reply)) && | |||
(msgh_size != (mach_msg_size_t)sizeof(mig_reply_error_t) || | |||
Out0P->RetCode == KERN_SUCCESS))) | |||
{ return MIG_TYPE_ERROR ; } | |||
#endif /* __MigTypeCheck */ | |||
if (Out0P->RetCode != KERN_SUCCESS) { | |||
#ifdef __NDR_convert__mig_reply_error_t__defined | |||
__NDR_convert__mig_reply_error_t((mig_reply_error_t *)Out0P); | |||
#endif /* __NDR_convert__mig_reply_error_t__defined */ | |||
return ((mig_reply_error_t *)Out0P)->RetCode; | |||
} | |||
#if defined(__NDR_convert__int_rep__Reply__rpc_jack_client_sync_notify_t__RetCode__defined) || \ | |||
defined(__NDR_convert__int_rep__Reply__rpc_jack_client_sync_notify_t__result__defined) | |||
if (Out0P->NDR.int_rep != NDR_record.int_rep) { | |||
#if defined(__NDR_convert__int_rep__Reply__rpc_jack_client_sync_notify_t__RetCode__defined) | |||
__NDR_convert__int_rep__Reply__rpc_jack_client_sync_notify_t__RetCode(&Out0P->RetCode, Out0P->NDR.int_rep); | |||
#endif /* __NDR_convert__int_rep__Reply__rpc_jack_client_sync_notify_t__RetCode__defined */ | |||
#if defined(__NDR_convert__int_rep__Reply__rpc_jack_client_sync_notify_t__result__defined) | |||
__NDR_convert__int_rep__Reply__rpc_jack_client_sync_notify_t__result(&Out0P->result, Out0P->NDR.int_rep); | |||
#endif /* __NDR_convert__int_rep__Reply__rpc_jack_client_sync_notify_t__result__defined */ | |||
} | |||
#endif /* defined(__NDR_convert__int_rep...) */ | |||
#if 0 || \ | |||
defined(__NDR_convert__char_rep__Reply__rpc_jack_client_sync_notify_t__result__defined) | |||
if (Out0P->NDR.char_rep != NDR_record.char_rep) { | |||
#if defined(__NDR_convert__char_rep__Reply__rpc_jack_client_sync_notify_t__result__defined) | |||
__NDR_convert__char_rep__Reply__rpc_jack_client_sync_notify_t__result(&Out0P->result, Out0P->NDR.char_rep); | |||
#endif /* __NDR_convert__char_rep__Reply__rpc_jack_client_sync_notify_t__result__defined */ | |||
} | |||
#endif /* defined(__NDR_convert__char_rep...) */ | |||
#if 0 || \ | |||
defined(__NDR_convert__float_rep__Reply__rpc_jack_client_sync_notify_t__result__defined) | |||
if (Out0P->NDR.float_rep != NDR_record.float_rep) { | |||
#if defined(__NDR_convert__float_rep__Reply__rpc_jack_client_sync_notify_t__result__defined) | |||
__NDR_convert__float_rep__Reply__rpc_jack_client_sync_notify_t__result(&Out0P->result, Out0P->NDR.float_rep); | |||
#endif /* __NDR_convert__float_rep__Reply__rpc_jack_client_sync_notify_t__result__defined */ | |||
} | |||
#endif /* defined(__NDR_convert__float_rep...) */ | |||
return MACH_MSG_SUCCESS; | |||
} | |||
#endif /* !defined(__MIG_check__Reply__rpc_jack_client_sync_notify_t__defined) */ | |||
#endif /* __MIG_check__Reply__JackRPCClient_subsystem__ */ | |||
#endif /* ( __MigTypeCheck || __NDR_convert__ ) */ | |||
/* Routine rpc_jack_client_sync_notify */ | |||
mig_external kern_return_t rpc_jack_client_sync_notify | |||
( | |||
mach_port_t client_port, | |||
int refnum, | |||
client_name_t client_name, | |||
int notify, | |||
message_t message, | |||
int value1, | |||
int value2, | |||
int *result | |||
) | |||
{ | |||
#ifdef __MigPackStructs | |||
#pragma pack(4) | |||
#endif | |||
typedef struct { | |||
mach_msg_header_t Head; | |||
NDR_record_t NDR; | |||
int refnum; | |||
client_name_t client_name; | |||
int notify; | |||
message_t message; | |||
int value1; | |||
int value2; | |||
} Request; | |||
#ifdef __MigPackStructs | |||
#pragma pack() | |||
#endif | |||
#ifdef __MigPackStructs | |||
#pragma pack(4) | |||
#endif | |||
typedef struct { | |||
mach_msg_header_t Head; | |||
NDR_record_t NDR; | |||
kern_return_t RetCode; | |||
int result; | |||
mach_msg_trailer_t trailer; | |||
} Reply; | |||
#ifdef __MigPackStructs | |||
#pragma pack() | |||
#endif | |||
#ifdef __MigPackStructs | |||
#pragma pack(4) | |||
#endif | |||
typedef struct { | |||
mach_msg_header_t Head; | |||
NDR_record_t NDR; | |||
kern_return_t RetCode; | |||
int result; | |||
} __Reply; | |||
#ifdef __MigPackStructs | |||
#pragma pack() | |||
#endif | |||
/* | |||
* typedef struct { | |||
* mach_msg_header_t Head; | |||
* NDR_record_t NDR; | |||
* kern_return_t RetCode; | |||
* } mig_reply_error_t; | |||
*/ | |||
union { | |||
Request In; | |||
Reply Out; | |||
} Mess; | |||
Request *InP = &Mess.In; | |||
Reply *Out0P = &Mess.Out; | |||
mach_msg_return_t msg_result; | |||
#ifdef __MIG_check__Reply__rpc_jack_client_sync_notify_t__defined | |||
kern_return_t check_result; | |||
#endif /* __MIG_check__Reply__rpc_jack_client_sync_notify_t__defined */ | |||
__DeclareSendRpc(1000, "rpc_jack_client_sync_notify") | |||
InP->NDR = NDR_record; | |||
InP->refnum = refnum; | |||
(void) mig_strncpy(InP->client_name, client_name, 64); | |||
InP->notify = notify; | |||
(void) mig_strncpy(InP->message, message, 256); | |||
InP->value1 = value1; | |||
InP->value2 = value2; | |||
InP->Head.msgh_bits = | |||
MACH_MSGH_BITS(19, MACH_MSG_TYPE_MAKE_SEND_ONCE); | |||
/* msgh_size passed as argument */ | |||
InP->Head.msgh_request_port = client_port; | |||
InP->Head.msgh_reply_port = mig_get_reply_port(); | |||
InP->Head.msgh_id = 1000; | |||
__BeforeSendRpc(1000, "rpc_jack_client_sync_notify") | |||
msg_result = mach_msg(&InP->Head, MACH_SEND_MSG|MACH_RCV_MSG|MACH_SEND_TIMEOUT|MACH_RCV_TIMEOUT|MACH_MSG_OPTION_NONE, (mach_msg_size_t)sizeof(Request), (mach_msg_size_t)sizeof(Reply), InP->Head.msgh_reply_port, 5000, MACH_PORT_NULL); | |||
__AfterSendRpc(1000, "rpc_jack_client_sync_notify") | |||
if (msg_result == MACH_SEND_TIMED_OUT) { | |||
} | |||
if (msg_result != MACH_MSG_SUCCESS) { | |||
__MachMsgErrorWithTimeout(msg_result); | |||
{ return msg_result; } | |||
} | |||
#if defined(__MIG_check__Reply__rpc_jack_client_sync_notify_t__defined) | |||
check_result = __MIG_check__Reply__rpc_jack_client_sync_notify_t((__Reply__rpc_jack_client_sync_notify_t *)Out0P); | |||
if (check_result != MACH_MSG_SUCCESS) | |||
{ return check_result; } | |||
#endif /* defined(__MIG_check__Reply__rpc_jack_client_sync_notify_t__defined) */ | |||
*result = Out0P->result; | |||
return KERN_SUCCESS; | |||
} | |||
/* SimpleRoutine rpc_jack_client_async_notify */ | |||
mig_external kern_return_t rpc_jack_client_async_notify | |||
( | |||
mach_port_t client_port, | |||
int refnum, | |||
client_name_t client_name, | |||
int notify, | |||
message_t message, | |||
int value1, | |||
int value2 | |||
) | |||
{ | |||
#ifdef __MigPackStructs | |||
#pragma pack(4) | |||
#endif | |||
typedef struct { | |||
mach_msg_header_t Head; | |||
NDR_record_t NDR; | |||
int refnum; | |||
client_name_t client_name; | |||
int notify; | |||
message_t message; | |||
int value1; | |||
int value2; | |||
} Request; | |||
#ifdef __MigPackStructs | |||
#pragma pack() | |||
#endif | |||
/* | |||
* typedef struct { | |||
* mach_msg_header_t Head; | |||
* NDR_record_t NDR; | |||
* kern_return_t RetCode; | |||
* } mig_reply_error_t; | |||
*/ | |||
union { | |||
Request In; | |||
} Mess; | |||
Request *InP = &Mess.In; | |||
mach_msg_return_t msg_result; | |||
#ifdef __MIG_check__Reply__rpc_jack_client_async_notify_t__defined | |||
kern_return_t check_result; | |||
#endif /* __MIG_check__Reply__rpc_jack_client_async_notify_t__defined */ | |||
__DeclareSendSimple(1001, "rpc_jack_client_async_notify") | |||
InP->NDR = NDR_record; | |||
InP->refnum = refnum; | |||
(void) mig_strncpy(InP->client_name, client_name, 64); | |||
InP->notify = notify; | |||
(void) mig_strncpy(InP->message, message, 256); | |||
InP->value1 = value1; | |||
InP->value2 = value2; | |||
InP->Head.msgh_bits = | |||
MACH_MSGH_BITS(19, 0); | |||
/* msgh_size passed as argument */ | |||
InP->Head.msgh_request_port = client_port; | |||
InP->Head.msgh_reply_port = MACH_PORT_NULL; | |||
InP->Head.msgh_id = 1001; | |||
__BeforeSendSimple(1001, "rpc_jack_client_async_notify") | |||
msg_result = mach_msg(&InP->Head, MACH_SEND_MSG|MACH_SEND_TIMEOUT|MACH_MSG_OPTION_NONE, (mach_msg_size_t)sizeof(Request), 0, MACH_PORT_NULL, 5000, MACH_PORT_NULL); | |||
__AfterSendSimple(1001, "rpc_jack_client_async_notify") | |||
if (msg_result == MACH_SEND_TIMED_OUT) { | |||
} | |||
return msg_result; | |||
} |
@@ -1,181 +0,0 @@ | |||
/* | |||
Copyright (C) 2004 Grame | |||
This program is free software; you can redistribute it and/or modify | |||
it under the terms of the GNU Lesser General Public License as published by | |||
the Free Software Foundation; either version 2.1 of the License, or | |||
(at your option) any later version. | |||
This program is distributed in the hope that it will be useful, | |||
but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
GNU Lesser General Public License for more details. | |||
You should have received a copy of the GNU Lesser General Public License | |||
along with this program; if not, write to the Free Software | |||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |||
*/ | |||
subsystem JackRPCEngine 1000; | |||
#include <mach/std_types.defs> | |||
#include <mach/mach_types.defs> | |||
import "Jackdefs.h"; | |||
ServerPrefix server_; | |||
type client_name_t = c_string[64]; | |||
type client_port_name_t = c_string[128]; | |||
type client_port_type_t = c_string[128]; | |||
type so_name_t = c_string[256]; | |||
type objet_data_t = c_string[256]; | |||
routine rpc_jack_client_open( | |||
server_port : mach_port_t; | |||
client_name : client_name_t; | |||
pid : int; | |||
out private_port : mach_port_make_send_t; | |||
out shared_engine : int; | |||
out shared_client : int; | |||
out shared_graph : int; | |||
out result : int); | |||
routine rpc_jack_client_check( | |||
server_port : mach_port_t; | |||
client_name : client_name_t; | |||
out client_name_res : client_name_t; | |||
protocol : int; | |||
options : int; | |||
out status : int; | |||
out result : int); | |||
routine rpc_jack_client_close( | |||
server_port : mach_port_t; | |||
refnum : int; | |||
out result : int); | |||
routine rpc_jack_client_activate( | |||
server_port : mach_port_t; | |||
refnum : int; | |||
state : int; | |||
out result : int); | |||
routine rpc_jack_client_deactivate( | |||
server_port : mach_port_t; | |||
refnum : int; | |||
out result : int); | |||
routine rpc_jack_port_register( | |||
server_port : mach_port_t; | |||
refnum : int; | |||
name : client_port_name_t; | |||
port_type : client_port_type_t; | |||
flags : unsigned; | |||
buffer_size : unsigned; | |||
out port_index : unsigned; | |||
out result : int); | |||
routine rpc_jack_port_unregister( | |||
server_port : mach_port_t; | |||
refnum : int; | |||
port : int; | |||
out result : int); | |||
routine rpc_jack_port_connect( | |||
server_port : mach_port_t; | |||
refnum : int; | |||
src : int; | |||
dst : int; | |||
out result : int); | |||
routine rpc_jack_port_disconnect( | |||
server_port : mach_port_t; | |||
refnum : int; | |||
src : int; | |||
dst : int; | |||
out result : int); | |||
routine rpc_jack_port_connect_name( | |||
server_port : mach_port_t; | |||
refnum : int; | |||
src : client_port_name_t; | |||
dst : client_port_name_t; | |||
out result : int); | |||
routine rpc_jack_port_disconnect_name( | |||
server_port : mach_port_t; | |||
refnum : int; | |||
src : client_port_name_t; | |||
dst : client_port_name_t; | |||
out result : int); | |||
routine rpc_jack_port_rename( | |||
server_port : mach_port_t; | |||
refnum : int; | |||
src : int; | |||
name : client_port_name_t; | |||
out result : int); | |||
routine rpc_jack_set_buffer_size( | |||
server_port : mach_port_t; | |||
buffer_size : int; | |||
out result : int); | |||
routine rpc_jack_set_freewheel( | |||
server_port : mach_port_t; | |||
onoff : int; | |||
out result : int); | |||
routine rpc_jack_release_timebase( | |||
server_port : mach_port_t; | |||
refnum : int; | |||
out result : int); | |||
routine rpc_jack_set_timebase_callback( | |||
server_port : mach_port_t; | |||
refnum : int; | |||
conditional : int; | |||
out result : int); | |||
routine rpc_jack_get_internal_clientname( | |||
server_port : mach_port_t; | |||
refnum : int; | |||
int_ref : int; | |||
out client_name_res : client_name_t; | |||
out result : int); | |||
routine rpc_jack_internal_clienthandle( | |||
server_port : mach_port_t; | |||
refnum : int; | |||
client_name : client_name_t; | |||
out int_ref : int; | |||
out status : int; | |||
out result : int); | |||
routine rpc_jack_internal_clientload( | |||
server_port : mach_port_t; | |||
refnum : int; | |||
client_name : client_name_t; | |||
so_name : so_name_t; | |||
objet_data : objet_data_t; | |||
options : int; | |||
out status : int; | |||
out int_ref : int; | |||
out result : int); | |||
routine rpc_jack_internal_clientunload( | |||
server_port : mach_port_t; | |||
refnum : int; | |||
int_ref : int; | |||
out status : int; | |||
out result : int); | |||
simpleroutine rpc_jack_client_rt_notify( | |||
client_port : mach_port_t; | |||
refnum : int; | |||
notify : int; | |||
value : int; | |||
waittime timeout : int); | |||
@@ -1,25 +0,0 @@ | |||
/* | |||
Copyright (C) 2004-2006 Grame | |||
This program is free software; you can redistribute it and/or modify | |||
it under the terms of the GNU General Public License as published by | |||
the Free Software Foundation; either version 2 of the License, or | |||
(at your option) any later version. | |||
This program is distributed in the hope that it will be useful, | |||
but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
GNU General Public License for more details. | |||
You should have received a copy of the GNU General Public License | |||
along with this program; if not, write to the Free Software | |||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |||
*/ | |||
typedef char client_name_t[64]; | |||
typedef char client_port_name_t[128]; | |||
typedef char client_port_type_t[128]; | |||
typedef char so_name_t[256]; | |||
typedef char objet_data_t[256]; | |||
typedef char message_t[256]; |
@@ -216,8 +216,8 @@ OSStatus JackCoreAudioDriver::Render(void *inRefCon, | |||
int JackCoreAudioDriver::Read() | |||
{ | |||
AudioUnitRender(fAUHAL, fActionFags, fCurrentTime, 1, fEngineControl->fBufferSize, fJackInputData); | |||
return 0; | |||
OSStatus err = AudioUnitRender(fAUHAL, fActionFags, fCurrentTime, 1, fEngineControl->fBufferSize, fJackInputData); | |||
return (err == noErr) ? 0 : -1; | |||
} | |||
int JackCoreAudioDriver::Write() | |||
@@ -1366,7 +1366,7 @@ int JackCoreAudioDriver::SetupBuffers(int inchannels) | |||
// Prepare buffers | |||
fJackInputData = (AudioBufferList*)malloc(sizeof(UInt32) + inchannels * sizeof(AudioBuffer)); | |||
fJackInputData->mNumberBuffers = inchannels; | |||
for (int i = 0; i < fCaptureChannels; i++) { | |||
for (int i = 0; i < inchannels; i++) { | |||
fJackInputData->mBuffers[i].mNumberChannels = 1; | |||
fJackInputData->mBuffers[i].mDataByteSize = fEngineControl->fBufferSize * sizeof(float); | |||
} | |||
@@ -1478,11 +1478,6 @@ int JackCoreAudioDriver::Open(jack_nframes_t buffer_size, | |||
char playback_driver_name[256]; | |||
// Keep initial state | |||
fCapturing = capturing; | |||
fPlaying = playing; | |||
fInChannels = inchannels; | |||
fOutChannels = outchannels; | |||
fMonitor = monitor; | |||
strcpy(fCaptureUID, capture_driver_uid); | |||
strcpy(fPlaybackUID, playback_driver_uid); | |||
fCaptureLatency = capture_latency; | |||
@@ -68,17 +68,9 @@ class JackCoreAudioDriver : public JackAudioDriver | |||
bool fState; | |||
bool fHogged; | |||
// Initial state | |||
bool fCapturing; | |||
bool fPlaying; | |||
int fInChannels; | |||
int fOutChannels; | |||
char fCaptureUID[256]; | |||
char fPlaybackUID[256]; | |||
bool fMonitor; | |||
float fIOUsage; | |||
float fComputationGrain; | |||
bool fClockDriftCompensate; | |||
@@ -48,7 +48,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |||
#define SERVER_EXPORT __attribute__((visibility("default"))) | |||
#endif | |||
#else | |||
#define SERVER_EXPORT | |||
#define SERVER_EXPORT __attribute__((visibility("hidden"))) | |||
#endif | |||
#else | |||
#define MEM_ALIGN(x,y) x | |||
@@ -117,7 +117,7 @@ int JackPosixThread::StartImp(pthread_t* thread, int priority, int realtime, voi | |||
if ((res = pthread_attr_setinheritsched(&attributes, PTHREAD_EXPLICIT_SCHED))) { | |||
jack_error("Cannot request explicit scheduling for RT thread res = %d", res); | |||
return -1; | |||
} | |||
} | |||
if ((res = pthread_attr_setschedpolicy(&attributes, JACK_SCHED_POLICY))) { | |||
jack_error("Cannot set RR scheduling class for RT thread res = %d", res); | |||
@@ -270,6 +270,11 @@ pthread_t JackPosixThread::GetThreadID() | |||
return fThread; | |||
} | |||
bool JackPosixThread::IsThread() | |||
{ | |||
return pthread_self() == fThread; | |||
} | |||
void JackPosixThread::Terminate() | |||
{ | |||
jack_log("JackPosixThread::Terminate"); | |||
@@ -68,10 +68,11 @@ class SERVER_EXPORT JackPosixThread : public detail::JackThreadInterface | |||
int DropSelfRealTime(); // Used when called from thread itself | |||
pthread_t GetThreadID(); | |||
bool IsThread(); | |||
static int AcquireRealTimeImp(pthread_t thread, int priority); | |||
static int AcquireRealTimeImp(pthread_t thread, int priority, UInt64 period, UInt64 computation, UInt64 constraint) | |||
{ return JackPosixThread::AcquireRealTimeImp(thread, priority); } | |||
{ return JackPosixThread::AcquireRealTimeImp(thread, priority); } | |||
static int DropRealTimeImp(pthread_t thread); | |||
static int StartImp(pthread_t* thread, int priority, int realtime, void*(*start_routine)(void*), void* arg); | |||
static int StopImp(pthread_t thread); | |||
@@ -129,7 +129,7 @@ int JackClientSocket::Connect(const char* dir, const char* name, int which) // A | |||
} | |||
#ifdef __APPLE__ | |||
int on = 1 ; | |||
int on = 1; | |||
if (setsockopt(fSocket, SOL_SOCKET, SO_NOSIGPIPE, (const char*)&on, sizeof(on)) < 0) { | |||
jack_log("setsockopt SO_NOSIGPIPE fd = %ld err = %s", fSocket, strerror(errno)); | |||
} | |||
@@ -260,7 +260,7 @@ int JackServerSocket::Bind(const char* dir, const char* name, int which) // A re | |||
goto error; | |||
} | |||
if (listen(fSocket, 1) < 0) { | |||
if (listen(fSocket, 100) < 0) { | |||
jack_error("Cannot enable listen on server socket err = %s", strerror(errno)); | |||
goto error; | |||
} | |||
@@ -51,7 +51,7 @@ int JackSocketClientChannel::ServerCheck(const char* server_name) | |||
} | |||
} | |||
int JackSocketClientChannel::Open(const char* server_name, const char* name, char* name_res, JackClient* obj, jack_options_t options, jack_status_t* status) | |||
int JackSocketClientChannel::Open(const char* server_name, const char* name, int uuid, char* name_res, JackClient* obj, jack_options_t options, jack_status_t* status) | |||
{ | |||
int result = 0; | |||
jack_log("JackSocketClientChannel::Open name = %s", name); | |||
@@ -62,7 +62,7 @@ int JackSocketClientChannel::Open(const char* server_name, const char* name, cha | |||
} | |||
// Check name in server | |||
ClientCheck(name, name_res, JACK_PROTOCOL_VERSION, (int)options, (int*)status, &result); | |||
ClientCheck(name, uuid, name_res, JACK_PROTOCOL_VERSION, (int)options, (int*)status, &result); | |||
if (result < 0) { | |||
int status1 = *status; | |||
if (status1 & JackVersionError) | |||
@@ -142,18 +142,18 @@ void JackSocketClientChannel::ServerAsyncCall(JackRequest* req, JackResult* res, | |||
} | |||
} | |||
void JackSocketClientChannel::ClientCheck(const char* name, char* name_res, int protocol, int options, int* status, int* result) | |||
void JackSocketClientChannel::ClientCheck(const char* name, int uuid, char* name_res, int protocol, int options, int* status, int* result) | |||
{ | |||
JackClientCheckRequest req(name, protocol, options); | |||
JackClientCheckRequest req(name, protocol, options, uuid); | |||
JackClientCheckResult res; | |||
ServerSyncCall(&req, &res, result); | |||
*status = res.fStatus; | |||
strcpy(name_res, res.fName); | |||
} | |||
void JackSocketClientChannel::ClientOpen(const char* name, int pid, int* shared_engine, int* shared_client, int* shared_graph, int* result) | |||
void JackSocketClientChannel::ClientOpen(const char* name, int pid, int uuid, int* shared_engine, int* shared_client, int* shared_graph, int* result) | |||
{ | |||
JackClientOpenRequest req(name, pid); | |||
JackClientOpenRequest req(name, pid, uuid); | |||
JackClientOpenResult res; | |||
ServerSyncCall(&req, &res, result); | |||
*shared_engine = res.fSharedEngine; | |||
@@ -246,6 +246,64 @@ void JackSocketClientChannel::SetFreewheel(int onoff, int* result) | |||
ServerSyncCall(&req, &res, result); | |||
} | |||
void JackSocketClientChannel::SessionNotify(int refnum, const char* target, jack_session_event_type_t type, const char* path, jack_session_command_t ** result) | |||
{ | |||
JackSessionNotifyRequest req(refnum, path, type, target); | |||
JackSessionNotifyResult res; | |||
int intresult; | |||
ServerSyncCall(&req, &res, &intresult); | |||
jack_session_command_t *session_command = (jack_session_command_t *)malloc( sizeof(jack_session_command_t) * (res.fCommandList.size()+1) ); | |||
int i=0; | |||
for (std::list<JackSessionCommand>::iterator ci=res.fCommandList.begin(); ci!=res.fCommandList.end(); ci++) { | |||
session_command[i].uuid = strdup( ci->fUUID ); | |||
session_command[i].client_name = strdup( ci->fClientName ); | |||
session_command[i].command = strdup( ci->fCommand ); | |||
session_command[i].flags = ci->fFlags; | |||
i+=1; | |||
} | |||
session_command[i].uuid = NULL; | |||
session_command[i].client_name = NULL; | |||
session_command[i].command = NULL; | |||
session_command[i].flags = (jack_session_flags_t)0; | |||
*result = session_command; | |||
} | |||
void JackSocketClientChannel::SessionReply(int refnum, int* result) | |||
{ | |||
JackSessionReplyRequest req(refnum); | |||
JackResult res; | |||
ServerSyncCall(&req, &res, result); | |||
} | |||
void JackSocketClientChannel::GetUUIDForClientName( int refnum, const char *client_name, char *uuid_res, int *result ) | |||
{ | |||
JackGetUUIDRequest req(client_name); | |||
JackUUIDResult res; | |||
ServerSyncCall(&req, &res, result); | |||
strncpy( uuid_res, res.fUUID, JACK_UUID_SIZE ); | |||
} | |||
void JackSocketClientChannel::GetClientNameForUUID( int refnum, const char *uuid, char *name_res, int *result ) | |||
{ | |||
JackGetClientNameRequest req(uuid); | |||
JackClientNameResult res; | |||
ServerSyncCall(&req, &res, result); | |||
strncpy( name_res, res.fName, JACK_CLIENT_NAME_SIZE ); | |||
} | |||
void JackSocketClientChannel::ReserveClientName( int refnum, const char *client_name, const char *uuid, int *result ) | |||
{ | |||
JackReserveNameRequest req(refnum, client_name, uuid); | |||
JackResult res; | |||
ServerSyncCall(&req, &res, result); | |||
} | |||
void JackSocketClientChannel::ReleaseTimebase(int refnum, int* result) | |||
{ | |||
JackReleaseTimebaseRequest req(refnum); | |||
@@ -277,9 +335,9 @@ void JackSocketClientChannel::InternalClientHandle(int refnum, const char* clien | |||
*status = res.fStatus; | |||
} | |||
void JackSocketClientChannel::InternalClientLoad(int refnum, const char* client_name, const char* so_name, const char* objet_data, int options, int* status, int* int_ref, int* result) | |||
void JackSocketClientChannel::InternalClientLoad(int refnum, const char* client_name, const char* so_name, const char* objet_data, int options, int* status, int* int_ref, int uuid, int* result) | |||
{ | |||
JackInternalClientLoadRequest req(refnum, client_name, so_name, objet_data, options); | |||
JackInternalClientLoadRequest req(refnum, client_name, so_name, objet_data, options, uuid); | |||
JackInternalClientLoadResult res; | |||
ServerSyncCall(&req, &res, result); | |||
*int_ref = res.fIntRefNum; | |||
@@ -38,11 +38,11 @@ class JackSocketClientChannel : public detail::JackClientChannelInterface, publi | |||
private: | |||
JackClientSocket fRequestSocket; // Socket to communicate with the server | |||
JackServerSocket fNotificationListenSocket; // Socket listener for server notification | |||
JackClientSocket* fNotificationSocket; // Socket for server notification | |||
JackClientSocket fRequestSocket; // Socket to communicate with the server | |||
JackServerSocket fNotificationListenSocket; // Socket listener for server notification | |||
JackClientSocket* fNotificationSocket; // Socket for server notification | |||
JackThread fThread; // Thread to execute the event loop | |||
JackClient* fClient; | |||
JackClient* fClient; | |||
void ServerSyncCall(JackRequest* req, JackResult* res, int* result); | |||
void ServerAsyncCall(JackRequest* req, JackResult* res, int* result); | |||
@@ -52,7 +52,7 @@ class JackSocketClientChannel : public detail::JackClientChannelInterface, publi | |||
JackSocketClientChannel(); | |||
virtual ~JackSocketClientChannel(); | |||
int Open(const char* server_name, const char* name, char* name_res, JackClient* obj, jack_options_t options, jack_status_t* status); | |||
int Open(const char* server_name, const char* name, int uuid, char* name_res, JackClient* obj, jack_options_t options, jack_status_t* status); | |||
void Close(); | |||
int Start(); | |||
@@ -60,9 +60,9 @@ class JackSocketClientChannel : public detail::JackClientChannelInterface, publi | |||
int ServerCheck(const char* server_name); | |||
void ClientCheck(const char* name, char* name_res, int protocol, int options, int* status, int* result); | |||
void ClientOpen(const char* name, int pid, int* shared_engine, int* shared_client, int* shared_graph, int* result); | |||
void ClientOpen(const char* name, int* ref, JackEngineControl** shared_engine, JackGraphManager** shared_manager, JackClientInterface* client, int* result) | |||
void ClientCheck(const char* name, int uuid, char* name_res, int protocol, int options, int* status, int* result); | |||
void ClientOpen(const char* name, int pid, int uuid, int* shared_engine, int* shared_client, int* shared_graph, int* result); | |||
void ClientOpen(const char* name, int* ref, int uuid, JackEngineControl** shared_engine, JackGraphManager** shared_manager, JackClientInterface* client, int* result) | |||
{} | |||
void ClientClose(int refnum, int* result); | |||
@@ -88,12 +88,22 @@ class JackSocketClientChannel : public detail::JackClientChannelInterface, publi | |||
void GetInternalClientName(int refnum, int int_ref, char* name_res, int* result); | |||
void InternalClientHandle(int refnum, const char* client_name, int* status, int* int_ref, int* result); | |||
void InternalClientLoad(int refnum, const char* client_name, const char* so_name, const char* objet_data, int options, int* status, int* int_ref, int* result); | |||
void InternalClientLoad(int refnum, const char* client_name, const char* so_name, const char* objet_data, int options, int* status, int* int_ref, int uuid, int* result); | |||
void InternalClientUnload(int refnum, int int_ref, int* status, int* result); | |||
// Session Stuff | |||
void SessionNotify(int refnum, const char* target, jack_session_event_type_t type, const char* path, jack_session_command_t** result); | |||
void SessionReply(int refnum, int* result); | |||
void GetUUIDForClientName( int refnum, const char *client_name, char *uuid_res, int *result ); | |||
void GetClientNameForUUID( int refnum, const char *uuid, char *name_res, int *result ); | |||
void ReserveClientName( int refnum, const char *client_name, const char *uuid, int *result ); | |||
// JackRunnableInterface interface | |||
bool Init(); | |||
bool Execute(); | |||
bool IsChannelThread() { return fThread.IsThread(); } | |||
}; | |||
} // end of namespace | |||
@@ -102,14 +102,20 @@ void JackSocketServerChannel::ClientCreate() | |||
} | |||
} | |||
void JackSocketServerChannel::ClientAdd(int fd, char* name, int pid, int* shared_engine, int* shared_client, int* shared_graph, int* result) | |||
void JackSocketServerChannel::ClientAdd(int fd, char* name, int pid, int uuid, int* shared_engine, int* shared_client, int* shared_graph, int* result) | |||
{ | |||
jack_log("JackSocketServerChannel::ClientAdd"); | |||
int refnum = -1; | |||
*result = fServer->GetEngine()->ClientExternalOpen(name, pid, &refnum, shared_engine, shared_client, shared_graph); | |||
*result = fServer->GetEngine()->ClientExternalOpen(name, pid, uuid, &refnum, shared_engine, shared_client, shared_graph); | |||
if (*result == 0) { | |||
fSocketTable[fd].first = refnum; | |||
fRebuild = true; | |||
#ifdef __APPLE__ | |||
int on = 1; | |||
if (setsockopt(fd, SOL_SOCKET, SO_NOSIGPIPE, (const char*)&on, sizeof(on)) < 0) { | |||
jack_log("setsockopt SO_NOSIGPIPE fd = %ld err = %s", fd, strerror(errno)); | |||
} | |||
#endif | |||
} else { | |||
jack_error("Cannot create new client"); | |||
} | |||
@@ -170,7 +176,7 @@ bool JackSocketServerChannel::HandleRequest(int fd) | |||
JackClientCheckRequest req; | |||
JackClientCheckResult res; | |||
if (req.Read(socket) == 0) | |||
res.fResult = fServer->GetEngine()->ClientCheck(req.fName, res.fName, req.fProtocol, req.fOptions, &res.fStatus); | |||
res.fResult = fServer->GetEngine()->ClientCheck(req.fName, req.fUUID, res.fName, req.fProtocol, req.fOptions, &res.fStatus); | |||
if (res.Write(socket) < 0) | |||
jack_error("JackRequest::ClientCheck write error name = %s", req.fName); | |||
break; | |||
@@ -181,7 +187,7 @@ bool JackSocketServerChannel::HandleRequest(int fd) | |||
JackClientOpenRequest req; | |||
JackClientOpenResult res; | |||
if (req.Read(socket) == 0) | |||
ClientAdd(fd, req.fName, req.fPID, &res.fSharedEngine, &res.fSharedClient, &res.fSharedGraph, &res.fResult); | |||
ClientAdd(fd, req.fName, req.fPID, req.fUUID, &res.fSharedEngine, &res.fSharedClient, &res.fSharedGraph, &res.fResult); | |||
if (res.Write(socket) < 0) | |||
jack_error("JackRequest::ClientOpen write error name = %s", req.fName); | |||
break; | |||
@@ -369,7 +375,7 @@ bool JackSocketServerChannel::HandleRequest(int fd) | |||
JackInternalClientLoadRequest req; | |||
JackInternalClientLoadResult res; | |||
if (req.Read(socket) == 0) | |||
res.fResult = fServer->InternalClientLoad(req.fName, req.fDllName, req.fLoadInitName, req.fOptions, &res.fIntRefNum, &res.fStatus); | |||
res.fResult = fServer->InternalClientLoad(req.fName, req.fDllName, req.fLoadInitName, req.fOptions, &res.fIntRefNum, req.fUUID, &res.fStatus); | |||
if (res.Write(socket) < 0) | |||
jack_error("JackRequest::InternalClientLoad write error name = %s", req.fName); | |||
break; | |||
@@ -400,6 +406,66 @@ bool JackSocketServerChannel::HandleRequest(int fd) | |||
break; | |||
} | |||
case JackRequest::kSessionNotify: { | |||
jack_log("JackRequest::SessionNotify"); | |||
JackSessionNotifyRequest req; | |||
JackSessionNotifyResult res; | |||
if (req.Read(socket) == 0) { | |||
fServer->GetEngine()->SessionNotify(req.fRefNum, req.fDst, req.fEventType, req.fPath, socket); | |||
} | |||
break; | |||
} | |||
case JackRequest::kSessionReply: { | |||
jack_log("JackRequest::SessionReply"); | |||
JackSessionReplyRequest req; | |||
JackResult res; | |||
if (req.Read(socket) == 0) { | |||
fServer->GetEngine()->SessionReply(req.fRefNum); | |||
res.fResult = 0; | |||
} | |||
if (res.Write(socket) < 0) | |||
jack_error("JackRequest::SessionReply write error"); | |||
break; | |||
} | |||
case JackRequest::kGetClientByUUID: { | |||
jack_log("JackRequest::GetClientNameForUUID"); | |||
JackGetClientNameRequest req; | |||
JackClientNameResult res; | |||
if (req.Read(socket) == 0) { | |||
fServer->GetEngine()->GetClientNameForUUID(req.fUUID, res.fName, &res.fResult); | |||
} | |||
if (res.Write(socket) < 0) | |||
jack_error("JackRequest::GetClientNameForUUID write error"); | |||
break; | |||
} | |||
case JackRequest::kGetUUIDByClient: { | |||
jack_log("JackRequest::GetUUIDForClientName"); | |||
JackGetUUIDRequest req; | |||
JackUUIDResult res; | |||
if (req.Read(socket) == 0) { | |||
fServer->GetEngine()->GetUUIDForClientName(req.fName, res.fUUID, &res.fResult); | |||
res.fResult = 0; | |||
} | |||
if (res.Write(socket) < 0) | |||
jack_error("JackRequest::GetUUIDForClientName write error"); | |||
break; | |||
} | |||
case JackRequest::kReserveClientName: { | |||
jack_log("JackRequest::ReserveClientName"); | |||
JackReserveNameRequest req; | |||
JackResult res; | |||
if (req.Read(socket) == 0) { | |||
fServer->GetEngine()->ReserveClientName(req.fName, req.fUUID, &res.fResult); | |||
} | |||
if (res.Write(socket) < 0) | |||
jack_error("JackRequest::ReserveClientName write error"); | |||
break; | |||
} | |||
default: | |||
jack_error("Unknown request %ld", header.fType); | |||
break; | |||
@@ -39,10 +39,10 @@ class JackSocketServerChannel : public JackRunnableInterface | |||
private: | |||
JackServerSocket fRequestListenSocket; // Socket to create request socket for the client | |||
JackServerSocket fRequestListenSocket; // Socket to create request socket for the client | |||
JackThread fThread; // Thread to execute the event loop | |||
JackServer* fServer; | |||
pollfd* fPollTable; | |||
JackServer* fServer; | |||
pollfd* fPollTable; | |||
bool fRebuild; | |||
std::map<int, std::pair<int, JackClientSocket*> > fSocketTable; | |||
@@ -50,7 +50,7 @@ class JackSocketServerChannel : public JackRunnableInterface | |||
void BuildPoolTable(); | |||
void ClientCreate(); | |||
void ClientAdd(int fd, char* name, int pid, int* shared_engine, int* shared_client, int* shared_graph, int* result); | |||
void ClientAdd(int fd, char* name, int pid, int uuid, int* shared_engine, int* shared_client, int* shared_graph, int* result); | |||
void ClientRemove(int fd, int refnum); | |||
void ClientKill(int fd); | |||
@@ -634,6 +634,7 @@ bool JackBoomerDriver::JackBoomerDriverInput::Init() | |||
return true; | |||
} | |||
// TODO : better error handling | |||
bool JackBoomerDriver::JackBoomerDriverInput::Execute() | |||
{ | |||
@@ -721,6 +722,7 @@ bool JackBoomerDriver::JackBoomerDriverOutput::Init() | |||
return true; | |||
} | |||
// TODO : better error handling | |||
bool JackBoomerDriver::JackBoomerDriverOutput::Execute() | |||
{ | |||
memset(fDriver->fOutputBuffer, 0, fDriver->fOutputBufferSize); | |||
@@ -152,10 +152,7 @@ class JackBoomerDriver : public JackAudioDriver | |||
} | |||
int SetBufferSize(jack_nframes_t buffer_size); | |||
bool Init(); | |||
bool Execute(); | |||
}; | |||
} // end of namespace | |||
@@ -707,7 +707,7 @@ int JackOSSDriver::ProcessSync() | |||
// Read input buffers for the current cycle | |||
if (Read() < 0) { | |||
jack_error("ProcessSync: read error, skip cycle"); | |||
return 0; // Skip cycle, but continue processing... | |||
return 0; // Non fatal error here, skip cycle, but continue processing... | |||
} | |||
if (fIsMaster) { | |||
@@ -719,7 +719,7 @@ int JackOSSDriver::ProcessSync() | |||
// Write output buffers for the current cycle | |||
if (Write() < 0) { | |||
jack_error("JackAudioDriver::ProcessSync: write error, skip cycle"); | |||
return 0; // Skip cycle, but continue processing... | |||
return 0; // Non fatal error here, skip cycle, but continue processing... | |||
} | |||
return 0; | |||
@@ -169,7 +169,7 @@ void Jack_Thread_Init_Callback(void *arg) | |||
void Jack_Freewheel_Callback(int starting, void *arg) | |||
{ | |||
Log("Freewhell callback has been successfully called with value %i. (msg from callback)\n", starting); | |||
Log("Freewheel callback has been successfully called with value %i. (msg from callback)\n", starting); | |||
FW = starting; | |||
} | |||
@@ -633,39 +633,39 @@ int main (int argc, char *argv[]) | |||
if (status & JackServerStarted) { | |||
fprintf(stderr, "JACK server started\n"); | |||
} | |||
/** | |||
* Internal client tests... | |||
* | |||
*/ | |||
jack_intclient_t intclient; | |||
Log("trying to load the \"inprocess\" server internal client \n"); | |||
intclient = jack_internal_client_load (client1, "inprocess", | |||
(jack_options_t)(JackLoadName|JackLoadInit), | |||
&status, "inprocess", ""); | |||
if (intclient == 0 || status & JackFailure) { | |||
printf("!!! ERROR !!! cannot load internal client \"inprocess\" intclient %d status 0x%2.0x !\n", intclient, status); | |||
} else { | |||
Log("\"inprocess\" server internal client loaded\n"); | |||
char* internal_name = jack_get_internal_client_name(client1, intclient); | |||
if (strcmp(internal_name, "inprocess") == 0) { | |||
Log("jack_get_internal_client_name returns %s\n", internal_name); | |||
} else { | |||
printf("!!! ERROR !!! jack_get_internal_client_name returns incorrect name %s\n", internal_name); | |||
} | |||
jack_intclient_t intclient1 = jack_internal_client_handle(client1, "inprocess", &status); | |||
if (intclient1 == intclient) { | |||
Log("jack_internal_client_handle returns correct handle\n"); | |||
} else { | |||
printf("!!! ERROR !!! jack_internal_client_handle returns incorrect handle %d\n", intclient1); | |||
} | |||
// Unload internal client | |||
status = jack_internal_client_unload (client1, intclient); | |||
if (status == 0) { | |||
@@ -673,7 +673,7 @@ int main (int argc, char *argv[]) | |||
} else { | |||
printf("!!! ERROR !!! jack_internal_client_unload returns incorrect value 0x%2.0x\n", status); | |||
} | |||
// Unload internal client second time | |||
status = jack_internal_client_unload (client1, intclient); | |||
if (status & JackFailure && status & JackNoSuchClient) { | |||
@@ -682,8 +682,8 @@ int main (int argc, char *argv[]) | |||
printf("!!! ERROR !!! jack_internal_client_unload returns incorrect value 0x%2.0x\n", status); | |||
} | |||
} | |||
/** | |||
* try to register another one with the same name... | |||
* | |||
@@ -738,7 +738,7 @@ int main (int argc, char *argv[]) | |||
printf("!!! ERROR !!! while calling jack_set_thread_init_callback()...\n"); | |||
if (jack_set_freewheel_callback(client1, Jack_Freewheel_Callback, 0) != 0 ) | |||
printf("\n!!! ERROR !!! while calling jack_set_freewheel_callback()...\n"); | |||
if (jack_set_process_callback(client1, process1, 0) != 0) { | |||
printf("Error when calling jack_set_process_callback() !\n"); | |||
@@ -754,7 +754,7 @@ int main (int argc, char *argv[]) | |||
if (jack_set_graph_order_callback(client1, Jack_Graph_Order_Callback, 0) != 0) { | |||
printf("Error when calling Jack_Graph_Order_Callback() !\n"); | |||
} | |||
if (jack_set_port_rename_callback(client1, Jack_Port_Rename_Callback, 0) != 0 ) | |||
printf("\n!!! ERROR !!! while calling jack_set_rename_callback()...\n"); | |||
@@ -874,7 +874,7 @@ int main (int argc, char *argv[]) | |||
} | |||
port_callback_reg = 0; // number of port registration received by the callback | |||
/** | |||
* Activate the client | |||
* | |||
@@ -883,31 +883,31 @@ int main (int argc, char *argv[]) | |||
printf ("Fatal error : cannot activate client1\n"); | |||
exit(1); | |||
} | |||
/** | |||
* Test if portrename callback have been called. | |||
* | |||
*/ | |||
jack_port_set_name (output_port1, "renamed-port#"); | |||
jack_sleep(1 * 1000); | |||
jack_sleep(1 * 1000); | |||
if (port_rename_clbk == 0) | |||
printf("!!! ERROR !!! Jack_Port_Rename_Callback was not called !!.\n"); | |||
/** | |||
* Test if portregistration callback have been called. | |||
* | |||
*/ | |||
jack_sleep(1 * 1000); | |||
jack_sleep(1 * 1000); | |||
if (1 == port_callback_reg) { | |||
Log("%i ports have been successfully created, and %i callback reg ports have been received... ok\n", 1, port_callback_reg); | |||
} else { | |||
printf("!!! ERROR !!! %i ports have been created, and %i callback reg ports have been received !\n", 1, port_callback_reg); | |||
} | |||
/** | |||
* Test if init callback initThread have been called. | |||
* | |||
@@ -1162,14 +1162,14 @@ int main (int argc, char *argv[]) | |||
} | |||
jack_sleep(1 * 1000); // To hope all port registration and reorder callback have been received... | |||
// Check port registration callback | |||
if (j == port_callback_reg) { | |||
Log("%i ports have been successfully created, and %i callback reg ports have been received... ok\n", j, port_callback_reg); | |||
} else { | |||
printf("!!! ERROR !!! %i ports have been created, and %i callback reg ports have been received !\n", j, port_callback_reg); | |||
} | |||
if (reorder == (2 * j)) { | |||
Log("%i graph reorder callback have been received... ok\n", reorder); | |||
} else { | |||
@@ -1231,9 +1231,9 @@ int main (int argc, char *argv[]) | |||
} | |||
a++; | |||
} | |||
// Check port registration callback again | |||
if (j == port_callback_reg) { | |||
if (j == port_callback_reg) { | |||
Log("%i ports have been successfully created, and %i callback reg ports have been received... ok\n", j, port_callback_reg); | |||
} else { | |||
printf("!!! ERROR !!! %i ports have been created, and %i callback reg ports have been received !\n", j, port_callback_reg); | |||
@@ -48,7 +48,7 @@ int JackWinNamedPipeClientChannel::ServerCheck(const char* server_name) | |||
} | |||
} | |||
int JackWinNamedPipeClientChannel::Open(const char* server_name, const char* name, char* name_res, JackClient* obj, jack_options_t options, jack_status_t* status) | |||
int JackWinNamedPipeClientChannel::Open(const char* server_name, const char* name, int uuid, char* name_res, JackClient* obj, jack_options_t options, jack_status_t* status) | |||
{ | |||
int result = 0; | |||
jack_log("JackWinNamedPipeClientChannel::Open name = %s", name); | |||
@@ -67,7 +67,7 @@ int JackWinNamedPipeClientChannel::Open(const char* server_name, const char* nam | |||
} | |||
// Check name in server | |||
ClientCheck(name, name_res, JACK_PROTOCOL_VERSION, (int)options, (int*)status, &result); | |||
ClientCheck(name, uuid, name_res, JACK_PROTOCOL_VERSION, (int)options, (int*)status, &result); | |||
if (result < 0) { | |||
jack_error("Client name = %s conflits with another running client", name); | |||
goto error; | |||
@@ -142,18 +142,18 @@ void JackWinNamedPipeClientChannel::ServerAsyncCall(JackRequest* req, JackResult | |||
} | |||
} | |||
void JackWinNamedPipeClientChannel::ClientCheck(const char* name, char* name_res, int protocol, int options, int* status, int* result) | |||
void JackWinNamedPipeClientChannel::ClientCheck(const char* name, int uuid, char* name_res, int protocol, int options, int* status, int* result) | |||
{ | |||
JackClientCheckRequest req(name, protocol, options); | |||
JackClientCheckRequest req(name, protocol, options, uuid); | |||
JackClientCheckResult res; | |||
ServerSyncCall(&req, &res, result); | |||
*status = res.fStatus; | |||
strcpy(name_res, res.fName); | |||
} | |||
void JackWinNamedPipeClientChannel::ClientOpen(const char* name, int pid, int* shared_engine, int* shared_client, int* shared_graph, int* result) | |||
void JackWinNamedPipeClientChannel::ClientOpen(const char* name, int pid, int uuid, int* shared_engine, int* shared_client, int* shared_graph, int* result) | |||
{ | |||
JackClientOpenRequest req(name, pid); | |||
JackClientOpenRequest req(name, pid, uuid); | |||
JackClientOpenResult res; | |||
ServerSyncCall(&req, &res, result); | |||
*shared_engine = res.fSharedEngine; | |||
@@ -246,6 +246,16 @@ void JackWinNamedPipeClientChannel::SetFreewheel(int onoff, int* result) | |||
ServerSyncCall(&req, &res, result); | |||
} | |||
void JackWinNamedPipeClientChannel::SessionNotify(int refnum, const char* target, jack_session_event_type_t type, const char* path, jack_session_command_t** result) | |||
{ | |||
JackSessionNotifyRequest req(refnum, target, type, path); | |||
JackResult res; | |||
int intresult; | |||
ServerSyncCall(&req, &res, &intresult); | |||
*result = NULL; | |||
} | |||
void JackWinNamedPipeClientChannel::ReleaseTimebase(int refnum, int* result) | |||
{ | |||
JackReleaseTimebaseRequest req(refnum); | |||
@@ -277,9 +287,9 @@ void JackWinNamedPipeClientChannel::InternalClientHandle(int refnum, const char* | |||
*status = res.fStatus; | |||
} | |||
void JackWinNamedPipeClientChannel::InternalClientLoad(int refnum, const char* client_name, const char* so_name, const char* objet_data, int options, int* status, int* int_ref, int* result) | |||
void JackWinNamedPipeClientChannel::InternalClientLoad(int refnum, const char* client_name, const char* so_name, const char* objet_data, int options, int* status, int* int_ref, int uuid, int* result) | |||
{ | |||
JackInternalClientLoadRequest req(refnum, client_name, so_name, objet_data, options); | |||
JackInternalClientLoadRequest req(refnum, client_name, so_name, objet_data, options, uuid); | |||
JackInternalClientLoadResult res; | |||
ServerSyncCall(&req, &res, result); | |||
*int_ref = res.fIntRefNum; | |||
@@ -1,20 +1,20 @@ | |||
/* | |||
Copyright (C) 2004-2008 Grame | |||
This program is free software; you can redistribute it and/or modify | |||
it under the terms of the GNU Lesser General Public License as published by | |||
the Free Software Foundation; either version 2.1 of the License, or | |||
(at your option) any later version. | |||
This program is distributed in the hope that it will be useful, | |||
but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
GNU Lesser General Public License for more details. | |||
You should have received a copy of the GNU Lesser General Public License | |||
along with this program; if not, write to the Free Software | |||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |||
*/ | |||
@@ -51,7 +51,7 @@ class JackWinNamedPipeClientChannel : public detail::JackClientChannelInterface, | |||
JackWinNamedPipeClientChannel(); | |||
virtual ~JackWinNamedPipeClientChannel(); | |||
int Open(const char* server_name, const char* name, char* name_res, JackClient* obj, jack_options_t options, jack_status_t* status); | |||
int Open(const char* server_name, const char* name, int uuid, char* name_res, JackClient* obj, jack_options_t options, jack_status_t* status); | |||
void Close(); | |||
int Start(); | |||
@@ -59,8 +59,8 @@ class JackWinNamedPipeClientChannel : public detail::JackClientChannelInterface, | |||
int ServerCheck(const char* server_name); | |||
void ClientCheck(const char* name, char* name_res, int protocol, int options, int* status, int* result); | |||
void ClientOpen(const char* name, int pid, int* shared_engine, int* shared_client, int* shared_graph, int* result); | |||
void ClientCheck(const char* name, int uuid, char* name_res, int protocol, int options, int* status, int* result); | |||
void ClientOpen(const char* name, int pid, int uuid, int* shared_engine, int* shared_client, int* shared_graph, int* result); | |||
void ClientOpen(const char* name, int* ref, JackEngineControl** shared_engine, JackGraphManager** shared_manager, JackClientInterface* client, int* result) | |||
{} | |||
void ClientClose(int refnum, int* result); | |||
@@ -76,7 +76,7 @@ class JackWinNamedPipeClientChannel : public detail::JackClientChannelInterface, | |||
void PortConnect(int refnum, jack_port_id_t src, jack_port_id_t dst, int* result); | |||
void PortDisconnect(int refnum, jack_port_id_t src, jack_port_id_t dst, int* result); | |||
void PortRename(int refnum, jack_port_id_t port, const char* name, int* result); | |||
void SetBufferSize(jack_nframes_t buffer_size, int* result); | |||
@@ -87,9 +87,11 @@ class JackWinNamedPipeClientChannel : public detail::JackClientChannelInterface, | |||
void GetInternalClientName(int refnum, int int_ref, char* name_res, int* result); | |||
void InternalClientHandle(int refnum, const char* client_name, int* status, int* int_ref, int* result); | |||
void InternalClientLoad(int refnum, const char* client_name, const char* so_name, const char* objet_data, int options, int* status, int* int_ref, int* result); | |||
void InternalClientLoad(int refnum, const char* client_name, const char* so_name, const char* objet_data, int options, int* status, int* int_ref, int uuid, int* result); | |||
void InternalClientUnload(int refnum, int int_ref, int* status, int* result); | |||
void SessionNotify(int refnum, const char* target, jack_session_event_type_t type, const char* path, jack_session_command_t** result); | |||
// JackRunnableInterface interface | |||
bool Init(); | |||
bool Execute(); | |||
@@ -53,7 +53,7 @@ JackClientPipeThread::~JackClientPipeThread() | |||
delete fPipe; | |||
} | |||
int JackClientPipeThread::Open(JackServer* server) // Open the Server/Client connection | |||
int JackClientPipeThread::Open(JackServer* server) // Open the Server/Client connection | |||
{ | |||
// Start listening | |||
if (fThread.Start() != 0) { | |||
@@ -65,13 +65,13 @@ int JackClientPipeThread::Open(JackServer* server) // Open the Server/Client con | |||
return 0; | |||
} | |||
void JackClientPipeThread::Close() // Close the Server/Client connection | |||
void JackClientPipeThread::Close() // Close the Server/Client connection | |||
{ | |||
jack_log("JackClientPipeThread::Close %x %ld", this, fRefNum); | |||
/* | |||
TODO : solve WIN32 thread Kill issue | |||
This would hang.. since Close will be followed by a delete, | |||
all ressources will be desallocated at the end. | |||
TODO : solve WIN32 thread Kill issue | |||
This would hang.. since Close will be followed by a delete, | |||
all ressources will be desallocated at the end. | |||
*/ | |||
fThread.Kill(); | |||
@@ -115,7 +115,7 @@ bool JackClientPipeThread::HandleRequest() | |||
JackClientCheckRequest req; | |||
JackClientCheckResult res; | |||
if (req.Read(fPipe) == 0) | |||
res.fResult = fServer->GetEngine()->ClientCheck(req.fName, res.fName, req.fProtocol, req.fOptions, &res.fStatus); | |||
res.fResult = fServer->GetEngine()->ClientCheck(req.fName, req.fUUID, res.fName, req.fProtocol, req.fOptions, &res.fStatus); | |||
res.Write(fPipe); | |||
break; | |||
} | |||
@@ -125,7 +125,7 @@ bool JackClientPipeThread::HandleRequest() | |||
JackClientOpenRequest req; | |||
JackClientOpenResult res; | |||
if (req.Read(fPipe) == 0) | |||
ClientAdd(req.fName, req.fPID, &res.fSharedEngine, &res.fSharedClient, &res.fSharedGraph, &res.fResult); | |||
ClientAdd(req.fName, req.fPID, req.fUUID, &res.fSharedEngine, &res.fSharedClient, &res.fSharedGraph, &res.fResult); | |||
res.Write(fPipe); | |||
break; | |||
} | |||
@@ -297,7 +297,7 @@ bool JackClientPipeThread::HandleRequest() | |||
JackInternalClientLoadRequest req; | |||
JackInternalClientLoadResult res; | |||
if (req.Read(fPipe) == 0) | |||
res.fResult = fServer->InternalClientLoad(req.fName, req.fDllName, req.fLoadInitName, req.fOptions, &res.fIntRefNum, &res.fStatus); | |||
res.fResult = fServer->InternalClientLoad(req.fName, req.fDllName, req.fLoadInitName, req.fOptions, &res.fIntRefNum, req.fUUID, &res.fStatus); | |||
res.Write(fPipe); | |||
break; | |||
} | |||
@@ -326,6 +326,63 @@ bool JackClientPipeThread::HandleRequest() | |||
break; | |||
} | |||
case JackRequest::kSessionNotify: { | |||
jack_log("JackRequest::SessionNotify"); | |||
JackSessionNotifyRequest req; | |||
JackSessionNotifyResult res; | |||
if (req.Read(fPipe) == 0) { | |||
fServer->GetEngine()->SessionNotify(req.fRefNum, req.fDst, req.fEventType, req.fPath, fPipe); | |||
} | |||
res.Write(fPipe); | |||
break; | |||
} | |||
case JackRequest::kSessionReply: { | |||
jack_log("JackRequest::SessionReply"); | |||
JackSessionReplyRequest req; | |||
JackResult res; | |||
if (req.Read(fPipe) == 0) { | |||
fServer->GetEngine()->SessionReply(req.fRefNum); | |||
res.fResult = 0; | |||
} | |||
break; | |||
} | |||
case JackRequest::kGetClientByUUID: { | |||
jack_log("JackRequest::GetClientNameForUUID"); | |||
JackGetClientNameRequest req; | |||
JackClientNameResult res; | |||
if (req.Read(fPipe) == 0) { | |||
fServer->GetEngine()->GetClientNameForUUID(req.fUUID, res.fName, &res.fResult); | |||
} | |||
res.Write(fPipe); | |||
break; | |||
} | |||
case JackRequest::kGetUUIDByClient: { | |||
jack_log("JackRequest::GetUUIDForClientName"); | |||
JackGetUUIDRequest req; | |||
JackUUIDResult res; | |||
if (req.Read(fPipe) == 0) { | |||
fServer->GetEngine()->GetUUIDForClientName(req.fName, res.fUUID, &res.fResult); | |||
res.fResult = 0; | |||
} | |||
res.Write(fPipe); | |||
break; | |||
} | |||
case JackRequest::kReserveClientName: { | |||
jack_log("JackRequest::ReserveClientName"); | |||
JackReserveNameRequest req; | |||
JackResult res; | |||
if (req.Read(fPipe) == 0) { | |||
fServer->GetEngine()->ReserveClientName(req.fName, req.fUUID, &res.fResult); | |||
res.fResult = 0; | |||
} | |||
res.Write(fPipe); | |||
break; | |||
} | |||
default: | |||
jack_log("Unknown request %ld", header.fType); | |||
break; | |||
@@ -337,11 +394,11 @@ bool JackClientPipeThread::HandleRequest() | |||
return ret; | |||
} | |||
void JackClientPipeThread::ClientAdd(char* name, int pid, int* shared_engine, int* shared_client, int* shared_graph, int* result) | |||
void JackClientPipeThread::ClientAdd(char* name, int pid, int uuid, int* shared_engine, int* shared_client, int* shared_graph, int* result) | |||
{ | |||
jack_log("JackClientPipeThread::ClientAdd %s", name); | |||
fRefNum = -1; | |||
*result = fServer->GetEngine()->ClientExternalOpen(name, pid, &fRefNum, shared_engine, shared_client, shared_graph); | |||
*result = fServer->GetEngine()->ClientExternalOpen(name, pid, uuid, &fRefNum, shared_engine, shared_client, shared_graph); | |||
} | |||
void JackClientPipeThread::ClientRemove() | |||
@@ -358,7 +415,7 @@ void JackClientPipeThread::ClientKill() | |||
{ | |||
jack_log("JackClientPipeThread::ClientKill ref = %d", fRefNum); | |||
if (fRefNum == -1) { // Correspond to an already removed client. | |||
if (fRefNum == -1) { // Correspond to an already removed client. | |||
jack_log("Kill a closed client"); | |||
} else if (fRefNum == 0) { // Correspond to a still not opened client. | |||
jack_log("Kill a not opened client"); | |||
@@ -401,10 +458,10 @@ int JackWinNamedPipeServerChannel::Open(const char* server_name, JackServer* ser | |||
void JackWinNamedPipeServerChannel::Close() | |||
{ | |||
/* TODO : solve WIN32 thread Kill issue | |||
This would hang the server... since we are quitting it, its not really problematic, | |||
all ressources will be desallocated at the end. | |||
This would hang the server... since we are quitting it, its not really problematic, | |||
all ressources will be desallocated at the end. | |||
fRequestListenPipe.Close(); | |||
fRequestListenPipe.Close(); | |||
fThread.Stop(); | |||
*/ | |||
@@ -1,20 +1,20 @@ | |||
/* | |||
Copyright (C) 2004-2008 Grame | |||
This program is free software; you can redistribute it and/or modify | |||
it under the terms of the GNU Lesser General Public License as published by | |||
the Free Software Foundation; either version 2.1 of the License, or | |||
(at your option) any later version. | |||
This program is distributed in the hope that it will be useful, | |||
but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
GNU Lesser General Public License for more details. | |||
You should have received a copy of the GNU Lesser General Public License | |||
along with this program; if not, write to the Free Software | |||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |||
*/ | |||
@@ -40,7 +40,7 @@ class JackClientPipeThread : public JackRunnableInterface | |||
JackThread fThread; | |||
int fRefNum; | |||
void ClientAdd(char* name, int pid, int* shared_engine, int* shared_client, int* shared_graph, int* result); | |||
void ClientAdd(char* name, int pid, int uuid, int* shared_engine, int* shared_client, int* shared_graph, int* result); | |||
void ClientRemove(); | |||
void ClientKill(); | |||
@@ -53,7 +53,7 @@ class JackClientPipeThread : public JackRunnableInterface | |||
int Open(JackServer* server); // Open the Server/Client connection | |||
void Close(); // Close the Server/Client connection | |||
bool HandleRequest(); | |||
// JackRunnableInterface interface | |||
@@ -91,7 +91,7 @@ class JackWinNamedPipeServerChannel : public JackRunnableInterface | |||
int Open(const char* server_name, JackServer* server); // Open the Server/Client connection | |||
void Close(); // Close the Server/Client connection | |||
int Start(); | |||
// JackRunnableInterface interface | |||
@@ -235,6 +235,11 @@ pthread_t JackWinThread::GetThreadID() | |||
return fThread; | |||
} | |||
bool JackWinThread::IsThread() | |||
{ | |||
return GetCurrentThread() == fThread; | |||
} | |||
void JackWinThread::Terminate() | |||
{ | |||
jack_log("JackWinThread::Terminate"); | |||
@@ -1,20 +1,20 @@ | |||
/* | |||
Copyright (C) 2004-2008 Grame | |||
This program is free software; you can redistribute it and/or modify | |||
it under the terms of the GNU Lesser General Public License as published by | |||
the Free Software Foundation; either version 2.1 of the License, or | |||
(at your option) any later version. | |||
This program is distributed in the hope that it will be useful, | |||
but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
GNU Lesser General Public License for more details. | |||
You should have received a copy of the GNU Lesser General Public License | |||
along with this program; if not, write to the Free Software | |||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |||
*/ | |||
@@ -59,24 +59,25 @@ class SERVER_EXPORT JackWinThread : public detail::JackThreadInterface | |||
int AcquireRealTime(); // Used when called from another thread | |||
int AcquireSelfRealTime(); // Used when called from thread itself | |||
int AcquireRealTime(int priority); // Used when called from another thread | |||
int AcquireSelfRealTime(int priority); // Used when called from thread itself | |||
int DropRealTime(); // Used when called from another thread | |||
int DropSelfRealTime(); // Used when called from thread itself | |||
pthread_t GetThreadID(); | |||
bool IsThread(); | |||
static int AcquireRealTimeImp(pthread_t thread, int priority); | |||
static int AcquireRealTimeImp(pthread_t thread, int priority, UInt64 period, UInt64 computation, UInt64 constraint) | |||
{ | |||
return JackWinThread::AcquireRealTimeImp(thread, priority); | |||
{ | |||
return JackWinThread::AcquireRealTimeImp(thread, priority); | |||
} | |||
static int DropRealTimeImp(pthread_t thread); | |||
static int StartImp(pthread_t* thread, int priority, int realtime, void*(*start_routine)(void*), void* arg) | |||
{ | |||
return JackWinThread::StartImp(thread, priority, realtime, (ThreadCallback) start_routine, arg); | |||
{ | |||
return JackWinThread::StartImp(thread, priority, realtime, (ThreadCallback) start_routine, arg); | |||
} | |||
static int StartImp(pthread_t* thread, int priority, int realtime, ThreadCallback start_routine, void* arg); | |||
static int StopImp(pthread_t thread); | |||