From 0b467a387a94de81b5687eb72a4e3daf05c594ac Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Sat, 12 Oct 2013 09:48:39 -0400 Subject: [PATCH] add JackPortNameCallback type and port rename callback (to match changes above, and to come into line with jack2) --- jack.h | 11 +++++++++++ types.h | 11 +++++++++++ 2 files changed, 22 insertions(+) diff --git a/jack.h b/jack.h index 0ffd513..3905485 100644 --- a/jack.h +++ b/jack.h @@ -393,6 +393,17 @@ int jack_set_port_registration_callback (jack_client_t *, JackPortRegistrationCallback registration_callback, void *arg) JACK_OPTIONAL_WEAK_EXPORT; + +/** + * Tell the JACK server to call @a registration_callback whenever a + * port is registered or unregistered, passing @a arg as a parameter. + * + * @return 0 on success, otherwise a non-zero error code + */ +int jack_set_port_rename_callback (jack_client_t *, + JackPortRenameCallback + rename_callback, void *arg) JACK_OPTIONAL_WEAK_EXPORT; + /** * Tell the JACK server to call @a connect_callback whenever a * port is connected or disconnected, passing @a arg as a parameter. diff --git a/types.h b/types.h index 74d0a15..ea7a6f2 100644 --- a/types.h +++ b/types.h @@ -371,6 +371,17 @@ typedef int (*JackSampleRateCallback)(jack_nframes_t nframes, void *arg); */ typedef void (*JackPortRegistrationCallback)(jack_port_id_t port, int register, void *arg); +/** + * Prototype for the client supplied function that is called + * whenever a port is renamed + * + * @param port the ID of the port + * @param arg pointer to a client supplied data + * @param old_name the name of the port before the rename was carried out + * @param new_name the name of the port after the rename was carried out + */ +typedef void (*JackPortRenameCallback)(jack_port_id_t port, const char* old_name, const char* new_name, void* arg); + /** * Prototype for the client supplied function that is called * whenever a client is registered or unregistered.