|
|
This class manages audio quality.
AudioQuality () |
Default constructor.
AudioQuality (const card16 samplingRate, const card8 bits, const card8 channels, const card16 byteOrder = BYTE_ORDER) |
Constructor for new AudioQuality object with given quality
Parameters:
samplingRate | SamplingRate. |
bits | Number of bits. |
channels | Number of channels. |
byteOrder | Byte order: BIG_ENDIAN, LITTLE_ENDIAN. |
AudioQuality (const AudioQualityInterface& quality) |
Constructor for new AudioQuality object from given AudioQualityInterface
Parameters:
quality | AudioQualityInterface. |
card16 getSamplingRate () |
getSamplingRate() Implementation of AudioQualityInterface.
See also: AudioQualityInterface#getSamplingRate
Reimplemented from AudioQualityInterface
card8 getBits () |
getBits() Implementation of AudioQualityInterface.
See also: AudioQualityInterface#getBits
Reimplemented from AudioQualityInterface
card8 getChannels () |
getChannels() Implementation of AudioQualityInterface.
See also: AudioQualityInterface#getChannels
Reimplemented from AudioQualityInterface
card16 getByteOrder () |
getByteOrder() Implementation of AudioQualityInterface.
See also: AudioQualityInterface#getByteOrder
Reimplemented from AudioQualityInterface
cardinal getBytesPerSecond () |
getBytesPerSecond() Implementation of AudioQualityInterface.
See also: AudioQualityInterface#getBytesPerSecond
Reimplemented from AudioQualityInterface
cardinal getBitsPerSample () |
getBitsPerSample() Implementation of AudioQualityInterface.
See also: AudioQualityInterface#getBitsPerSample
Reimplemented from AudioQualityInterface
card16 setSamplingRate (const card16 samplingRate) |
setSamplingRate() Implementation of AdjustableAudioQualityInterface.
See also: AdjustableAudioQualityInterface#setSamplingRate
Reimplemented from AdjustableAudioQualityInterface
card8 setBits (const card8 bits) |
setBits() Implementation of AdjustableAudioQualityInterface.
See also: AdjustableAudioQualityInterface#setBits
Reimplemented from AdjustableAudioQualityInterface
card8 setChannels (const card8 channels) |
setChannels() Implementation of AdjustableAudioQualityInterface.
See also: AdjustableAudioQualityInterface#setChannels
Reimplemented from AdjustableAudioQualityInterface
card16 setByteOrder (const card16 byteOrder) |
setByteOrder() Implementation of AdjustableAudioQualityInterface.
See also: AdjustableAudioQualityInterface#setByteOrder
Reimplemented from AdjustableAudioQualityInterface
inline bool isLowest () |
Check, if quality is lowest quality.
Returns: true, if quality is lowest; false otherwise.
inline bool isHighest () |
Check, if quality is highest quality.
Returns: true, is quality is highest; false otherwise.
void increase (const cardinal steps) |
Increase quality by given number of steps. The number of steps available is given by QualityLevels constant.
Parameters:
steps | Number of steps. |
void decrease (const cardinal setps) |
Decrease quality by given number of steps. The number of steps available is given by QualityLevels constant.
Parameters:
steps | Number of steps. |
bool prevSamplingRate () |
Set sampling rate to next lower value.
Returns: true, if sampling rate has been set; false, if it was already lowest.
bool nextSamplingRate () |
Set sampling rate to next higher value.
Returns: true, if sampling rate has been set; false, if it was already highest.
inline card64 bytesToTime (const size_t bytes) |
Convert bytes to microseconds.
inline size_t timeToBytes (const card64 microseconds) |
Convert microseconds to bytes.
AudioQuality& operator= (const AudioQualityInterface& quality) |
Implementation of = operator.
AudioQuality operator++ (int) |
Implementation of ++ operator.
AudioQuality operator-- (int) |
Implementation of -- operator.
AudioQuality getQualityForByteRate (const cardinal bps) |
Get maximum audio quality for a given byte rate.
Parameters:
bps | Bytes per second. |
Returns: AudioQuality.
AudioQuality getRandomQuality (Randomizer* randomizer) |
Get a random quality setting. All settings have the same probability.
Returns: Random quality setting.
static const card16* ValidRatesTable |
Table with valid sampling rate values.
static const cardinal ValidRates |
Number of valid sampling rates in ValidRatesTable.
static const card8* ValidBitsTable |
Table with valid bit values.
static const cardinal ValidBits |
Number of valid bits values in ValidRatesTable.
static const card8* ValidChannelsTable |
Table with valid channel values.
static const cardinal ValidChannels |
Number of valid channels values in ValidRatesTable.
static const AudioQuality LowestQuality |
Constant for lowest quality.
static const AudioQuality HighestQuality |
Constant for highest quality.
static const card16 LowestSamplingRate |
Constant for lowest sampling rate.
static const card16 HighestSamplingRate |
Constant for highest sampling rate.
static const card8 LowestBits |
Constant for lowest number of bits.
static const card8 HighestBits |
Constant for highest number of bits.
static const card8 LowestChannels |
Constant for lowest number of channels.
static const card8 HighestChannels |
Constant for highest number of channels.
static const cardinal QualityLevels |
Number of quality levels supported by operator++/operator--.