simpleaudio: generalize r/w buf pointer types

This commit is contained in:
Kamal Mostafa 2012-08-12 14:39:23 -07:00
parent 4d326a8c82
commit a65a20d274
6 changed files with 12 additions and 12 deletions

View File

@ -39,7 +39,7 @@
static ssize_t
sa_alsa_read( simpleaudio *sa, float *buf, size_t nframes )
sa_alsa_read( simpleaudio *sa, void *buf, size_t nframes )
{
ssize_t frames_read = 0;
snd_pcm_t *pcm = (snd_pcm_t *)sa->backend_handle;
@ -65,7 +65,7 @@ sa_alsa_read( simpleaudio *sa, float *buf, size_t nframes )
static ssize_t
sa_alsa_write( simpleaudio *sa, float *buf, size_t nframes )
sa_alsa_write( simpleaudio *sa, void *buf, size_t nframes )
{
ssize_t frames_written = 0;
snd_pcm_t *pcm = (snd_pcm_t *)sa->backend_handle;

View File

@ -41,7 +41,7 @@
static ssize_t
sa_pulse_read( simpleaudio *sa, float *buf, size_t nframes )
sa_pulse_read( simpleaudio *sa, void *buf, size_t nframes )
{
int error;
pa_simple *s = (pa_simple *)sa->backend_handle;
@ -57,7 +57,7 @@ sa_pulse_read( simpleaudio *sa, float *buf, size_t nframes )
static ssize_t
sa_pulse_write( simpleaudio *sa, float *buf, size_t nframes )
sa_pulse_write( simpleaudio *sa, void *buf, size_t nframes )
{
int error;
pa_simple *s = (pa_simple *)sa->backend_handle;

View File

@ -40,7 +40,7 @@
static ssize_t
sa_sndfile_read( simpleaudio *sa, float *buf, size_t nframes )
sa_sndfile_read( simpleaudio *sa, void *buf, size_t nframes )
{
SNDFILE *s = (SNDFILE *)sa->backend_handle;
int n;
@ -55,7 +55,7 @@ sa_sndfile_read( simpleaudio *sa, float *buf, size_t nframes )
static ssize_t
sa_sndfile_write( simpleaudio *sa, float *buf, size_t nframes )
sa_sndfile_write( simpleaudio *sa, void *buf, size_t nframes )
{
//fprintf(stderr, "sf_writef_float: nframes=%ld\n", nframes);
SNDFILE *s = (SNDFILE *)sa->backend_handle;

View File

@ -144,13 +144,13 @@ simpleaudio_get_samplesize( simpleaudio *sa )
}
ssize_t
simpleaudio_read( simpleaudio *sa, float *buf, size_t nframes )
simpleaudio_read( simpleaudio *sa, void *buf, size_t nframes )
{
return sa->backend->simpleaudio_read(sa, buf, nframes);
}
ssize_t
simpleaudio_write( simpleaudio *sa, float *buf, size_t nframes )
simpleaudio_write( simpleaudio *sa, void *buf, size_t nframes )
{
return sa->backend->simpleaudio_write(sa, buf, nframes);
}

View File

@ -75,10 +75,10 @@ unsigned int
simpleaudio_get_samplesize( simpleaudio *sa );
ssize_t
simpleaudio_read( simpleaudio *sa, float *buf, size_t nframes );
simpleaudio_read( simpleaudio *sa, void *buf, size_t nframes );
ssize_t
simpleaudio_write( simpleaudio *sa, float *buf, size_t nframes );
simpleaudio_write( simpleaudio *sa, void *buf, size_t nframes );
void
simpleaudio_close( simpleaudio *sa );

View File

@ -48,10 +48,10 @@ struct simpleaudio_backend {
char *app_name, char *stream_name );
ssize_t
(*simpleaudio_read)( simpleaudio *sa, float *buf, size_t nframes );
(*simpleaudio_read)( simpleaudio *sa, void *buf, size_t nframes );
ssize_t
(*simpleaudio_write)( simpleaudio *sa, float *buf, size_t nframes );
(*simpleaudio_write)( simpleaudio *sa, void *buf, size_t nframes );
void
(*simpleaudio_close)( simpleaudio *sa );