| - -( dyne // software :: culture :: events :: tazebao :: discussion :: museum \\ freaknet )- - |
#include <pipe.h>
Collaboration diagram for Pipe:

Public Member Functions | |
| Pipe (int size=16384) | |
| Pipe constructor class. | |
| ~Pipe () | |
| Pipe destructor class. | |
| bool | set_input_type (char *name) |
| set the input conversion type for this Pipe | |
| bool | set_output_type (char *name) |
| set the output conversion type for this Pipe | |
| void | set_block (bool input, bool output) |
| set the blocking policy on the read and write | |
| void | set_block_timeout (int input, int output) |
| set the timeout in milliseconds for the read and write block | |
| int | read (int length, void *data) |
| read from the pipe | |
| int | write (int length, void *data) |
| < read from the pipe into a bidimensional float array Mix audio from FIFO pipe into a mixing buffer write into FIFO pipe | |
| void | block (bool val) |
| Setup blocking behaviour of the Pipe. | |
| int | size () |
| tell the amount of data contained in the Pipe | |
| int | space () |
| tell the amount of free space in the Pipe | |
| void | flush () |
| flush all data contained in the Pipe, loosing it | |
| void | flush (int size) |
| flush a certain amount of bytes from FIFO Pipe | |
Public Attributes | |
| bool | blocking |
|
|
Pipe constructor class. The constructor initializes all buffers needed, which will be in fact the size of the buffer |
|
|
Pipe destructor class.
|
|
|
Setup blocking behaviour of the Pipe. The term 'blocking' here is used in a quite improper way, read more about in the description of the Pipe class. |
|
|
flush a certain amount of bytes from FIFO Pipe
|
|
|
flush all data contained in the Pipe, loosing it
|
|
||||||||||||
|
read from the pipe Reads out audio data from the pipe filling up the given buffer which has to be properly allocated. If the pipe is set 'blocking' then will return -1 if the pipe buffer is full. Otherwise, when non-blocking, will return the amount of data that could be pushed in the pipe.
|
|
||||||||||||
|
set the blocking policy on the read and write
|
|
||||||||||||
|
set the timeout in milliseconds for the read and write block
|
|
|
set the input conversion type for this Pipe A Pipe can be of different types, meaning that it does different kind of operations when reading or writing like: conversions, mixing of various kinds, all opearations that we can optimize when doing in one single pass, while data is flowing around. Implementations of the various types available can be obtained looking into pipe.cpp when the copy callback functions are registered. The set_input_type and set_output_type methods are used to set which kind of operation the Pipe will execute when moving in and out the data. Default is "copy_byte" which simply copies one byte each sample, you want to change this to set it to the sample type you are using types available: copy_byte copy_int16_to_float int to float using /32768.0f copy_float_to_int16 float to int using lrintf() mix_int16_to_int32 simple sum of 16bit over 32bit int |
|
|
set the output conversion type for this Pipe
|
|
|
tell the amount of data contained in the Pipe
|
|
|
tell the amount of free space in the Pipe
|
|
||||||||||||
|
< read from the pipe into a bidimensional float array Mix audio from FIFO pipe into a mixing buffer write into FIFO pipe Write data inside the FIFO pipe, locking to not overlap read operations (thread safe).
|
|
|
|
|
|
|
|
| Copyleft 2000 - 2008 dyne.org foundation and respective authors. Verbatim copying and distribution is permitted in any medium, provided this notice is preserved. Send inquiries & questions to dyne.org's hackers. |
|