1 | .TH "roar_vs_buffer" "3" "June 2011" "RoarAudio" "RoarAudio Programmer's Manual" |
---|
2 | |
---|
3 | .SH NAME |
---|
4 | roar_vs_buffer \- Use buffered mode streams |
---|
5 | |
---|
6 | .SH SYNOPSIS |
---|
7 | |
---|
8 | #include <roaraudio.h> |
---|
9 | |
---|
10 | int roar_vs_buffer(roar_vs_t * vss, size_t buffer, int * error); |
---|
11 | |
---|
12 | ssize_t roar_vs_get_avail_read(roar_vs_t * vss, int * error); |
---|
13 | |
---|
14 | ssize_t roar_vs_get_avail_write(roar_vs_t * vss, int * error); |
---|
15 | |
---|
16 | int roar_vs_reset_buffer(roar_vs_t * vss, int writering, int readring, int * error); |
---|
17 | |
---|
18 | .SH "DESCRIPTION" |
---|
19 | These functions controls the buffered mode of the VS object. Using this mode is not recommended. |
---|
20 | |
---|
21 | \fBroar_vs_buffer()\fR initializes the buffered mode. It takes the size for the buffer as argument. |
---|
22 | The size should be a power of two. Common values include 2048 and 4096. |
---|
23 | |
---|
24 | \fBroar_vs_get_avail_read()\fR and \fBroar_vs_get_avail_write()\fR return the amount of free space |
---|
25 | in the read and write buffer. |
---|
26 | |
---|
27 | \fBroar_vs_reset_buffer()\fR resets the read and/or write buffer. This means the data in the buffers is discarded. |
---|
28 | This does not happen frame aligned and may result in broken audio. |
---|
29 | |
---|
30 | Buffers are not flushed automaically. To do this use \fBroar_vs_iterate\fR(3) or \fBroar_vs_run\fR(3). |
---|
31 | |
---|
32 | .SH "PARAMETERS" |
---|
33 | .TP |
---|
34 | \fBvss\fR |
---|
35 | The VS object to be used. |
---|
36 | |
---|
37 | .TP |
---|
38 | \fBbuffer\fR |
---|
39 | The size of the buffer to be used in bytes. |
---|
40 | |
---|
41 | .TP |
---|
42 | \fBwritering\fR, \fBreadring\fR |
---|
43 | Selects the buffer to reset. Must be ROAR_VS_TRUE or ROAR_VS_FALSE. |
---|
44 | |
---|
45 | .TP |
---|
46 | \fBerror\fR |
---|
47 | This is a pointer to a integer used to store the error value in case of error. |
---|
48 | This can be NULL if not used but it is very recommended to use this error value to report |
---|
49 | good error messages to the user. |
---|
50 | |
---|
51 | .SH "RETURN VALUE" |
---|
52 | On success these calls return 0. |
---|
53 | roar_vs_get_avail_read() and roar_vs_get_avail_write() return the free space in the corresponding buffer. |
---|
54 | On error, \-1 is returned. |
---|
55 | |
---|
56 | .SH "EXAMPLES" |
---|
57 | FIXME |
---|
58 | |
---|
59 | .SH "SEE ALSO" |
---|
60 | \fBroarvs\fR(7), |
---|
61 | \fBlibroar\fR(7), |
---|
62 | \fBRoarAudio\fR(7). |
---|
63 | |
---|
64 | .\" ll |
---|