RTP Audio System  2.0.0
AudioDevice Class Reference

Audio Device. More...

#include <audiodevice.h>

Inheritance diagram for AudioDevice:
AudioWriterInterface Thread AdjustableAudioQualityInterface Synchronizable AudioQualityInterface

List of all members.

Public Member Functions

 AudioDevice (const char *name="/dev/dsp")
 ~AudioDevice ()
cardinal getSyncCount () const
void resetSyncCount ()
card16 getSamplingRate () const
card8 getBits () const
card8 getChannels () const
card16 getByteOrder () const
cardinal getBytesPerSecond () const
cardinal getBitsPerSample () const
card16 setSamplingRate (const card16 samplingRate)
card8 setBits (const card8 bits)
card8 setChannels (const card8 channels)
card16 setByteOrder (const card16 byteOrder)
bool ready () const
void sync ()
bool write (const void *data, const size_t length)
cardinal getCurrentCapacity ()

Static Public Attributes

static const cardinal RingBufferSize = 128 * 1024
static const cardinal ResizeThresholdPercent = 75
static const cardinal ResizeModulo = 4

Private Member Functions

void run ()

Private Attributes

bool IsReady
cardinal SyncCount
cardinal JitterCompensationLatency
card16 AudioSamplingRate
card8 AudioBits
card8 AudioChannels
card16 AudioByteOrder
card16 DeviceSamplingRate
card8 DeviceBits
card8 DeviceChannels
card16 DeviceByteOrder
int DeviceFD
int DeviceCapabilities
int DeviceFormats
integer DeviceBlockSize
integer DeviceFragmentSize
integer DeviceOSpace
RingBuffer Buffer
cardinal ResizeThreshold
card64 LastWriteTimeStamp
integer Balance
bool IsFillingBuffer

Detailed Description

Audio Device.

This class implements AudioWriterInterface for the audio device.

Author:
Thomas Dreibholz
Version:
1.0

Constructor & Destructor Documentation

AudioDevice::AudioDevice ( const char *  name = "/dev/dsp")

Constructor.

Parameters:
nameName of the audio device (normally "/dev/dsp").

Destructor.


Member Function Documentation

cardinal AudioDevice::getSyncCount ( ) const [inline]

Get number of times, sync() has been called.

Returns:
Number of times, sync() has been called.
See also:
AudioWriterInterface::sync
bool AudioDevice::ready ( ) const [virtual]
void AudioDevice::resetSyncCount ( ) [inline]

Reset number of times, sync() has been called.

See also:
AudioWriterInterface::sync
void AudioDevice::run ( ) [private, virtual]

The virtual run() method, which contains the thread's implementation. It has to be implemented by classes, which inherit Thread.

Implements Thread.

void AudioDevice::sync ( ) [virtual]
bool AudioDevice::write ( const void *  data,
const size_t  length 
) [virtual]

Member Data Documentation

int AudioDevice::DeviceFD [private]
bool AudioDevice::IsReady [private]
const cardinal AudioDevice::ResizeModulo = 4 [static]

Buffer resize modulo: The buffer's size will be removed by the fraction of (1/ResizeModulo) by removing every ResizeModulo-th 32-bit word.

Buffer fill threshold to Resize (in percent).

const cardinal AudioDevice::RingBufferSize = 128 * 1024 [static]

Size of audio ringbuffer in bytes.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines