|
MPD
0.20.23
|
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 36 of file AudioFormat.hxx.
|
default |
|
inline |
Definition at line 69 of file AudioFormat.hxx.
|
noexcept |
|
inline |
Clears the object, i.e.
sets all attributes to an undefined (invalid) value.
Definition at line 82 of file AudioFormat.hxx.
|
inline |
Returns the size of each full frame in bytes.
Definition at line 205 of file AudioFormat.hxx.
|
inline |
Returns the size of each (mono) sample in bytes.
Definition at line 199 of file AudioFormat.hxx.
|
inline |
Returns the floating point factor which converts a time span to a storage size in bytes.
Definition at line 211 of file AudioFormat.hxx.
|
inline |
Checks whether the object has a defined value.
Definition at line 91 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 100 of file AudioFormat.hxx.
|
inline |
Checks whether the object has at least one defined value.
Definition at line 108 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 189 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 177 of file AudioFormat.hxx.
|
inline |
Definition at line 122 of file AudioFormat.hxx.
|
inline |
Definition at line 116 of file AudioFormat.hxx.
|
inlinestatic |
Definition at line 74 of file AudioFormat.hxx.
|
inlinenoexcept |
Definition at line 129 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 65 of file AudioFormat.hxx.
| SampleFormat AudioFormat::format |
The format samples are stored in.
See the #sample_format enum for valid values.
Definition at line 48 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 42 of file AudioFormat.hxx.
1.8.15