Commit 249c0c3b authored by sletz's avatar sletz
Browse files

rebase from trunk 3966:4004

git-svn-id: http://subversion.jackaudio.org/jack/jack2/branches/libjacknet@4005 0c269be4-1314-0410-8aa9-9f06e86f4224
parent 54ebab2c
......@@ -29,11 +29,23 @@ Arnold Krille
---------------------------
Jackdmp changes log
---------------------------
2010-04-016 Stephane Letz <letz@grame.fr>
* Make jack_connect/jack_disconnect wait for effective port connection/disconnection.
2010-04-07 Stephane Letz <letz@grame.fr>
* Remove call to exit in library code.
2010-03-26 Stephane Letz <letz@grame.fr>
* ffado-portname-sync.patch from ticket #163 applied.
2010-03-24 Stephane Letz <letz@grame.fr>
* On Windows, now use TRE library for regexp (BSD license instead of GPL license).
2010-03-19 Stephane Letz <letz@grame.fr>
* Fix some file header to have library side code use LGPL.
......
......@@ -56,9 +56,9 @@ extern "C"
const char *
jack_get_version_string();
EXPORT jack_client_t * jack_client_open_aux (const char *client_name,
jack_client_t * jack_client_new_aux (const char *client_name,
jack_options_t options,
jack_status_t *status, va_list ap);
jack_status_t *status);
EXPORT jack_client_t * jack_client_open (const char *client_name,
jack_options_t options,
jack_status_t *status, ...);
......@@ -300,7 +300,7 @@ EXPORT jack_client_t* jack_client_new(const char* client_name)
int options = JackUseExactName;
if (getenv("JACK_START_SERVER") == NULL)
options |= JackNoStartServer;
jack_client_t* res = jack_client_open_aux(client_name, (jack_options_t)options, NULL, NULL);
jack_client_t* res = jack_client_new_aux(client_name, (jack_options_t)options, NULL);
JackGlobals::fOpenMutex->Unlock();
return res;
} catch (std::bad_alloc& e) {
......@@ -317,11 +317,7 @@ EXPORT void* jack_port_get_buffer(jack_port_t* port, jack_nframes_t frames)
#ifdef __CLIENTDEBUG__
JackGlobals::CheckContext("jack_port_get_buffer");
#endif
#if defined(__x86_64__) || defined(__ppc64__)
uint64_t port_aux = (uint64_t)port;
#else
uint32_t port_aux = (uint32_t)port;
#endif
uintptr_t port_aux = (uintptr_t)port;
jack_port_id_t myport = (jack_port_id_t)port_aux;
if (!CheckPort(myport)) {
jack_error("jack_port_get_buffer called with an incorrect port %ld", myport);
......@@ -337,11 +333,7 @@ EXPORT const char* jack_port_name(const jack_port_t* port)
#ifdef __CLIENTDEBUG__
JackGlobals::CheckContext("jack_port_name");
#endif
#if defined(__x86_64__) || defined(__ppc64__)
uint64_t port_aux = (uint64_t)port;
#else
uint32_t port_aux = (uint32_t)port;
#endif
uintptr_t port_aux = (uintptr_t)port;
jack_port_id_t myport = (jack_port_id_t)port_aux;
if (!CheckPort(myport)) {
jack_error("jack_port_name called with an incorrect port %ld", myport);
......@@ -357,11 +349,7 @@ EXPORT const char* jack_port_short_name(const jack_port_t* port)
#ifdef __CLIENTDEBUG__
JackGlobals::CheckContext("jack_port_short_name");
#endif
#if defined(__x86_64__) || defined(__ppc64__)
uint64_t port_aux = (uint64_t)port;
#else
uint32_t port_aux = (uint32_t)port;
#endif
uintptr_t port_aux = (uintptr_t)port;
jack_port_id_t myport = (jack_port_id_t)port_aux;
if (!CheckPort(myport)) {
jack_error("jack_port_short_name called with an incorrect port %ld", myport);
......@@ -377,11 +365,7 @@ EXPORT int jack_port_flags(const jack_port_t* port)
#ifdef __CLIENTDEBUG__
JackGlobals::CheckContext("jack_port_flags");
#endif
#if defined(__x86_64__) || defined(__ppc64__)
uint64_t port_aux = (uint64_t)port;
#else
uint32_t port_aux = (uint32_t)port;
#endif
uintptr_t port_aux = (uintptr_t)port;
jack_port_id_t myport = (jack_port_id_t)port_aux;
if (!CheckPort(myport)) {
jack_error("jack_port_flags called with an incorrect port %ld", myport);
......@@ -397,11 +381,7 @@ EXPORT const char* jack_port_type(const jack_port_t* port)
#ifdef __CLIENTDEBUG__
JackGlobals::CheckContext("jack_port_type");
#endif
#if defined(__x86_64__) || defined(__ppc64__)
uint64_t port_aux = (uint64_t)port;
#else
uint32_t port_aux = (uint32_t)port;
#endif
uintptr_t port_aux = (uintptr_t)port;
jack_port_id_t myport = (jack_port_id_t)port_aux;
if (!CheckPort(myport)) {
jack_error("jack_port_flags called an incorrect port %ld", myport);
......@@ -417,11 +397,7 @@ EXPORT jack_port_type_id_t jack_port_type_id(const jack_port_t *port)
#ifdef __CLIENTDEBUG__
JackGlobals::CheckContext("jack_port_type_id");
#endif
#if defined(__x86_64__) || defined(__ppc64__)
uint64_t port_aux = (uint64_t)port;
#else
uint32_t port_aux = (uint32_t)port;
#endif
uintptr_t port_aux = (uintptr_t)port;
jack_port_id_t myport = (jack_port_id_t)port_aux;
if (!CheckPort(myport)) {
jack_error("jack_port_type_id called an incorrect port %ld", myport);
......@@ -437,11 +413,7 @@ EXPORT int jack_port_connected(const jack_port_t* port)
#ifdef __CLIENTDEBUG__
JackGlobals::CheckContext("jack_port_connected");
#endif
#if defined(__x86_64__) || defined(__ppc64__)
uint64_t port_aux = (uint64_t)port;
#else
uint32_t port_aux = (uint32_t)port;
#endif
uintptr_t port_aux = (uintptr_t)port;
jack_port_id_t myport = (jack_port_id_t)port_aux;
if (!CheckPort(myport)) {
jack_error("jack_port_connected called with an incorrect port %ld", myport);
......@@ -458,11 +430,7 @@ EXPORT int jack_port_connected_to(const jack_port_t* port, const char* port_name
#ifdef __CLIENTDEBUG__
JackGlobals::CheckContext("jack_port_connected_to");
#endif
#if defined(__x86_64__) || defined(__ppc64__)
uint64_t port_aux = (uint64_t)port;
#else
uint32_t port_aux = (uint32_t)port;
#endif
uintptr_t port_aux = (uintptr_t)port;
jack_port_id_t src = (jack_port_id_t)port_aux;
if (!CheckPort(src)) {
jack_error("jack_port_connected_to called with an incorrect port %ld", src);
......@@ -488,21 +456,13 @@ EXPORT int jack_port_tie(jack_port_t* src, jack_port_t* dst)
#ifdef __CLIENTDEBUG__
JackGlobals::CheckContext("jack_port_tie");
#endif
#if defined(__x86_64__) || defined(__ppc64__)
uint64_t src_aux = (uint64_t)src;
#else
uint32_t src_aux = (uint32_t)src;
#endif
uintptr_t src_aux = (uintptr_t)src;
jack_port_id_t mysrc = (jack_port_id_t)src_aux;
if (!CheckPort(mysrc)) {
jack_error("jack_port_tie called with a NULL src port");
return -1;
}
#if defined(__x86_64__) || defined(__ppc64__)
uint64_t dst_aux = (uint64_t)dst;
#else
uint32_t dst_aux = (uint32_t)dst;
#endif
uintptr_t dst_aux = (uintptr_t)dst;
jack_port_id_t mydst = (jack_port_id_t)dst_aux;
if (!CheckPort(mydst)) {
jack_error("jack_port_tie called with a NULL dst port");
......@@ -522,11 +482,7 @@ EXPORT int jack_port_untie(jack_port_t* port)
#ifdef __CLIENTDEBUG__
JackGlobals::CheckContext("jack_port_untie");
#endif
#if defined(__x86_64__) || defined(__ppc64__)
uint64_t port_aux = (uint64_t)port;
#else
uint32_t port_aux = (uint32_t)port;
#endif
uintptr_t port_aux = (uintptr_t)port;
jack_port_id_t myport = (jack_port_id_t)port_aux;
if (!CheckPort(myport)) {
jack_error("jack_port_untie called with an incorrect port %ld", myport);
......@@ -542,11 +498,7 @@ EXPORT jack_nframes_t jack_port_get_latency(jack_port_t* port)
#ifdef __CLIENTDEBUG__
JackGlobals::CheckContext("jack_port_get_latency");
#endif
#if defined(__x86_64__) || defined(__ppc64__)
uint64_t port_aux = (uint64_t)port;
#else
uint32_t port_aux = (uint32_t)port;
#endif
uintptr_t port_aux = (uintptr_t)port;
jack_port_id_t myport = (jack_port_id_t)port_aux;
if (!CheckPort(myport)) {
jack_error("jack_port_get_latency called with an incorrect port %ld", myport);
......@@ -563,11 +515,7 @@ EXPORT void jack_port_set_latency(jack_port_t* port, jack_nframes_t frames)
#ifdef __CLIENTDEBUG__
JackGlobals::CheckContext("jack_port_set_latency");
#endif
#if defined(__x86_64__) || defined(__ppc64__)
uint64_t port_aux = (uint64_t)port;
#else
uint32_t port_aux = (uint32_t)port;
#endif
uintptr_t port_aux = (uintptr_t)port;
jack_port_id_t myport = (jack_port_id_t)port_aux;
if (!CheckPort(myport)) {
jack_error("jack_port_set_latency called with an incorrect port %ld", myport);
......@@ -585,11 +533,7 @@ EXPORT int jack_recompute_total_latency(jack_client_t* ext_client, jack_port_t*
#endif
JackClient* client = (JackClient*)ext_client;
#if defined(__x86_64__) || defined(__ppc64__)
uint64_t port_aux = (uint64_t)port;
#else
uint32_t port_aux = (uint32_t)port;
#endif
uintptr_t port_aux = (uintptr_t)port;
jack_port_id_t myport = (jack_port_id_t)port_aux;
if (client == NULL) {
jack_error("jack_recompute_total_latencies called with a NULL client");
......@@ -630,11 +574,7 @@ EXPORT int jack_port_set_name(jack_port_t* port, const char* name)
#ifdef __CLIENTDEBUG__
JackGlobals::CheckContext("jack_port_set_name");
#endif
#if defined(__x86_64__) || defined(__ppc64__)
uint64_t port_aux = (uint64_t)port;
#else
uint32_t port_aux = (uint32_t)port;
#endif
uintptr_t port_aux = (uintptr_t)port;
jack_port_id_t myport = (jack_port_id_t)port_aux;
if (!CheckPort(myport)) {
jack_error("jack_port_set_name called with an incorrect port %ld", myport);
......@@ -660,11 +600,7 @@ EXPORT int jack_port_set_alias(jack_port_t* port, const char* name)
#ifdef __CLIENTDEBUG__
JackGlobals::CheckContext("jack_port_set_alias");
#endif
#if defined(__x86_64__) || defined(__ppc64__)
uint64_t port_aux = (uint64_t)port;
#else
uint32_t port_aux = (uint32_t)port;
#endif
uintptr_t port_aux = (uintptr_t)port;
jack_port_id_t myport = (jack_port_id_t)port_aux;
if (!CheckPort(myport)) {
jack_error("jack_port_set_alias called with an incorrect port %ld", myport);
......@@ -683,11 +619,7 @@ EXPORT int jack_port_unset_alias(jack_port_t* port, const char* name)
#ifdef __CLIENTDEBUG__
JackGlobals::CheckContext("jack_port_unset_alias");
#endif
#if defined(__x86_64__) || defined(__ppc64__)
uint64_t port_aux = (uint64_t)port;
#else
uint32_t port_aux = (uint32_t)port;
#endif
uintptr_t port_aux = (uintptr_t)port;
jack_port_id_t myport = (jack_port_id_t)port_aux;
if (!CheckPort(myport)) {
jack_error("jack_port_unset_alias called with an incorrect port %ld", myport);
......@@ -706,11 +638,7 @@ EXPORT int jack_port_get_aliases(const jack_port_t* port, char* const aliases[2]
#ifdef __CLIENTDEBUG__
JackGlobals::CheckContext("jack_port_get_aliases");
#endif
#if defined(__x86_64__) || defined(__ppc64__)
uint64_t port_aux = (uint64_t)port;
#else
uint32_t port_aux = (uint32_t)port;
#endif
uintptr_t port_aux = (uintptr_t)port;
jack_port_id_t myport = (jack_port_id_t)port_aux;
if (!CheckPort(myport)) {
jack_error("jack_port_get_aliases called with an incorrect port %ld", myport);
......@@ -726,11 +654,7 @@ EXPORT int jack_port_request_monitor(jack_port_t* port, int onoff)
#ifdef __CLIENTDEBUG__
JackGlobals::CheckContext("jack_port_request_monitor");
#endif
#if defined(__x86_64__) || defined(__ppc64__)
uint64_t port_aux = (uint64_t)port;
#else
uint32_t port_aux = (uint32_t)port;
#endif
uintptr_t port_aux = (uintptr_t)port;
jack_port_id_t myport = (jack_port_id_t)port_aux;
if (!CheckPort(myport)) {
jack_error("jack_port_request_monitor called with an incorrect port %ld", myport);
......@@ -769,11 +693,7 @@ EXPORT int jack_port_ensure_monitor(jack_port_t* port, int onoff)
#ifdef __CLIENTDEBUG__
JackGlobals::CheckContext("jack_port_ensure_monitor");
#endif
#if defined(__x86_64__) || defined(__ppc64__)
uint64_t port_aux = (uint64_t)port;
#else
uint32_t port_aux = (uint32_t)port;
#endif
uintptr_t port_aux = (uintptr_t)port;
jack_port_id_t myport = (jack_port_id_t)port_aux;
if (!CheckPort(myport)) {
jack_error("jack_port_ensure_monitor called with an incorrect port %ld", myport);
......@@ -789,11 +709,7 @@ EXPORT int jack_port_monitoring_input(jack_port_t* port)
#ifdef __CLIENTDEBUG__
JackGlobals::CheckContext("jack_port_monitoring_input");
#endif
#if defined(__x86_64__) || defined(__ppc64__)
uint64_t port_aux = (uint64_t)port;
#else
uint32_t port_aux = (uint32_t)port;
#endif
uintptr_t port_aux = (uintptr_t)port;
jack_port_id_t myport = (jack_port_id_t)port_aux;
if (!CheckPort(myport)) {
jack_error("jack_port_monitoring_input called with an incorrect port %ld", myport);
......@@ -1128,11 +1044,7 @@ EXPORT jack_port_t* jack_port_register(jack_client_t* ext_client, const char* po
jack_error("jack_port_register called with a NULL port name or a NULL port_type");
return NULL;
} else {
#if defined(__x86_64__) || defined(__ppc64__)
return (jack_port_t *)((uint64_t)client->PortRegister(port_name, port_type, flags, buffer_size));
#else
return (jack_port_t *)client->PortRegister(port_name, port_type, flags, buffer_size);
#endif
return (jack_port_t *)((uintptr_t)client->PortRegister(port_name, port_type, flags, buffer_size));
}
}
......@@ -1146,11 +1058,7 @@ EXPORT int jack_port_unregister(jack_client_t* ext_client, jack_port_t* port)
jack_error("jack_port_unregister called with a NULL client");
return -1;
}
#if defined(__x86_64__) || defined(__ppc64__)
uint64_t port_aux = (uint64_t)port;
#else
uint32_t port_aux = (uint32_t)port;
#endif
uintptr_t port_aux = (uintptr_t)port;
jack_port_id_t myport = (jack_port_id_t)port_aux;
if (!CheckPort(myport)) {
jack_error("jack_port_unregister called with an incorrect port %ld", myport);
......@@ -1169,11 +1077,7 @@ EXPORT int jack_port_is_mine(const jack_client_t* ext_client, const jack_port_t*
jack_error("jack_port_is_mine called with a NULL client");
return -1;
}
#if defined(__x86_64__) || defined(__ppc64__)
uint64_t port_aux = (uint64_t)port;
#else
uint32_t port_aux = (uint32_t)port;
#endif
uintptr_t port_aux = (uintptr_t)port;
jack_port_id_t myport = (jack_port_id_t)port_aux;
if (!CheckPort(myport)) {
jack_error("jack_port_is_mine called with an incorrect port %ld", myport);
......@@ -1187,11 +1091,7 @@ EXPORT const char** jack_port_get_connections(const jack_port_t* port)
#ifdef __CLIENTDEBUG__
JackGlobals::CheckContext("jack_port_get_connections");
#endif
#if defined(__x86_64__) || defined(__ppc64__)
uint64_t port_aux = (uint64_t)port;
#else
uint32_t port_aux = (uint32_t)port;
#endif
uintptr_t port_aux = (uintptr_t)port;
jack_port_id_t myport = (jack_port_id_t)port_aux;
if (!CheckPort(myport)) {
jack_error("jack_port_get_connections called with an incorrect port %ld", myport);
......@@ -1215,11 +1115,7 @@ EXPORT const char** jack_port_get_all_connections(const jack_client_t* ext_clien
return NULL;
}
#if defined(__x86_64__) || defined(__ppc64__)
uint64_t port_aux = (uint64_t)port;
#else
uint32_t port_aux = (uint32_t)port;
#endif
uintptr_t port_aux = (uintptr_t)port;
jack_port_id_t myport = (jack_port_id_t)port_aux;
if (!CheckPort(myport)) {
jack_error("jack_port_get_all_connections called with an incorrect port %ld", myport);
......@@ -1242,11 +1138,7 @@ EXPORT jack_nframes_t jack_port_get_total_latency(jack_client_t* ext_client, jac
return 0;
}
#if defined(__x86_64__) || defined(__ppc64__)
uint64_t port_aux = (uint64_t)port;
#else
uint32_t port_aux = (uint32_t)port;
#endif
uintptr_t port_aux = (uintptr_t)port;
jack_port_id_t myport = (jack_port_id_t)port_aux;
if (!CheckPort(myport)) {
jack_error("jack_port_get_total_latency called with an incorrect port %ld", myport);
......@@ -1307,11 +1199,7 @@ EXPORT int jack_port_disconnect(jack_client_t* ext_client, jack_port_t* src)
jack_error("jack_port_disconnect called with a NULL client");
return -1;
}
#if defined(__x86_64__) || defined(__ppc64__)
uint64_t port_aux = (uint64_t)src;
#else
uint32_t port_aux = (uint32_t)src;
#endif
uintptr_t port_aux = (uintptr_t)src;
jack_port_id_t myport = (jack_port_id_t)port_aux;
if (!CheckPort(myport)) {
jack_error("jack_port_disconnect called with an incorrect port %ld", myport);
......@@ -1383,11 +1271,7 @@ EXPORT jack_port_t* jack_port_by_name(jack_client_t* ext_client, const char* por
if (!manager)
return NULL;
int res = manager->GetPort(portname); // returns a port index at least > 1
#if defined(__x86_64__) || defined(__ppc64__)
return (res == NO_PORT) ? NULL : (jack_port_t*)((uint64_t)res);
#else
return (res == NO_PORT) ? NULL : (jack_port_t*)res;
#endif
return (res == NO_PORT) ? NULL : (jack_port_t*)((uintptr_t)res);
}
}
......@@ -1397,11 +1281,7 @@ EXPORT jack_port_t* jack_port_by_id(jack_client_t* ext_client, jack_port_id_t id
JackGlobals::CheckContext("jack_port_by_id");
#endif
/* jack_port_t* type is actually the port index */
#if defined(__x86_64__) || defined(__ppc64__)
return (jack_port_t*)((uint64_t)id);
#else
return (jack_port_t*)id;
#endif
return (jack_port_t*)((uintptr_t)id);
}
EXPORT int jack_engine_takeover_timebase(jack_client_t* ext_client)
......
......@@ -59,30 +59,6 @@
#define JACK_DEFAULT_SERVER_NAME "default"
#ifdef WIN32
#define jack_server_dir "server"
#define jack_client_dir "client"
#define ADDON_DIR "jack"
#endif
#ifdef __APPLE__
#define jack_server_dir "/tmp"
#define jack_client_dir "/tmp"
#define JACK_DEFAULT_DRIVER "coreaudio"
#endif
#ifdef __linux__
#define jack_server_dir "/dev/shm"
#define jack_client_dir "/dev/shm"
#define JACK_DEFAULT_DRIVER "alsa"
#endif
#if defined(__sun__) || defined(sun)
#define jack_server_dir "/tmp"
#define jack_client_dir "/tmp"
#define JACK_DEFAULT_DRIVER "oss"
#endif
#define jack_server_entry "jackdmp_entry"
#define jack_client_entry "jack_client"
......
......@@ -152,7 +152,7 @@ jack_parse_driver_params (jack_driver_desc_t * desc, int argc, char* argv[], JSL
fprintf (stderr, "Options for driver '%s':\n", desc->name);
jack_print_driver_options (desc, stderr);
exit (1);
return 1;
}
for (param_index = 0; param_index < desc->nparams; param_index++) {
......
......@@ -36,7 +36,10 @@ extern "C"
{
#endif
EXPORT jack_client_t * jack_client_open_aux (const char *client_name,
jack_client_t * jack_client_new_aux (const char *client_name,
jack_options_t options,
jack_status_t *status);
jack_client_t * jack_client_open_aux (const char *client_name,
jack_options_t options,
jack_status_t *status, va_list ap);
EXPORT jack_client_t * jack_client_open (const char *client_name,
......@@ -52,18 +55,18 @@ extern "C"
JackLibGlobals* JackLibGlobals::fGlobals = NULL;
int JackLibGlobals::fClientCount = 0;
EXPORT jack_client_t* jack_client_open_aux(const char* client_name, jack_options_t options, jack_status_t* status, va_list ap)
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_status_t my_status;
JackClient* client;
if (client_name == NULL) {
jack_error("jack_client_open called with a NULL client_name");
jack_error("jack_client_new called with a NULL client_name");
return NULL;
}
jack_log("jack_client_open %s", client_name);
jack_log("jack_client_new %s", client_name);
if (status == NULL) /* no status from caller? */
status = &my_status; /* use local status word */
......@@ -77,11 +80,60 @@ EXPORT jack_client_t* jack_client_open_aux(const char* client_name, jack_options
}
/* parse variable arguments */
if (ap) {
jack_varargs_parse(options, ap, &va);
jack_varargs_init(&va);
JackLibGlobals::Init(); // jack library initialisation
if (try_start_server(&va, options, status)) {
jack_error("jack server is not running or cannot be started");
JackLibGlobals::Destroy(); // jack library destruction
return 0;
}
if (JACK_DEBUG) {
client = new JackDebugClient(new JackLibClient(GetSynchroTable())); // Debug mode
} else {
jack_varargs_init(&va);
client = new JackLibClient(GetSynchroTable());
}
int res = client->Open(va.server_name, client_name, options, status);
if (res < 0) {
delete client;
JackLibGlobals::Destroy(); // jack library destruction
int my_status1 = (JackFailure | JackServerError);
*status = (jack_status_t)my_status1;
return NULL;
} else {
return (jack_client_t*)client;
}
}
jack_client_t* jack_client_open_aux(const char* client_name, jack_options_t options, jack_status_t* status, va_list ap)
{
jack_varargs_t va; /* variable arguments */
jack_status_t my_status;
JackClient* client;
if (client_name == NULL) {
jack_error("jack_client_open called with a NULL client_name");
return NULL;
}
jack_log("jack_client_open %s", client_name);
if (status == NULL) /* no status from caller? */
status = &my_status; /* use local status word */
*status = (jack_status_t)0;
/* validate parameters */
if ((options & ~JackOpenOptions)) {
int my_status1 = *status | (JackFailure | JackInvalidOption);
*status = (jack_status_t)my_status1;
return NULL;
}
/* parse variable arguments */
jack_varargs_parse(options, ap, &va);
JackLibGlobals::Init(); // jack library initialisation
......@@ -111,10 +163,10 @@ EXPORT jack_client_t* jack_client_open_aux(const char* client_name, jack_options
EXPORT jack_client_t* jack_client_open(const char* ext_client_name, jack_options_t options, jack_status_t* status, ...)
{
try {
#ifdef __CLIENTDEBUG__
JackGlobals::CheckContext("jack_client_open");
#endif
try {
assert(JackGlobals::fOpenMutex);
JackGlobals::fOpenMutex->Lock();
va_list ap;
......
......@@ -33,7 +33,10 @@ extern "C"
{
#endif
EXPORT jack_client_t * jack_client_open_aux (const char *client_name,
jack_client_t * jack_client_new_aux (const char *client_name,
jack_options_t options,
jack_status_t *status);
jack_client_t * jack_client_open_aux (const char *client_name,
jack_options_t options,
jack_status_t *status, va_list ap);
EXPORT jack_client_t * jack_client_open (const char *client_name,
......@@ -48,18 +51,18 @@ extern "C"
using namespace Jack;
EXPORT jack_client_t* jack_client_open_aux(const char* client_name, jack_options_t options, jack_status_t* status, va_list ap)
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_status_t my_status;
JackClient* client;
if (client_name == NULL) {
jack_error("jack_client_open called with a NULL client_name");
jack_error("jack_client_new called with a NULL client_name");
return NULL;
}
jack_log("jack_client_open %s", client_name);
jack_log("jack_client_new %s", client_name);
if (status == NULL) /* no status from caller? */
status = &my_status; /* use local status word */
......@@ -73,12 +76,59 @@ EXPORT jack_client_t* jack_client_open_aux(const char* client_name, jack_options
}
/* parse variable arguments */
if (ap) {
jack_varargs_parse(options, ap, &va);
jack_varargs_init(&va);
if (!JackServerGlobals::Init()) { // jack server initialisation
int my_status1 = (JackFailure | JackServerError);
*status = (jack_status_t)my_status1;
return NULL;
}
if (JACK_DEBUG) {
client = new JackDebugClient(new JackInternalClient(JackServerGlobals::fInstance, GetSynchroTable())); // Debug mode
} else {
jack_varargs_init(&va);
client = new JackInternalClient(JackServerGlobals::fInstance, GetSynchroTable());
}
int res = client->Open(va.server_name, client_name, options, status);