1 #ifndef LIBPICOFE_SNDOUT_H
2 #define LIBPICOFE_SNDOUT_H
3 
4 struct sndout_driver {
5 	const char *name;
6 	int  (*init)(void);
7 	void (*exit)(void);
8 	int  (*start)(int rate, int stereo);
9 	void (*stop)(void);
10 	void (*wait)(void);
11 	int  (*write_nb)(const void *data, int bytes);
12 };
13 
14 extern struct sndout_driver sndout_current;
15 
16 void sndout_init(void);
17 
sndout_exit(void)18 static inline void sndout_exit(void)
19 {
20 	sndout_current.exit();
21 }
22 
sndout_start(int rate,int stereo)23 static inline int sndout_start(int rate, int stereo)
24 {
25 	return sndout_current.start(rate, stereo);
26 }
27 
sndout_stop(void)28 static inline void sndout_stop(void)
29 {
30 	sndout_current.stop();
31 }
32 
sndout_wait(void)33 static inline void sndout_wait(void)
34 {
35 	sndout_current.wait();
36 }
37 
sndout_write_nb(const void * data,int bytes)38 static inline int sndout_write_nb(const void *data, int bytes)
39 {
40 	return sndout_current.write_nb(data, bytes);
41 }
42 
43 #endif // LIBPICOFE_SNDOUT_H
44