Changeset 4605:8f0e515e61a6 in roaraudio
- Timestamp:
- 11/15/10 17:10:00 (13 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
include/libroar/vs.h
r4580 r4605 30 30 * or libpulse*: 31 31 * The libs libroaresd, libroararts and libroarpulse link this lib 32 * and are therefore GPL. Because of this it may be ill igal to use32 * and are therefore GPL. Because of this it may be illegal to use 33 33 * them with any software that uses libesd, libartsc or libpulse*. 34 34 */ … … 44 44 typedef signed long int roar_mus_t; 45 45 46 /* return readable string descri ping the problem */46 /* return readable string describing the problem */ 47 47 const char * roar_vs_strerr(int error); 48 48 … … 60 60 61 61 /* connect to server and start stream in once 62 * this is basic ly roar_vs_new() and roar_vs_stream() in one function.62 * this is basically roar_vs_new() and roar_vs_stream() in one function. 63 63 */ 64 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); … … 95 95 * This does all needed cleanup. 96 96 * If server connection was made by VS it is closed, too. 97 * If server connection was provided by caller it is untouched.97 * If server connection was provided by caller it is untouched. 98 98 */ 99 99 int roar_vs_close(roar_vs_t * vss, int killit, int * error); … … 102 102 * This function writes some data to the stream. 103 103 * return is number of bytes written or -1 on error. 104 * return value can be zero to in tercate no data can be written but no error.104 * return value can be zero to indicate no data can be written but no error. 105 105 * this may be the case with non-blocking streams. 106 * ret runed value can be less then requested value. indecates a short write.107 * you should wait some (short!) time (for example one main loop i nteration) and try again.106 * returned value can be less then requested value. indicates a short write. 107 * you should wait some (short!) time (for example one main loop iteration) and try again. 108 108 */ 109 109 ssize_t roar_vs_write(roar_vs_t * vss, const void * buf, size_t len, int * error); … … 112 112 * This function reads some data from the stream. 113 113 * return is number of bytes read or -1 on error. 114 * return value can be zero to in tercate no data can be read but no error.114 * return value can be zero to indicate no data can be read but no error. 115 115 * this may be the case with non-blocking streams. 116 * ret runed value can be less then requested value. indecates a short read.117 * you should wait some (short!) time (for example one main loop i nteration) and try again.116 * returned value can be less then requested value. indicates a short read. 117 * you should wait some (short!) time (for example one main loop iteration) and try again. 118 118 */ 119 119 ssize_t roar_vs_read (roar_vs_t * vss, void * buf, size_t len, int * error); … … 138 138 /* do not supply backend offset */ 139 139 #define ROAR_VS_BACKEND_NONE -1 140 /* use first found prima y stream of same mixer as offset source */140 /* use first found primary stream of same mixer as offset source */ 141 141 #define ROAR_VS_BACKEND_FIRST -2 142 142 /* use mean of primary streams of same mixer as offset source */ 143 143 #define ROAR_VS_BACKEND_MEAN -3 144 144 145 /* get server's pos sition of stream146 * returns server's pos sition of the stream or -1 on error.147 * The ret runed server possition is the possition in samples145 /* get server's position of stream 146 * returns server's position of the stream or -1 on error. 147 * The returned server position is the position in samples 148 148 * plus a offset provided by the selected backend 149 149 */ … … 153 153 * This function may fail because the used codec uses 154 154 * non-fixed bitrate. 155 * if this function fails it ret runs zero and sets error or155 * if this function fails it returns zero and sets error or 156 156 * clear error to ROAR_ERROR_NONE. 157 * If non-zero is ret runed error is untouched.157 * If non-zero is returned error is untouched. 158 158 * return value is in mu-sec (units of 10^-6s). 159 * Note that the ret runed value may be negative (the server being159 * Note that the returned value may be negative (the server being 160 160 * ahead of us). This is normal in case we read a stream. 161 161 */ … … 163 163 164 164 /* set pause flag 165 * The pause flag should be set whenever the user presses the pause button or sim ular.165 * The pause flag should be set whenever the user presses the pause button or similar. 166 166 * The stream may be come blocking after the pause flag has been set. 167 * returns old pause setting (useful lwith ROAR_VS_TOGGLE)167 * returns old pause setting (useful with ROAR_VS_TOGGLE) 168 168 */ 169 169 int roar_vs_pause(roar_vs_t * vss, int val, int * error); 170 170 171 171 /* set the mute flag of the stream 172 * Th ie pause flag should be set wehnever the user mutes the stream in some way.172 * The pause flag should be set whenever the user mutes the stream in some way. 173 173 * This flag is used so the volume is not changed and can be restored by the server 174 174 * while unmuting. 175 175 * It is very recommended to use this flag and not just set the volume to zero 176 * returns old mute setting (useful lwith ROAR_VS_TOGGLE)176 * returns old mute setting (useful with ROAR_VS_TOGGLE) 177 177 */ 178 178 int roar_vs_mute (roar_vs_t * vss, int val, int * error); … … 183 183 */ 184 184 int roar_vs_volume_mono (roar_vs_t * vss, float c, int * error); 185 /* set volume of stream (like volume + bal lance, stereo mode)185 /* set volume of stream (like volume + balance, stereo mode) 186 186 * volume l and r are floats from 0 ('muted', see above) to 1 (full volume). 187 187 * Returns 0 on no error and -1 on error. … … 189 189 int roar_vs_volume_stereo (roar_vs_t * vss, float l, float r, int * error); 190 190 191 /* get volume from stream (like volume + bal lance, stereo mode)192 * volume p inters l and r are floats from 0 ('muted', see above) to 1 (full volume).191 /* get volume from stream (like volume + balance, stereo mode) 192 * volume pointers l and r are floats from 0 ('muted', see above) to 1 (full volume). 193 193 * Returns 0 on no error and -1 on error. 194 194 * NOTE: if you want a 'mono' volume (like roar_vs_volume_mono() takes) … … 215 215 int roar_vs_role (roar_vs_t * vss, int role, int * error); 216 216 217 /* Run a single i nteration.217 /* Run a single iteration. 218 218 * This will try to read data from source, write it to the stream 219 219 * and flush the buffer in buffered mode. … … 222 222 int roar_vs_iterate (roar_vs_t * vss, int wait, int * error); 223 223 224 /* Iterate until lEOF or error.224 /* Iterate until EOF or error. 225 225 * Very simple main loop. 226 226 * Returns 0 on no error and -1 on error. … … 229 229 230 230 /* Get used connection object 231 * This may be useful lif you want to use functions from the main API.231 * This may be useful if you want to use functions from the main API. 232 232 * Returns used connection object or NULL on error. 233 233 */ … … 235 235 236 236 /* Get used stream object 237 * This may be useful lif you want to use functions from the main API.237 * This may be useful if you want to use functions from the main API. 238 238 * Returns used stream object or NULL on error. 239 239 */ … … 241 241 242 242 /* Get used VIO object 243 * This may be useful lif you want to use functions from the main API.243 * This may be useful if you want to use functions from the main API. 244 244 * For example this can be used in non-blocking mode 245 245 * to test if we can read or write. To test that use roar_vio_select(). … … 250 250 /* send NOOP command to server 251 251 * This can be used to ping the server. 252 * This is of no use normal y.252 * This is of no use normally. 253 253 * Returns 0 on no error and -1 on error. 254 254 */
Note: See TracChangeset
for help on using the changeset viewer.