Browse Source

Correct JackRouter::getChannelInfo.

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@4721 0c269be4-1314-0410-8aa9-9f06e86f4224
tags/1.9.9.5
sletz 13 years ago
parent
commit
37c492664a
3 changed files with 35 additions and 23 deletions
  1. +4
    -0
      example-clients/lsp.c
  2. +1
    -1
      posix/JackSocket.h
  3. +30
    -22
      windows/JackRouter/JackRouter.cpp

+ 4
- 0
example-clients/lsp.c View File

@@ -241,6 +241,10 @@ main (int argc, char *argv[])
}

error:
if (show_aliases) {
free(aliases[0]);
free(aliases[1]);
}
if (ports)
jack_free (ports);
jack_client_close (client);


+ 1
- 1
posix/JackSocket.h View File

@@ -48,7 +48,7 @@ class JackClientSocket : public detail::JackClientRequestInterface

public:

JackClientSocket():JackClientRequestInterface(), fSocket( -1),fTimeOut(0)
JackClientSocket():JackClientRequestInterface(), fSocket(-1), fTimeOut(0)
{}
JackClientSocket(int socket);



+ 30
- 22
windows/JackRouter/JackRouter.cpp View File

@@ -569,13 +569,15 @@ ASIOError JackRouter::getChannelInfo(ASIOChannelInfo *info)
info->isActive = ASIOFalse;
long i;
char buf[32];
const char** ports;
char* aliases[2];
aliases[0] = (char*)malloc(jack_port_name_size());
aliases[1] = (char*)malloc(jack_port_name_size());
if (!aliases[0] || !aliases[1])
if (!aliases[0] || !aliases[1]) {
return ASE_NoMemory;
}
if (info->isInput) {
for (i = 0; i < fActiveInputs; i++) {
@@ -585,17 +587,20 @@ ASIOError JackRouter::getChannelInfo(ASIOChannelInfo *info)
}
}
jack_port_t* port = fInputPorts[i];
// A alias on system is wanted
if (fAliasSystem && jack_port_get_aliases(port, aliases) == 1) {
strncpy(info->name, aliases[0], 32);
//strcpy(info->name, "toto");
} else {
_snprintf(buf, sizeof(buf) - 1, "In%d", info->channel);
strcpy(info->name, buf);
}
if (fAliasSystem && fAutoConnectIn && (ports = jack_get_ports(fClient, NULL, NULL, JackPortIsPhysical | JackPortIsOutput))) {
jack_port_t* port = jack_port_by_name(fClient, ports[info->channel]);
if (port) {
if (jack_port_get_aliases(port, aliases) == 2) {
strncpy(info->name, aliases[1], 32);
goto end:
}
}
}
_snprintf(buf, sizeof(buf) - 1, "In%d", info->channel);
strcpy(info->name, buf);
} else {
for (i = 0; i < fActiveOutputs; i++) {
if (fOutMap[i] == info->channel) {
@@ -604,18 +609,21 @@ ASIOError JackRouter::getChannelInfo(ASIOChannelInfo *info)
}
}
jack_port_t* port = fOutputPorts[i];
// A alias on system is wanted
if (fAliasSystem && jack_port_get_aliases(port, aliases) == 1) {
strncpy(info->name, aliases[0], 32);
//strcpy(info->name, "toto");
} else {
_snprintf(buf, sizeof(buf) - 1, "Out%d", info->channel);
strcpy(info->name, buf);
}
if (fAliasSystem && fAutoConnectOut && (ports = jack_get_ports(fClient, NULL, NULL, JackPortIsPhysical | JackPortIsInput))) {
jack_port_t* port = jack_port_by_name(fClient, ports[info->channel]);
if (port) {
if (jack_port_get_aliases(port, aliases) == 2) {
strncpy(info->name, aliases[1], 32);
goto end:
}
}
}
_snprintf(buf, sizeof(buf) - 1, "Out%d", info->channel);
strcpy(info->name, buf);
}
end:
free(aliases[0]);
free(aliases[1]);
@@ -921,7 +929,7 @@ void JackRouter::AutoConnect()
}
*/
long ASIO_channel = fOutMap[i];
if (!ports[ASIO_channel]){
if (!ports[ASIO_channel]) {
printf("destination port is null ASIO_channel = %ld\n", ASIO_channel);
break;
} else if (jack_connect(fClient, jack_port_name(fOutputPorts[i]), ports[ASIO_channel]) != 0) {


Loading…
Cancel
Save