minimodem-mirror/src/simpleaudio_internal.h

43 lines
857 B
C
Raw Normal View History

2011-06-08 23:00:22 +02:00
/*
* simpleaudio_internal.h
*
* Copyright (C) 2011 Kamal Mostafa <kamal@whence.com>
*
* NO LICENSE HAS BEEN SPECIFIED OR GRANTED FOR THIS WORK.
*
*/
#ifndef SIMPLEAUDIO_INTERNAL_H
#define SIMPLEAUDIO_INTERNAL_H
#include "simpleaudio.h"
/*
* Backend modules must provide an "open" routine which returns a
* (simpleaudio *) to the caller.
*/
struct simpleaudio_backend;
typedef struct simpleaudio_backend simpleaudio_backend;
struct simpleaudio {
const struct simpleaudio_backend *backend;
unsigned int rate;
unsigned int channels;
void * backend_handle;
unsigned int backend_framesize;
};
struct simpleaudio_backend {
ssize_t
(*simpleaudio_read)( simpleaudio *sa, float *buf, size_t nframes );
2011-06-17 23:21:31 +02:00
ssize_t
(*simpleaudio_write)( simpleaudio *sa, float *buf, size_t nframes );
void
(*simpleaudio_close)( simpleaudio *sa );
};
#endif