MPD
0.20.15
|
A chunk of music data. More...
#include <MusicChunk.hxx>
Public Member Functions | |
MusicChunk ()=default | |
MusicChunk (const MusicChunk &)=delete | |
~MusicChunk () | |
MusicChunk & | operator= (const MusicChunk &)=delete |
bool | IsEmpty () const |
gcc_pure bool | CheckFormat (AudioFormat audio_format) const noexcept |
Checks if the audio format if the chunk is equal to the specified audio_format. More... | |
WritableBuffer< void > | Write (AudioFormat af, SongTime data_time, uint16_t bit_rate) noexcept |
Prepares appending to the music chunk. More... | |
bool | Expand (AudioFormat af, size_t length) noexcept |
Increases the length of the chunk after the caller has written to the buffer returned by Write(). More... | |
Data Fields | |
MusicChunk * | next |
the next chunk in a linked list More... | |
MusicChunk * | other = nullptr |
An optional chunk which should be mixed into this chunk. More... | |
float | mix_ratio |
The current mix ratio for cross-fading: 1.0 means play 100% of this chunk, 0.0 means play 100% of the "other" chunk. More... | |
uint16_t | length = 0 |
number of bytes stored in this chunk More... | |
uint16_t | bit_rate |
current bit rate of the source file More... | |
SignedSongTime | time |
the time stamp within the song More... | |
Tag * | tag = nullptr |
An optional tag associated with this chunk (and the following chunks); appears at song boundaries. More... | |
ReplayGainInfo | replay_gain_info |
Replay gain information associated with this chunk. More... | |
unsigned | replay_gain_serial |
A serial number for checking if replay gain info has changed since the last chunk. More... | |
uint8_t | data [CHUNK_SIZE] |
the data (probably PCM) More... | |
AudioFormat | audio_format |
Static Public Attributes | |
static constexpr unsigned | IGNORE_REPLAY_GAIN = ~0u |
A magic value for replay_gain_serial which omits updating the #ReplayGainFilter. More... | |
A chunk of music data.
Its format is defined by the MusicPipe::Push() caller.
Definition at line 43 of file MusicChunk.hxx.
|
default |
|
delete |
MusicChunk::~MusicChunk | ( | ) |
|
noexcept |
Checks if the audio format if the chunk is equal to the specified audio_format.
|
noexcept |
Increases the length of the chunk after the caller has written to the buffer returned by Write().
af | the audio format for the appended data; must stay the same for the life cycle of this chunk |
length | the number of bytes which were appended |
|
inline |
Definition at line 112 of file MusicChunk.hxx.
|
delete |
|
noexcept |
Prepares appending to the music chunk.
Returns a buffer where you may write into. After you are finished, call Expand().
af | the audio format for the appended data; must stay the same for the life cycle of this chunk |
data_time | the time within the song |
bit_rate | the current bit rate of the source file |
AudioFormat MusicChunk::audio_format |
Definition at line 101 of file MusicChunk.hxx.
uint16_t MusicChunk::bit_rate |
current bit rate of the source file
Definition at line 63 of file MusicChunk.hxx.
uint8_t MusicChunk::data[CHUNK_SIZE] |
the data (probably PCM)
Definition at line 98 of file MusicChunk.hxx.
|
static |
A magic value for replay_gain_serial which omits updating the #ReplayGainFilter.
This is used by "silence" chunks (see PlayerThread::SendSilence()) so they don't affect the replay gain.
Definition at line 88 of file MusicChunk.hxx.
uint16_t MusicChunk::length = 0 |
number of bytes stored in this chunk
Definition at line 60 of file MusicChunk.hxx.
float MusicChunk::mix_ratio |
The current mix ratio for cross-fading: 1.0 means play 100% of this chunk, 0.0 means play 100% of the "other" chunk.
Definition at line 57 of file MusicChunk.hxx.
MusicChunk* MusicChunk::next |
the next chunk in a linked list
Definition at line 45 of file MusicChunk.hxx.
MusicChunk* MusicChunk::other = nullptr |
An optional chunk which should be mixed into this chunk.
This is used for cross-fading.
Definition at line 51 of file MusicChunk.hxx.
ReplayGainInfo MusicChunk::replay_gain_info |
Replay gain information associated with this chunk.
Only valid if the serial is not 0.
Definition at line 80 of file MusicChunk.hxx.
unsigned MusicChunk::replay_gain_serial |
A serial number for checking if replay gain info has changed since the last chunk.
The magic value 0 indicates that there is no replay gain info available.
Definition at line 95 of file MusicChunk.hxx.
Tag* MusicChunk::tag = nullptr |
An optional tag associated with this chunk (and the following chunks); appears at song boundaries.
The tag object is owned by this chunk, and must be freed when this chunk is deinitialized.
Definition at line 74 of file MusicChunk.hxx.
SignedSongTime MusicChunk::time |
the time stamp within the song
Definition at line 66 of file MusicChunk.hxx.