Browse Source

added graph order callback

git-svn-id: svn+ssh://jackaudio.org/trunk/jack@140 0c269be4-1314-0410-8aa9-9f06e86f4224
tags/0.109.0
pbd 24 years ago
parent
commit
a0ac75f460
6 changed files with 31 additions and 25 deletions
  1. +18
    -0
      client.c
  2. +2
    -2
      configure.in
  3. +8
    -23
      engine.c
  4. +1
    -0
      jack/internal.h
  5. +1
    -0
      jack/jack.h
  6. +1
    -0
      jack/types.h

+ 18
- 0
client.c View File

@@ -259,6 +259,14 @@ jack_handle_reorder (jack_client_t *client, jack_event_t *event)
return -1;
}

/* If the client registered its own callback for graph order events,
execute it now.
*/

if (client->control->graph_order) {
client->control->graph_order ();
}

return 0;
}
@@ -1250,6 +1258,16 @@ jack_port_untie (jack_port_t *port)
return 0;
}

int
jack_set_graph_order_callback (jack_client_t *client, JackGraphOrderCallback callback)
{
if (client->control->active) {
return -1;
}
client->control->graph_order = callback;
return 0;
}

int
jack_set_process_callback (jack_client_t *client, JackProcessCallback callback, void *arg)



+ 2
- 2
configure.in View File

@@ -4,8 +4,8 @@ AC_INIT(client.c)
AC_CONFIG_AUX_DIR(.)

JACK_MAJOR_VERSION=0
JACK_MINOR_VERSION=16
JACK_MICRO_VERSION=1
JACK_MINOR_VERSION=17
JACK_MICRO_VERSION=0

BETA=



+ 8
- 23
engine.c View File

@@ -1376,6 +1376,7 @@ jack_client_internal_new (jack_engine_t *engine, int fd, jack_client_connect_req
client->control->srate_arg = NULL;
client->control->port_register = NULL;
client->control->port_register_arg = NULL;
client->control->graph_order = NULL;

if (req->type == ClientDynamic) {
if (jack_load_client (engine, client, req->object_path)) {
@@ -1580,7 +1581,6 @@ jack_deliver_event (jack_engine_t *engine, jack_client_internal_t *client, jack_

int
jack_client_set_order (jack_engine_t *engine, jack_client_internal_t *client)

{
jack_event_t event;

@@ -1592,12 +1592,10 @@ jack_client_set_order (jack_engine_t *engine, jack_client_internal_t *client)

int
jack_rechain_graph (jack_engine_t *engine, int take_lock)

{
GSList *node, *next;
unsigned long n;
int err = 0;
int need_to_reset_fifo;
jack_client_internal_t *client, *subgraph_client, *next_client;

if (take_lock) {
@@ -1606,11 +1604,6 @@ jack_rechain_graph (jack_engine_t *engine, int take_lock)

jack_clear_fifos (engine);

/* We're going to try to avoid reconnecting clients that
don't need to be reconnected. This is slightly tricky,
but worth it for performance reasons.
*/

subgraph_client = 0;

if (engine->verbose) {
@@ -1640,13 +1633,8 @@ jack_rechain_graph (jack_engine_t *engine, int take_lock)
next_client = (jack_client_internal_t *) next->data;
}

if (client->execution_order != n || client->next_client != next_client) {
client->execution_order = n;
client->next_client = next_client;
need_to_reset_fifo = TRUE;
} else {
need_to_reset_fifo = FALSE;
}
client->execution_order = n;
client->next_client = next_client;
if (jack_client_is_inprocess (client)) {
@@ -1695,14 +1683,11 @@ jack_rechain_graph (jack_engine_t *engine, int take_lock)

}
if (need_to_reset_fifo) {
/* make sure fifo for 'n + 1' exists
* before issuing client reorder */
(void) jack_get_fifo_fd(engine, n + 1);

jack_client_set_order (engine, client);
}
/* make sure fifo for 'n + 1' exists
* before issuing client reorder
*/
(void) jack_get_fifo_fd(engine, n + 1);
jack_client_set_order (engine, client);
n++;
}
}


+ 1
- 0
jack/internal.h View File

@@ -144,6 +144,7 @@ typedef volatile struct {
void *srate_arg;
JackPortRegistrationCallback port_register;
void *port_register_arg;
JackGraphOrderCallback graph_order;

/* for engine use only */



+ 1
- 0
jack/jack.h View File

@@ -54,6 +54,7 @@ int jack_set_process_callback (jack_client_t *, JackProcessCallback, void *arg);
int jack_set_buffer_size_callback (jack_client_t *, JackBufferSizeCallback, void *arg);
int jack_set_sample_rate_callback (jack_client_t *, JackSampleRateCallback, void *arg);
int jack_set_port_registration_callback (jack_client_t *, JackPortRegistrationCallback, void *);
int jack_set_graph_order_callback (jack_client_t *, JackGraphOrderCallback);

int jack_activate (jack_client_t *client);
int jack_deactivate (jack_client_t *client);


+ 1
- 0
jack/types.h View File

@@ -33,6 +33,7 @@ typedef long channel_t;
static const nframes_t max_frames = ULONG_MAX;

typedef int (*JackProcessCallback)(nframes_t, void *);
typedef int (*JackGraphOrderCallback)(void);
typedef int (*JackBufferSizeCallback)(nframes_t, void *);
typedef int (*JackSampleRateCallback)(nframes_t, void *);
typedef void (*JackPortRegistrationCallback)(jack_port_id_t,int,void*);


Loading…
Cancel
Save