Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

aflibAudioMemoryInput Class Reference

Provides ability to insert raw audio data into audio chain. More...

#include <aflibAudioMemoryInput.h>

Inheritance diagram for aflibAudioMemoryInput::

aflibAudio aflibChain aflibMemCache List of all members.

Public Methods

 aflibAudioMemoryInput (const aflibConfig &config)
 Constructor - Default constructor.

 ~aflibAudioMemoryInput ()
 Destructor.

void setAudioMemoryInputCallback (samples_callback func_ptr)
 Enables and disables the memory input callback. More...

aflibStatus compute_segment (list< aflibData *> &data, long long position=-1)
 Work function, must be implemented by derived class.

const char* getName () const
 Returns the name of the derived class.


Detailed Description

Provides ability to insert raw audio data into audio chain.

This class allows one to insert raw data into an audio chain at the start of the chain. This class can't be used anywhere in a chain other than at the start. Once an audio chain is formed then the caller can call the process member function of the last item in the chain and retrieve the aflibData object to get the raw audio data out of the chain. Users will call the process member function at the end of an audio chain. This will result in data being requested down the chain until this class is reached. Then the samples_callback will be called requesting audio data from the user. Users of this class should call the setAudioMemoryInputCallback function to register a callback function that will provide data to the chain. This callback function shall have 5 parameters and shall return the actual number of data stored. Since this object is at the beginning of the audio chain then in order for data to be inserted into the chain the caller must register a callback function before calling the process member function of the chain. The 5 parameters are:
aflibAudio * - the aflibAudioMemoryInput object that is making this call.
void * - pointer to the audio data memory location.
long - number of samples to read.
long - total length of samples (ie samples above * size of each sample).
long long - position in data stream that is requested.

The last parameter is the position of the data to read from. The user can request to start reading anywhere they wish. Thus they can start 10000 samples from the beginning of the audio data. If the user is streaming data then the library will make every attempt to request data sequentially from this class, but this is not guaranteed.


Constructor & Destructor Documentation

aflibAudioMemoryInput::aflibAudioMemoryInput ( const aflibConfig & config )
 

Constructor - Default constructor.

aflibAudioMemoryInput::~aflibAudioMemoryInput ( )
 

Destructor.


Member Function Documentation

aflibStatus aflibAudioMemoryInput::compute_segment ( list< aflibData *> & data,
long long position = -1 ) [virtual]
 

Work function, must be implemented by derived class.

Reimplemented from aflibAudio.

const char * aflibAudioMemoryInput::getName ( ) const [inline, virtual]
 

Returns the name of the derived class.

Reimplemented from aflibAudio.

void aflibAudioMemoryInput::setAudioMemoryInputCallback ( samples_callback func_ptr )
 

Enables and disables the memory input callback.

This function enables or disables the memory input callback. The callback registered must accept 5 parameters. The first is a pointer to this aflibAudio object. This allows the caller to know which object is generating this callback. This is so that if people have multiple objects all registering the same callback. The next parameter is the pointer to the memory location to store the data in. The next is the number of elements requested to be stored into the pointer. The next is the total number of bytes to store. The last parameter is the position of the audio data that is requested.


The documentation for this class was generated from the following files:
Generated at Tue Aug 7 22:18:06 2001 for Open Source Audio Library Project by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001