Changeset 1554:075fb6bf5c2c in roaraudio for include/libroarsndio
- Timestamp:
- 04/13/09 00:04:46 (15 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
include/libroarsndio/sndiosym.h
r1552 r1554 36 36 #include <roaraudio.h> 37 37 38 #ifdef ROAR_HAVE_H_POLL 39 #include <poll.h> 40 #else 41 struct pollfd; 42 #endif 43 44 #define SIO_PLAY 1 45 #define SIO_REC 2 46 47 #define SIO_IGNORE 0 /* pause during xrun */ 48 #define SIO_SYNC 1 /* resync after xrun */ 49 #define SIO_ERROR 2 /* terminate on xrun */ 50 51 #if BYTE_ORDER == BIG_ENDIAN && !defined(ROAR_TARGET_WIN32) 52 #define SIO_LE_NATIVE 0 53 #else 54 #if BYTE_ORDER == LITTLE_ENDIAN 55 #define SIO_LE_NATIVE 1 56 #else 57 #error Byte Order of this system is not supported within the sndio interface. 58 #endif 59 #endif 60 61 #define SIO_BPS(bits) (((bits)/8) + ((bits) % 8 ? 1 : 0)) 62 63 struct sio_par { 64 unsigned bits; /* bits per sample */ 65 unsigned bps; /* bytes per sample */ 66 unsigned sig; /* 1 = signed, 0 = unsigned */ 67 unsigned le; /* 1 = LE, 0 = BE byte order */ 68 unsigned msb; /* 1 = MSB, 0 = LSB aligned */ 69 unsigned rchan; /* number channels for recording */ 70 unsigned pchan; /* number channels for playback */ 71 unsigned rate; /* frames per second */ 72 unsigned appbufsz; /* minimum buffer size without xruns */ 73 unsigned bufsz; /* end-to-end buffer size (read-only) */ 74 unsigned round; /* optimal buffer size divisor */ 75 unsigned xrun; /* what to do on overrun/underrun */ 76 }; 77 78 struct sio_hdl { 79 int fh; 80 struct sio_par para; 81 void (*on_move)(void * arg, int delta); 82 void * on_move_arg; 83 void (*on_vol )(void * arg, unsigned vol); 84 void * on_vol_arg; 85 }; 86 87 struct sio_hdl * sio_open(char * name, unsigned mode, int nbio_flag); 88 void sio_close (struct sio_hdl * hdl); 89 90 void sio_initpar(struct sio_par * par); 91 int sio_setpar (struct sio_hdl * hdl, struct sio_par * par); 92 int sio_getpar (struct sio_hdl * hdl, struct sio_par * par); 93 94 int sio_getcap (struct sio_hdl * hdl, struct sio_cap * cap); 95 96 int sio_start (struct sio_hdl * hdl); 97 int sio_stop (struct sio_hdl * hdl); 98 99 size_t sio_read (struct sio_hdl * hdl, void * addr, size_t nbytes); 100 size_t sio_write (struct sio_hdl * hdl, void * addr, size_t nbytes); 101 102 void sio_onmove (struct sio_hdl * hdl, void (*cb)(void * arg, int delta), void * arg); 103 104 int sio_nfds (struct sio_hdl * hdl); 105 106 int sio_pollfd (struct sio_hdl * hdl, struct pollfd * pfd, int events); 107 108 int sio_revents(struct sio_hdl * hdl, struct pollfd * pfd); 109 110 int sio_eof (struct sio_hdl * hdl); 111 112 int sio_setvol (struct sio_hdl * hdl, unsigned vol); 113 void sio_onvol (struct sio_hdl * hdl, void (*cb)(void * arg, unsigned vol), void * arg); 114 38 115 #endif 39 116
Note: See TracChangeset
for help on using the changeset viewer.