Commit 4e0a70b5 authored by sletz's avatar sletz
Browse files

Enable explicit channel mapping in CoreAudio driver.

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@4515 0c269be4-1314-0410-8aa9-9f06e86f4224
parent 840b47f8
......@@ -35,6 +35,10 @@ Chris Caudle
Jackdmp changes log
---------------------------
2011-07-29 Stephane Letz <letz@grame.fr>
* Enable explicit channel mapping in CoreAudio driver.
2011-07-25 Stephane Letz <letz@grame.fr>
* NetJack2: no more timeout, correct JackWaitThreadedDriver::Execute.
......
......@@ -173,10 +173,10 @@ jack_parse_driver_params(jack_driver_desc_t * desc, int argc, char* argv[], JSLi
if (optarg) {
switch (desc->params[param_index].type) {
case JackDriverParamInt:
driver_param->value.i = atoi (optarg);
driver_param->value.i = atoi(optarg);
break;
case JackDriverParamUInt:
driver_param->value.ui = strtoul (optarg, NULL, 10);
driver_param->value.ui = strtoul(optarg, NULL, 10);
break;
case JackDriverParamChar:
driver_param->value.c = optarg[0];
......@@ -185,20 +185,11 @@ jack_parse_driver_params(jack_driver_desc_t * desc, int argc, char* argv[], JSLi
strncpy (driver_param->value.str, optarg, JACK_DRIVER_PARAM_STRING_MAX);
break;
case JackDriverParamBool:
/*
if (strcasecmp ("false", optarg) == 0 ||
strcasecmp ("off", optarg) == 0 ||
strcasecmp ("no", optarg) == 0 ||
strcasecmp ("0", optarg) == 0 ||
strcasecmp ("(null)", optarg) == 0 ) {
*/
// steph
if (strcmp ("false", optarg) == 0 ||
strcmp ("off", optarg) == 0 ||
strcmp ("no", optarg) == 0 ||
strcmp ("0", optarg) == 0 ||
strcmp ("(null)", optarg) == 0 ) {
if (strcasecmp("false", optarg) == 0 ||
strcasecmp("off", optarg) == 0 ||
strcasecmp("no", optarg) == 0 ||
strcasecmp("0", optarg) == 0 ||
strcasecmp("(null)", optarg) == 0 ) {
driver_param->value.i = false;
} else {
......@@ -317,11 +308,11 @@ jackctl_parse_driver_params(jackctl_driver *driver_ptr, int argc, char* argv[])
if (optarg) {
switch (jackctl_parameter_get_type(param)) {
case JackDriverParamInt:
value.i = atoi (optarg);
value.i = atoi(optarg);
jackctl_parameter_set_value(param, &value);
break;
case JackDriverParamUInt:
value.ui = strtoul (optarg, NULL, 10);
value.ui = strtoul(optarg, NULL, 10);
jackctl_parameter_set_value(param, &value);
break;
case JackDriverParamChar:
......@@ -329,23 +320,15 @@ jackctl_parse_driver_params(jackctl_driver *driver_ptr, int argc, char* argv[])
jackctl_parameter_set_value(param, &value);
break;
case JackDriverParamString:
strncpy (value.str, optarg, JACK_DRIVER_PARAM_STRING_MAX);
strncpy(value.str, optarg, JACK_DRIVER_PARAM_STRING_MAX);
jackctl_parameter_set_value(param, &value);
break;
case JackDriverParamBool:
/*
if (strcasecmp ("false", optarg) == 0 ||
strcasecmp ("off", optarg) == 0 ||
strcasecmp ("no", optarg) == 0 ||
strcasecmp ("0", optarg) == 0 ||
strcasecmp ("(null)", optarg) == 0 ) {
*/
// steph
if (strcmp ("false", optarg) == 0 ||
strcmp ("off", optarg) == 0 ||
strcmp ("no", optarg) == 0 ||
strcmp ("0", optarg) == 0 ||
strcmp ("(null)", optarg) == 0 ) {
if (strcasecmp("false", optarg) == 0 ||
strcasecmp("off", optarg) == 0 ||
strcasecmp("no", optarg) == 0 ||
strcasecmp("0", optarg) == 0 ||
strcasecmp("(null)", optarg) == 0 ) {
value.i = false;
} else {
value.i = true;
......
......@@ -28,18 +28,18 @@ extern "C"
#include <jack/systemdeps.h>
#include <jack/types.h>
#define DEFAULT_MULTICAST_IP "225.3.19.154"
#define DEFAULT_PORT 19000
#define DEFAULT_MTU 1500
#define MASTER_NAME_SIZE 256
#define DEFAULT_MULTICAST_IP "225.3.19.154"
#define DEFAULT_PORT 19000
#define DEFAULT_MTU 1500
#define MASTER_NAME_SIZE 256
#define SOCKET_ERROR -1
enum JackNetEncoder {
JackFloatEncoder = 0, // Samples are transmitted as float
JackIntEncoder = 1, // Samples are transmitted as 16 bits integer
JackCeltEncoder = 2, // Samples are transmitted using CELT codec (http://www.celt-codec.org/)
JackFloatEncoder = 0, // samples are transmitted as float
JackIntEncoder = 1, // samples are transmitted as 16 bits integer
JackCeltEncoder = 2, // samples are transmitted using CELT codec (http://www.celt-codec.org/)
};
typedef struct {
......@@ -50,7 +50,7 @@ typedef struct {
int midi_output; // to master or from slave (-1 for get master MIDI physical inputs)
int mtu; // network Maximum Transmission Unit
int time_out; // in second, -1 means in infinite
int encoder; // Encoder type (one of JackNetEncoder)
int encoder; // encoder type (one of JackNetEncoder)
int kbps; // KB per second for CELT encoder
int latency; // network latency
......@@ -104,7 +104,7 @@ int jack_net_slave_close(jack_net_slave_t* net);
* @param audio_output_buffer an array of audio output buffers (to master)
* @param midi_output number of MIDI outputs
* @param midi_output_buffer an array of MIDI output buffers (to master)
* @param arg pointer to a client supplied structure supplied by jack_set_net_process_callback().
* @param arg pointer to a client supplied structure supplied by jack_set_net_process_callback()
*
* @return zero on success, non-zero on error
*/
......@@ -148,7 +148,7 @@ int jack_net_slave_deactivate(jack_net_slave_t* net);
/**
* Prototype for BufferSize callback.
* @param nframes buffer size
* @param arg pointer to a client supplied structure supplied by jack_set_net_buffer_size_callback().
* @param arg pointer to a client supplied structure supplied by jack_set_net_buffer_size_callback()
*
* @return zero on success, non-zero on error
*/
......@@ -157,7 +157,7 @@ typedef int (*JackNetSlaveBufferSizeCallback)(jack_nframes_t nframes, void *arg)
/**
* Prototype for SampleRate callback.
* @param nframes sample rate
* @param arg pointer to a client supplied structure supplied by jack_set_net_sample_rate_callback().
* @param arg pointer to a client supplied structure supplied by jack_set_net_sample_rate_callback()
*
* @return zero on success, non-zero on error
*/
......@@ -185,7 +185,7 @@ int jack_set_net_slave_sample_rate_callback(jack_net_slave_t *net, JackNetSlaveS
/**
* Prototype for server Shutdown callback (if not set, the client will just restart, waiting for an available master again).
* @param arg pointer to a client supplied structure supplied by jack_set_net_shutdown_callback().
* @param arg pointer to a client supplied structure supplied by jack_set_net_shutdown_callback()
*/
typedef void (*JackNetSlaveShutdownCallback)(void* data);
......@@ -200,8 +200,7 @@ typedef void (*JackNetSlaveShutdownCallback)(void* data);
int jack_set_net_slave_shutdown_callback(jack_net_slave_t *net, JackNetSlaveShutdownCallback shutdown_callback, void *arg);
/**
* jack_net_master_t is an opaque type.
* You may only access it using the API provided.
* jack_net_master_t is an opaque type, you may only access it using the API provided.
*/
typedef struct _jack_net_master jack_net_master_t;
......@@ -237,7 +236,7 @@ int jack_net_master_close(jack_net_master_t* net);
int jack_net_master_recv(jack_net_master_t* net, int audio_input, float** audio_input_buffer, int midi_input, void** midi_input_buffer);
/**
* Send sync and data to the network
* Send sync and data to the network.
* @param net the network connection
* @param audio_output number of audio outputs
* @param audio_output_buffer an array of audio output buffers
......@@ -251,8 +250,7 @@ int jack_net_master_send(jack_net_master_t* net, int audio_output, float** audio
// Experimental Adapter API
/**
* jack_adapter_t is an opaque type. You may only access it using the
* API provided.
* jack_adapter_t is an opaque type, you may only access it using the API provided.
*/
typedef struct _jack_adapter jack_adapter_t;
......@@ -290,7 +288,7 @@ int jack_destroy_adapter(jack_adapter_t* adapter);
void jack_flush_adapter(jack_adapter_t* adapter);
/**
* Push input to and pull output from adapter ringbuffer
* Push input to and pull output from adapter ringbuffer.
* @param adapter the adapter
* @param input an array of audio input buffers
* @param output an array of audio ouput buffers
......@@ -301,7 +299,7 @@ void jack_flush_adapter(jack_adapter_t* adapter);
int jack_adapter_push_and_pull(jack_adapter_t* adapter, float** input, float** output, unsigned int frames);
/**
* Pull input to and push output from adapter ringbuffer
* Pull input to and push output from adapter ringbuffer.
* @param adapter the adapter
* @param input an array of audio input buffers
* @param output an array of audio ouput buffers
......
......@@ -130,7 +130,7 @@ main (int argc, char *argv[])
return 1;
}
printf("Slave is found and running...\n");
printf("Master is found and running...\n");
jack_set_net_slave_process_callback(net, net_process, NULL);
jack_set_net_slave_shutdown_callback(net, net_shutdown, NULL);
......
This diff is collapsed.
......@@ -141,6 +141,8 @@ class JackCoreAudioDriver : public JackAudioDriver
int outchannels,
int in_nChannels,
int out_nChannels,
const vector<int>& chan_in_list,
const vector<int>& chan_out_list,
jack_nframes_t nframes,
jack_nframes_t samplerate);
void CloseAUHAL();
......@@ -153,6 +155,8 @@ class JackCoreAudioDriver : public JackAudioDriver
void UpdateLatencies();
void ParseChannelList(const string& list, vector<int>& result);
public:
JackCoreAudioDriver(const char* name, const char* alias, JackLockedEngine* engine, JackSynchro* table);
......@@ -162,8 +166,10 @@ class JackCoreAudioDriver : public JackAudioDriver
jack_nframes_t samplerate,
bool capturing,
bool playing,
int chan_in,
int chan_out,
int inchannels,
int outchannels,
const char* chan_in_list,
const char* chan_out_list,
bool monitor,
const char* capture_driver_name,
const char* playback_driver_name,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment