RTP Audio System  2.0.0
AudioQuality Class Reference

Audio Quality. More...

#include <audioquality.h>

Inheritance diagram for AudioQuality:
AdjustableAudioQualityInterface AudioQualityInterface AdvancedAudioEncoder AudioNull MP3AudioReader MultiAudioReader SimpleAudioEncoder WavAudioReader

List of all members.

Public Member Functions

 AudioQuality ()
 AudioQuality (const card16 samplingRate, const card8 bits, const card8 channels, const card16 byteOrder=BYTE_ORDER)
 AudioQuality (const AudioQualityInterface &quality)
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 isLowest () const
bool isHighest () const
void increase (const cardinal steps)
void decrease (const cardinal setps)
bool prevSamplingRate ()
bool nextSamplingRate ()
card64 bytesToTime (const size_t bytes) const
size_t timeToBytes (const card64 microseconds) const
AudioQualityoperator= (const AudioQualityInterface &quality)
AudioQuality operator++ (int)
AudioQuality operator-- (int)

Static Public Member Functions

static AudioQuality getQualityForByteRate (const cardinal bps)
static AudioQuality getRandomQuality (Randomizer *randomizer)

Static Public Attributes

static const card16ValidRatesTable = (const card16*)&_ValidRatesTable
static const cardinal ValidRates
static const card8ValidBitsTable = (const card8*)&_ValidBitsTable
static const cardinal ValidBits
static const card8ValidChannelsTable = (const card8*)&_ValidChannelsTable
static const cardinal ValidChannels
static const AudioQuality LowestQuality = AudioQuality(4410,4,1,BYTE_ORDER)
static const AudioQuality HighestQuality = AudioQuality(44100,16,2,BYTE_ORDER)
static const card16 LowestSamplingRate = 4410
static const card16 HighestSamplingRate = 44100
static const card8 LowestBits = 4
static const card8 HighestBits = 16
static const card8 LowestChannels = 1
static const card8 HighestChannels = 2
static const cardinal QualityLevels = 23

Private Attributes

card16 SamplingRate
card8 Bits
card8 Channels
card16 ByteOrder

Detailed Description

Audio Quality.

This class manages audio quality.

Author:
Thomas Dreibholz
Version:
1.0

Constructor & Destructor Documentation

Default constructor.

AudioQuality::AudioQuality ( const card16  samplingRate,
const card8  bits,
const card8  channels,
const card16  byteOrder = BYTE_ORDER 
)

Constructor for new AudioQuality object with given quality

Parameters:
samplingRateSamplingRate.
bitsNumber of bits.
channelsNumber of channels.
byteOrderByte order: BIG_ENDIAN, LITTLE_ENDIAN.

Constructor for new AudioQuality object from given AudioQualityInterface

Parameters:
qualityAudioQualityInterface.

Member Function Documentation

card64 AudioQuality::bytesToTime ( const size_t  bytes) const [inline]

Convert bytes to microseconds.

void AudioQuality::decrease ( const cardinal  setps)

Decrease quality by given number of steps. The number of steps available is given by QualityLevels constant.

Parameters:
stepsNumber of steps.

Get maximum audio quality for a given byte rate.

Parameters:
bpsBytes per second.
Returns:
AudioQuality.

Get a random quality setting. All settings have the same probability.

Returns:
Random quality setting.
void AudioQuality::increase ( const cardinal  steps)

Increase quality by given number of steps. The number of steps available is given by QualityLevels constant.

Parameters:
stepsNumber of steps.
bool AudioQuality::isHighest ( ) const [inline]

Check, if quality is highest quality.

Returns:
true, is quality is highest; false otherwise.
bool AudioQuality::isLowest ( ) const [inline]

Check, if quality is lowest quality.

Returns:
true, if quality is lowest; false otherwise.

Set sampling rate to next higher value.

Returns:
true, if sampling rate has been set; false, if it was already highest.
AudioQuality AudioQuality::operator++ ( int  )

Implementation of ++ operator.

AudioQuality AudioQuality::operator-- ( int  )

Implementation of -- operator.

AudioQuality & AudioQuality::operator= ( const AudioQualityInterface quality)

Implementation of = operator.

Set sampling rate to next lower value.

Returns:
true, if sampling rate has been set; false, if it was already lowest.
size_t AudioQuality::timeToBytes ( const card64  microseconds) const [inline]

Convert microseconds to bytes.


Member Data Documentation

const card8 AudioQuality::HighestBits = 16 [static]

Constant for highest number of bits.

Constant for highest number of channels.

const AudioQuality AudioQuality::HighestQuality = AudioQuality(44100,16,2,BYTE_ORDER) [static]

Constant for highest quality.

const card16 AudioQuality::HighestSamplingRate = 44100 [static]

Constant for highest sampling rate.

const card8 AudioQuality::LowestBits = 4 [static]

Constant for lowest number of bits.

const card8 AudioQuality::LowestChannels = 1 [static]

Constant for lowest number of channels.

const AudioQuality AudioQuality::LowestQuality = AudioQuality(4410,4,1,BYTE_ORDER) [static]

Constant for lowest quality.

Constant for lowest sampling rate.

Number of quality levels supported by operator++/operator--.

Initial value:
   sizeof(_ValidBitsTable) / sizeof(card8)

Number of valid bits values in ValidRatesTable.

Table with valid bit values.

Initial value:
   sizeof(_ValidChannelsTable) / sizeof(card8)

Number of valid channels values in ValidRatesTable.

Table with valid channel values.

Initial value:
   sizeof(_ValidRatesTable) / sizeof(card16)

Number of valid sampling rates in ValidRatesTable.

Table with valid sampling rate values.


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