|
|
|
|
|
|
|
|
static int pulse_running; |
|
|
static int pulse_running; |
|
|
|
|
|
|
|
|
// wave.cpp (this file) |
|
|
// wave.cpp (this file) |
|
|
void *wave_port_open(int); |
|
|
|
|
|
|
|
|
void *wave_port_open(int, const char *); |
|
|
size_t wave_port_write(void *theHandler, char *theMono16BitsWaveBuffer, size_t theSize); |
|
|
size_t wave_port_write(void *theHandler, char *theMono16BitsWaveBuffer, size_t theSize); |
|
|
int wave_port_close(void *theHandler); |
|
|
int wave_port_close(void *theHandler); |
|
|
int wave_port_is_busy(void *theHandler); |
|
|
int wave_port_is_busy(void *theHandler); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// wave_pulse.cpp |
|
|
// wave_pulse.cpp |
|
|
int is_pulse_running(); |
|
|
int is_pulse_running(); |
|
|
void *wave_pulse_open(int); |
|
|
|
|
|
|
|
|
void *wave_pulse_open(int, const char *); |
|
|
size_t wave_pulse_write(void *theHandler, char *theMono16BitsWaveBuffer, size_t theSize); |
|
|
size_t wave_pulse_write(void *theHandler, char *theMono16BitsWaveBuffer, size_t theSize); |
|
|
int wave_pulse_close(void *theHandler); |
|
|
int wave_pulse_close(void *theHandler); |
|
|
int wave_pulse_is_busy(void *theHandler); |
|
|
int wave_pulse_is_busy(void *theHandler); |
|
|
|
|
|
|
|
|
int wave_pulse_get_remaining_time(uint32_t sample, uint32_t *time); |
|
|
int wave_pulse_get_remaining_time(uint32_t sample, uint32_t *time); |
|
|
|
|
|
|
|
|
// wrappers |
|
|
// wrappers |
|
|
void *wave_open(int srate) |
|
|
|
|
|
|
|
|
void *wave_open(int srate, const char *device) |
|
|
{ |
|
|
{ |
|
|
if (pulse_running) |
|
|
if (pulse_running) |
|
|
return wave_pulse_open(srate); |
|
|
|
|
|
|
|
|
return wave_pulse_open(srate, device); |
|
|
else |
|
|
else |
|
|
return wave_port_open(srate); |
|
|
|
|
|
|
|
|
return wave_port_open(srate, device); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
size_t wave_write(void *theHandler, char *theMono16BitsWaveBuffer, size_t theSize) |
|
|
size_t wave_write(void *theHandler, char *theMono16BitsWaveBuffer, size_t theSize) |
|
|
|
|
|
|
|
|
my_callback_is_output_enabled = cb; |
|
|
my_callback_is_output_enabled = cb; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void *wave_open(int srate) |
|
|
|
|
|
|
|
|
void *wave_open(int srate, const char *device) |
|
|
{ |
|
|
{ |
|
|
|
|
|
(void)device; // unused |
|
|
|
|
|
|
|
|
PaError err; |
|
|
PaError err; |
|
|
|
|
|
|
|
|
pa_stream = NULL; |
|
|
pa_stream = NULL; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#else |
|
|
#else |
|
|
|
|
|
|
|
|
void *wave_open(int srate) |
|
|
|
|
|
|
|
|
void *wave_open(int srate, const char *device) |
|
|
{ |
|
|
{ |
|
|
(void)srate; // unused |
|
|
(void)srate; // unused |
|
|
|
|
|
(void)device; // unused |
|
|
|
|
|
|
|
|
return (void *)1; |
|
|
return (void *)1; |
|
|
} |
|
|
} |