From 8f979ca17e583d316adbffb0926b67e8b32f8bad Mon Sep 17 00:00:00 2001 From: Alexis Murzeau Date: Sat, 21 Aug 2021 22:26:38 +0200 Subject: [PATCH] Use dllimport/dllexport in public jack headers When building jack, symbols are declared using dllexport. When headers are used by an application, symbols will be declared using dllimport. Fixes: #792 --- common/jack/intclient.h | 5 +++ common/jack/jack.h | 95 +++++++++++++++++++++++++++++++++++++++- common/jack/metadata.h | 20 +++++++++ common/jack/midiport.h | 9 ++++ common/jack/ringbuffer.h | 17 ++++++- common/jack/session.h | 15 +++++-- common/jack/statistics.h | 4 ++ common/jack/systemdeps.h | 13 ++++++ common/jack/thread.h | 20 ++++++--- common/jack/transport.h | 15 ++++++- common/jack/uuid.h | 32 +++++++++----- wscript | 5 ++- 12 files changed, 226 insertions(+), 24 deletions(-) diff --git a/common/jack/intclient.h b/common/jack/intclient.h index d4503aee7..dc045aca5 100644 --- a/common/jack/intclient.h +++ b/common/jack/intclient.h @@ -26,6 +26,7 @@ extern "C" #endif #include +#include /** * Get an internal client's name. This is useful when @ref @@ -42,6 +43,7 @@ extern "C" * client name obtained from the heap via malloc(). The caller should * jack_free() this storage when no longer needed. */ +JACK_CLIENT_API_EXPORT char *jack_get_internal_client_name (jack_client_t *client, jack_intclient_t intclient); @@ -63,6 +65,7 @@ char *jack_get_internal_client_name (jack_client_t *client, * internal client was not found, and @a *status includes the @ref * JackNoSuchClient and @ref JackFailure bits. */ +JACK_CLIENT_API_EXPORT jack_intclient_t jack_internal_client_handle (jack_client_t *client, const char *client_name, jack_status_t *status); @@ -104,6 +107,7 @@ jack_intclient_t jack_internal_client_handle (jack_client_t *client, * the load operation failed, the internal client was not loaded, and * @a *status includes the @ref JackFailure bit. */ +JACK_CLIENT_API_EXPORT jack_intclient_t jack_internal_client_load (jack_client_t *client, const char *client_name, jack_options_t options, @@ -120,6 +124,7 @@ jack_intclient_t jack_internal_client_load (jack_client_t *client, * * @return 0 if successful, otherwise @ref JackStatus bits. */ +JACK_CLIENT_API_EXPORT jack_status_t jack_internal_client_unload (jack_client_t *client, jack_intclient_t intclient); diff --git a/common/jack/jack.h b/common/jack/jack.h index a020e4229..0ff163959 100644 --- a/common/jack/jack.h +++ b/common/jack/jack.h @@ -60,6 +60,7 @@ extern "C" * @param major_ptr pointer to variable receiving protocol version of JACK. * */ +JACK_CLIENT_API_EXPORT void jack_get_version( int *major_ptr, @@ -73,6 +74,7 @@ jack_get_version( * @return Human readable string describing JACK version being used. * */ +JACK_CLIENT_API_EXPORT const char * jack_get_version_string(void) JACK_OPTIONAL_WEAK_EXPORT; @@ -114,6 +116,7 @@ jack_get_version_string(void) JACK_OPTIONAL_WEAK_EXPORT; * open operation failed, @a *status includes @ref JackFailure and the * caller is not a JACK client. */ +JACK_CLIENT_API_EXPORT jack_client_t * jack_client_open (const char *client_name, jack_options_t options, jack_status_t *status, ...) JACK_OPTIONAL_WEAK_EXPORT; @@ -124,6 +127,7 @@ jack_client_t * jack_client_open (const char *client_name, * * @deprecated Please use jack_client_open(). */ +JACK_CLIENT_API_EXPORT jack_client_t * jack_client_new (const char *client_name) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT; /** @@ -131,12 +135,14 @@ jack_client_t * jack_client_new (const char *client_name) JACK_OPTIONAL_WEAK_DEP * * @return 0 on success, otherwise a non-zero error code */ +JACK_CLIENT_API_EXPORT int jack_client_close (jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT; /** * @return the maximum number of characters in a JACK client name * including the final NULL character. This value is a constant. */ +JACK_CLIENT_API_EXPORT int jack_client_name_size (void) JACK_OPTIONAL_WEAK_EXPORT; /** @@ -145,6 +151,7 @@ int jack_client_name_size (void) JACK_OPTIONAL_WEAK_EXPORT; * JackNameNotUnique status was returned. In that case, the actual * name will differ from the @a client_name requested. */ +JACK_CLIENT_API_EXPORT char * jack_get_client_name (jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT; /** @@ -155,6 +162,7 @@ char * jack_get_client_name (jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT; * The caller is responsible for calling jack_free(3) on any non-NULL * returned value. */ +JACK_CLIENT_API_EXPORT char *jack_get_uuid_for_client_name (jack_client_t *client, const char *client_name) JACK_WEAK_EXPORT; @@ -167,6 +175,7 @@ char *jack_get_uuid_for_client_name (jack_client_t *client, * The caller is responsible for calling jack_free(3) on any non-NULL * returned value. */ +JACK_CLIENT_API_EXPORT char *jack_get_client_name_by_uuid (jack_client_t *client, const char *client_uuid ) JACK_WEAK_EXPORT; @@ -191,6 +200,7 @@ char *jack_get_client_name_by_uuid (jack_client_t *client, * * @return 0 if successful. */ +JACK_CLIENT_API_EXPORT int jack_internal_client_new (const char *client_name, const char *load_name, const char *load_init) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT; @@ -200,6 +210,7 @@ int jack_internal_client_new (const char *client_name, * * @deprecated Please use jack_internal_client_unload(). */ +JACK_CLIENT_API_EXPORT void jack_internal_client_close (const char *client_name) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT; /** @@ -208,6 +219,7 @@ void jack_internal_client_close (const char *client_name) JACK_OPTIONAL_WEAK_DEP * * @return 0 on success, otherwise a non-zero error code */ +JACK_CLIENT_API_EXPORT int jack_activate (jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT; /** @@ -217,17 +229,20 @@ int jack_activate (jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT; * * @return 0 on success, otherwise a non-zero error code */ +JACK_CLIENT_API_EXPORT int jack_deactivate (jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT; /** * @return pid of client. If not available, 0 will be returned. */ +JACK_CLIENT_API_EXPORT int jack_get_client_pid (const char *name) JACK_OPTIONAL_WEAK_EXPORT; /** * @return the pthread ID of the thread running the JACK client side * real-time code. */ +JACK_CLIENT_API_EXPORT jack_native_thread_t jack_client_thread_id (jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT; /*@}*/ @@ -239,6 +254,7 @@ jack_native_thread_t jack_client_thread_id (jack_client_t *client) JACK_OPTIONAL * * @return 1 if JACK is running realtime, 0 otherwise */ +JACK_CLIENT_API_EXPORT int jack_is_realtime (jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT; /** @@ -252,6 +268,7 @@ int jack_is_realtime (jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT; * * @deprecated Please use jack_cycle_wait() and jack_cycle_signal() functions. */ +JACK_CLIENT_API_EXPORT jack_nframes_t jack_thread_wait (jack_client_t *client, int status) JACK_OPTIONAL_WEAK_EXPORT; /** @@ -261,6 +278,7 @@ jack_nframes_t jack_thread_wait (jack_client_t *client, int status) JACK_OPTIONA * * @return the number of frames of data to process */ +JACK_CLIENT_API_EXPORT jack_nframes_t jack_cycle_wait (jack_client_t* client) JACK_OPTIONAL_WEAK_EXPORT; /** @@ -269,6 +287,7 @@ jack_nframes_t jack_cycle_wait (jack_client_t* client) JACK_OPTIONAL_WEAK_EXPORT * @param client - pointer to a JACK client structure * @param status - if non-zero, calling thread should exit */ +JACK_CLIENT_API_EXPORT void jack_cycle_signal (jack_client_t* client, int status) JACK_OPTIONAL_WEAK_EXPORT; /** @@ -287,6 +306,7 @@ void jack_cycle_signal (jack_client_t* client, int status) JACK_OPTIONAL_WEAK_EX * * @return 0 on success, otherwise a non-zero error code. */ +JACK_CLIENT_API_EXPORT int jack_set_process_thread(jack_client_t* client, JackThreadCallback thread_callback, void *arg) JACK_OPTIONAL_WEAK_EXPORT; /*@}*/ @@ -310,6 +330,7 @@ int jack_set_process_thread(jack_client_t* client, JackThreadCallback thread_cal * @return 0 on success, otherwise a non-zero error code, causing JACK * to remove that client from the process() graph. */ +JACK_CLIENT_API_EXPORT int jack_set_thread_init_callback (jack_client_t *client, JackThreadInitCallback thread_init_callback, void *arg) JACK_OPTIONAL_WEAK_EXPORT; @@ -342,6 +363,7 @@ int jack_set_thread_init_callback (jack_client_t *client, * (since "jack_client_close" cannot be called directly in the context * of the thread that calls the shutdown callback). */ +JACK_CLIENT_API_EXPORT void jack_on_shutdown (jack_client_t *client, JackShutdownCallback shutdown_callback, void *arg) JACK_OPTIONAL_WEAK_EXPORT; @@ -372,6 +394,7 @@ void jack_on_shutdown (jack_client_t *client, * (since "jack_client_close" cannot be called directly in the context * of the thread that calls the shutdown callback). */ +JACK_CLIENT_API_EXPORT void jack_on_info_shutdown (jack_client_t *client, JackInfoShutdownCallback shutdown_callback, void *arg) JACK_WEAK_EXPORT; @@ -392,6 +415,7 @@ void jack_on_info_shutdown (jack_client_t *client, * * @return 0 on success, otherwise a non-zero error code. */ +JACK_CLIENT_API_EXPORT int jack_set_process_callback (jack_client_t *client, JackProcessCallback process_callback, void *arg) JACK_OPTIONAL_WEAK_EXPORT; @@ -412,6 +436,7 @@ int jack_set_process_callback (jack_client_t *client, * * @return 0 on success, otherwise a non-zero error code. */ +JACK_CLIENT_API_EXPORT int jack_set_freewheel_callback (jack_client_t *client, JackFreewheelCallback freewheel_callback, void *arg) JACK_OPTIONAL_WEAK_EXPORT; @@ -435,6 +460,7 @@ int jack_set_freewheel_callback (jack_client_t *client, * * @return 0 on success, otherwise a non-zero error code */ +JACK_CLIENT_API_EXPORT int jack_set_buffer_size_callback (jack_client_t *client, JackBufferSizeCallback bufsize_callback, void *arg) JACK_OPTIONAL_WEAK_EXPORT; @@ -452,6 +478,7 @@ int jack_set_buffer_size_callback (jack_client_t *client, * * @return 0 on success, otherwise a non-zero error code */ +JACK_CLIENT_API_EXPORT int jack_set_sample_rate_callback (jack_client_t *client, JackSampleRateCallback srate_callback, void *arg) JACK_OPTIONAL_WEAK_EXPORT; @@ -469,6 +496,7 @@ int jack_set_sample_rate_callback (jack_client_t *client, * * @return 0 on success, otherwise a non-zero error code */ +JACK_CLIENT_API_EXPORT int jack_set_client_registration_callback (jack_client_t *client, JackClientRegistrationCallback registration_callback, void *arg) JACK_OPTIONAL_WEAK_EXPORT; @@ -486,7 +514,8 @@ int jack_set_client_registration_callback (jack_client_t *client, * * @return 0 on success, otherwise a non-zero error code */ - int jack_set_port_registration_callback (jack_client_t *client, +JACK_CLIENT_API_EXPORT +int jack_set_port_registration_callback (jack_client_t *client, JackPortRegistrationCallback registration_callback, void *arg) JACK_OPTIONAL_WEAK_EXPORT; @@ -503,6 +532,7 @@ int jack_set_client_registration_callback (jack_client_t *client, * * @return 0 on success, otherwise a non-zero error code */ +JACK_CLIENT_API_EXPORT int jack_set_port_connect_callback (jack_client_t *client, JackPortConnectCallback connect_callback, void *arg) JACK_OPTIONAL_WEAK_EXPORT; @@ -520,6 +550,7 @@ int jack_set_port_connect_callback (jack_client_t *client, * * @return 0 on success, otherwise a non-zero error code */ +JACK_CLIENT_API_EXPORT int jack_set_port_rename_callback (jack_client_t *client, JackPortRenameCallback rename_callback, void *arg) JACK_OPTIONAL_WEAK_EXPORT; @@ -537,6 +568,7 @@ int jack_set_port_rename_callback (jack_client_t *client, * * @return 0 on success, otherwise a non-zero error code */ +JACK_CLIENT_API_EXPORT int jack_set_graph_order_callback (jack_client_t *client, JackGraphOrderCallback graph_callback, void *) JACK_OPTIONAL_WEAK_EXPORT; @@ -554,6 +586,7 @@ int jack_set_graph_order_callback (jack_client_t *client, * * @return 0 on success, otherwise a non-zero error code */ +JACK_CLIENT_API_EXPORT int jack_set_xrun_callback (jack_client_t *client, JackXRunCallback xrun_callback, void *arg) JACK_OPTIONAL_WEAK_EXPORT; @@ -616,6 +649,7 @@ int jack_set_xrun_callback (jack_client_t *client, * * @return 0 on success, otherwise a non-zero error code */ +JACK_CLIENT_API_EXPORT int jack_set_latency_callback (jack_client_t *client, JackLatencyCallback latency_callback, void *) JACK_WEAK_EXPORT; @@ -650,6 +684,7 @@ int jack_set_latency_callback (jack_client_t *client, * * @return 0 on success, otherwise a non-zero error code. */ +JACK_CLIENT_API_EXPORT int jack_set_freewheel(jack_client_t* client, int onoff) JACK_OPTIONAL_WEAK_EXPORT; /** @@ -667,12 +702,14 @@ int jack_set_freewheel(jack_client_t* client, int onoff) JACK_OPTIONAL_WEAK_EXPO * * @return 0 on success, otherwise a non-zero error code */ +JACK_CLIENT_API_EXPORT int jack_set_buffer_size (jack_client_t *client, jack_nframes_t nframes) JACK_OPTIONAL_WEAK_EXPORT; /** * @return the sample rate of the jack system, as set by the user when * jackd was started. */ +JACK_CLIENT_API_EXPORT jack_nframes_t jack_get_sample_rate (jack_client_t *) JACK_OPTIONAL_WEAK_EXPORT; /** @@ -684,6 +721,7 @@ jack_nframes_t jack_get_sample_rate (jack_client_t *) JACK_OPTIONAL_WEAK_EXPORT; * * @see jack_set_buffer_size_callback() */ +JACK_CLIENT_API_EXPORT jack_nframes_t jack_get_buffer_size (jack_client_t *) JACK_OPTIONAL_WEAK_EXPORT; /** @@ -696,6 +734,7 @@ jack_nframes_t jack_get_buffer_size (jack_client_t *) JACK_OPTIONAL_WEAK_EXPORT; * * @return ENOSYS, function not implemented. */ +JACK_CLIENT_API_EXPORT int jack_engine_takeover_timebase (jack_client_t *) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT; /** @@ -704,6 +743,7 @@ int jack_engine_takeover_timebase (jack_client_t *) JACK_OPTIONAL_WEAK_DEPRECATE * all clients as a percentage of the real time available per cycle * determined by the buffer size and sample rate. */ +JACK_CLIENT_API_EXPORT float jack_cpu_load (jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT; /*@}*/ @@ -742,6 +782,7 @@ float jack_cpu_load (jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT; * * @return jack_port_t pointer on success, otherwise NULL. */ +JACK_CLIENT_API_EXPORT jack_port_t * jack_port_register (jack_client_t *client, const char *port_name, const char *port_type, @@ -754,6 +795,7 @@ jack_port_t * jack_port_register (jack_client_t *client, * * @return 0 on success, otherwise a non-zero error code */ +JACK_CLIENT_API_EXPORT int jack_port_unregister (jack_client_t *client, jack_port_t *port) JACK_OPTIONAL_WEAK_EXPORT; /** @@ -775,6 +817,7 @@ int jack_port_unregister (jack_client_t *client, jack_port_t *port) JACK_OPTIONA * Caching output ports is DEPRECATED in Jack 2.0, due to some new optimization (like "pipelining"). * Port buffers have to be retrieved in each callback for proper functioning. */ +JACK_CLIENT_API_EXPORT void * jack_port_get_buffer (jack_port_t *port, jack_nframes_t) JACK_OPTIONAL_WEAK_EXPORT; /** @@ -782,6 +825,7 @@ void * jack_port_get_buffer (jack_port_t *port, jack_nframes_t) JACK_OPTIONAL_WE * * @see jack_uuid_to_string() to convert into a string representation */ +JACK_CLIENT_API_EXPORT jack_uuid_t jack_port_uuid (const jack_port_t *port) JACK_OPTIONAL_WEAK_EXPORT; /** @@ -790,6 +834,7 @@ jack_uuid_t jack_port_uuid (const jack_port_t *port) JACK_OPTIONAL_WEAK_EXPORT; * * @see jack_port_name_size(). */ +JACK_CLIENT_API_EXPORT const char * jack_port_name (const jack_port_t *port) JACK_OPTIONAL_WEAK_EXPORT; /** @@ -798,27 +843,32 @@ const char * jack_port_name (const jack_port_t *port) JACK_OPTIONAL_WEAK_EXPORT; * * @see jack_port_name_size(). */ +JACK_CLIENT_API_EXPORT const char * jack_port_short_name (const jack_port_t *port) JACK_OPTIONAL_WEAK_EXPORT; /** * @return the @ref JackPortFlags of the jack_port_t. */ +JACK_CLIENT_API_EXPORT int jack_port_flags (const jack_port_t *port) JACK_OPTIONAL_WEAK_EXPORT; /** * @return the @a port type, at most jack_port_type_size() characters * including a final NULL. */ +JACK_CLIENT_API_EXPORT const char * jack_port_type (const jack_port_t *port) JACK_OPTIONAL_WEAK_EXPORT; /** * @return the @a port type id. */ +JACK_CLIENT_API_EXPORT jack_port_type_id_t jack_port_type_id (const jack_port_t *port) JACK_OPTIONAL_WEAK_EXPORT; /** * @return TRUE if the jack_port_t belongs to the jack_client_t. */ +JACK_CLIENT_API_EXPORT int jack_port_is_mine (const jack_client_t *client, const jack_port_t *port) JACK_OPTIONAL_WEAK_EXPORT; /** @@ -826,6 +876,7 @@ int jack_port_is_mine (const jack_client_t *client, const jack_port_t *port) JAC * * @pre The calling client must own @a port. */ +JACK_CLIENT_API_EXPORT int jack_port_connected (const jack_port_t *port) JACK_OPTIONAL_WEAK_EXPORT; /** @@ -834,6 +885,7 @@ int jack_port_connected (const jack_port_t *port) JACK_OPTIONAL_WEAK_EXPORT; * * @see jack_port_name_size() */ +JACK_CLIENT_API_EXPORT int jack_port_connected_to (const jack_port_t *port, const char *port_name) JACK_OPTIONAL_WEAK_EXPORT; @@ -848,6 +900,7 @@ int jack_port_connected_to (const jack_port_t *port, * * @see jack_port_name_size(), jack_port_get_all_connections() */ +JACK_CLIENT_API_EXPORT const char ** jack_port_get_connections (const jack_port_t *port) JACK_OPTIONAL_WEAK_EXPORT; /** @@ -869,6 +922,7 @@ const char ** jack_port_get_connections (const jack_port_t *port) JACK_OPTIONAL_ * * @see jack_port_name_size() */ +JACK_CLIENT_API_EXPORT const char ** jack_port_get_all_connections (const jack_client_t *client, const jack_port_t *port) JACK_OPTIONAL_WEAK_EXPORT; @@ -879,6 +933,7 @@ const char ** jack_port_get_all_connections (const jack_client_t *client, * turned out to serve essentially no purpose in real-life * JACK clients. */ +JACK_CLIENT_API_EXPORT int jack_port_tie (jack_port_t *src, jack_port_t *dst) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT; /** @@ -888,6 +943,7 @@ int jack_port_tie (jack_port_t *src, jack_port_t *dst) JACK_OPTIONAL_WEAK_DEPREC * turned out to serve essentially no purpose in real-life * JACK clients. */ +JACK_CLIENT_API_EXPORT int jack_port_untie (jack_port_t *port) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT; /** @@ -900,6 +956,7 @@ int jack_port_untie (jack_port_t *port) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT; * * @return 0 on success, otherwise a non-zero error code. */ +JACK_CLIENT_API_EXPORT int jack_port_set_name (jack_port_t *port, const char *port_name) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT; /** @@ -912,6 +969,7 @@ int jack_port_set_name (jack_port_t *port, const char *port_name) JACK_OPTIONAL_ * This differs from jack_port_set_name() by triggering PortRename notifications to * clients that have registered a port rename handler. */ +JACK_CLIENT_API_EXPORT int jack_port_rename (jack_client_t* client, jack_port_t *port, const char *port_name) JACK_OPTIONAL_WEAK_EXPORT; /** @@ -927,6 +985,7 @@ int jack_port_rename (jack_client_t* client, jack_port_t *port, const char *port * * @return 0 on success, otherwise a non-zero error code. */ +JACK_CLIENT_API_EXPORT int jack_port_set_alias (jack_port_t *port, const char *alias) JACK_OPTIONAL_WEAK_EXPORT; /** @@ -937,6 +996,7 @@ int jack_port_set_alias (jack_port_t *port, const char *alias) JACK_OPTIONAL_WEA * * @return 0 on success, otherwise a non-zero error code. */ +JACK_CLIENT_API_EXPORT int jack_port_unset_alias (jack_port_t *port, const char *alias) JACK_OPTIONAL_WEAK_EXPORT; /** @@ -944,12 +1004,14 @@ int jack_port_unset_alias (jack_port_t *port, const char *alias) JACK_OPTIONAL_W * * @return the number of aliases discovered for the port */ +JACK_CLIENT_API_EXPORT int jack_port_get_aliases (const jack_port_t *port, char* const aliases[2]) JACK_OPTIONAL_WEAK_EXPORT; /** * If @ref JackPortCanMonitor is set for this @a port, turn input * monitoring on or off. Otherwise, do nothing. */ +JACK_CLIENT_API_EXPORT int jack_port_request_monitor (jack_port_t *port, int onoff) JACK_OPTIONAL_WEAK_EXPORT; /** @@ -960,6 +1022,7 @@ int jack_port_request_monitor (jack_port_t *port, int onoff) JACK_OPTIONAL_WEAK_ * * @see jack_port_name_size() */ +JACK_CLIENT_API_EXPORT int jack_port_request_monitor_by_name (jack_client_t *client, const char *port_name, int onoff) JACK_OPTIONAL_WEAK_EXPORT; @@ -970,11 +1033,13 @@ int jack_port_request_monitor_by_name (jack_client_t *client, * * @return 0 on success, otherwise a non-zero error code */ +JACK_CLIENT_API_EXPORT int jack_port_ensure_monitor (jack_port_t *port, int onoff) JACK_OPTIONAL_WEAK_EXPORT; /** * @return TRUE if input monitoring has been requested for @a port. */ +JACK_CLIENT_API_EXPORT int jack_port_monitoring_input (jack_port_t *port) JACK_OPTIONAL_WEAK_EXPORT; /** @@ -994,6 +1059,7 @@ int jack_port_monitoring_input (jack_port_t *port) JACK_OPTIONAL_WEAK_EXPORT; * @return 0 on success, EEXIST if the connection is already made, * otherwise a non-zero error code */ +JACK_CLIENT_API_EXPORT int jack_connect (jack_client_t *client, const char *source_port, const char *destination_port) JACK_OPTIONAL_WEAK_EXPORT; @@ -1011,6 +1077,7 @@ int jack_connect (jack_client_t *client, * * @return 0 on success, otherwise a non-zero error code */ +JACK_CLIENT_API_EXPORT int jack_disconnect (jack_client_t *client, const char *source_port, const char *destination_port) JACK_OPTIONAL_WEAK_EXPORT; @@ -1024,6 +1091,7 @@ int jack_disconnect (jack_client_t *client, * while generic connection clients (e.g. patchbays) would use * jack_disconnect(). */ +JACK_CLIENT_API_EXPORT int jack_port_disconnect (jack_client_t *client, jack_port_t *port) JACK_OPTIONAL_WEAK_EXPORT; /** @@ -1034,12 +1102,14 @@ int jack_port_disconnect (jack_client_t *client, jack_port_t *port) JACK_OPTIONA * with a colon (:) followed by its short name and a NULL * character. */ +JACK_CLIENT_API_EXPORT int jack_port_name_size(void) JACK_OPTIONAL_WEAK_EXPORT; /** * @return the maximum number of characters in a JACK port type name * including the final NULL character. This value is a constant. */ +JACK_CLIENT_API_EXPORT int jack_port_type_size(void) JACK_OPTIONAL_WEAK_EXPORT; /** @@ -1047,6 +1117,7 @@ int jack_port_type_size(void) JACK_OPTIONAL_WEAK_EXPORT; * * this function may only be called in a buffer_size callback. */ +JACK_CLIENT_API_EXPORT size_t jack_port_type_get_buffer_size (jack_client_t *client, const char *port_type) JACK_WEAK_EXPORT; /*@}*/ @@ -1115,6 +1186,7 @@ size_t jack_port_type_get_buffer_size (jack_client_t *client, const char *port_t * be replaced by a latency callback that calls @ref * jack_port_set_latency_range(). */ +JACK_CLIENT_API_EXPORT void jack_port_set_latency (jack_port_t *port, jack_nframes_t) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT; /** @@ -1129,6 +1201,7 @@ void jack_port_set_latency (jack_port_t *port, jack_nframes_t) JACK_OPTIONAL_WEA * the port is connected, and that gets signalled by the latency callback. * See @ref jack_set_latency_callback() for details. */ +JACK_CLIENT_API_EXPORT void jack_port_get_latency_range (jack_port_t *port, jack_latency_callback_mode_t mode, jack_latency_range_t *range) JACK_WEAK_EXPORT; /** @@ -1198,6 +1271,7 @@ void jack_port_get_latency_range (jack_port_t *port, jack_latency_callback_mode_ * See the description of @ref jack_set_latency_callback for more * information. */ +JACK_CLIENT_API_EXPORT void jack_port_set_latency_range (jack_port_t *port, jack_latency_callback_mode_t mode, jack_latency_range_t *range) JACK_WEAK_EXPORT; /** @@ -1213,6 +1287,7 @@ void jack_port_set_latency_range (jack_port_t *port, jack_latency_callback_mode_ * @return zero for successful execution of the request. non-zero * otherwise. */ +JACK_CLIENT_API_EXPORT int jack_recompute_total_latencies (jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT; /** @@ -1230,6 +1305,7 @@ int jack_recompute_total_latencies (jack_client_t *client) JACK_OPTIONAL_WEAK_EX * be replaced by jack_port_get_latency_range() in any existing * use cases. */ +JACK_CLIENT_API_EXPORT jack_nframes_t jack_port_get_latency (jack_port_t *port) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT; /** @@ -1242,6 +1318,7 @@ jack_nframes_t jack_port_get_latency (jack_port_t *port) JACK_OPTIONAL_WEAK_DEPR * be replaced by jack_port_get_latency_range() in any existing * use cases. */ +JACK_CLIENT_API_EXPORT jack_nframes_t jack_port_get_total_latency (jack_client_t *client, jack_port_t *port) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT; @@ -1261,6 +1338,7 @@ jack_nframes_t jack_port_get_total_latency (jack_client_t *client, * be replaced by jack_recompute_total_latencies() in any existing * use cases. */ +JACK_CLIENT_API_EXPORT int jack_recompute_total_latency (jack_client_t*, jack_port_t* port) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT; /*@}*/ @@ -1286,6 +1364,7 @@ int jack_recompute_total_latency (jack_client_t*, jack_port_t* port) JACK_OPTION * * @see jack_port_name_size(), jack_port_type_size() */ +JACK_CLIENT_API_EXPORT const char ** jack_get_ports (jack_client_t *client, const char *port_name_pattern, const char *type_name_pattern, @@ -1296,11 +1375,13 @@ const char ** jack_get_ports (jack_client_t *client, * * @see jack_port_name_size() */ +JACK_CLIENT_API_EXPORT jack_port_t * jack_port_by_name (jack_client_t *client, const char *port_name) JACK_OPTIONAL_WEAK_EXPORT; /** * @return address of the jack_port_t of a @a port_id. */ +JACK_CLIENT_API_EXPORT jack_port_t * jack_port_by_id (jack_client_t *client, jack_port_id_t port_id) JACK_OPTIONAL_WEAK_EXPORT; @@ -1319,6 +1400,7 @@ jack_port_t * jack_port_by_id (jack_client_t *client, * @return the estimated time in frames that has passed since the JACK * server began the current process cycle. */ +JACK_CLIENT_API_EXPORT jack_nframes_t jack_frames_since_cycle_start (const jack_client_t *) JACK_OPTIONAL_WEAK_EXPORT; /** @@ -1327,6 +1409,7 @@ jack_nframes_t jack_frames_since_cycle_start (const jack_client_t *) JACK_OPTION * callback). The return value can be compared with the value of * jack_last_frame_time to relate time in other threads to JACK time. */ +JACK_CLIENT_API_EXPORT jack_nframes_t jack_frame_time (const jack_client_t *) JACK_OPTIONAL_WEAK_EXPORT; /** @@ -1343,6 +1426,7 @@ jack_nframes_t jack_frame_time (const jack_client_t *) JACK_OPTIONAL_WEAK_EXPORT * If an xrun occurs, clients must check this value again, as time * may have advanced in a non-linear way (e.g. cycles may have been skipped). */ +JACK_CLIENT_API_EXPORT jack_nframes_t jack_last_frame_time (const jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT; /** @@ -1388,6 +1472,7 @@ jack_nframes_t jack_last_frame_time (const jack_client_t *client) JACK_OPTIONAL_ * * @return zero if OK, non-zero otherwise. */ +JACK_CLIENT_API_EXPORT int jack_get_cycle_times(const jack_client_t *client, jack_nframes_t *current_frames, jack_time_t *current_usecs, @@ -1397,11 +1482,13 @@ int jack_get_cycle_times(const jack_client_t *client, /** * @return the estimated time in microseconds of the specified frame time */ +JACK_CLIENT_API_EXPORT jack_time_t jack_frames_to_time(const jack_client_t *client, jack_nframes_t) JACK_OPTIONAL_WEAK_EXPORT; /** * @return the estimated time in frames for the specified system time. */ +JACK_CLIENT_API_EXPORT jack_nframes_t jack_time_to_frames(const jack_client_t *client, jack_time_t) JACK_OPTIONAL_WEAK_EXPORT; /** @@ -1410,6 +1497,7 @@ jack_nframes_t jack_time_to_frames(const jack_client_t *client, jack_time_t) JAC * * The value returned is guaranteed to be monotonic, but not linear. */ +JACK_CLIENT_API_EXPORT jack_time_t jack_get_time(void) JACK_OPTIONAL_WEAK_EXPORT; /*@}*/ @@ -1427,6 +1515,7 @@ jack_time_t jack_get_time(void) JACK_OPTIONAL_WEAK_EXPORT; * * @param msg error message text (no newline at end). */ +JACK_CLIENT_API_EXPORT extern void (*jack_error_callback)(const char *msg) JACK_OPTIONAL_WEAK_EXPORT; /** @@ -1436,6 +1525,7 @@ extern void (*jack_error_callback)(const char *msg) JACK_OPTIONAL_WEAK_EXPORT; * The JACK library provides two built-in callbacks for this purpose: * default_jack_error_callback() and silent_jack_error_callback(). */ +JACK_CLIENT_API_EXPORT void jack_set_error_function (void (*func)(const char *)) JACK_OPTIONAL_WEAK_EXPORT; /** @@ -1446,6 +1536,7 @@ void jack_set_error_function (void (*func)(const char *)) JACK_OPTIONAL_WEAK_EXP * * @param msg info message text (no newline at end). */ +JACK_CLIENT_API_EXPORT extern void (*jack_info_callback)(const char *msg) JACK_OPTIONAL_WEAK_EXPORT; /** @@ -1455,6 +1546,7 @@ extern void (*jack_info_callback)(const char *msg) JACK_OPTIONAL_WEAK_EXPORT; * The JACK library provides two built-in callbacks for this purpose: * default_jack_info_callback() and silent_jack_info_callback(). */ +JACK_CLIENT_API_EXPORT void jack_set_info_function (void (*func)(const char *)) JACK_OPTIONAL_WEAK_EXPORT; /*@}*/ @@ -1467,6 +1559,7 @@ void jack_set_info_function (void (*func)(const char *)) JACK_OPTIONAL_WEAK_EXPO * * @param ptr the memory pointer to be deallocated. */ +JACK_CLIENT_API_EXPORT void jack_free(void* ptr) JACK_OPTIONAL_WEAK_EXPORT; diff --git a/common/jack/metadata.h b/common/jack/metadata.h index 891dbd627..88abe1813 100644 --- a/common/jack/metadata.h +++ b/common/jack/metadata.h @@ -28,6 +28,7 @@ #define __jack_metadata_h__ #include +#include #ifdef __cplusplus extern "C" { @@ -88,6 +89,7 @@ typedef struct { * types in the definition of jack_property_t above. * @return 0 on success. */ +JACK_CLIENT_API_EXPORT int jack_set_property(jack_client_t*, jack_uuid_t subject, @@ -108,6 +110,7 @@ jack_set_property(jack_client_t*, * * @return 0 on success, -1 if the @p subject has no @p key property. */ +JACK_CLIENT_API_EXPORT int jack_get_property(jack_uuid_t subject, const char* key, @@ -130,6 +133,7 @@ typedef struct { * @param desc a jack_description_t whose associated memory will all be released * @param free_description_itself if non-zero, then @param desc will also be passed to free() */ +JACK_CLIENT_API_EXPORT void jack_free_description (jack_description_t* desc, int free_description_itself); @@ -140,6 +144,7 @@ jack_free_description (jack_description_t* desc, int free_description_itself); * The caller must free this value with jack_free_description(). * @return the number of properties, -1 if no @p subject with any properties exists. */ +JACK_CLIENT_API_EXPORT int jack_get_properties (jack_uuid_t subject, jack_description_t* desc); @@ -151,6 +156,7 @@ jack_get_properties (jack_uuid_t subject, * and the array itself with jack_free(). * @return the number of descriptions, or -1 on error. */ +JACK_CLIENT_API_EXPORT int jack_get_all_properties (jack_description_t** descs); @@ -163,6 +169,7 @@ jack_get_all_properties (jack_description_t** descs); * * @return 0 on success, -1 otherwise */ +JACK_CLIENT_API_EXPORT int jack_remove_property (jack_client_t* client, jack_uuid_t subject, const char* key); /** @@ -173,6 +180,7 @@ int jack_remove_property (jack_client_t* client, jack_uuid_t subject, const char * * @return a count of the number of properties removed, or -1 on error. */ +JACK_CLIENT_API_EXPORT int jack_remove_properties (jack_client_t* client, jack_uuid_t subject); /** @@ -186,6 +194,7 @@ int jack_remove_properties (jack_client_t* client, jack_uuid_t subject); * * @return 0 on success, -1 otherwise */ +JACK_CLIENT_API_EXPORT int jack_remove_all_properties (jack_client_t* client); typedef enum { @@ -221,6 +230,7 @@ typedef void (*JackPropertyChangeCallback)(jack_uuid_t subject, * * @return 0 success, -1 otherwise. */ +JACK_CLIENT_API_EXPORT int jack_set_property_change_callback (jack_client_t* client, JackPropertyChangeCallback callback, void* arg); @@ -229,6 +239,7 @@ int jack_set_property_change_callback (jack_client_t* client, * A value that identifies what the hardware port is connected to (an external * device of some kind). Possible values might be "E-Piano" or "Master 2 Track". */ +JACK_CLIENT_API_EXPORT extern const char* JACK_METADATA_CONNECTED; /** @@ -242,6 +253,7 @@ extern const char* JACK_METADATA_CONNECTED; * status byte will gracefully ignore OSC messages if the user makes an * inappropriate connection. */ +JACK_CLIENT_API_EXPORT extern const char* JACK_METADATA_EVENT_TYPES; /** @@ -249,6 +261,7 @@ extern const char* JACK_METADATA_EVENT_TYPES; * specific hardware outputs of a client. Typical values might be * "ADAT1", "S/PDIF L" or "MADI 43". */ +JACK_CLIENT_API_EXPORT extern const char* JACK_METADATA_HARDWARE; /** @@ -256,6 +269,7 @@ extern const char* JACK_METADATA_HARDWARE; * NxN (with 32 < N <= 128) image to be used when displaying a visual * representation of that client or port. */ +JACK_CLIENT_API_EXPORT extern const char* JACK_METADATA_ICON_LARGE; /** @@ -267,6 +281,7 @@ extern const char* JACK_METADATA_ICON_LARGE; * Theme Specification: * https://specifications.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html */ +JACK_CLIENT_API_EXPORT extern const char* JACK_METADATA_ICON_NAME; /** @@ -274,6 +289,7 @@ extern const char* JACK_METADATA_ICON_NAME; * NxN (with N <=32) image to be used when displaying a visual representation * of that client or port. */ +JACK_CLIENT_API_EXPORT extern const char* JACK_METADATA_ICON_SMALL; /** @@ -287,6 +303,7 @@ extern const char* JACK_METADATA_ICON_SMALL; * * It is encouraged to use http://www.w3.org/2001/XMLSchema#int as the type. */ +JACK_CLIENT_API_EXPORT extern const char* JACK_METADATA_ORDER; /** @@ -294,10 +311,12 @@ extern const char* JACK_METADATA_ORDER; * unless the user has explicitly overridden that a request to show the port * name, or some other key value. */ +JACK_CLIENT_API_EXPORT extern const char* JACK_METADATA_PRETTY_NAME; /** */ +JACK_CLIENT_API_EXPORT extern const char* JACK_METADATA_PORT_GROUP; /** @@ -309,6 +328,7 @@ extern const char* JACK_METADATA_PORT_GROUP; * their output directly to speakers. In particular, CV ports are not * necessarily periodic at all and may have very high DC. */ +JACK_CLIENT_API_EXPORT extern const char* JACK_METADATA_SIGNAL_TYPE; /** diff --git a/common/jack/midiport.h b/common/jack/midiport.h index 3fbf21264..08ce7c1dd 100644 --- a/common/jack/midiport.h +++ b/common/jack/midiport.h @@ -26,6 +26,7 @@ extern "C" { #endif #include +#include #include #include @@ -53,6 +54,7 @@ typedef struct _jack_midi_event * @param port_buffer Port buffer from which to retrieve event. * @return number of events inside @a port_buffer */ +JACK_CLIENT_API_EXPORT uint32_t jack_midi_get_event_count(void* port_buffer) JACK_OPTIONAL_WEAK_EXPORT; @@ -79,6 +81,7 @@ jack_midi_get_event_count(void* port_buffer) JACK_OPTIONAL_WEAK_EXPORT; * @param event_index Index of event to retrieve. * @return 0 on success, ENODATA if buffer is empty. */ +JACK_CLIENT_API_EXPORT int jack_midi_event_get(jack_midi_event_t *event, void *port_buffer, @@ -93,6 +96,7 @@ jack_midi_event_get(jack_midi_event_t *event, * * @param port_buffer Port buffer to clear (must be an output port buffer). */ +JACK_CLIENT_API_EXPORT void jack_midi_clear_buffer(void *port_buffer) JACK_OPTIONAL_WEAK_EXPORT; @@ -106,6 +110,7 @@ jack_midi_clear_buffer(void *port_buffer) JACK_OPTIONAL_WEAK_EXPORT; * * @param port_buffer Port buffer to reset. */ +JACK_CLIENT_API_EXPORT void jack_midi_reset_buffer(void *port_buffer) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT; @@ -117,6 +122,7 @@ jack_midi_reset_buffer(void *port_buffer) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT; * * @param port_buffer Port buffer to check size of. */ +JACK_CLIENT_API_EXPORT size_t jack_midi_max_event_size(void* port_buffer) JACK_OPTIONAL_WEAK_EXPORT; @@ -140,6 +146,7 @@ jack_midi_max_event_size(void* port_buffer) JACK_OPTIONAL_WEAK_EXPORT; * @return Pointer to the beginning of the reserved event's data buffer, or * NULL on error (ie not enough space). */ +JACK_CLIENT_API_EXPORT jack_midi_data_t* jack_midi_event_reserve(void *port_buffer, jack_nframes_t time, @@ -167,6 +174,7 @@ jack_midi_event_reserve(void *port_buffer, * @param data_size Length of @a data in bytes. * @return 0 on success, ENOBUFS if there's not enough space in buffer for event. */ +JACK_CLIENT_API_EXPORT int jack_midi_event_write(void *port_buffer, jack_nframes_t time, @@ -182,6 +190,7 @@ jack_midi_event_write(void *port_buffer, * @param port_buffer Port to receive count for. * @returns Number of events that could not be written to @a port_buffer. */ +JACK_CLIENT_API_EXPORT uint32_t jack_midi_get_lost_event_count(void *port_buffer) JACK_OPTIONAL_WEAK_EXPORT; diff --git a/common/jack/ringbuffer.h b/common/jack/ringbuffer.h index 5204383cb..ed0a3d1f2 100644 --- a/common/jack/ringbuffer.h +++ b/common/jack/ringbuffer.h @@ -27,6 +27,7 @@ extern "C" #endif #include +#include /** @file ringbuffer.h * @@ -68,6 +69,7 @@ jack_ringbuffer_t ; * @return a pointer to a new jack_ringbuffer_t, if successful; NULL * otherwise. */ +JACK_CLIENT_API_EXPORT jack_ringbuffer_t *jack_ringbuffer_create(size_t sz); /** @@ -76,6 +78,7 @@ jack_ringbuffer_t *jack_ringbuffer_create(size_t sz); * * @param rb a pointer to the ringbuffer structure. */ +JACK_CLIENT_API_EXPORT void jack_ringbuffer_free(jack_ringbuffer_t *rb); /** @@ -98,6 +101,7 @@ void jack_ringbuffer_free(jack_ringbuffer_t *rb); * @param vec a pointer to a 2 element array of jack_ringbuffer_data_t. * */ +JACK_CLIENT_API_EXPORT void jack_ringbuffer_get_read_vector(const jack_ringbuffer_t *rb, jack_ringbuffer_data_t *vec); @@ -120,6 +124,7 @@ void jack_ringbuffer_get_read_vector(const jack_ringbuffer_t *rb, * @param rb a pointer to the ringbuffer structure. * @param vec a pointer to a 2 element array of jack_ringbuffer_data_t. */ +JACK_CLIENT_API_EXPORT void jack_ringbuffer_get_write_vector(const jack_ringbuffer_t *rb, jack_ringbuffer_data_t *vec); @@ -133,6 +138,7 @@ void jack_ringbuffer_get_write_vector(const jack_ringbuffer_t *rb, * * @return the number of bytes read, which may range from 0 to cnt. */ +JACK_CLIENT_API_EXPORT size_t jack_ringbuffer_read(jack_ringbuffer_t *rb, char *dest, size_t cnt); /** @@ -150,6 +156,7 @@ size_t jack_ringbuffer_read(jack_ringbuffer_t *rb, char *dest, size_t cnt); * * @return the number of bytes read, which may range from 0 to cnt. */ +JACK_CLIENT_API_EXPORT size_t jack_ringbuffer_peek(jack_ringbuffer_t *rb, char *dest, size_t cnt); /** @@ -163,6 +170,7 @@ size_t jack_ringbuffer_peek(jack_ringbuffer_t *rb, char *dest, size_t cnt); * @param rb a pointer to the ringbuffer structure. * @param cnt the number of bytes read. */ +JACK_CLIENT_API_EXPORT void jack_ringbuffer_read_advance(jack_ringbuffer_t *rb, size_t cnt); /** @@ -172,6 +180,7 @@ void jack_ringbuffer_read_advance(jack_ringbuffer_t *rb, size_t cnt); * * @return the number of bytes available to read. */ +JACK_CLIENT_API_EXPORT size_t jack_ringbuffer_read_space(const jack_ringbuffer_t *rb); /** @@ -181,6 +190,7 @@ size_t jack_ringbuffer_read_space(const jack_ringbuffer_t *rb); * * @param rb a pointer to the ringbuffer structure. */ +JACK_CLIENT_API_EXPORT int jack_ringbuffer_mlock(jack_ringbuffer_t *rb); /** @@ -190,6 +200,7 @@ int jack_ringbuffer_mlock(jack_ringbuffer_t *rb); * * @param rb a pointer to the ringbuffer structure. */ +JACK_CLIENT_API_EXPORT void jack_ringbuffer_reset(jack_ringbuffer_t *rb); /** @@ -200,6 +211,7 @@ void jack_ringbuffer_reset(jack_ringbuffer_t *rb); * @param rb a pointer to the ringbuffer structure. * @param sz the new size, that must be less than allocated size. */ +JACK_CLIENT_API_EXPORT void jack_ringbuffer_reset_size (jack_ringbuffer_t * rb, size_t sz); /** @@ -211,8 +223,9 @@ void jack_ringbuffer_reset_size (jack_ringbuffer_t * rb, size_t sz); * * @return the number of bytes write, which may range from 0 to cnt */ +JACK_CLIENT_API_EXPORT size_t jack_ringbuffer_write(jack_ringbuffer_t *rb, const char *src, - size_t cnt); + size_t cnt); /** * Advance the write pointer. @@ -225,6 +238,7 @@ size_t jack_ringbuffer_write(jack_ringbuffer_t *rb, const char *src, * @param rb a pointer to the ringbuffer structure. * @param cnt the number of bytes written. */ +JACK_CLIENT_API_EXPORT void jack_ringbuffer_write_advance(jack_ringbuffer_t *rb, size_t cnt); /** @@ -234,6 +248,7 @@ void jack_ringbuffer_write_advance(jack_ringbuffer_t *rb, size_t cnt); * * @return the amount of free space (in bytes) available for writing. */ +JACK_CLIENT_API_EXPORT size_t jack_ringbuffer_write_space(const jack_ringbuffer_t *rb); #ifdef __cplusplus diff --git a/common/jack/session.h b/common/jack/session.h index 514209a7c..cac43dc2d 100644 --- a/common/jack/session.h +++ b/common/jack/session.h @@ -27,6 +27,7 @@ extern "C" { #include #include +#include /** * @defgroup SessionClientFunctions Session API for clients. @@ -184,9 +185,10 @@ typedef void (*JackSessionCallback)(jack_session_event_t *event, * * @return 0 on success, otherwise a non-zero error code */ +JACK_CLIENT_API_EXPORT int jack_set_session_callback (jack_client_t *client, - JackSessionCallback session_callback, - void *arg) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT; + JackSessionCallback session_callback, + void *arg) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT; /** * Reply to a session event. @@ -201,8 +203,9 @@ int jack_set_session_callback (jack_client_t *client, * * @return 0 on success, otherwise a non-zero error code */ +JACK_CLIENT_API_EXPORT int jack_session_reply (jack_client_t *client, - jack_session_event_t *event) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT; + jack_session_event_t *event) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT; /** @@ -214,6 +217,7 @@ int jack_session_reply (jack_client_t *client, * JACK developers recommend the use of NSM instead. * See https://github.com/linuxaudio/new-session-manager */ +JACK_CLIENT_API_EXPORT void jack_session_event_free (jack_session_event_t *event) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT; @@ -224,6 +228,7 @@ void jack_session_event_free (jack_session_event_t *event) JACK_OPTIONAL_WEAK_DE * The caller is responsible for calling jack_free(3) on any non-NULL * returned value. */ +JACK_CLIENT_API_EXPORT char *jack_client_get_uuid (jack_client_t *client) JACK_WEAK_EXPORT; /** @@ -250,6 +255,7 @@ typedef struct { * of jack_session_command_t. its terminated by ret[i].uuid == NULL target == * NULL means send to all interested clients. otherwise a clientname */ +JACK_CLIENT_API_EXPORT jack_session_command_t *jack_session_notify ( jack_client_t* client, const char *target, @@ -263,6 +269,7 @@ jack_session_command_t *jack_session_notify ( * JACK developers recommend the use of NSM instead. * See https://github.com/linuxaudio/new-session-manager */ +JACK_CLIENT_API_EXPORT void jack_session_commands_free (jack_session_command_t *cmds) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT; /** @@ -274,6 +281,7 @@ void jack_session_commands_free (jack_session_command_t *cmds) JACK_OPTIONAL_WEA * * @return 0 on success, otherwise a non-zero error code */ +JACK_CLIENT_API_EXPORT int jack_reserve_client_name (jack_client_t *client, const char *name, @@ -289,6 +297,7 @@ jack_reserve_client_name (jack_client_t *client, * @return 0 when the client has no session callback, 1 when it has one. * -1 on error. */ +JACK_CLIENT_API_EXPORT int jack_client_has_session_callback (jack_client_t *client, const char *client_name) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT; diff --git a/common/jack/statistics.h b/common/jack/statistics.h index 28c270d0e..3b5e7b544 100644 --- a/common/jack/statistics.h +++ b/common/jack/statistics.h @@ -27,12 +27,14 @@ extern "C" #endif #include +#include /** * @return the maximum delay reported by the backend since * startup or reset. When compared to the period size in usecs, this * can be used to estimate the ideal period size for a given setup. */ +JACK_CLIENT_API_EXPORT float jack_get_max_delayed_usecs (jack_client_t *client); /** @@ -40,6 +42,7 @@ float jack_get_max_delayed_usecs (jack_client_t *client); * occurrence. This probably only makes sense when called from a @ref * JackXRunCallback defined using jack_set_xrun_callback(). */ +JACK_CLIENT_API_EXPORT float jack_get_xrun_delayed_usecs (jack_client_t *client); /** @@ -48,6 +51,7 @@ float jack_get_xrun_delayed_usecs (jack_client_t *client); * system (e.g. toggling kernel preemption) has on the delay * experienced by JACK, without having to restart the JACK engine. */ +JACK_CLIENT_API_EXPORT void jack_reset_max_delayed_usecs (jack_client_t *client); #ifdef __cplusplus diff --git a/common/jack/systemdeps.h b/common/jack/systemdeps.h index 84b4ce35f..7eb232820 100644 --- a/common/jack/systemdeps.h +++ b/common/jack/systemdeps.h @@ -138,4 +138,17 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. #define JACK_LIB_EXPORT #endif + +#ifdef _WIN32 + #if defined(BUILDING_JACK) + #define JACK_CLIENT_API_EXPORT __declspec(dllexport) + #else + #define JACK_CLIENT_API_EXPORT __declspec(dllimport) + #endif +#elif __GNUC__ >= 4 + #define JACK_CLIENT_API_EXPORT __attribute__((visibility("default"))) +#else + #define JACK_CLIENT_API_EXPORT /* nothing */ +#endif + #endif /* __jack_systemdeps_h__ */ diff --git a/common/jack/thread.h b/common/jack/thread.h index 776c5206e..b9b33b8b0 100644 --- a/common/jack/thread.h +++ b/common/jack/thread.h @@ -50,6 +50,7 @@ extern "C" * Otherwise returns -1. */ +JACK_CLIENT_API_EXPORT int jack_client_real_time_priority (jack_client_t*) JACK_OPTIONAL_WEAK_EXPORT; /** @@ -58,6 +59,7 @@ int jack_client_real_time_priority (jack_client_t*) JACK_OPTIONAL_WEAK_EXPORT; * is subject to realtime scheduling. Otherwise returns -1. */ +JACK_CLIENT_API_EXPORT int jack_client_max_real_time_priority (jack_client_t*) JACK_OPTIONAL_WEAK_EXPORT; /** @@ -70,6 +72,7 @@ int jack_client_max_real_time_priority (jack_client_t*) JACK_OPTIONAL_WEAK_EXPOR * @returns 0, if successful; EPERM, if the calling process lacks * required realtime privileges; otherwise some other error number. */ +JACK_CLIENT_API_EXPORT int jack_acquire_real_time_scheduling (jack_native_thread_t thread, int priority) JACK_OPTIONAL_WEAK_EXPORT; /** @@ -88,12 +91,13 @@ int jack_acquire_real_time_scheduling (jack_native_thread_t thread, int priority * * @returns 0, if successful; otherwise some error number. */ +JACK_CLIENT_API_EXPORT int jack_client_create_thread (jack_client_t* client, - jack_native_thread_t *thread, - int priority, - int realtime, /* boolean */ - void *(*start_routine)(void*), - void *arg) JACK_OPTIONAL_WEAK_EXPORT; + jack_native_thread_t *thread, + int priority, + int realtime, /* boolean */ + void *(*start_routine)(void*), + void *arg) JACK_OPTIONAL_WEAK_EXPORT; /** * Drop realtime scheduling for a thread. @@ -102,6 +106,7 @@ int jack_client_create_thread (jack_client_t* client, * * @returns 0, if successful; otherwise an error number. */ +JACK_CLIENT_API_EXPORT int jack_drop_real_time_scheduling (jack_native_thread_t thread) JACK_OPTIONAL_WEAK_EXPORT; /** @@ -111,6 +116,7 @@ int jack_drop_real_time_scheduling (jack_native_thread_t thread) JACK_OPTIONAL_W * * @returns 0, if successful; otherwise an error number. */ +JACK_CLIENT_API_EXPORT int jack_client_stop_thread(jack_client_t* client, jack_native_thread_t thread) JACK_OPTIONAL_WEAK_EXPORT; /** @@ -120,7 +126,8 @@ int jack_client_stop_thread(jack_client_t* client, jack_native_thread_t thread) * * @returns 0, if successful; otherwise an error number. */ - int jack_client_kill_thread(jack_client_t* client, jack_native_thread_t thread) JACK_OPTIONAL_WEAK_EXPORT; +JACK_CLIENT_API_EXPORT +int jack_client_kill_thread(jack_client_t* client, jack_native_thread_t thread) JACK_OPTIONAL_WEAK_EXPORT; #ifndef _WIN32 @@ -147,6 +154,7 @@ int jack_client_stop_thread(jack_client_t* client, jack_native_thread_t thread) * @param creator a function that creates a new thread * */ +JACK_CLIENT_API_EXPORT void jack_set_thread_creator (jack_thread_creator_t creator) JACK_OPTIONAL_WEAK_EXPORT; #endif diff --git a/common/jack/transport.h b/common/jack/transport.h index 4cec6e03b..590688b62 100644 --- a/common/jack/transport.h +++ b/common/jack/transport.h @@ -27,6 +27,7 @@ extern "C" { #include #include +#include /** * @defgroup TransportControl Transport and Timebase control @@ -49,6 +50,7 @@ extern "C" { * * @return 0 on success, otherwise a non-zero error code. */ +JACK_CLIENT_API_EXPORT int jack_release_timebase (jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT; /** @@ -71,7 +73,8 @@ int jack_release_timebase (jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT; * * @return 0 on success, otherwise a non-zero error code. */ -int jack_set_sync_callback (jack_client_t *client, +JACK_CLIENT_API_EXPORT +int jack_set_sync_callback (jack_client_t *client, JackSyncCallback sync_callback, void *arg) JACK_OPTIONAL_WEAK_EXPORT; @@ -92,6 +95,7 @@ int jack_set_sync_callback (jack_client_t *client, * * @return 0 on success, otherwise a non-zero error code. */ +JACK_CLIENT_API_EXPORT int jack_set_sync_timeout (jack_client_t *client, jack_time_t timeout) JACK_OPTIONAL_WEAK_EXPORT; @@ -120,6 +124,7 @@ int jack_set_sync_timeout (jack_client_t *client, * timebase master; * - other non-zero error code. */ +JACK_CLIENT_API_EXPORT int jack_set_timebase_callback (jack_client_t *client, int conditional, JackTimebaseCallback timebase_callback, @@ -141,6 +146,7 @@ int jack_set_timebase_callback (jack_client_t *client, * * @return 0 if valid request, non-zero otherwise. */ +JACK_CLIENT_API_EXPORT int jack_transport_locate (jack_client_t *client, jack_nframes_t frame) JACK_OPTIONAL_WEAK_EXPORT; @@ -159,6 +165,7 @@ int jack_transport_locate (jack_client_t *client, * * @return Current transport state. */ +JACK_CLIENT_API_EXPORT jack_transport_state_t jack_transport_query (const jack_client_t *client, jack_position_t *pos) JACK_OPTIONAL_WEAK_EXPORT; @@ -169,6 +176,7 @@ jack_transport_state_t jack_transport_query (const jack_client_t *client, * * @param client the JACK client structure */ +JACK_CLIENT_API_EXPORT jack_nframes_t jack_get_current_transport_frame (const jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT; /** @@ -187,6 +195,7 @@ jack_nframes_t jack_get_current_transport_frame (const jack_client_t *client) JA * * @return 0 if valid request, EINVAL if position structure rejected. */ +JACK_CLIENT_API_EXPORT int jack_transport_reposition (jack_client_t *client, const jack_position_t *pos) JACK_OPTIONAL_WEAK_EXPORT; @@ -201,6 +210,7 @@ int jack_transport_reposition (jack_client_t *client, * * @param client the JACK client structure. */ +JACK_CLIENT_API_EXPORT void jack_transport_start (jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT; /** @@ -211,6 +221,7 @@ void jack_transport_start (jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT; * * @param client the JACK client structure. */ +JACK_CLIENT_API_EXPORT void jack_transport_stop (jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT; /** @@ -225,6 +236,7 @@ void jack_transport_stop (jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT; * * @pre Must be called from the process thread. */ +JACK_CLIENT_API_EXPORT void jack_get_transport_info (jack_client_t *client, jack_transport_info_t *tinfo) JACK_OPTIONAL_WEAK_EXPORT; @@ -235,6 +247,7 @@ void jack_get_transport_info (jack_client_t *client, * earlier transport interface, but it does nothing. Instead, define * a ::JackTimebaseCallback. */ +JACK_CLIENT_API_EXPORT void jack_set_transport_info (jack_client_t *client, jack_transport_info_t *tinfo) JACK_OPTIONAL_WEAK_EXPORT; diff --git a/common/jack/uuid.h b/common/jack/uuid.h index faa354b56..26d92abe4 100644 --- a/common/jack/uuid.h +++ b/common/jack/uuid.h @@ -21,6 +21,7 @@ #define __jack_uuid_h__ #include +#include #ifdef __cplusplus extern "C" { @@ -30,17 +31,26 @@ extern "C" { #define JACK_UUID_STRING_SIZE (JACK_UUID_SIZE+1) /* includes trailing null */ #define JACK_UUID_EMPTY_INITIALIZER 0 -extern jack_uuid_t jack_client_uuid_generate (); -extern jack_uuid_t jack_port_uuid_generate (uint32_t port_id); - -extern uint32_t jack_uuid_to_index (jack_uuid_t); - -extern int jack_uuid_compare (jack_uuid_t, jack_uuid_t); -extern void jack_uuid_copy (jack_uuid_t* dst, jack_uuid_t src); -extern void jack_uuid_clear (jack_uuid_t*); -extern int jack_uuid_parse (const char *buf, jack_uuid_t*); -extern void jack_uuid_unparse (jack_uuid_t, char buf[JACK_UUID_STRING_SIZE]); -extern int jack_uuid_empty (jack_uuid_t); +JACK_CLIENT_API_EXPORT +jack_uuid_t jack_client_uuid_generate (); +JACK_CLIENT_API_EXPORT +jack_uuid_t jack_port_uuid_generate (uint32_t port_id); + +JACK_CLIENT_API_EXPORT +uint32_t jack_uuid_to_index (jack_uuid_t); + +JACK_CLIENT_API_EXPORT +int jack_uuid_compare (jack_uuid_t, jack_uuid_t); +JACK_CLIENT_API_EXPORT +void jack_uuid_copy (jack_uuid_t* dst, jack_uuid_t src); +JACK_CLIENT_API_EXPORT +void jack_uuid_clear (jack_uuid_t*); +JACK_CLIENT_API_EXPORT +int jack_uuid_parse (const char *buf, jack_uuid_t*); +JACK_CLIENT_API_EXPORT +void jack_uuid_unparse (jack_uuid_t, char buf[JACK_UUID_STRING_SIZE]); +JACK_CLIENT_API_EXPORT +int jack_uuid_empty (jack_uuid_t); #ifdef __cplusplus } /* namespace */ diff --git a/wscript b/wscript index e0d32c8de..d3bf7c532 100644 --- a/wscript +++ b/wscript @@ -229,7 +229,10 @@ def configure(conf): conf.env.append_unique('CFLAGS', '-Wall') conf.env.append_unique('CXXFLAGS', ['-Wall', '-Wno-invalid-offsetof']) conf.env.append_unique('CXXFLAGS', '-std=gnu++11') - + + conf.env.append_unique('CFLAGS', '-DBUILDING_JACK') + conf.env.append_unique('CXXFLAGS', '-DBUILDING_JACK') + if not conf.env['IS_MACOSX']: conf.env.append_unique('LDFLAGS', '-Wl,--no-undefined') else: