mirror of
https://github.com/RaySollium99/libpicofe.git
synced 2025-09-06 23:28:04 -04:00
support multiple sound drivers, add sdl
This commit is contained in:
parent
20b143089c
commit
26d3ca0d29
6 changed files with 294 additions and 6 deletions
43
sndout.h
Normal file
43
sndout.h
Normal file
|
@ -0,0 +1,43 @@
|
|||
#ifndef LIBPICOFE_SNDOUT_H
|
||||
#define LIBPICOFE_SNDOUT_H
|
||||
|
||||
struct sndout_driver {
|
||||
const char *name;
|
||||
int (*init)(void);
|
||||
void (*exit)(void);
|
||||
int (*start)(int rate, int stereo);
|
||||
void (*stop)(void);
|
||||
void (*wait)(void);
|
||||
int (*write_nb)(const void *data, int bytes);
|
||||
};
|
||||
|
||||
extern struct sndout_driver sndout_current;
|
||||
|
||||
void sndout_init(void);
|
||||
|
||||
static inline void sndout_exit(void)
|
||||
{
|
||||
sndout_current.exit();
|
||||
}
|
||||
|
||||
static inline int sndout_start(int rate, int stereo)
|
||||
{
|
||||
return sndout_current.start(rate, stereo);
|
||||
}
|
||||
|
||||
static inline void sndout_stop(void)
|
||||
{
|
||||
sndout_current.stop();
|
||||
}
|
||||
|
||||
static inline void sndout_wait(void)
|
||||
{
|
||||
sndout_current.wait();
|
||||
}
|
||||
|
||||
static inline int sndout_write_nb(const void *data, int bytes)
|
||||
{
|
||||
return sndout_current.write_nb(data, bytes);
|
||||
}
|
||||
|
||||
#endif // LIBPICOFE_SNDOUT_H
|
Loading…
Add table
Add a link
Reference in a new issue