Changeset 5109:4f9fc788fe91 in roaraudio for include/libroar/vs.h
- Timestamp:
- 07/28/11 16:32:34 (13 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
include/libroar/vs.h
r5078 r5109 39 39 #include "libroar.h" 40 40 41 #define _LIBROAR_VS_STDATTRS _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL(1) 42 41 43 struct roar_vs; 42 44 … … 45 47 46 48 /* return readable string describing the problem */ 47 const char * roar_vs_strerr(int error) ;49 const char * roar_vs_strerr(int error) _LIBROAR_ATTR_PURE _LIBROAR_ATTR_USE_RESULT; 48 50 49 51 /* create a new VS object from normal RoarAudio connection object … … 51 53 * The connection is not closed by roar_vs_close(). 52 54 */ 53 roar_vs_t * roar_vs_new_from_con(struct roar_connection * con, int * error) ;55 roar_vs_t * roar_vs_new_from_con(struct roar_connection * con, int * error) _LIBROAR_VS_STDATTRS; 54 56 55 57 /* create a new VS object with a new connection */ 56 roar_vs_t * roar_vs_new(const char * server, const char * name, int * error) ;58 roar_vs_t * roar_vs_new(const char * server, const char * name, int * error) _LIBROAR_ATTR_USE_RESULT; 57 59 58 60 /* start a the stream in the VS object */ 59 int roar_vs_stream(roar_vs_t * vss, const struct roar_audio_info * info, int dir, int * error) ;61 int roar_vs_stream(roar_vs_t * vss, const struct roar_audio_info * info, int dir, int * error) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL(1, 2); 60 62 61 63 /* connect to server and start stream in once 62 64 * this is basically roar_vs_new() and roar_vs_stream() in one function. 63 65 */ 64 roar_vs_t * roar_vs_new_simple(const char * server, const char * name, int rate, int channels, int codec, int bits, int dir, int * error) ;66 roar_vs_t * roar_vs_new_simple(const char * server, const char * name, int rate, int channels, int codec, int bits, int dir, int * error) _LIBROAR_ATTR_USE_RESULT; 65 67 66 68 /* create a VS object for playback. … … 73 75 */ 74 76 75 int roar_vs_file(roar_vs_t * vss, struct roar_vio_calls * vio, int closefile, int * error) ;77 int roar_vs_file(roar_vs_t * vss, struct roar_vio_calls * vio, int closefile, int * error) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL(1, 2); 76 78 77 79 /* Open a file and attach it. 78 80 */ 79 int roar_vs_file_simple(roar_vs_t * vss, char * filename, int * error) ;81 int roar_vs_file_simple(roar_vs_t * vss, char * filename, int * error) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL(1, 2); 80 82 81 83 /* Connects to a server to just play a file. 82 84 */ 83 roar_vs_t * roar_vs_new_from_file(const char * server, const char * name, char * filename, int * error) ;85 roar_vs_t * roar_vs_new_from_file(const char * server, const char * name, char * filename, int * error) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL(3); 84 86 85 87 /* Switch to buffered mode. … … 92 94 * Buffer size should be a value of 2^n. Typical values are 2048 and 4096. 93 95 */ 94 int roar_vs_buffer(roar_vs_t * vss, size_t buffer, int * error) ;96 int roar_vs_buffer(roar_vs_t * vss, size_t buffer, int * error) _LIBROAR_VS_STDATTRS; 95 97 96 98 … … 109 111 * If server connection was provided by caller it is untouched. 110 112 */ 111 int roar_vs_close(roar_vs_t * vss, int killit, int * error) ;113 int roar_vs_close(roar_vs_t * vss, int killit, int * error) _LIBROAR_ATTR_NONNULL(1); 112 114 113 115 /* write data to a stream … … 119 121 * you should wait some (short!) time (for example one main loop iteration) and try again. 120 122 */ 121 ssize_t roar_vs_write(roar_vs_t * vss, const void * buf, size_t len, int * error) ;123 ssize_t roar_vs_write(roar_vs_t * vss, const void * buf, size_t len, int * error) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL(1, 2); 122 124 123 125 /* read data from a stream … … 129 131 * you should wait some (short!) time (for example one main loop iteration) and try again. 130 132 */ 131 ssize_t roar_vs_read (roar_vs_t * vss, void * buf, size_t len, int * error) ;133 ssize_t roar_vs_read (roar_vs_t * vss, void * buf, size_t len, int * error) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL(1, 2); 132 134 133 135 /* wait value for waiting */ … … 141 143 * Returns 0 on no error and -1 on error. 142 144 */ 143 int roar_vs_sync (roar_vs_t * vss, int wait, int * error) ;145 int roar_vs_sync (roar_vs_t * vss, int wait, int * error) _LIBROAR_ATTR_NONNULL(1); 144 146 145 147 /* set blocking mode of stream 146 148 * returns old blocking state 147 149 */ 148 int roar_vs_blocking (roar_vs_t * vss, int val, int * error) ;150 int roar_vs_blocking (roar_vs_t * vss, int val, int * error) _LIBROAR_VS_STDATTRS; 149 151 150 152 /* do not supply backend offset */ … … 162 164 * plus a offset provided by the selected backend 163 165 */ 164 ssize_t roar_vs_position(roar_vs_t * vss, int backend, int * error) ;166 ssize_t roar_vs_position(roar_vs_t * vss, int backend, int * error) _LIBROAR_VS_STDATTRS; 165 167 166 168 /* get latency between playback and local write counter … … 174 176 * ahead of us). This is normal in case we read a stream. 175 177 */ 176 roar_mus_t roar_vs_latency(roar_vs_t * vss, int backend, int * error) ;177 roar_mus_t roar_vs_latency2(roar_vs_t * vss, int backend, int wait, int * error) ;178 roar_mus_t roar_vs_latency(roar_vs_t * vss, int backend, int * error) _LIBROAR_VS_STDATTRS _LIBROAR_ATTR_DEPRECATED; 179 roar_mus_t roar_vs_latency2(roar_vs_t * vss, int backend, int wait, int * error) _LIBROAR_VS_STDATTRS; 178 180 179 181 /* set pause flag … … 182 184 * returns old pause setting (useful with ROAR_VS_TOGGLE) 183 185 */ 184 int roar_vs_pause(roar_vs_t * vss, int val, int * error) ;186 int roar_vs_pause(roar_vs_t * vss, int val, int * error) _LIBROAR_ATTR_NONNULL(1); 185 187 186 188 /* set the mute flag of the stream … … 191 193 * returns old mute setting (useful with ROAR_VS_TOGGLE) 192 194 */ 193 int roar_vs_mute (roar_vs_t * vss, int val, int * error) ;195 int roar_vs_mute (roar_vs_t * vss, int val, int * error) _LIBROAR_ATTR_NONNULL(1); 194 196 195 197 /* set volume of stream (all channels to the same value) … … 197 199 * Returns 0 on no error and -1 on error. 198 200 */ 199 int roar_vs_volume_mono (roar_vs_t * vss, float c, int * error) ;201 int roar_vs_volume_mono (roar_vs_t * vss, float c, int * error) _LIBROAR_ATTR_NONNULL(1); 200 202 /* set volume of stream (like volume + balance, stereo mode) 201 203 * volume l and r are floats from 0 ('muted', see above) to 1 (full volume). 202 204 * Returns 0 on no error and -1 on error. 203 205 */ 204 int roar_vs_volume_stereo (roar_vs_t * vss, float l, float r, int * error) ;206 int roar_vs_volume_stereo (roar_vs_t * vss, float l, float r, int * error) _LIBROAR_ATTR_NONNULL(1); 205 207 206 208 /* get volume from stream (like volume + balance, stereo mode) … … 210 212 * you can just use: c = (*l + *r)/2 211 213 */ 212 int roar_vs_volume_get (roar_vs_t * vss, float * l, float * r, int * error) ;214 int roar_vs_volume_get (roar_vs_t * vss, float * l, float * r, int * error) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL(1, 2, 3); 213 215 214 216 /* set an array of meta data for the stream … … 222 224 * ret = roar_vs_meta(vss, &kv, 1, &err); 223 225 */ 224 int roar_vs_meta (roar_vs_t * vss, struct roar_keyval * kv, size_t len, int * error) ;226 int roar_vs_meta (roar_vs_t * vss, struct roar_keyval * kv, size_t len, int * error) _LIBROAR_ATTR_NONNULL(1, 2); 225 227 226 228 /* sets the stream role … … 228 230 * Returns 0 on no error and -1 on error. 229 231 */ 230 int roar_vs_role (roar_vs_t * vss, int role, int * error) ;232 int roar_vs_role (roar_vs_t * vss, int role, int * error) _LIBROAR_ATTR_NONNULL(1); 231 233 232 234 /* Run a single iteration. … … 235 237 * Returns -1 on error, 0 on EOF and positive true value on no error. 236 238 */ 237 int roar_vs_iterate (roar_vs_t * vss, int wait, int * error) ;239 int roar_vs_iterate (roar_vs_t * vss, int wait, int * error) _LIBROAR_ATTR_NONNULL(1); 238 240 239 241 /* Iterate until EOF or error. … … 241 243 * Returns 0 on no error and -1 on error. 242 244 */ 243 int roar_vs_run (roar_vs_t * vss, int * error) ;244 245 ssize_t roar_vs_get_avail_read(roar_vs_t * vss, int * error) ;246 ssize_t roar_vs_get_avail_write(roar_vs_t * vss, int * error) ;245 int roar_vs_run (roar_vs_t * vss, int * error) _LIBROAR_ATTR_NONNULL(1); 246 247 ssize_t roar_vs_get_avail_read(roar_vs_t * vss, int * error) _LIBROAR_VS_STDATTRS; 248 ssize_t roar_vs_get_avail_write(roar_vs_t * vss, int * error) _LIBROAR_VS_STDATTRS; 247 249 248 250 /* If in buffered mode drop all data from internal buffer. … … 252 254 * but should be avoided as it may break the bitstream. 253 255 */ 254 int roar_vs_reset_buffer(roar_vs_t * vss, int writering, int readring, int * error) ;256 int roar_vs_reset_buffer(roar_vs_t * vss, int writering, int readring, int * error) _LIBROAR_VS_STDATTRS _LIBROAR_ATTR_DEPRECATED; 255 257 256 258 /* Misc controls. … … 317 319 #define ROAR_VS_ASYNCLEVEL_AUTO 2 318 320 319 int roar_vs_ctl (roar_vs_t * vss, roar_vs_ctlcmd cmd, void * argp, int * error) ;321 int roar_vs_ctl (roar_vs_t * vss, roar_vs_ctlcmd cmd, void * argp, int * error) _LIBROAR_VS_STDATTRS; 320 322 321 323 … … 324 326 * Returns used connection object or NULL on error. 325 327 */ 326 struct roar_connection * roar_vs_connection_obj(roar_vs_t * vss, int * error) ;328 struct roar_connection * roar_vs_connection_obj(roar_vs_t * vss, int * error) _LIBROAR_VS_STDATTRS; 327 329 328 330 /* Get used stream object … … 330 332 * Returns used stream object or NULL on error. 331 333 */ 332 struct roar_stream * roar_vs_stream_obj (roar_vs_t * vss, int * error) ;334 struct roar_stream * roar_vs_stream_obj (roar_vs_t * vss, int * error) _LIBROAR_VS_STDATTRS; 333 335 334 336 /* Get used VIO object … … 338 340 * Returns used VIO object or NULL on error. 339 341 */ 340 struct roar_vio_calls * roar_vs_vio_obj (roar_vs_t * vss, int * error) ;342 struct roar_vio_calls * roar_vs_vio_obj (roar_vs_t * vss, int * error) _LIBROAR_VS_STDATTRS; 341 343 342 344 /* send NOOP command to server
Note: See TracChangeset
for help on using the changeset viewer.