diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2013-10-11 21:02:02 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2013-10-11 21:02:02 -0400 |
commit | 94c819accfab2612050e875c24cf325daa0fd26d (patch) | |
tree | 07d000f134c6a6bebb142e806136dc02793ddf5d /libjack | |
parent | 16193a395222d36496f28a67913d98fa559e300b (diff) | |
download | jack1-94c819accfab2612050e875c24cf325daa0fd26d.tar.gz |
basics for a hypothetical PortRename callback
This cannot be implemented at present because jack_port_set_name() does not take
a jack_client_t* as an argument, and thus no msg can be sent to the server
regarding the name change. Jack2 accomplishes this by walking its static array
of clients to find one that is in use and sends the msg using that one. This
is not possible in Jack1 because we do not use static arrays of clients (or
ports).
Diffstat (limited to 'libjack')
-rw-r--r-- | libjack/client.c | 4 | ||||
-rw-r--r-- | libjack/local.h | 2 | ||||
-rw-r--r-- | libjack/port.c | 2 |
3 files changed, 7 insertions, 1 deletions
diff --git a/libjack/client.c b/libjack/client.c index 0173bac..692ab21 100644 --- a/libjack/client.c +++ b/libjack/client.c @@ -1853,6 +1853,10 @@ jack_client_process_events (jack_client_t* client) if (key) { free (key); } + case PortRename: + if (control->port_rename_cbset) { + client->port_rename_cb (event.y.other_id, event.x.name, event.z.other_name, client->port_rename_cb_arg); + } break; } diff --git a/libjack/local.h b/libjack/local.h index 6a6f5ae..46d787d 100644 --- a/libjack/local.h +++ b/libjack/local.h @@ -79,6 +79,8 @@ struct _jack_client { void *latency_cb_arg; JackPropertyChangeCallback property_cb; void *property_cb_arg; + JackPortRenameCallback port_rename_cb; + void *port_rename_cb_arg; /* external clients: set by libjack * internal clients: set by engine */ diff --git a/libjack/port.c b/libjack/port.c index ab40d70..2c74f06 100644 --- a/libjack/port.c +++ b/libjack/port.c @@ -809,7 +809,7 @@ jack_port_set_name (jack_port_t *port, const char *new_name) len = sizeof (port->shared->name) - ((int) (colon - port->shared->name)) - 2; snprintf (colon+1, len, "%s", new_name); - + return 0; } |