Browse Source

first port_connect output.

tags/0.120.1
Torben Hohn 16 years ago
parent
commit
bd9b4b3833
4 changed files with 35 additions and 3 deletions
  1. +1
    -0
      jack/port.h
  2. +18
    -3
      jackd/engine.c
  3. +15
    -0
      libjack/client.c
  4. +1
    -0
      libjack/port.c

+ 1
- 0
jack/port.h View File

@@ -113,6 +113,7 @@ typedef struct _jack_port_shared {
jack_port_type_id_t ptype_id; /* index into port type array */
jack_shmsize_t offset; /* buffer offset in shm segment */
jack_port_id_t id; /* index into engine port array */
jack_port_id_t uid; /* index into engine port array */
uint32_t flags;
char name[JACK_CLIENT_NAME_SIZE+JACK_PORT_NAME_SIZE];
char alias1[JACK_CLIENT_NAME_SIZE+JACK_PORT_NAME_SIZE];


+ 18
- 3
jackd/engine.c View File

@@ -2447,6 +2447,19 @@ static jack_client_id_t jack_engine_get_max_uuid( jack_engine_t *engine )
return retval;
}

static void jack_client_fixup_uuid (jack_client_internal_t *client )
{
JSList *node;
jack_port_t *port;

for (node = client->ports; node; node = jack_slist_next (node)) {
port = (jack_port_t *) node->data;

port->shared->uid = client->control->uid;

}
}

static int
jack_do_session_notify (jack_engine_t *engine, jack_request_t *req, int reply_fd )
{
@@ -2468,18 +2481,20 @@ jack_do_session_notify (jack_engine_t *engine, jack_request_t *req, int reply_fd
jack_client_internal_t* client = (jack_client_internal_t*) node->data;
if (client->control->session_cbset) {
if( client->control->uid == 0 )
if( client->control->uid == 0 ) {
client->control->uid=jack_engine_get_max_uuid( engine ) + 1;
jack_client_fixup_uuid( client );
}
reply = jack_deliver_event (engine, client, &event);

if (write (reply_fd, &client->control->uid, sizeof (client->control->uid))
if (write (reply_fd, (const void *) &client->control->uid, sizeof (client->control->uid))
< (ssize_t) sizeof (client->control->uid)) {
jack_error ("cannot write GetPortConnections result "
"to client via fd = %d (%s)",
reply_fd, strerror (errno));
goto out;
}
if (write (reply_fd, client->control->session_command, sizeof (client->control->session_command))
if (write (reply_fd, (const void *) client->control->session_command, sizeof (client->control->session_command))
< (ssize_t) sizeof (client->control->session_command)) {
jack_error ("cannot write GetPortConnections result "
"to client via fd = %d (%s)",


+ 15
- 0
libjack/client.c View File

@@ -2550,9 +2550,20 @@ jack_get_ports (jack_client_t *client,
regex_t port_regex;
regex_t type_regex;
int matching;
jack_client_id_t port_uuid_match = 0U;

engine = client->engine;

if( port_name_pattern ) {
if((strncmp( "!uuid:", port_name_pattern, sizeof("!uuid:") ) )) {
printf( "%s\n",port_name_pattern+6 );
port_uuid_match = atoi( port_name_pattern+6);
printf( "port_uuid_match = %u\n", port_uuid_match );
port_name_pattern = NULL;
}
}
if (port_name_pattern && port_name_pattern[0]) {
regcomp (&port_regex, port_name_pattern,
REG_EXTENDED|REG_NOSUB);
@@ -2582,6 +2593,10 @@ jack_get_ports (jack_client_t *client,
}
}

if (matching && port_uuid_match) {
if( psp[i].uid != port_uuid_match )
matching = 0;
}
if (matching && port_name_pattern && port_name_pattern[0]) {
if (regexec (&port_regex, psp[i].name, 0, NULL, 0)) {
matching = 0;


+ 1
- 0
libjack/port.c View File

@@ -201,6 +201,7 @@ jack_port_new (const jack_client_t *client, jack_port_id_t port_id,
port_functions = &jack_builtin_NULL_functions;
port->fptr = *port_functions;
port->shared->has_mixdown = (port->fptr.mixdown ? TRUE : FALSE);
port->shared->uid = client->control->uid;
}

/* set up a base address so that port->offset can be used to


Loading…
Cancel
Save