}
jack_status_t status;
- jack_client_t* c = jack_client_open1 ("ardourprobe", JackNoStartServer, &status);
+ jack_client_t* c = jack_client_open ("ardourprobe", JackNoStartServer, &status);
if (status == 0) {
jack_client_close (c);
get_jack_server_dir_paths (dirs);
set_path_env_for_jack_autostart (dirs);
- if ((_jack = jack_client_open2 (_client_name.c_str(), JackSessionID, &status, session_uuid.c_str())) == 0) {
+ if ((_jack = jack_client_open (_client_name.c_str(), JackSessionID, &status, session_uuid.c_str())) == 0) {
return -1;
}
* (jack ringbuffer may be an exception for some apps)
*/
-/* expand ellipsis for jack-session */
-jack_client_t * WJACK_client_open2 (const char *client_name, jack_options_t options, jack_status_t *status, const char *uuid) {
- if (_j._client_open) {
- return ((jack_client_t* (*)(const char *, jack_options_t, jack_status_t *, ...))(_j._client_open))(client_name, options, status, uuid);
- } else {
- WJACK_WARNING(client_open);
- if (status) *status = (jack_status_t)0;
- return NULL;
- }
+/* dedicated support for jack_client_open(,..) variable arg function macro */
+func_t WJACK_get_client_open(void) {
+ return _j._client_open;
}
-jack_client_t * WJACK_client_open1 (const char *client_name, jack_options_t options, jack_status_t *status) {
- if (_j._client_open) {
- return ((jack_client_t* (*)(const char *, jack_options_t, jack_status_t *, ...))_j._client_open)(client_name, options, status);
- } else {
- WJACK_WARNING(client_open);
- if (status) *status = (jack_status_t)0;
- return NULL;
- }
+/* callback to set status */
+jack_client_t * WJACK_no_client_open (const char *client_name, jack_options_t options, jack_status_t *status, ...) {
+ WJACK_WARNING(client_open);
+ if (status) { *status = JackFailure; }
+ return NULL;
}
/*******************************************************************************
#ifdef USE_WEAK_JACK
/* <jack/jack.h> */
-#define jack_client_open WJACK_client_openX
#define jack_client_close WJACK_client_close
#define jack_get_client_name WJACK_get_client_name
#define jack_get_sample_rate WJACK_get_sample_rate
#define jack_client_stop_thread WJACK_client_stop_thread
#define jack_client_kill_thread WJACK_client_kill_thread
-/* var-args hack */
-#define jack_client_open1 WJACK_client_open1
-#define jack_client_open2 WJACK_client_open2
+#define jack_client_open WJACK_client_client_openXXX
-#include <jack/types.h> // needed for jack_client_open abstraction
+#endif // end USE_WEAK_JACK
-#ifdef __cplusplus
-extern "C"
-{
-#endif
+#include <jack/jack.h>
+#include <jack/transport.h>
+#include <jack/ringbuffer.h>
+#include <jack/midiport.h>
+#include <jack/session.h>
+#include <jack/thread.h>
+
+#ifdef USE_WEAK_JACK
-jack_client_t * WJACK_client_open1 (
- const char *client_name,
- jack_options_t options, jack_status_t *status);
+#undef jack_client_open
-jack_client_t * WJACK_client_open2 (
- const char *client_name,
- jack_options_t options, jack_status_t *status, const char *uuid);
+/* var-args hack */
+#ifdef __cplusplus
+extern "C" {
+#endif
+void (* WJACK_get_client_open (void)) (void);
+jack_client_t * WJACK_no_client_open (const char *client_name, jack_options_t options, jack_status_t *status, ...);
#ifdef __cplusplus
}
#endif
-#else /* directly use JACK API */
-
-/* var-args hack */
-#define jack_client_open1 jack_client_open
-#define jack_client_open2 jack_client_open
+#define jack_client_open(...) \
+( \
+ (WJACK_get_client_open() != NULL) \
+ ? ((jack_client_t* (*)(const char *, jack_options_t, jack_status_t *, ...))(WJACK_get_client_open()))(__VA_ARGS__) \
+ : WJACK_no_client_open(__VA_ARGS__) \
+)
#endif // end USE_WEAK_JACK
-#include <jack/jack.h>
-#include <jack/transport.h>
-#include <jack/ringbuffer.h>
-#include <jack/midiport.h>
-#include <jack/session.h>
-#include <jack/thread.h>
-
#endif // _WEAK_JACK_H