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

aflibDevFile Class Reference

Derived class to read and write to a Linux audio device. More...

#include <aflibDevFile.h>

Inheritance diagram for aflibDevFile::

aflibFile List of all members.

Public Methods

 aflibDevFile ()
 ~aflibDevFile ()
aflibStatus afopen (const char *file, aflibConfig *cfg)
 Main API for opening a file or device in read mode. More...

aflibStatus afcreate (const char *file, const aflibConfig &config)
 Main API for opening a file or device in write mode. More...

aflibStatus afread (aflibData &data, long long position=-1)
 Main API function to read a segment of data. More...

aflibStatus afwrite (aflibData &data, long long position=-1)
 Main API function to write a segment of audio data. More...

bool setItem (const char *item, const void *value)
 Processes unique information for the Linux sound device. More...

void programDevice ()
bool isDataSizeSupported (aflib_data_size size)
bool isEndianSupported (aflib_data_endian end)
bool isSampleRateSupported (int &rate)

Detailed Description

Derived class to read and write to a Linux audio device.

This is the class for Linux Device audio file reading and writing. It is based on the OSS API. It is as follows:

Controlling the format data can be done by ioctl commands as follows: SNDCTL_DSP_SETFMT - Set Format of data to and from port AFMT_U8 - Unsigned 8 bit data AFMT_S16_LE - Signed 16 bit data Little Endian SNDCTL_DSP_STEREO - Set number of channels 0 - Mono 1 - Stereo SNDCTL_DSP_SPEED - Sample Rate in samples per second SNDCTL_DSP_SETFRAGMENT - Set buffer sizes 0xMMMMSSSS - 2 to the SSSS power gives size of buffer. MMMM is num of fragments SNDCTL_DSP_GETBLKSIZE - Get fragment size in bytes


Constructor & Destructor Documentation

aflibDevFile::aflibDevFile ( )
 

aflibDevFile::~aflibDevFile ( )
 


Member Function Documentation

aflibStatus aflibDevFile::afcreate ( const char * file,
const aflibConfig & config ) [virtual]
 

Main API for opening a file or device in write mode.

This function is only used for module support. For no module support the derived classes afcreate function will be called instead. For module support this function will make a call to the derived classes function.

Reimplemented from aflibFile.

aflibStatus aflibDevFile::afopen ( const char * file,
aflibConfig * cfg ) [virtual]
 

Main API for opening a file or device in read mode.

This function is only used for module support. For no modules support the derived classes afopen function will be called instead. For module support this function will make a call to the derived classes function.

Reimplemented from aflibFile.

aflibStatus aflibDevFile::afread ( aflibData & data,
long long position = -1 ) [virtual]
 

Main API function to read a segment of data.

This function is only used for module support. For no module support the derived classes afread function will be called instead. For module support this function will make a call to the derived classes function.

Reimplemented from aflibFile.

aflibStatus aflibDevFile::afwrite ( aflibData & data,
long long position = -1 ) [virtual]
 

Main API function to write a segment of audio data.

This function is only used for module support. For no module support the derived classes afwrite function will be called instead. For module support this function will make a call to the derived class.

Reimplemented from aflibFile.

bool aflibDevFile::isDataSizeSupported ( aflib_data_size size ) [virtual]
 

Reimplemented from aflibFile.

bool aflibDevFile::isEndianSupported ( aflib_data_endian end ) [virtual]
 

Reimplemented from aflibFile.

bool aflibDevFile::isSampleRateSupported ( int & rate ) [virtual]
 

Reimplemented from aflibFile.

void aflibDevFile::programDevice ( )
 

bool aflibDevFile::setItem ( const char * item,
const void * value ) [virtual]
 

Processes unique information for the Linux sound device.

This will process any unique information for the Linux audio device. It currently supports one item. It is AFLIB_DEV_ITEM_BUFFER. It will expect a value that is of type double. This will create a buffer in the hardware, if it is supported, of the length specified in seconds.

Reimplemented from aflibFile.


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