Browse Source

helper functions for jack_driver_desc_t construction

The main goal is to reduce risk of mismatch between allocated
and initialized parameter numbers.
tags/1.9.8
Nedko Arnaudov 13 years ago
parent
commit
a9e4628340
26 changed files with 769 additions and 1827 deletions
  1. +101
    -0
      common/JackDriverLoader.cpp
  2. +20
    -57
      common/JackDummyDriver.cpp
  3. +7
    -16
      common/JackLoopbackDriver.cpp
  4. +37
    -102
      common/JackNetAdapter.cpp
  5. +32
    -94
      common/JackNetDriver.cpp
  6. +14
    -32
      common/JackNetManager.cpp
  7. +53
    -165
      common/JackNetOneDriver.cpp
  8. +10
    -31
      common/JackProfiler.cpp
  9. +23
    -0
      common/driver_interface.h
  10. +34
    -102
      linux/alsa/JackAlsaAdapter.cpp
  11. +78
    -173
      linux/alsa/JackAlsaDriver.cpp
  12. +5
    -13
      linux/alsarawmidi/JackALSARawMidiDriver.cpp
  13. +46
    -116
      linux/firewire/JackFFADODriver.cpp
  14. +31
    -100
      linux/freebob/JackFreebobDriver.cpp
  15. +38
    -110
      macosx/coreaudio/JackCoreAudioAdapter.cpp
  16. +48
    -142
      macosx/coreaudio/JackCoreAudioDriver.cpp
  17. +8
    -24
      macosx/coremidi/JackCoreMidiDriver.cpp
  18. +38
    -113
      solaris/oss/JackBoomerDriver.cpp
  19. +0
    -1
      solaris/oss/JackBoomerDriver.h
  20. +36
    -109
      solaris/oss/JackOSSAdapter.cpp
  21. +0
    -1
      solaris/oss/JackOSSAdapter.h
  22. +38
    -113
      solaris/oss/JackOSSDriver.cpp
  23. +0
    -1
      solaris/oss/JackOSSDriver.h
  24. +33
    -90
      windows/portaudio/JackPortAudioAdapter.cpp
  25. +38
    -113
      windows/portaudio/JackPortAudioDriver.cpp
  26. +1
    -9
      windows/winmme/JackWinMMEDriver.cpp

+ 101
- 0
common/JackDriverLoader.cpp View File

@@ -834,3 +834,104 @@ JackDriverInfo::~JackDriverInfo()
if (fHandle)
UnloadDriverModule(fHandle);
}

EXPORT
jack_driver_desc_t *
jack_driver_descriptor_construct(
const char * name,
const char * description,
jack_driver_desc_filler_t * filler_ptr)
{
size_t name_len;
size_t description_len;
jack_driver_desc_t * desc_ptr;

name_len = strlen(name);
description_len = strlen(description);

if (name_len > sizeof(desc_ptr->name) - 1 ||
description_len > sizeof(desc_ptr->desc) - 1) {
assert(false);
return 0;
}

desc_ptr = (jack_driver_desc_t*)calloc (1, sizeof (jack_driver_desc_t));
if (desc_ptr == NULL) {
jack_error("calloc() failed to allocate memory for driver descriptor struct");
return 0;
}

memcpy(desc_ptr->name, name, name_len + 1);
memcpy(desc_ptr->desc, description, description_len + 1);

desc_ptr->nparams = 0;

if (filler_ptr != NULL) {
filler_ptr->size = 0;
}

return desc_ptr;
}

EXPORT
int
jack_driver_descriptor_add_parameter(
jack_driver_desc_t * desc_ptr,
jack_driver_desc_filler_t * filler_ptr,
const char * name,
char character,
jack_driver_param_type_t type,
const jack_driver_param_value_t * value_ptr,
jack_driver_param_constraint_desc_t * constraint,
const char * short_desc,
const char * long_desc)
{
size_t name_len;
size_t short_desc_len;
size_t long_desc_len;
jack_driver_param_desc_t * param_ptr;
size_t newsize;

name_len = strlen(name);
short_desc_len = strlen(short_desc);

if (long_desc != NULL) {
long_desc_len = strlen(long_desc);
} else {
long_desc = short_desc;
long_desc_len = short_desc_len;
}

if (name_len > sizeof(param_ptr->name) - 1 ||
short_desc_len > sizeof(param_ptr->short_desc) - 1 ||
long_desc_len > sizeof(param_ptr->long_desc) - 1) {
assert(false);
return 0;
}

if (desc_ptr->nparams == filler_ptr->size) {
newsize = filler_ptr->size + 20; // most drivers have less than 20 parameters
param_ptr = (jack_driver_param_desc_t*)realloc (desc_ptr->params, newsize * sizeof (jack_driver_param_desc_t));
if (param_ptr == NULL) {
jack_error("realloc() failed for parameter array of %zu elements", newsize);
return false;
}
filler_ptr->size = newsize;
desc_ptr->params = param_ptr;
}

assert(desc_ptr->nparams < filler_ptr->size);
param_ptr = desc_ptr->params + desc_ptr->nparams;

memcpy(param_ptr->name, name, name_len + 1);
param_ptr->character = character;
param_ptr->type = type;
param_ptr->value = *value_ptr;
param_ptr->constraint = constraint;
memcpy(param_ptr->short_desc, short_desc, short_desc_len + 1);
memcpy(param_ptr->long_desc, long_desc, long_desc_len + 1);

desc_ptr->nparams++;

return true;
}

+ 20
- 57
common/JackDummyDriver.cpp View File

@@ -93,63 +93,26 @@ extern "C"

SERVER_EXPORT jack_driver_desc_t * driver_get_descriptor () {
jack_driver_desc_t * desc;
unsigned int i;

desc = (jack_driver_desc_t*)calloc (1, sizeof (jack_driver_desc_t));
strcpy(desc->name, "dummy"); // size MUST be less then JACK_DRIVER_NAME_MAX + 1
strcpy(desc->desc, "Timer based backend"); // size MUST be less then JACK_DRIVER_PARAM_DESC + 1

desc->nparams = 6;
desc->params = (jack_driver_param_desc_t*)calloc (desc->nparams, sizeof (jack_driver_param_desc_t));

i = 0;
strcpy(desc->params[i].name, "capture");
desc->params[i].character = 'C';
desc->params[i].type = JackDriverParamUInt;
desc->params[i].value.ui = 2U;
strcpy(desc->params[i].short_desc, "Number of capture ports");
strcpy(desc->params[i].long_desc, desc->params[i].short_desc);

i++;
strcpy(desc->params[i].name, "playback");
desc->params[i].character = 'P';
desc->params[i].type = JackDriverParamUInt;
desc->params[1].value.ui = 2U;
strcpy(desc->params[i].short_desc, "Number of playback ports");
strcpy(desc->params[i].long_desc, desc->params[i].short_desc);

i++;
strcpy(desc->params[i].name, "rate");
desc->params[i].character = 'r';
desc->params[i].type = JackDriverParamUInt;
desc->params[i].value.ui = 48000U;
strcpy(desc->params[i].short_desc, "Sample rate");
strcpy(desc->params[i].long_desc, desc->params[i].short_desc);

i++;
strcpy(desc->params[i].name, "monitor");
desc->params[i].character = 'm';
desc->params[i].type = JackDriverParamBool;
desc->params[i].value.i = 0;
strcpy(desc->params[i].short_desc, "Provide monitor ports for the output");
strcpy(desc->params[i].long_desc, desc->params[i].short_desc);

i++;
strcpy(desc->params[i].name, "period");
desc->params[i].character = 'p';
desc->params[i].type = JackDriverParamUInt;
desc->params[i].value.ui = 1024U;
strcpy(desc->params[i].short_desc, "Frames per period");
strcpy(desc->params[i].long_desc, desc->params[i].short_desc);

i++;
strcpy(desc->params[i].name, "wait");
desc->params[i].character = 'w';
desc->params[i].type = JackDriverParamUInt;
desc->params[i].value.ui = 21333U;
strcpy(desc->params[i].short_desc,
"Number of usecs to wait between engine processes");
strcpy(desc->params[i].long_desc, desc->params[i].short_desc);
jack_driver_desc_filler_t filler;
jack_driver_param_value_t value;

desc = jack_driver_descriptor_construct("dummy", "Timer based backend", &filler);

value.ui = 2U;
jack_driver_descriptor_add_parameter(desc, &filler, "capture", 'C', JackDriverParamUInt, &value, NULL, "Number of capture ports", NULL);
jack_driver_descriptor_add_parameter(desc, &filler, "playback", 'P', JackDriverParamUInt, &value, NULL, "Number of playback ports", NULL);

value.ui = 48000U;
jack_driver_descriptor_add_parameter(desc, &filler, "rate", 'r', JackDriverParamUInt, &value, NULL, "Sample rate", NULL);

value.i = 0;
jack_driver_descriptor_add_parameter(desc, &filler, "monitor", 'm', JackDriverParamBool, &value, NULL, "Provide monitor ports for the output", NULL);

value.ui = 1024U;
jack_driver_descriptor_add_parameter(desc, &filler, "period", 'p', JackDriverParamUInt, &value, NULL, "Frames per period", NULL);

value.ui = 21333U;
jack_driver_descriptor_add_parameter(desc, &filler, "wait", 'w', JackDriverParamUInt, &value, NULL, "Number of usecs to wait between engine processes", NULL);

return desc;
}


+ 7
- 16
common/JackLoopbackDriver.cpp View File

@@ -98,22 +98,13 @@ extern "C"
SERVER_EXPORT jack_driver_desc_t * driver_get_descriptor()
{
jack_driver_desc_t * desc;
unsigned int i;

desc = (jack_driver_desc_t*)calloc (1, sizeof (jack_driver_desc_t));
strcpy(desc->name, "loopback"); // size MUST be less then JACK_DRIVER_NAME_MAX + 1
strcpy(desc->desc, "Loopback backend"); // size MUST be less then JACK_DRIVER_PARAM_DESC + 1

desc->nparams = 1;
desc->params = (jack_driver_param_desc_t*)calloc (desc->nparams, sizeof (jack_driver_param_desc_t));

i = 0;
strcpy(desc->params[i].name, "channels");
desc->params[i].character = 'c';
desc->params[i].type = JackDriverParamInt;
desc->params[i].value.ui = 0;
strcpy(desc->params[i].short_desc, "Maximum number of loopback ports");
strcpy(desc->params[i].long_desc, desc->params[i].short_desc);
jack_driver_desc_filler_t filler;
jack_driver_param_value_t value;

desc = jack_driver_descriptor_construct("loopback", "Loopback backend", &filler);

value.i = 0;
jack_driver_descriptor_add_parameter(desc, &filler, "channels", 'c', JackDriverParamInt, &value, NULL, "Maximum number of loopback ports", NULL);

return desc;
}


+ 37
- 102
common/JackNetAdapter.cpp View File

@@ -403,112 +403,47 @@ extern "C"

SERVER_EXPORT jack_driver_desc_t* jack_get_descriptor()
{
jack_driver_desc_t* desc = (jack_driver_desc_t*) calloc(1, sizeof(jack_driver_desc_t));

strcpy(desc->name, "netadapter"); // size MUST be less then JACK_DRIVER_NAME_MAX + 1
strcpy(desc->desc, "netjack net <==> audio backend adapter"); // size MUST be less then JACK_DRIVER_PARAM_DESC + 1

desc->params = (jack_driver_param_desc_t*) calloc(12, sizeof(jack_driver_param_desc_t));

int i = 0;
strcpy(desc->params[i].name, "multicast_ip");
desc->params[i].character = 'a';
desc->params[i].type = JackDriverParamString;
strcpy(desc->params[i].value.str, DEFAULT_MULTICAST_IP);
strcpy(desc->params[i].short_desc, "Multicast Address");
strcpy(desc->params[i].long_desc, desc->params[i].short_desc);

i++;
strcpy(desc->params[i].name, "udp_net_port");
desc->params[i].character = 'p';
desc->params[i].type = JackDriverParamInt;
desc->params[i].value.i = DEFAULT_PORT;
strcpy(desc->params[i].short_desc, "UDP port");
strcpy(desc->params[i].long_desc, desc->params[i].short_desc);

i++;
strcpy(desc->params[i].name, "mtu");
desc->params[i].character = 'M';
desc->params[i].type = JackDriverParamInt;
desc->params[i].value.i = DEFAULT_MTU;
strcpy(desc->params[i].short_desc, "MTU to the master");
strcpy(desc->params[i].long_desc, desc->params[i].short_desc);

i++;
strcpy(desc->params[i].name, "input-ports");
desc->params[i].character = 'C';
desc->params[i].type = JackDriverParamInt;
desc->params[i].value.i = 2;
strcpy(desc->params[i].short_desc, "Number of audio input ports");
strcpy(desc->params[i].long_desc, desc->params[i].short_desc);

i++;
strcpy(desc->params[i].name, "output-ports");
desc->params[i].character = 'P';
desc->params[i].type = JackDriverParamInt;
desc->params[i].value.i = 2;
strcpy(desc->params[i].short_desc, "Number of audio output ports");
strcpy(desc->params[i].long_desc, desc->params[i].short_desc);
jack_driver_desc_t * desc;
jack_driver_desc_filler_t filler;
jack_driver_param_value_t value;

desc = jack_driver_descriptor_construct("netadapter", "netjack net <==> audio backend adapter", &filler);

strcpy(value.str, DEFAULT_MULTICAST_IP);
jack_driver_descriptor_add_parameter(desc, &filler, "multicast_ip", 'a', JackDriverParamString, &value, NULL, "Multicast Address", NULL);

value.i = DEFAULT_PORT;
jack_driver_descriptor_add_parameter(desc, &filler, "udp_net_port", 'p', JackDriverParamInt, &value, NULL, "UDP port", NULL);

value.i = DEFAULT_MTU;
jack_driver_descriptor_add_parameter(desc, &filler, "mtu", 'M', JackDriverParamInt, &value, NULL, "MTU to the master", NULL);

value.i = 2;
jack_driver_descriptor_add_parameter(desc, &filler, "input-ports", 'C', JackDriverParamInt, &value, NULL, "Number of audio input ports", NULL);
jack_driver_descriptor_add_parameter(desc, &filler, "output-ports", 'C', JackDriverParamInt, &value, NULL, "Number of audio output ports", NULL);

#if HAVE_CELT
i++;
strcpy(desc->params[i].name, "celt");
desc->params[i].character = 'c';
desc->params[i].type = JackDriverParamInt;
desc->params[i].value.i = -1;
strcpy(desc->params[i].short_desc, "Set CELT encoding and number of kBits per channel");
strcpy(desc->params[i].long_desc, desc->params[i].short_desc);
value.i = -1;
jack_driver_descriptor_add_parameter(desc, &filler, "celt", 'c', JackDriverParamInt, &value, NULL, "Set CELT encoding and number of kBits per channel", NULL);
#endif

i++;
strcpy(desc->params[i].name, "client-name");
desc->params[i].character = 'n';
desc->params[i].type = JackDriverParamString;
strcpy(desc->params[i].value.str, "'hostname'");
strcpy(desc->params[i].short_desc, "Name of the jack client");
strcpy(desc->params[i].long_desc, desc->params[i].short_desc);

i++;
strcpy(desc->params[i].name, "transport-sync");
desc->params[i].character = 't';
desc->params[i].type = JackDriverParamUInt;
desc->params[i].value.ui = 1U;
strcpy(desc->params[i].short_desc, "Sync transport with master's");
strcpy(desc->params[i].long_desc, desc->params[i].short_desc);

i++;
strcpy(desc->params[i].name, "mode");
desc->params[i].character = 'm';
desc->params[i].type = JackDriverParamString;
strcpy(desc->params[i].value.str, "slow");
strcpy(desc->params[i].short_desc, "Slow, Normal or Fast mode.");
strcpy(desc->params[i].long_desc, desc->params[i].short_desc);

i++;
strcpy(desc->params[i].name, "quality");
desc->params[i].character = 'q';
desc->params[i].type = JackDriverParamInt;
desc->params[i].value.ui = 0;
strcpy(desc->params[i].short_desc, "Resample algorithm quality (0 - 4)");
strcpy(desc->params[i].long_desc, desc->params[i].short_desc);

i++;
strcpy(desc->params[i].name, "ring-buffer");
desc->params[i].character = 'g';
desc->params[i].type = JackDriverParamInt;
desc->params[i].value.ui = 32768;
strcpy(desc->params[i].short_desc, "Fixed ringbuffer size");
strcpy(desc->params[i].long_desc, "Fixed ringbuffer size (if not set => automatic adaptative)");

i++;
strcpy (desc->params[i].name, "auto-connect");
desc->params[i].character = 'c';
desc->params[i].type = JackDriverParamBool;
desc->params[i].value.i = false;
strcpy (desc->params[i].short_desc, "Auto connect netmaster to system ports");
strcpy (desc->params[i].long_desc, desc->params[i].short_desc);

desc->nparams = i + 1;
strcpy(value.str, "'hostname'");
jack_driver_descriptor_add_parameter(desc, &filler, "client-name", 'n', JackDriverParamString, &value, NULL, "Name of the jack client", NULL);

value.ui = 1U;
jack_driver_descriptor_add_parameter(desc, &filler, "transport-sync", 't', JackDriverParamUInt, &value, NULL, "Sync transport with master's", NULL);

strcpy(value.str, "slow");
jack_driver_descriptor_add_parameter(desc, &filler, "mode", 'm', JackDriverParamString, &value, NULL, "Slow, Normal or Fast mode.", NULL);

value.i = 0;
jack_driver_descriptor_add_parameter(desc, &filler, "quality", 'q', JackDriverParamInt, &value, NULL, "Resample algorithm quality (0 - 4)", NULL);

value.i = 32768;
jack_driver_descriptor_add_parameter(desc, &filler, "ring-buffer", 'g', JackDriverParamInt, &value, NULL, "Fixed ringbuffer size", "Fixed ringbuffer size (if not set => automatic adaptative)");

value.i = false;
jack_driver_descriptor_add_parameter(desc, &filler, "auto-connect", 'c', JackDriverParamBool, &value, NULL, "Auto connect netmaster to system ports", "");

return desc;
}


+ 32
- 94
common/JackNetDriver.cpp View File

@@ -599,103 +599,41 @@ namespace Jack
#endif
SERVER_EXPORT jack_driver_desc_t* driver_get_descriptor()
{
jack_driver_desc_t* desc = (jack_driver_desc_t*) calloc(1, sizeof(jack_driver_desc_t));

strcpy(desc->name, "net"); // size MUST be less then JACK_DRIVER_NAME_MAX + 1
strcpy(desc->desc, "netjack slave backend component"); // size MUST be less then JACK_DRIVER_PARAM_DESC + 1

desc->params = (jack_driver_param_desc_t*) calloc(11, sizeof(jack_driver_param_desc_t));

int i = 0;
strcpy(desc->params[i].name, "multicast_ip");
desc->params[i].character = 'a';
desc->params[i].type = JackDriverParamString;
strcpy(desc->params[i].value.str, DEFAULT_MULTICAST_IP);
strcpy(desc->params[i].short_desc, "Multicast Address");
strcpy(desc->params[i].long_desc, desc->params[i].short_desc);

i++;
strcpy(desc->params[i].name, "udp_net_port");
desc->params[i].character = 'p';
desc->params[i].type = JackDriverParamInt;
desc->params[i].value.i = DEFAULT_PORT;
strcpy(desc->params[i].short_desc, "UDP port");
strcpy(desc->params[i].long_desc, desc->params[i].short_desc);

i++;
strcpy(desc->params[i].name, "mtu");
desc->params[i].character = 'M';
desc->params[i].type = JackDriverParamInt;
desc->params[i].value.i = DEFAULT_MTU;
strcpy(desc->params[i].short_desc, "MTU to the master");
strcpy(desc->params[i].long_desc, desc->params[i].short_desc);

i++;
strcpy(desc->params[i].name, "input_ports");
desc->params[i].character = 'C';
desc->params[i].type = JackDriverParamInt;
desc->params[i].value.i = -1;
strcpy(desc->params[i].short_desc, "Number of audio input ports");
strcpy(desc->params[i].long_desc, "Number of audio input ports. If -1, audio physical input from the master");

i++;
strcpy(desc->params[i].name, "output_ports");
desc->params[i].character = 'P';
desc->params[i].type = JackDriverParamInt;
desc->params[i].value.i = -1;
strcpy(desc->params[i].short_desc, "Number of audio output ports");
strcpy(desc->params[i].long_desc, "Number of audio output ports. If -1, audio physical output from the master");

i++;
strcpy(desc->params[i].name, "midi_in_ports");
desc->params[i].character = 'i';
desc->params[i].type = JackDriverParamInt;
desc->params[i].value.i = 0;
strcpy(desc->params[i].short_desc, "Number of midi input ports");
strcpy(desc->params[i].long_desc, desc->params[i].short_desc);

i++;
strcpy(desc->params[i].name, "midi_out_ports");
desc->params[i].character = 'o';
desc->params[i].type = JackDriverParamInt;
desc->params[i].value.i = 0;
strcpy(desc->params[i].short_desc, "Number of midi output ports");
strcpy(desc->params[i].long_desc, desc->params[i].short_desc);
jack_driver_desc_t * desc;
jack_driver_desc_filler_t filler;
jack_driver_param_value_t value;

desc = jack_driver_descriptor_construct("net", "netjack slave backend component", &filler);

strcpy(value.str, DEFAULT_MULTICAST_IP);
jack_driver_descriptor_add_parameter(desc, &filler, "multicast_ip", 'a', JackDriverParamString, &value, NULL, "Multicast Address", NULL);

value.i = DEFAULT_PORT;
jack_driver_descriptor_add_parameter(desc, &filler, "udp_net_port", 'p', JackDriverParamInt, &value, NULL, "UDP port", NULL);

value.i = DEFAULT_MTU;
jack_driver_descriptor_add_parameter(desc, &filler, "mtu", 'M', JackDriverParamInt, &value, NULL, "MTU to the master", NULL);

value.i = -1;
jack_driver_descriptor_add_parameter(desc, &filler, "input_ports", 'C', JackDriverParamInt, &value, NULL, "Number of audio input ports", "Number of audio input ports. If -1, audio physical input from the master");
jack_driver_descriptor_add_parameter(desc, &filler, "output_ports", 'P', JackDriverParamInt, &value, NULL, "Number of audio output ports", "Number of audio output ports. If -1, audio physical output from the master");

value.i = 0;
jack_driver_descriptor_add_parameter(desc, &filler, "midi_in_ports", 'i', JackDriverParamInt, &value, NULL, "Number of midi input ports", NULL);
jack_driver_descriptor_add_parameter(desc, &filler, "midi_out_ports", 'o', JackDriverParamInt, &value, NULL, "Number of midi output ports", NULL);

#if HAVE_CELT
i++;
strcpy(desc->params[i].name, "celt");
desc->params[i].character = 'c';
desc->params[i].type = JackDriverParamInt;
desc->params[i].value.i = -1;
strcpy(desc->params[i].short_desc, "Set CELT encoding and number of kBits per channel");
strcpy(desc->params[i].long_desc, desc->params[i].short_desc);
value.i = -1;
jack_driver_descriptor_add_parameter(desc, &filler, "celt", 'c', JackDriverParamInt, &value, NULL, "Set CELT encoding and number of kBits per channel", NULL);
#endif
i++;
strcpy(desc->params[i].name, "client_name");
desc->params[i].character = 'n';
desc->params[i].type = JackDriverParamString;
strcpy(desc->params[i].value.str, "'hostname'");
strcpy(desc->params[i].short_desc, "Name of the jack client");
strcpy(desc->params[i].long_desc, desc->params[i].short_desc);

i++;
strcpy(desc->params[i].name, "transport_sync");
desc->params[i].character = 't';
desc->params[i].type = JackDriverParamUInt;
desc->params[i].value.ui = 1U;
strcpy(desc->params[i].short_desc, "Sync transport with master's");
strcpy(desc->params[i].long_desc, desc->params[i].short_desc);

i++;
strcpy(desc->params[i].name, "mode");
desc->params[i].character = 'm';
desc->params[i].type = JackDriverParamString;
strcpy(desc->params[i].value.str, "slow");
strcpy(desc->params[i].short_desc, "Slow, Normal or Fast mode.");
strcpy(desc->params[i].long_desc, desc->params[i].short_desc);

desc->nparams = i + 1;
strcpy(value.str, "'hostname'");
jack_driver_descriptor_add_parameter(desc, &filler, "client_name", 'n', JackDriverParamString, &value, NULL, "Name of the jack client", NULL);

value.ui = 1U;
jack_driver_descriptor_add_parameter(desc, &filler, "transport_sync", 't', JackDriverParamUInt, &value, NULL, "Sync transport with master's", NULL);

strcpy(value.str, "slow");
jack_driver_descriptor_add_parameter(desc, &filler, "mode", 'm', JackDriverParamString, &value, NULL, "Slow, Normal or Fast mode.", NULL);

return desc;
}


+ 14
- 32
common/JackNetManager.cpp View File

@@ -751,38 +751,20 @@ extern "C"

SERVER_EXPORT jack_driver_desc_t* jack_get_descriptor()
{
jack_driver_desc_t *desc;
desc = ( jack_driver_desc_t* ) calloc ( 1, sizeof ( jack_driver_desc_t ) );

strcpy ( desc->name, "netmanager" ); // size MUST be less then JACK_DRIVER_NAME_MAX + 1
strcpy ( desc->desc, "netjack multi-cast master component" ); // size MUST be less then JACK_DRIVER_PARAM_DESC + 1

desc->nparams = 3;
desc->params = ( jack_driver_param_desc_t* ) calloc ( desc->nparams, sizeof ( jack_driver_param_desc_t ) );

int i = 0;
strcpy ( desc->params[i].name, "multicast_ip" );
desc->params[i].character = 'a';
desc->params[i].type = JackDriverParamString;
strcpy ( desc->params[i].value.str, DEFAULT_MULTICAST_IP );
strcpy ( desc->params[i].short_desc, "Multicast Address" );
strcpy ( desc->params[i].long_desc, desc->params[i].short_desc );

i++;
strcpy ( desc->params[i].name, "udp_net_port" );
desc->params[i].character = 'p';
desc->params[i].type = JackDriverParamInt;
desc->params[i].value.i = DEFAULT_PORT;
strcpy ( desc->params[i].short_desc, "UDP port" );
strcpy ( desc->params[i].long_desc, desc->params[i].short_desc );

i++;
strcpy ( desc->params[i].name, "auto_connect" );
desc->params[i].character = 'c';
desc->params[i].type = JackDriverParamBool;
desc->params[i].value.i = false;
strcpy ( desc->params[i].short_desc, "Auto connect netmaster to system ports" );
strcpy ( desc->params[i].long_desc, desc->params[i].short_desc );
jack_driver_desc_t * desc;
jack_driver_desc_filler_t filler;
jack_driver_param_value_t value;

desc = jack_driver_descriptor_construct("netmanager", "netjack multi-cast master component", &filler);

strcpy(value.str, DEFAULT_MULTICAST_IP );
jack_driver_descriptor_add_parameter(desc, &filler, "multicast_ip", 'a', JackDriverParamString, &value, NULL, "Multicast Address", NULL);

value.i = DEFAULT_PORT;
jack_driver_descriptor_add_parameter(desc, &filler, "udp_net_port", 'p', JackDriverParamInt, &value, NULL, "UDP port", NULL);

value.i = false;
jack_driver_descriptor_add_parameter(desc, &filler, "auto_connect", 'c', JackDriverParamBool, &value, NULL, "Auto connect netmaster to system ports", NULL);

return desc;
}


+ 53
- 165
common/JackNetOneDriver.cpp View File

@@ -778,174 +778,62 @@ extern "C"
#endif
SERVER_EXPORT jack_driver_desc_t* driver_get_descriptor ()
{
jack_driver_desc_t* desc = ( jack_driver_desc_t* ) calloc ( 1, sizeof ( jack_driver_desc_t ) );
jack_driver_param_desc_t * params;

strcpy ( desc->name, "netone" ); // size MUST be less then JACK_DRIVER_NAME_MAX + 1
strcpy ( desc->desc, "netjack one slave backend component" ); // size MUST be less then JACK_DRIVER_PARAM_DESC + 1

params = ( jack_driver_param_desc_t* ) calloc ( 18, sizeof ( jack_driver_param_desc_t ) );

int i = 0;
strcpy (params[i].name, "audio-ins");
params[i].character = 'i';
params[i].type = JackDriverParamUInt;
params[i].value.ui = 2U;
strcpy (params[i].short_desc, "Number of capture channels (defaults to 2)");
strcpy (params[i].long_desc, params[i].short_desc);

i++;
strcpy (params[i].name, "audio-outs");
params[i].character = 'o';
params[i].type = JackDriverParamUInt;
params[i].value.ui = 2U;
strcpy (params[i].short_desc, "Number of playback channels (defaults to 2)");
strcpy (params[i].long_desc, params[i].short_desc);

i++;
strcpy (params[i].name, "midi-ins");
params[i].character = 'I';
params[i].type = JackDriverParamUInt;
params[i].value.ui = 1U;
strcpy (params[i].short_desc, "Number of midi capture channels (defaults to 1)");
strcpy (params[i].long_desc, params[i].short_desc);

i++;
strcpy (params[i].name, "midi-outs");
params[i].character = 'O';
params[i].type = JackDriverParamUInt;
params[i].value.ui = 1U;
strcpy (params[i].short_desc, "Number of midi playback channels (defaults to 1)");
strcpy (params[i].long_desc, params[i].short_desc);

i++;
strcpy (params[i].name, "rate");
params[i].character = 'r';
params[i].type = JackDriverParamUInt;
params[i].value.ui = 48000U;
strcpy (params[i].short_desc, "Sample rate");
strcpy (params[i].long_desc, params[i].short_desc);

i++;
strcpy (params[i].name, "period");
params[i].character = 'p';
params[i].type = JackDriverParamUInt;
params[i].value.ui = 1024U;
strcpy (params[i].short_desc, "Frames per period");
strcpy (params[i].long_desc, params[i].short_desc);

i++;
strcpy (params[i].name, "num-periods");
params[i].character = 'n';
params[i].type = JackDriverParamUInt;
params[i].value.ui = 5U;
strcpy (params[i].short_desc,
"Network latency setting in no. of periods");
strcpy (params[i].long_desc, params[i].short_desc);

i++;
strcpy (params[i].name, "listen-port");
params[i].character = 'l';
params[i].type = JackDriverParamUInt;
params[i].value.ui = 3000U;
strcpy (params[i].short_desc,
"The socket port we are listening on for sync packets");
strcpy (params[i].long_desc, params[i].short_desc);

i++;
strcpy (params[i].name, "factor");
params[i].character = 'f';
params[i].type = JackDriverParamUInt;
params[i].value.ui = 1U;
strcpy (params[i].short_desc,
"Factor for sample rate reduction");
strcpy (params[i].long_desc, params[i].short_desc);

i++;
strcpy (params[i].name, "upstream-factor");
params[i].character = 'u';
params[i].type = JackDriverParamUInt;
params[i].value.ui = 0U;
strcpy (params[i].short_desc,
"Factor for sample rate reduction on the upstream");
strcpy (params[i].long_desc, params[i].short_desc);
jack_driver_desc_t * desc;
jack_driver_desc_filler_t filler;
jack_driver_param_value_t value;

desc = jack_driver_descriptor_construct("netone", "netjack one slave backend component", &filler);

value.ui = 2U;
jack_driver_descriptor_add_parameter(desc, &filler, "audio-ins", 'i', JackDriverParamUInt, &value, NULL, "Number of capture channels (defaults to 2)", NULL);
jack_driver_descriptor_add_parameter(desc, &filler, "audio-outs", 'o', JackDriverParamUInt, &value, NULL, "Number of playback channels (defaults to 2)", NULL);

value.ui = 1U;
jack_driver_descriptor_add_parameter(desc, &filler, "midi-ins", 'I', JackDriverParamUInt, &value, NULL, "Number of midi capture channels (defaults to 1)", NULL);
jack_driver_descriptor_add_parameter(desc, &filler, "midi-outs", 'O', JackDriverParamUInt, &value, NULL, "Number of midi playback channels (defaults to 1)", NULL);

value.ui = 48000U;
jack_driver_descriptor_add_parameter(desc, &filler, "rate", 'r', JackDriverParamUInt, &value, NULL, "Sample rate", NULL);

value.ui = 1024U;
jack_driver_descriptor_add_parameter(desc, &filler, "period", 'p', JackDriverParamUInt, &value, NULL, "Frames per period", NULL);

value.ui = 5U;
jack_driver_descriptor_add_parameter(desc, &filler, "num-periods", 'n', JackDriverParamUInt, &value, NULL, "Network latency setting in no. of periods", NULL);

value.ui = 3000U;
jack_driver_descriptor_add_parameter(desc, &filler, "listen-port", 'l', JackDriverParamUInt, &value, NULL, "The socket port we are listening on for sync packets", NULL);

value.ui = 1U;
jack_driver_descriptor_add_parameter(desc, &filler, "factor", 'f', JackDriverParamUInt, &value, NULL, "Factor for sample rate reduction", NULL);

value.ui = 0U;
jack_driver_descriptor_add_parameter(desc, &filler, "upstream-factor", 'u', JackDriverParamUInt, &value, NULL, "Factor for sample rate reduction on the upstream", NULL);

#if HAVE_CELT
i++;
strcpy (params[i].name, "celt");
params[i].character = 'c';
params[i].type = JackDriverParamUInt;
params[i].value.ui = 0U;
strcpy (params[i].short_desc,
"sets celt encoding and number of kbits per channel");
strcpy (params[i].long_desc, params[i].short_desc);
value.ui = 0U;
jack_driver_descriptor_add_parameter(desc, &filler, "celt", 'c', JackDriverParamUInt, &value, NULL, "sets celt encoding and number of kbits per channel", NULL);
#endif
i++;
strcpy (params[i].name, "bit-depth");
params[i].character = 'b';
params[i].type = JackDriverParamUInt;
params[i].value.ui = 0U;
strcpy (params[i].short_desc,
"Sample bit-depth (0 for float, 8 for 8bit and 16 for 16bit)");
strcpy (params[i].long_desc, params[i].short_desc);

i++;
strcpy (params[i].name, "transport-sync");
params[i].character = 't';
params[i].type = JackDriverParamBool;
params[i].value.ui = 1U;
strcpy (params[i].short_desc,
"Whether to slave the transport to the master transport");
strcpy (params[i].long_desc, params[i].short_desc);

i++;
strcpy (params[i].name, "autoconf");
params[i].character = 'a';
params[i].type = JackDriverParamBool;
params[i].value.ui = 1U;
strcpy (params[i].short_desc,
"Whether to use Autoconfig, or just start.");
strcpy (params[i].long_desc, params[i].short_desc);

i++;
strcpy (params[i].name, "redundancy");
params[i].character = 'R';
params[i].type = JackDriverParamUInt;
params[i].value.ui = 1U;
strcpy (params[i].short_desc,
"Send packets N times");
strcpy (params[i].long_desc, params[i].short_desc);

i++;
strcpy (params[i].name, "native-endian");
params[i].character = 'e';
params[i].type = JackDriverParamBool;
params[i].value.ui = 0U;
strcpy (params[i].short_desc,
"Dont convert samples to network byte order.");
strcpy (params[i].long_desc, params[i].short_desc);

i++;
strcpy (params[i].name, "jitterval");
params[i].character = 'J';
params[i].type = JackDriverParamInt;
params[i].value.i = 0;
strcpy (params[i].short_desc,
"attempted jitterbuffer microseconds on master");
strcpy (params[i].long_desc, params[i].short_desc);

i++;
strcpy (params[i].name, "always-deadline");
params[i].character = 'D';
params[i].type = JackDriverParamBool;
params[i].value.ui = 0U;
strcpy (params[i].short_desc,
"always use deadline");
strcpy (params[i].long_desc, params[i].short_desc);

desc->nparams = i + 1;

desc->params = params;
value.ui = 0U;
jack_driver_descriptor_add_parameter(desc, &filler, "bit-depth", 'b', JackDriverParamUInt, &value, NULL, "Sample bit-depth (0 for float, 8 for 8bit and 16 for 16bit)", NULL);

value.i = true;
jack_driver_descriptor_add_parameter(desc, &filler, "transport-sync", 't', JackDriverParamBool, &value, NULL, "Whether to slave the transport to the master transport", NULL);

value.ui = true;
jack_driver_descriptor_add_parameter(desc, &filler, "autoconf", 'a', JackDriverParamBool, &value, NULL, "Whether to use Autoconfig, or just start.", NULL);

value.ui = 1U;
jack_driver_descriptor_add_parameter(desc, &filler, "redundancy", 'R', JackDriverParamUInt, &value, NULL, "Send packets N times", NULL);

value.ui = false;
jack_driver_descriptor_add_parameter(desc, &filler, "native-endian", 'e', JackDriverParamBool, &value, NULL, "Dont convert samples to network byte order.", NULL);

value.i = 0;
jack_driver_descriptor_add_parameter(desc, &filler, "jitterval", 'J', JackDriverParamInt, &value, NULL, "attempted jitterbuffer microseconds on master", NULL);

value.i = false;
jack_driver_descriptor_add_parameter(desc, &filler, "always-deadline", 'D', JackDriverParamBool, &value, NULL, "always use deadline", NULL);

return desc;
}


+ 10
- 31
common/JackProfiler.cpp View File

@@ -206,37 +206,16 @@ extern "C"

SERVER_EXPORT jack_driver_desc_t* jack_get_descriptor()
{
jack_driver_desc_t* desc = (jack_driver_desc_t*)calloc(1, sizeof(jack_driver_desc_t));
strcpy(desc->name, "profiler"); // size MUST be less then JACK_DRIVER_NAME_MAX + 1
strcpy(desc->desc, "real-time server profiling"); // size MUST be less then JACK_DRIVER_PARAM_DESC + 1
desc->nparams = 3;
desc->params = (jack_driver_param_desc_t*)calloc(desc->nparams, sizeof(jack_driver_param_desc_t));
int i = 0;
strcpy(desc->params[i].name, "cpu-load");
desc->params[i].character = 'c';
desc->params[i].type = JackDriverParamBool;
desc->params[i].value.i = FALSE;
strcpy(desc->params[i].short_desc, "Show DSP CPU load");
strcpy(desc->params[i].long_desc, desc->params[i].short_desc);
i++;
strcpy(desc->params[i].name, "driver-period");
desc->params[i].character = 'p';
desc->params[i].type = JackDriverParamBool;
desc->params[i].value.i = FALSE;
strcpy(desc->params[i].short_desc, "Show driver period");
strcpy(desc->params[i].long_desc, desc->params[i].short_desc);
i++;
strcpy(desc->params[i].name, "driver-end-time");
desc->params[i].character = 'e';
desc->params[i].type = JackDriverParamBool;
desc->params[i].value.i = FALSE;
strcpy(desc->params[i].short_desc, "Show driver end time");
strcpy(desc->params[i].long_desc, desc->params[i].short_desc);
jack_driver_desc_t * desc;
jack_driver_desc_filler_t filler;
jack_driver_param_value_t value;

desc = jack_driver_descriptor_construct("profiler", "real-time server profiling", &filler);

value.i = FALSE;
jack_driver_descriptor_add_parameter(desc, &filler, "cpu-load", 'c', JackDriverParamBool, &value, NULL, "Show DSP CPU load", NULL);
jack_driver_descriptor_add_parameter(desc, &filler, "driver-period", 'p', JackDriverParamBool, &value, NULL, "Show driver period", NULL);
jack_driver_descriptor_add_parameter(desc, &filler, "driver-end-time", 'e', JackDriverParamBool, &value, NULL, "Show driver end time", NULL);

return desc;
}


+ 23
- 0
common/driver_interface.h View File

@@ -111,9 +111,32 @@ extern "C"
}
jack_driver_desc_t;

typedef struct {
uint32_t size; /* size of the param array, in elements */
}
jack_driver_desc_filler_t;

SERVER_EXPORT int jack_parse_driver_params (jack_driver_desc_t * desc, int argc, char* argv[], JSList ** param_ptr);

jack_driver_desc_t * /* newlly allocated driver descriptor, NULL on failure */
jack_driver_descriptor_construct(
const char * name, /* driver name */
const char * description, /* driver description */
jack_driver_desc_filler_t * filler); /* Pointer to stack var to be supplied to jack_driver_descriptor_add_parameter() as well.
Can be NULL for drivers that have no parameters. */

int /* 0 on failure */
jack_driver_descriptor_add_parameter(
jack_driver_desc_t * driver_descr, /* pointer to driver descriptor as returned by jack_driver_descriptor_construct() */
jack_driver_desc_filler_t * filler, /* Pointer to the stack var that was supplied to jack_driver_descriptor_add_parameter(). */
const char * name, /* parameter's name */
char character, /* parameter's character (for getopt, etc) */
jack_driver_param_type_t type, /* The parameter's type */
const jack_driver_param_value_t * value_ptr, /* Pointer to parameter's (default) value */
jack_driver_param_constraint_desc_t * constraint, /* Pointer to parameter constraint descriptor. NULL if there is no constraint */
const char * short_desc, /* A short (~30 chars) description for the user */
const char * long_desc); /* A longer description for the user, if NULL short_desc will be used */

#ifdef __cplusplus
}
#endif


+ 34
- 102
linux/alsa/JackAlsaAdapter.cpp View File

@@ -187,108 +187,40 @@ extern "C"

SERVER_EXPORT jack_driver_desc_t* jack_get_descriptor()
{
jack_driver_desc_t *desc;
unsigned int i;
desc = ( jack_driver_desc_t* ) calloc ( 1, sizeof ( jack_driver_desc_t ) );

strcpy ( desc->name, "audioadapter" ); // size MUST be less then JACK_DRIVER_NAME_MAX + 1
strcpy ( desc->desc, "netjack audio <==> net backend adapter" ); // size MUST be less then JACK_DRIVER_PARAM_DESC + 1

desc->nparams = 11;
desc->params = ( jack_driver_param_desc_t* ) calloc ( desc->nparams, sizeof ( jack_driver_param_desc_t ) );

i = 0;
strcpy ( desc->params[i].name, "capture" );
desc->params[i].character = 'C';
desc->params[i].type = JackDriverParamString;
strcpy ( desc->params[i].value.str, "none" );
strcpy ( desc->params[i].short_desc,
"Provide capture ports. Optionally set device" );
strcpy ( desc->params[i].long_desc, desc->params[i].short_desc );

i++;
strcpy ( desc->params[i].name, "playback" );
desc->params[i].character = 'P';
desc->params[i].type = JackDriverParamString;
strcpy ( desc->params[i].value.str, "none" );
strcpy ( desc->params[i].short_desc,
"Provide playback ports. Optionally set device" );
strcpy ( desc->params[i].long_desc, desc->params[i].short_desc );

i++;
strcpy ( desc->params[i].name, "device" );
desc->params[i].character = 'd';
desc->params[i].type = JackDriverParamString;
strcpy ( desc->params[i].value.str, "hw:0" );
strcpy ( desc->params[i].short_desc, "ALSA device name" );
strcpy ( desc->params[i].long_desc, desc->params[i].short_desc );

i++;
strcpy ( desc->params[i].name, "rate" );
desc->params[i].character = 'r';
desc->params[i].type = JackDriverParamUInt;
desc->params[i].value.ui = 48000U;
strcpy ( desc->params[i].short_desc, "Sample rate" );
strcpy ( desc->params[i].long_desc, desc->params[i].short_desc );

i++;
strcpy ( desc->params[i].name, "periodsize" );
desc->params[i].character = 'p';
desc->params[i].type = JackDriverParamUInt;
desc->params[i].value.ui = 512U;
strcpy ( desc->params[i].short_desc, "Period size" );
strcpy ( desc->params[i].long_desc, desc->params[i].short_desc );

i++;
strcpy ( desc->params[i].name, "nperiods" );
desc->params[i].character = 'n';
desc->params[i].type = JackDriverParamUInt;
desc->params[i].value.ui = 2U;
strcpy ( desc->params[i].short_desc, "Number of periods of playback latency" );
strcpy ( desc->params[i].long_desc, desc->params[i].short_desc );

i++;
strcpy ( desc->params[i].name, "duplex" );
desc->params[i].character = 'D';
desc->params[i].type = JackDriverParamBool;
desc->params[i].value.i = true;
strcpy ( desc->params[i].short_desc,
"Provide both capture and playback ports" );
strcpy ( desc->params[i].long_desc, desc->params[i].short_desc );

i++;
strcpy ( desc->params[i].name, "inchannels" );
desc->params[i].character = 'i';
desc->params[i].type = JackDriverParamInt;
desc->params[i].value.i = 0;
strcpy ( desc->params[i].short_desc,
"Number of capture channels (defaults to hardware max)" );
strcpy ( desc->params[i].long_desc, desc->params[i].short_desc );

i++;
strcpy ( desc->params[i].name, "outchannels" );
desc->params[i].character = 'o';
desc->params[i].type = JackDriverParamInt;
desc->params[i].value.i = 0;
strcpy ( desc->params[i].short_desc,
"Number of playback channels (defaults to hardware max)" );
strcpy ( desc->params[i].long_desc, desc->params[i].short_desc );

i++;
strcpy(desc->params[i].name, "quality");
desc->params[i].character = 'q';
desc->params[i].type = JackDriverParamUInt;
desc->params[i].value.ui = 0;
strcpy(desc->params[i].short_desc, "Resample algorithm quality (0 - 4)");
strcpy(desc->params[i].long_desc, desc->params[i].short_desc);

i++;
strcpy(desc->params[i].name, "ring-buffer");
desc->params[i].character = 'g';
desc->params[i].type = JackDriverParamUInt;
desc->params[i].value.ui = 32768;
strcpy(desc->params[i].short_desc, "Fixed ringbuffer size");
strcpy(desc->params[i].long_desc, "Fixed ringbuffer size (if not set => automatic adaptative)");
jack_driver_desc_t * desc;
jack_driver_desc_filler_t filler;
jack_driver_param_value_t value;

desc = jack_driver_descriptor_construct("audioadapter", "netjack audio <==> net backend adapter", &filler);

strcpy(value.str, "none");
jack_driver_descriptor_add_parameter(desc, &filler, "capture", 'C', JackDriverParamString, &value, NULL, "Provide capture ports. Optionally set device", NULL);
jack_driver_descriptor_add_parameter(desc, &filler, "playback", 'P', JackDriverParamString, &value, NULL, "Provide playback ports. Optionally set device", NULL);

strcpy(value.str, "hw:0");
jack_driver_descriptor_add_parameter(desc, &filler, "device", 'd', JackDriverParamString, &value, NULL, "ALSA device name", NULL);

value.ui = 48000U;
jack_driver_descriptor_add_parameter(desc, &filler, "rate", 'r', JackDriverParamUInt, &value, NULL, "Sample rate", NULL);

value.ui = 512U;
jack_driver_descriptor_add_parameter(desc, &filler, "periodsize", 'p', JackDriverParamUInt, &value, NULL, "Period size", NULL);

value.ui = 2U;
jack_driver_descriptor_add_parameter(desc, &filler, "nperiods", 'n', JackDriverParamUInt, &value, NULL, "Number of periods of playback latency", NULL);

value.i = true;
jack_driver_descriptor_add_parameter(desc, &filler, "duplex", 'D', JackDriverParamBool, &value, NULL, "Provide both capture and playback ports", NULL);

value.i = 0;
jack_driver_descriptor_add_parameter(desc, &filler, "inchannels", 'i', JackDriverParamInt, &value, NULL, "Number of capture channels (defaults to hardware max)", NULL);
jack_driver_descriptor_add_parameter(desc, &filler, "outchannels", 'o', JackDriverParamInt, &value, NULL, "Number of playback channels (defaults to hardware max)", NULL);

value.ui = 0;
jack_driver_descriptor_add_parameter(desc, &filler, "quality", 'q', JackDriverParamUInt, &value, NULL, "Resample algorithm quality (0 - 4)", NULL);

value.ui = 32768;
jack_driver_descriptor_add_parameter(desc, &filler, "ring-buffer", 'g', JackDriverParamUInt, &value, NULL, "Fixed ringbuffer size", "Fixed ringbuffer size (if not set => automatic adaptative)");

return desc;
}


+ 78
- 173
linux/alsa/JackAlsaDriver.cpp View File

@@ -725,179 +725,84 @@ dither_opt (char c, DitherAlgorithm* dither)
SERVER_EXPORT const jack_driver_desc_t* driver_get_descriptor ()
{
jack_driver_desc_t * desc;
jack_driver_param_desc_t * params;
unsigned int i;

desc = (jack_driver_desc_t*)calloc (1, sizeof (jack_driver_desc_t));

strcpy(desc->name, "alsa"); // size MUST be less then JACK_DRIVER_NAME_MAX + 1
strcpy(desc->desc, "Linux ALSA API based audio backend"); // size MUST be less then JACK_DRIVER_PARAM_DESC + 1

desc->nparams = 18;
params = (jack_driver_param_desc_t*)calloc (desc->nparams, sizeof (jack_driver_param_desc_t));

i = 0;
strcpy (params[i].name, "capture");
params[i].character = 'C';
params[i].type = JackDriverParamString;
strcpy (params[i].value.str, "none");
strcpy (params[i].short_desc,
"Provide capture ports. Optionally set device");
strcpy (params[i].long_desc, params[i].short_desc);

i++;
strcpy (params[i].name, "playback");
params[i].character = 'P';
params[i].type = JackDriverParamString;
strcpy (params[i].value.str, "none");
strcpy (params[i].short_desc,
"Provide playback ports. Optionally set device");
strcpy (params[i].long_desc, params[i].short_desc);

i++;
strcpy (params[i].name, "device");
params[i].character = 'd';
params[i].type = JackDriverParamString;
strcpy (params[i].value.str, "hw:0");
strcpy (params[i].short_desc, "ALSA device name");
strcpy (params[i].long_desc, params[i].short_desc);
params[i].constraint = enum_alsa_devices();

i++;
strcpy (params[i].name, "rate");
params[i].character = 'r';
params[i].type = JackDriverParamUInt;
params[i].value.ui = 48000U;
strcpy (params[i].short_desc, "Sample rate");
strcpy (params[i].long_desc, params[i].short_desc);

i++;
strcpy (params[i].name, "period");
params[i].character = 'p';
params[i].type = JackDriverParamUInt;
params[i].value.ui = 1024U;
strcpy (params[i].short_desc, "Frames per period");
strcpy (params[i].long_desc, params[i].short_desc);

i++;
strcpy (params[i].name, "nperiods");
params[i].character = 'n';
params[i].type = JackDriverParamUInt;
params[i].value.ui = 2U;
strcpy (params[i].short_desc, "Number of periods of playback latency");
strcpy (params[i].long_desc, params[i].short_desc);

i++;
strcpy (params[i].name, "hwmon");
params[i].character = 'H';
params[i].type = JackDriverParamBool;
params[i].value.i = 0;
strcpy (params[i].short_desc, "Hardware monitoring, if available");
strcpy (params[i].long_desc, params[i].short_desc);

i++;
strcpy (params[i].name, "hwmeter");
params[i].character = 'M';
params[i].type = JackDriverParamBool;
params[i].value.i = 0;
strcpy (params[i].short_desc, "Hardware metering, if available");
strcpy (params[i].long_desc, params[i].short_desc);

i++;
strcpy (params[i].name, "duplex");
params[i].character = 'D';
params[i].type = JackDriverParamBool;
params[i].value.i = 1;
strcpy (params[i].short_desc,
"Provide both capture and playback ports");
strcpy (params[i].long_desc, params[i].short_desc);

i++;
strcpy (params[i].name, "softmode");
params[i].character = 's';
params[i].type = JackDriverParamBool;
params[i].value.i = 0;
strcpy (params[i].short_desc, "Soft-mode, no xrun handling");
strcpy (params[i].long_desc, params[i].short_desc);

i++;
strcpy (params[i].name, "monitor");
params[i].character = 'm';
params[i].type = JackDriverParamBool;
params[i].value.i = 0;
strcpy (params[i].short_desc, "Provide monitor ports for the output");
strcpy (params[i].long_desc, params[i].short_desc);

i++;
strcpy (params[i].name, "dither");
params[i].character = 'z';
params[i].type = JackDriverParamChar;
params[i].value.c = 'n';
strcpy (params[i].short_desc, "Dithering mode");
strcpy (params[i].long_desc,
"Dithering mode:\n"
" n - none\n"
" r - rectangular\n"
" s - shaped\n"
" t - triangular");
params[i].constraint = get_dither_constraint();

i++;
strcpy (params[i].name, "inchannels");
params[i].character = 'i';
params[i].type = JackDriverParamInt;
params[i].value.i = 0;
strcpy (params[i].short_desc,
"Number of capture channels (defaults to hardware max)");
strcpy (params[i].long_desc, params[i].short_desc);

i++;
strcpy (params[i].name, "outchannels");
params[i].character = 'o';
params[i].type = JackDriverParamInt;
params[i].value.i = 0;
strcpy (params[i].short_desc,
"Number of playback channels (defaults to hardware max)");
strcpy (params[i].long_desc, params[i].short_desc);

i++;
strcpy (params[i].name, "shorts");
params[i].character = 'S';
params[i].type = JackDriverParamBool;
params[i].value.i = FALSE;
strcpy (params[i].short_desc, "Try 16-bit samples before 32-bit");
strcpy (params[i].long_desc, params[i].short_desc);

i++;
strcpy (params[i].name, "input-latency");
params[i].character = 'I';
params[i].type = JackDriverParamUInt;
params[i].value.ui = 0;
strcpy (params[i].short_desc, "Extra input latency (frames)");
strcpy (params[i].long_desc, params[i].short_desc);

i++;
strcpy (params[i].name, "output-latency");
params[i].character = 'O';
params[i].type = JackDriverParamUInt;
params[i].value.ui = 0;
strcpy (params[i].short_desc, "Extra output latency (frames)");
strcpy (params[i].long_desc, params[i].short_desc);

i++;
strcpy (params[i].name, "midi-driver");
params[i].character = 'X';
params[i].type = JackDriverParamString;
strcpy (params[i].value.str, "none");
strcpy (params[i].short_desc, "ALSA MIDI driver name (seq|raw)");
strcpy (params[i].long_desc,
"ALSA MIDI driver:\n"
" none - no MIDI driver\n"
" seq - ALSA Sequencer driver\n"
" raw - ALSA RawMIDI driver\n");
params[i].constraint = get_midi_driver_constraint();

desc->params = params;
jack_driver_desc_filler_t filler;
jack_driver_param_value_t value;

desc = jack_driver_descriptor_construct("alsa", "Linux ALSA API based audio backend", &filler);

strcpy(value.str, "none");
jack_driver_descriptor_add_parameter(desc, &filler, "capture", 'C', JackDriverParamString, &value, NULL, "Provide capture ports. Optionally set device", NULL);
jack_driver_descriptor_add_parameter(desc, &filler, "playback", 'P', JackDriverParamString, &value, NULL, "Provide playback ports. Optionally set device", NULL);

strcpy(value.str, "hw:0");
jack_driver_descriptor_add_parameter(desc, &filler, "device", 'd', JackDriverParamString, &value, enum_alsa_devices(), "ALSA device name", NULL);

value.ui = 48000U;
jack_driver_descriptor_add_parameter(desc, &filler, "rate", 'r', JackDriverParamUInt, &value, NULL, "Sample rate", NULL);

value.ui = 1024U;
jack_driver_descriptor_add_parameter(desc, &filler, "period", 'p', JackDriverParamUInt, &value, NULL, "Frames per period", NULL);

value.ui = 2U;
jack_driver_descriptor_add_parameter(desc, &filler, "nperiods", 'n', JackDriverParamUInt, &value, NULL, "Number of periods of playback latency", NULL);

value.i = 0;
jack_driver_descriptor_add_parameter(desc, &filler, "hwmon", 'H', JackDriverParamBool, &value, NULL, "Hardware monitoring, if available", NULL);

value.i = 0;
jack_driver_descriptor_add_parameter(desc, &filler, "hwmeter", 'M', JackDriverParamBool, &value, NULL, "Hardware metering, if available", NULL);

value.i = 1;
jack_driver_descriptor_add_parameter(desc, &filler, "duplex", 'D', JackDriverParamBool, &value, NULL, "Provide both capture and playback ports", NULL);

value.i = 0;
jack_driver_descriptor_add_parameter(desc, &filler, "softmode", 's', JackDriverParamBool, &value, NULL, "Soft-mode, no xrun handling", NULL);

value.i = 0;
jack_driver_descriptor_add_parameter(desc, &filler, "monitor", 'm', JackDriverParamBool, &value, NULL, "Provide monitor ports for the output", NULL);

value.c = 'n';
jack_driver_descriptor_add_parameter(
desc,
&filler,
"dither",
'z',
JackDriverParamChar,
&value,
get_dither_constraint(),
"Dithering mode",
"Dithering mode:\n"
" n - none\n"
" r - rectangular\n"
" s - shaped\n"
" t - triangular");

value.i = 0;
jack_driver_descriptor_add_parameter(desc, &filler, "inchannels", 'i', JackDriverParamInt, &value, NULL, "Number of capture channels (defaults to hardware max)", NULL);
jack_driver_descriptor_add_parameter(desc, &filler, "outchannels", 'o', JackDriverParamInt, &value, NULL, "Number of playback channels (defaults to hardware max)", NULL);

value.i = FALSE;
jack_driver_descriptor_add_parameter(desc, &filler, "shorts", 'S', JackDriverParamBool, &value, NULL, "Try 16-bit samples before 32-bit", NULL);

value.ui = 0;
jack_driver_descriptor_add_parameter(desc, &filler, "input-latency", 'I', JackDriverParamUInt, &value, NULL, "Extra input latency (frames)", NULL);
jack_driver_descriptor_add_parameter(desc, &filler, "output-latency", 'O', JackDriverParamUInt, &value, NULL, "Extra output latency (frames)", NULL);

strcpy(value.str, "none");
jack_driver_descriptor_add_parameter(
desc,
&filler,
"midi-driver",
'X',
JackDriverParamString,
&value,
get_midi_driver_constraint(),
"ALSA device name",
"ALSA MIDI driver:\n"
" none - no MIDI driver\n"
" seq - ALSA Sequencer driver\n"
" raw - ALSA RawMIDI driver\n");

return desc;
}



+ 5
- 13
linux/alsarawmidi/JackALSARawMidiDriver.cpp View File

@@ -630,19 +630,11 @@ extern "C" {
SERVER_EXPORT jack_driver_desc_t *
driver_get_descriptor()
{
jack_driver_desc_t *desc =
(jack_driver_desc_t *) malloc(sizeof(jack_driver_desc_t));
if (desc) {
strcpy(desc->desc, "Alternative ALSA raw MIDI backend.");
strcpy(desc->name, "alsarawmidi");

// X: There could be parameters here regarding setting I/O buffer
// sizes. I don't think MIDI drivers can accept parameters right
// now without being set as the main driver.
desc->nparams = 0;
desc->params = 0;
}
return desc;
// X: There could be parameters here regarding setting I/O buffer
// sizes. I don't think MIDI drivers can accept parameters right
// now without being set as the main driver.

return jack_driver_descriptor_construct("alsarawmidi", "Alternative ALSA raw MIDI backend.", NULL);
}

SERVER_EXPORT Jack::JackDriverClientInterface *


+ 46
- 116
linux/firewire/JackFFADODriver.cpp View File

@@ -751,122 +751,52 @@ extern "C"
SERVER_EXPORT const jack_driver_desc_t *
driver_get_descriptor () {
jack_driver_desc_t * desc;
jack_driver_param_desc_t * params;
unsigned int i;

desc = (jack_driver_desc_t *)calloc (1, sizeof (jack_driver_desc_t));

strcpy (desc->name, "firewire"); // size MUST be less then JACK_DRIVER_NAME_MAX + 1
strcpy(desc->desc, "Linux FFADO API based audio backend"); // size MUST be less then JACK_DRIVER_PARAM_DESC + 1

desc->nparams = 13;

params = (jack_driver_param_desc_t *)calloc (desc->nparams, sizeof (jack_driver_param_desc_t));
desc->params = params;

i = 0;
strcpy (params[i].name, "device");
params[i].character = 'd';
params[i].type = JackDriverParamString;
strcpy (params[i].value.str, "hw:0");
strcpy (params[i].short_desc, "The FireWire device to use.");
strcpy (params[i].long_desc, "The FireWire device to use. Please consult the FFADO documentation for more info.");

i++;
strcpy (params[i].name, "period");
params[i].character = 'p';
params[i].type = JackDriverParamUInt;
params[i].value.ui = 1024;
strcpy (params[i].short_desc, "Frames per period");
strcpy (params[i].long_desc, params[i].short_desc);

i++;
strcpy (params[i].name, "nperiods");
params[i].character = 'n';
params[i].type = JackDriverParamUInt;
params[i].value.ui = 3;
strcpy (params[i].short_desc, "Number of periods of playback latency");
strcpy (params[i].long_desc, params[i].short_desc);

i++;
strcpy (params[i].name, "rate");
params[i].character = 'r';
params[i].type = JackDriverParamUInt;
params[i].value.ui = 48000U;
strcpy (params[i].short_desc, "Sample rate");
strcpy (params[i].long_desc, params[i].short_desc);

i++;
strcpy (params[i].name, "capture");
params[i].character = 'C';
params[i].type = JackDriverParamBool;
params[i].value.i = 0;
strcpy (params[i].short_desc, "Provide capture ports.");
strcpy (params[i].long_desc, params[i].short_desc);

i++;
strcpy (params[i].name, "playback");
params[i].character = 'P';
params[i].type = JackDriverParamBool;
params[i].value.i = 0;
strcpy (params[i].short_desc, "Provide playback ports.");
strcpy (params[i].long_desc, params[i].short_desc);

i++;
strcpy (params[i].name, "duplex");
params[i].character = 'D';
params[i].type = JackDriverParamBool;
params[i].value.i = 1;
strcpy (params[i].short_desc, "Provide both capture and playback ports.");
strcpy (params[i].long_desc, params[i].short_desc);

i++;
strcpy (params[i].name, "input-latency");
params[i].character = 'I';
params[i].type = JackDriverParamUInt;
params[i].value.ui = 0;
strcpy (params[i].short_desc, "Extra input latency (frames)");
strcpy (params[i].long_desc, params[i].short_desc);

i++;
strcpy (params[i].name, "output-latency");
params[i].character = 'O';
params[i].type = JackDriverParamUInt;
params[i].value.ui = 0;
strcpy (params[i].short_desc, "Extra output latency (frames)");
strcpy (params[i].long_desc, params[i].short_desc);

i++;
strcpy (params[i].name, "inchannels");
params[i].character = 'i';
params[i].type = JackDriverParamUInt;
params[i].value.ui = 0;
strcpy (params[i].short_desc, "Number of input channels to provide (note: currently ignored)");
strcpy (params[i].long_desc, params[i].short_desc);

i++;
strcpy (params[i].name, "outchannels");
params[i].character = 'o';
params[i].type = JackDriverParamUInt;
params[i].value.ui = 0;
strcpy (params[i].short_desc, "Number of output channels to provide (note: currently ignored)");
strcpy (params[i].long_desc, params[i].short_desc);

i++;
strcpy (params[i].name, "verbose");
params[i].character = 'v';
params[i].type = JackDriverParamUInt;
params[i].value.ui = 3;
strcpy (params[i].short_desc, "libffado verbose level");
strcpy (params[i].long_desc, params[i].short_desc);

i++;
strcpy (params[i].name, "snoop");
params[i].character = 'X';
params[i].type = JackDriverParamBool;
params[i].value.i = 0;
strcpy (params[i].short_desc, "Snoop firewire traffic");
strcpy (params[i].long_desc, params[i].short_desc);
jack_driver_desc_filler_t filler;
jack_driver_param_value_t value;

desc = jack_driver_descriptor_construct("firewire", "Linux FFADO API based audio backend", &filler);

strcpy(value.str, "hw:0");
jack_driver_descriptor_add_parameter(
desc,
&filler,
"device",
'd',
JackDriverParamString,
&value,
NULL,
"The FireWire device to use.",
"The FireWire device to use. Please consult the FFADO documentation for more info.");

value.ui = 1024;
jack_driver_descriptor_add_parameter(desc, &filler, "period", 'p', JackDriverParamUInt, &value, NULL, "Frames per period", NULL);

value.ui = 3;
jack_driver_descriptor_add_parameter(desc, &filler, "nperiods", 'n', JackDriverParamUInt, &value, NULL, "Number of periods of playback latency", NULL);

value.ui = 48000U;
jack_driver_descriptor_add_parameter(desc, &filler, "rate", 'r', JackDriverParamUInt, &value, NULL, "Sample rate", NULL);

value.i = 0;
jack_driver_descriptor_add_parameter(desc, &filler, "capture", 'C', JackDriverParamBool, &value, NULL, "Provide capture ports.", NULL);
jack_driver_descriptor_add_parameter(desc, &filler, "playback", 'P', JackDriverParamBool, &value, NULL, "Provide playback ports.", NULL);

value.i = 1;
jack_driver_descriptor_add_parameter(desc, &filler, "duplex", 'D', JackDriverParamBool, &value, NULL, "Provide both capture and playback ports.", NULL);

value.ui = 0;
jack_driver_descriptor_add_parameter(desc, &filler, "input-latency", 'I', JackDriverParamUInt, &value, NULL, "Extra input latency (frames)", NULL);
jack_driver_descriptor_add_parameter(desc, &filler, "output-latency", 'O', JackDriverParamUInt, &value, NULL, "Extra output latency (frames)", NULL);

value.ui = 0;
jack_driver_descriptor_add_parameter(desc, &filler, "inchannels", 'i', JackDriverParamUInt, &value, NULL, "Number of input channels to provide (note: currently ignored)", NULL);
jack_driver_descriptor_add_parameter(desc, &filler, "outchannels", 'o', JackDriverParamUInt, &value, NULL, "Number of output channels to provide (note: currently ignored)", NULL);

value.ui = 3;
jack_driver_descriptor_add_parameter(desc, &filler, "verbose", 'v', JackDriverParamUInt, &value, NULL, "libffado verbose level", NULL);

value.i = 0;
jack_driver_descriptor_add_parameter(desc, &filler, "snoop", 'X', JackDriverParamBool, &value, NULL, "Snoop firewire traffic", NULL);

return desc;
}


+ 31
- 100
linux/freebob/JackFreebobDriver.cpp View File

@@ -952,106 +952,37 @@ extern "C"
const jack_driver_desc_t *
driver_get_descriptor () {
jack_driver_desc_t * desc;
jack_driver_param_desc_t * params;
unsigned int i;

desc = (jack_driver_desc_t *)calloc (1, sizeof (jack_driver_desc_t));

strcpy (desc->name, "freebob"); // size MUST be less then JACK_DRIVER_NAME_MAX + 1
strcpy(desc->desc, "Linux FreeBob API based audio backend"); // size MUST be less then JACK_DRIVER_PARAM_DESC + 1

desc->nparams = 11;

params = (jack_driver_param_desc_t *)calloc (desc->nparams, sizeof (jack_driver_param_desc_t));
desc->params = params;

i = 0;
strcpy (params[i].name, "device");
params[i].character = 'd';
params[i].type = JackDriverParamString;
strcpy (params[i].value.str, "hw:0");
strcpy (params[i].short_desc, "The FireWire device to use. Format is: 'hw:port[,node]'.");
strcpy (params[i].long_desc, params[i].short_desc);

i++;
strcpy (params[i].name, "period");
params[i].character = 'p';
params[i].type = JackDriverParamUInt;
params[i].value.ui = 1024;
strcpy (params[i].short_desc, "Frames per period");
strcpy (params[i].long_desc, params[i].short_desc);

i++;
strcpy (params[i].name, "nperiods");
params[i].character = 'n';
params[i].type = JackDriverParamUInt;
params[i].value.ui = 3;
strcpy (params[i].short_desc, "Number of periods of playback latency");
strcpy (params[i].long_desc, params[i].short_desc);

i++;
strcpy (params[i].name, "rate");
params[i].character = 'r';
params[i].type = JackDriverParamUInt;
params[i].value.ui = 48000U;
strcpy (params[i].short_desc, "Sample rate");
strcpy (params[i].long_desc, params[i].short_desc);

i++;
strcpy (params[i].name, "capture");
params[i].character = 'C';
params[i].type = JackDriverParamBool;
params[i].value.i = 0;
strcpy (params[i].short_desc, "Provide capture ports.");
strcpy (params[i].long_desc, params[i].short_desc);

i++;
strcpy (params[i].name, "playback");
params[i].character = 'P';
params[i].type = JackDriverParamBool;
params[i].value.i = 0;
strcpy (params[i].short_desc, "Provide playback ports.");
strcpy (params[i].long_desc, params[i].short_desc);

i++;
strcpy (params[i].name, "duplex");
params[i].character = 'D';
params[i].type = JackDriverParamBool;
params[i].value.i = 1;
strcpy (params[i].short_desc, "Provide both capture and playback ports.");
strcpy (params[i].long_desc, params[i].short_desc);

i++;
strcpy (params[i].name, "input-latency");
params[i].character = 'I';
params[i].type = JackDriverParamUInt;
params[i].value.ui = 0;
strcpy (params[i].short_desc, "Extra input latency (frames)");
strcpy (params[i].long_desc, params[i].short_desc);

i++;
strcpy (params[i].name, "output-latency");
params[i].character = 'O';
params[i].type = JackDriverParamUInt;
params[i].value.ui = 0;
strcpy (params[i].short_desc, "Extra output latency (frames)");
strcpy (params[i].long_desc, params[i].short_desc);

i++;
strcpy (params[i].name, "inchannels");
params[i].character = 'i';
params[i].type = JackDriverParamUInt;
params[i].value.ui = 0;
strcpy (params[i].short_desc, "Number of input channels to provide (note: currently ignored)");
strcpy (params[i].long_desc, params[i].short_desc);

i++;
strcpy (params[i].name, "outchannels");
params[i].character = 'o';
params[i].type = JackDriverParamUInt;
params[i].value.ui = 0;
strcpy (params[i].short_desc, "Number of output channels to provide (note: currently ignored)");
strcpy (params[i].long_desc, params[i].short_desc);
jack_driver_desc_filler_t filler;
jack_driver_param_value_t value;

desc = jack_driver_descriptor_construct("freebob", "Linux FreeBob API based audio backend", &filler);

strcpy(value.str, "hw:0");
jack_driver_descriptor_add_parameter(desc, &filler, "device", 'd', JackDriverParamString, &value, NULL, "The FireWire device to use. Format is: 'hw:port[,node]'.", NULL);

value.ui = 1024;
jack_driver_descriptor_add_parameter(desc, &filler, "period", 'p', JackDriverParamUInt, &value, NULL, "Frames per period", NULL);

value.ui = 3;
jack_driver_descriptor_add_parameter(desc, &filler, "nperiods", 'n', JackDriverParamUInt, &value, NULL, "Number of periods of playback latency", NULL);

value.ui = 48000U;
jack_driver_descriptor_add_parameter(desc, &filler, "rate", 'r', JackDriverParamUInt, &value, NULL, "Sample rate", NULL);

value.i = 0;
jack_driver_descriptor_add_parameter(desc, &filler, "capture", 'C', JackDriverParamBool, &value, NULL, "Provide capture ports.", NULL);
jack_driver_descriptor_add_parameter(desc, &filler, "playback", 'P', JackDriverParamBool, &value, NULL, "Provide playback ports.", NULL);

value.i = 1;
jack_driver_descriptor_add_parameter(desc, &filler, "duplex", 'D', JackDriverParamBool, &value, NULL, "Provide both capture and playback ports.", NULL);

value.ui = 0;
jack_driver_descriptor_add_parameter(desc, &filler, "input-latency", 'I', JackDriverParamUInt, &value, NULL, "Extra input latency (frames)", NULL);
jack_driver_descriptor_add_parameter(desc, &filler, "output-latency", 'O', JackDriverParamUInt, &value, NULL, "Extra output latency (frames)", NULL);

value.ui = 0;
jack_driver_descriptor_add_parameter(desc, &filler, "inchannels", 'i', JackDriverParamUInt, &value, NULL, "Number of input channels to provide (note: currently ignored)", NULL);
jack_driver_descriptor_add_parameter(desc, &filler, "outchannels", 'o', JackDriverParamUInt, &value, NULL, "Number of output channels to provide (note: currently ignored)", NULL);

return desc;
}


+ 38
- 110
macosx/coreaudio/JackCoreAudioAdapter.cpp View File

@@ -1497,116 +1497,44 @@ extern "C"

SERVER_EXPORT jack_driver_desc_t* jack_get_descriptor()
{
jack_driver_desc_t *desc;
unsigned int i;
desc = (jack_driver_desc_t*)calloc(1, sizeof(jack_driver_desc_t));

strcpy(desc->name, "audioadapter"); // size MUST be less then JACK_DRIVER_NAME_MAX + 1
strcpy(desc->desc, "netjack audio <==> net backend adapter"); // size MUST be less then JACK_DRIVER_PARAM_DESC + 1

desc->nparams = 13;
desc->params = (jack_driver_param_desc_t*)calloc(desc->nparams, sizeof(jack_driver_param_desc_t));

i = 0;
strcpy(desc->params[i].name, "channels");
desc->params[i].character = 'c';
desc->params[i].type = JackDriverParamInt;
desc->params[i].value.i = -1;
strcpy(desc->params[i].short_desc, "Maximum number of channels");
strcpy(desc->params[i].long_desc, "Maximum number of channels. If -1, max possible number of channels will be used");

i++;
strcpy(desc->params[i].name, "inchannels");
desc->params[i].character = 'i';
desc->params[i].type = JackDriverParamInt;
desc->params[i].value.i = -1;
strcpy(desc->params[i].short_desc, "Maximum number of input channels");
strcpy(desc->params[i].long_desc, "Maximum number of input channels. If -1, max possible number of input channels will be used");

i++;
strcpy(desc->params[i].name, "outchannels");
desc->params[i].character = 'o';
desc->params[i].type = JackDriverParamInt;
desc->params[i].value.i = -1;
strcpy(desc->params[i].short_desc, "Maximum number of output channels");
strcpy(desc->params[i].long_desc, "Maximum number of output channels. If -1, max possible number of output channels will be used");

i++;
strcpy(desc->params[i].name, "capture");
desc->params[i].character = 'C';
desc->params[i].type = JackDriverParamString;
strcpy(desc->params[i].short_desc, "Input CoreAudio device name");
strcpy(desc->params[i].long_desc, desc->params[i].short_desc);

i++;
strcpy(desc->params[i].name, "playback");
desc->params[i].character = 'P';
desc->params[i].type = JackDriverParamString;
strcpy(desc->params[i].short_desc, "Output CoreAudio device name");
strcpy(desc->params[i].long_desc, desc->params[i].short_desc);

i++;
strcpy(desc->params[i].name, "rate");
desc->params[i].character = 'r';
desc->params[i].type = JackDriverParamUInt;
desc->params[i].value.ui = 44100U;
strcpy(desc->params[i].short_desc, "Sample rate");
strcpy(desc->params[i].long_desc, desc->params[i].short_desc);

i++;
strcpy(desc->params[i].name, "period");
desc->params[i].character = 'p';
desc->params[i].type = JackDriverParamUInt;
desc->params[i].value.ui = 512U;
strcpy(desc->params[i].short_desc, "Frames per period");
strcpy(desc->params[i].long_desc, desc->params[i].short_desc);

i++;
strcpy(desc->params[i].name, "duplex");
desc->params[i].character = 'D';
desc->params[i].type = JackDriverParamBool;
desc->params[i].value.i = TRUE;
strcpy(desc->params[i].short_desc, "Provide both capture and playback ports");
strcpy(desc->params[i].long_desc, desc->params[i].short_desc);

i++;
strcpy(desc->params[i].name, "device");
desc->params[i].character = 'd';
desc->params[i].type = JackDriverParamString;
strcpy(desc->params[i].short_desc, "CoreAudio device name");
strcpy(desc->params[i].long_desc, desc->params[i].short_desc);

i++;
strcpy(desc->params[i].name, "list-devices");
desc->params[i].character = 'l';
desc->params[i].type = JackDriverParamBool;
desc->params[i].value.i = TRUE;
strcpy(desc->params[i].short_desc, "Display available CoreAudio devices");
strcpy(desc->params[i].long_desc, desc->params[i].short_desc);

i++;
strcpy(desc->params[i].name, "quality");
desc->params[i].character = 'q';
desc->params[i].type = JackDriverParamInt;
desc->params[i].value.ui = 0;
strcpy(desc->params[i].short_desc, "Resample algorithm quality (0 - 4)");
strcpy(desc->params[i].long_desc, desc->params[i].short_desc);

i++;
strcpy(desc->params[i].name, "ring-buffer");
desc->params[i].character = 'g';
desc->params[i].type = JackDriverParamInt;
desc->params[i].value.ui = 32768;
strcpy(desc->params[i].short_desc, "Fixed ringbuffer size");
strcpy(desc->params[i].long_desc, "Fixed ringbuffer size (if not set => automatic adaptative)");

i++;
strcpy(desc->params[i].name, "clock-drift");
desc->params[i].character = 's';
desc->params[i].type = JackDriverParamBool;
desc->params[i].value.i = FALSE;
strcpy(desc->params[i].short_desc, "Clock drift compensation");
strcpy(desc->params[i].long_desc, "Whether to compensate clock drift in dynamically created aggregate device");
jack_driver_desc_t * desc;
jack_driver_desc_filler_t filler;
jack_driver_param_value_t value;

desc = jack_driver_descriptor_construct("audioadapter", "netjack audio <==> net backend adapter", &filler);

value.i = -1;
jack_driver_descriptor_add_parameter(desc, &filler, "channels", 'c', JackDriverParamInt, &value, NULL, "Maximum number of channels", "Maximum number of channels. If -1, max possible number of channels will be used");
jack_driver_descriptor_add_parameter(desc, &filler, "inchannels", 'i', JackDriverParamInt, &value, NULL, "Maximum number of input channels", "Maximum number of input channels. If -1, max possible number of input channels will be used");
jack_driver_descriptor_add_parameter(desc, &filler, "outchannels", 'o', JackDriverParamInt, &value, NULL, "Maximum number of output channels", "Maximum number of output channels. If -1, max possible number of output channels will be used");

value.str[0] = 0;
jack_driver_descriptor_add_parameter(desc, &filler, "capture", 'C', JackDriverParamString, &value, NULL, "Input CoreAudio device name", NULL);
jack_driver_descriptor_add_parameter(desc, &filler, "playback", 'P', JackDriverParamString, &value, NULL, "Output CoreAudio device name", NULL);

value.ui = 44100U;
jack_driver_descriptor_add_parameter(desc, &filler, "rate", 'r', JackDriverParamUInt, &value, NULL, "Sample rate", NULL);

value.ui = 512U;
jack_driver_descriptor_add_parameter(desc, &filler, "period", 'p', JackDriverParamUInt, &value, NULL, "Frames per period", NULL);

value.i = TRUE;
jack_driver_descriptor_add_parameter(desc, &filler, "duplex", 'D', JackDriverParamBool, &value, NULL, "Provide both capture and playback ports", NULL);

value.str[0] = 0;
jack_driver_descriptor_add_parameter(desc, &filler, "device", 'd', JackDriverParamString, &value, NULL, "CoreAudio device name", NULL);

value.i = TRUE;
jack_driver_descriptor_add_parameter(desc, &filler, "list-devices", 'l', JackDriverParamBool, &value, NULL, "Display available CoreAudio devices", NULL);

value.ui = 0;
jack_driver_descriptor_add_parameter(desc, &filler, "quality", 'q', JackDriverParamInt, &value, NULL, "Resample algorithm quality (0 - 4)", NULL);

value.ui = 32768;
jack_driver_descriptor_add_parameter(desc, &filler, "ring-buffer", 'g', JackDriverParamInt, &value, NULL, "Fixed ringbuffer size", "Fixed ringbuffer size (if not set => automatic adaptative)");

value.i = FALSE;
jack_driver_descriptor_add_parameter(desc, &filler, "clock-drift", 's', JackDriverParamBool, &value, NULL, "Clock drift compensation", "Whether to compensate clock drift in dynamically created aggregate device");

return desc;
}


+ 48
- 142
macosx/coreaudio/JackCoreAudioDriver.cpp View File

@@ -1833,148 +1833,54 @@ extern "C"

SERVER_EXPORT jack_driver_desc_t* driver_get_descriptor()
{
jack_driver_desc_t *desc;
unsigned int i;
desc = (jack_driver_desc_t*)calloc(1, sizeof(jack_driver_desc_t));

strcpy(desc->name, "coreaudio"); // size MUST be less then JACK_DRIVER_NAME_MAX + 1
strcpy(desc->desc, "Apple CoreAudio API based audio backend"); // size MUST be less then JACK_DRIVER_PARAM_DESC + 1

desc->nparams = 17;
desc->params = (jack_driver_param_desc_t*)calloc(desc->nparams, sizeof(jack_driver_param_desc_t));

i = 0;
strcpy(desc->params[i].name, "channels");
desc->params[i].character = 'c';
desc->params[i].type = JackDriverParamInt;
desc->params[i].value.i = -1;
strcpy(desc->params[i].short_desc, "Maximum number of channels");
strcpy(desc->params[i].long_desc, "Maximum number of channels. If -1, max possible number of channels will be used");

i++;
strcpy(desc->params[i].name, "inchannels");
desc->params[i].character = 'i';
desc->params[i].type = JackDriverParamInt;
desc->params[i].value.i = -1;
strcpy(desc->params[i].short_desc, "Maximum number of input channels");
strcpy(desc->params[i].long_desc, "Maximum number of input channels. If -1, max possible number of input channels will be used");

i++;
strcpy(desc->params[i].name, "outchannels");
desc->params[i].character = 'o';
desc->params[i].type = JackDriverParamInt;
desc->params[i].value.i = -1;
strcpy(desc->params[i].short_desc, "Maximum number of output channels");
strcpy(desc->params[i].long_desc, "Maximum number of output channels. If -1, max possible number of output channels will be used");

i++;
strcpy(desc->params[i].name, "capture");
desc->params[i].character = 'C';
desc->params[i].type = JackDriverParamString;
strcpy(desc->params[i].short_desc, "Input CoreAudio device name");
strcpy(desc->params[i].long_desc, desc->params[i].short_desc);

i++;
strcpy(desc->params[i].name, "playback");
desc->params[i].character = 'P';
desc->params[i].type = JackDriverParamString;
strcpy(desc->params[i].short_desc, "Output CoreAudio device name");
strcpy(desc->params[i].long_desc, desc->params[i].short_desc);

i++;
strcpy (desc->params[i].name, "monitor");
desc->params[i].character = 'm';
desc->params[i].type = JackDriverParamBool;
desc->params[i].value.i = 0;
strcpy(desc->params[i].short_desc, "Provide monitor ports for the output");
strcpy(desc->params[i].long_desc, desc->params[i].short_desc);

i++;
strcpy(desc->params[i].name, "duplex");
desc->params[i].character = 'D';
desc->params[i].type = JackDriverParamBool;
desc->params[i].value.i = TRUE;
strcpy(desc->params[i].short_desc, "Provide both capture and playback ports");
strcpy(desc->params[i].long_desc, desc->params[i].short_desc);

i++;
strcpy(desc->params[i].name, "rate");
desc->params[i].character = 'r';
desc->params[i].type = JackDriverParamUInt;
desc->params[i].value.ui = 44100U;
strcpy(desc->params[i].short_desc, "Sample rate");
strcpy(desc->params[i].long_desc, desc->params[i].short_desc);

i++;
strcpy(desc->params[i].name, "period");
desc->params[i].character = 'p';
desc->params[i].type = JackDriverParamUInt;
desc->params[i].value.ui = 128U;
strcpy(desc->params[i].short_desc, "Frames per period");
strcpy(desc->params[i].long_desc, desc->params[i].short_desc);

i++;
strcpy(desc->params[i].name, "device");
desc->params[i].character = 'd';
desc->params[i].type = JackDriverParamString;
strcpy(desc->params[i].short_desc, "CoreAudio device name");
strcpy(desc->params[i].long_desc, desc->params[i].short_desc);

i++;
strcpy(desc->params[i].name, "input-latency");
desc->params[i].character = 'I';
desc->params[i].type = JackDriverParamUInt;
desc->params[i].value.ui = 0;
strcpy(desc->params[i].short_desc, "Extra input latency (frames)");
strcpy(desc->params[i].long_desc, desc->params[i].short_desc);

i++;
strcpy(desc->params[i].name, "output-latency");
desc->params[i].character = 'O';
desc->params[i].type = JackDriverParamUInt;
desc->params[i].value.ui = 0;
strcpy(desc->params[i].short_desc, "Extra output latency (frames)");
strcpy(desc->params[i].long_desc, desc->params[i].short_desc);

i++;
strcpy(desc->params[i].name, "list-devices");
desc->params[i].character = 'l';
desc->params[i].type = JackDriverParamBool;
desc->params[i].value.i = FALSE;
strcpy(desc->params[i].short_desc, "Display available CoreAudio devices");
strcpy(desc->params[i].long_desc, desc->params[i].short_desc);

i++;
strcpy(desc->params[i].name, "hog");
desc->params[i].character = 'H';
desc->params[i].type = JackDriverParamBool;
desc->params[i].value.i = FALSE;
strcpy(desc->params[i].short_desc, "Take exclusive access of the audio device");
strcpy(desc->params[i].long_desc, desc->params[i].short_desc);

i++;
strcpy(desc->params[i].name, "async-latency");
desc->params[i].character = 'L';
desc->params[i].type = JackDriverParamUInt;
desc->params[i].value.ui = 100;
strcpy(desc->params[i].short_desc, "Extra output latency in asynchronous mode (percent)");
strcpy(desc->params[i].long_desc, desc->params[i].short_desc);

i++;
strcpy(desc->params[i].name, "grain");
desc->params[i].character = 'G';
desc->params[i].type = JackDriverParamUInt;
desc->params[i].value.ui = 100;
strcpy(desc->params[i].short_desc, "Computation grain in RT thread (percent)");
strcpy(desc->params[i].long_desc, desc->params[i].short_desc);

i++;
strcpy(desc->params[i].name, "clock-drift");
desc->params[i].character = 's';
desc->params[i].type = JackDriverParamBool;
desc->params[i].value.i = FALSE;
strcpy(desc->params[i].short_desc, "Clock drift compensation");
strcpy(desc->params[i].long_desc, "Whether to compensate clock drift in dynamically created aggregate device");
jack_driver_desc_t * desc;
jack_driver_desc_filler_t filler;
jack_driver_param_value_t value;

desc = jack_driver_descriptor_construct("coreaudio", "Apple CoreAudio API based audio backend", &filler);

value.i = -1;
jack_driver_descriptor_add_parameter(desc, &filler, "channels", 'c', JackDriverParamInt, &value, NULL, "Maximum number of channels", "Maximum number of channels. If -1, max possible number of channels will be used");
jack_driver_descriptor_add_parameter(desc, &filler, "inchannels", 'i', JackDriverParamInt, &value, NULL, "Maximum number of input channels", "Maximum number of input channels. If -1, max possible number of input channels will be used");
jack_driver_descriptor_add_parameter(desc, &filler, "outchannels", 'o', JackDriverParamInt, &value, NULL, "Maximum number of output channels", "Maximum number of output channels. If -1, max possible number of output channels will be used");

value.str[0] = 0;
jack_driver_descriptor_add_parameter(desc, &filler, "capture", 'C', JackDriverParamString, &value, NULL, "Input CoreAudio device name", NULL);
jack_driver_descriptor_add_parameter(desc, &filler, "playback", 'P', JackDriverParamString, &value, NULL, "Output CoreAudio device name", NULL);

value.i = 0;
jack_driver_descriptor_add_parameter(desc, &filler, "monitor", 'm', JackDriverParamBool, &value, NULL, "Provide monitor ports for the output", NULL);

value.i = TRUE;
jack_driver_descriptor_add_parameter(desc, &filler, "duplex", 'D', JackDriverParamBool, &value, NULL, "Provide both capture and playback ports", NULL);

value.ui = 44100U;
jack_driver_descriptor_add_parameter(desc, &filler, "rate", 'r', JackDriverParamUInt, &value, NULL, "Sample rate", NULL);

value.ui = 128U;
jack_driver_descriptor_add_parameter(desc, &filler, "period", 'p', JackDriverParamUInt, &value, NULL, "Frames per period", NULL);

value.str[0] = 0;
jack_driver_descriptor_add_parameter(desc, &filler, "device", 'd', JackDriverParamString, &value, NULL, "CoreAudio device name", NULL);

value.ui = 0;
jack_driver_descriptor_add_parameter(desc, &filler, "input-latency", 'I', JackDriverParamUInt, &value, NULL, "Extra input latency (frames)", NULL);
jack_driver_descriptor_add_parameter(desc, &filler, "output-latency", 'O', JackDriverParamUInt, &value, NULL, "Extra output latency (frames)", NULL);

value.i = FALSE;
jack_driver_descriptor_add_parameter(desc, &filler, "list-devices", 'l', JackDriverParamBool, &value, NULL, "Display available CoreAudio devices", NULL);

value.i = FALSE;
jack_driver_descriptor_add_parameter(desc, &filler, "hog", 'H', JackDriverParamBool, &value, NULL, "Take exclusive access of the audio device", NULL);

value.ui = 100;
jack_driver_descriptor_add_parameter(desc, &filler, "async-latency", 'L', JackDriverParamUInt, &value, NULL, "Extra output latency in asynchronous mode (percent)", NULL);

value.ui = 100;
jack_driver_descriptor_add_parameter(desc, &filler, "grain", 'G', JackDriverParamUInt, &value, NULL, "Computation grain in RT thread (percent)", NULL);

value.i = FALSE;
jack_driver_descriptor_add_parameter(desc, &filler, "clock-drift", 's', JackDriverParamBool, &value, NULL, "Clock drift compensation", "Whether to compensate clock drift in dynamically created aggregate device");

return desc;
}


+ 8
- 24
macosx/coremidi/JackCoreMidiDriver.cpp View File

@@ -637,30 +637,14 @@ extern "C" {
SERVER_EXPORT jack_driver_desc_t * driver_get_descriptor()
{
jack_driver_desc_t * desc;
unsigned int i;

desc = (jack_driver_desc_t*)calloc (1, sizeof (jack_driver_desc_t));
strcpy(desc->name, "coremidi"); // size MUST be less then JACK_DRIVER_NAME_MAX + 1
strcpy(desc->desc, "Apple CoreMIDI API based MIDI backend"); // size MUST be less then JACK_DRIVER_PARAM_DESC + 1

desc->nparams = 2;
desc->params = (jack_driver_param_desc_t*)calloc (desc->nparams, sizeof (jack_driver_param_desc_t));

i = 0;
strcpy(desc->params[i].name, "inchannels");
desc->params[i].character = 'i';
desc->params[i].type = JackDriverParamUInt;
desc->params[i].value.ui = 0;
strcpy(desc->params[i].short_desc, "CoreMIDI virtual bus");
strcpy(desc->params[i].long_desc, desc->params[i].short_desc);