MPD
0.20.18
|
This structure describes the format of a raw PCM stream. More...
#include <AudioFormat.hxx>
Public Member Functions | |
AudioFormat ()=default | |
constexpr | AudioFormat (uint32_t _sample_rate, SampleFormat _format, uint8_t _channels) |
void | Clear () |
Clears the object, i.e. More... | |
constexpr bool | IsDefined () const |
Checks whether the object has a defined value. More... | |
constexpr bool | IsFullyDefined () const |
Checks whether the object is full, i.e. More... | |
constexpr bool | IsMaskDefined () const |
Checks whether the object has at least one defined value. More... | |
bool | IsValid () const |
Returns false if the format is not valid for playback with MPD. More... | |
bool | IsMaskValid () const |
Returns false if the format mask is not valid for playback with MPD. More... | |
constexpr bool | operator== (const AudioFormat other) const |
constexpr bool | operator!= (const AudioFormat other) const |
void | ApplyMask (AudioFormat mask) noexcept |
gcc_pure AudioFormat | WithMask (AudioFormat mask) const noexcept |
unsigned | GetSampleSize () const |
Returns the size of each (mono) sample in bytes. More... | |
unsigned | GetFrameSize () const |
Returns the size of each full frame in bytes. More... | |
double | GetTimeToSize () const |
Returns the floating point factor which converts a time span to a storage size in bytes. More... | |
Static Public Member Functions | |
static constexpr AudioFormat | Undefined () |
Data Fields | |
uint32_t | sample_rate |
The sample rate in Hz. More... | |
SampleFormat | format |
The format samples are stored in. More... | |
uint8_t | channels |
The number of channels. More... | |
This structure describes the format of a raw PCM stream.
Definition at line 37 of file AudioFormat.hxx.
|
default |
|
inline |
Definition at line 70 of file AudioFormat.hxx.
|
noexcept |
|
inline |
Clears the object, i.e.
sets all attributes to an undefined (invalid) value.
Definition at line 83 of file AudioFormat.hxx.
|
inline |
Returns the size of each full frame in bytes.
Definition at line 206 of file AudioFormat.hxx.
|
inline |
Returns the size of each (mono) sample in bytes.
Definition at line 200 of file AudioFormat.hxx.
|
inline |
Returns the floating point factor which converts a time span to a storage size in bytes.
Definition at line 212 of file AudioFormat.hxx.
|
inline |
Checks whether the object has a defined value.
Definition at line 92 of file AudioFormat.hxx.
|
inline |
Checks whether the object is full, i.e.
all attributes are defined. This is more complete than IsDefined(), but slower.
Definition at line 101 of file AudioFormat.hxx.
|
inline |
Checks whether the object has at least one defined value.
Definition at line 109 of file AudioFormat.hxx.
|
inline |
Returns false if the format mask is not valid for playback with MPD.
This function performs some basic validity checks.
Definition at line 190 of file AudioFormat.hxx.
|
inline |
Returns false if the format is not valid for playback with MPD.
This function performs some basic validity checks.
Definition at line 178 of file AudioFormat.hxx.
|
inline |
Definition at line 123 of file AudioFormat.hxx.
|
inline |
Definition at line 117 of file AudioFormat.hxx.
|
inlinestatic |
Definition at line 75 of file AudioFormat.hxx.
|
inlinenoexcept |
Definition at line 130 of file AudioFormat.hxx.
uint8_t AudioFormat::channels |
The number of channels.
Channel order follows the FLAC convention (https://xiph.org/flac/format.html):
Definition at line 66 of file AudioFormat.hxx.
SampleFormat AudioFormat::format |
The format samples are stored in.
See the #sample_format enum for valid values.
Definition at line 49 of file AudioFormat.hxx.
uint32_t AudioFormat::sample_rate |
The sample rate in Hz.
A better name for this attribute is "frame rate", because technically, you have two samples per frame in stereo sound.
Definition at line 43 of file AudioFormat.hxx.