20 #ifndef MPD_DECODER_BRIDGE_HXX
21 #define MPD_DECODER_BRIDGE_HXX
105 initial_seek_pending(_initial_seek_pending),
146 const void *data,
size_t length,
147 uint16_t kbit_rate)
override;
157 bool PrepareInitialSeek();
gcc_pure bool CheckCancelRead() const
Should be read operation be cancelled? That is the case when the player thread has sent a command suc...
DecoderCommand GetCommand() override
Determines the pending decoder command.
An interface between the decoder plugin and the MPD core.
MusicChunk * GetChunk()
Returns the current chunk the decoder writes to, or allocates a new chunk if there is none...
Tag * decoder_tag
the last tag received from the decoder plugin
bool initial_seek_pending
Is the initial seek (to the start position of the sub-song) pending, or has it been performed already...
The meta information about a song file.
A time stamp within a song.
PcmConvert * convert
For converting input data to the configured audio format.
void FlushChunk()
Flushes the current chunk.
void SeekError() override
Call this instead of CommandFinished() when seeking has failed.
ReplayGainInfo replay_gain_info
DecoderBridge(DecoderControl &_dc, bool _initial_seek_pending, Tag *_tag)
MusicChunk * current_chunk
the chunk currently being written to
std::exception_ptr error
An error has occurred (in DecoderAPI.cxx), and the plugin will be asked to stop.
unsigned replay_gain_serial
A positive serial number for checking if replay gain info has changed since the last check...
DecoderCommand SubmitData(InputStream *is, const void *data, size_t length, uint16_t kbit_rate) override
This function is called by the decoder plugin when it has successfully decoded block of input data...
bool seeking
This flag is set by GetSeekTime(), and checked by CommandFinished().
double timestamp
The time stamp of the next data chunk, in seconds.
size_t Read(InputStream &is, void *buffer, size_t length) override
Blocking read from the input stream.
void SubmitTimestamp(double t) override
Sets the time stamp for the next data chunk [seconds].
void CommandFinished() override
Called by the decoder when it has performed the requested command (dc->command).
std::unique_ptr< InputStream > InputStreamPtr
void SubmitMixRamp(MixRampInfo &&mix_ramp) override
Store MixRamp tags.
bool initial_seek_running
Is the initial seek currently running? During this time, the decoder command is SEEK.
SongTime GetSeekTime() override
Call this when you have received the DecoderCommand::SEEK command.
A variant of SongTime that is based on a signed integer.
Tag * stream_tag
the last tag received from the stream
void SubmitReplayGain(const ReplayGainInfo *replay_gain_info) override
Set replay gain values for the following chunks.
DecoderCommand SubmitTag(InputStream *is, Tag &&tag) override
This function is called by the decoder plugin when it has successfully decoded a tag.
Tag * song_tag
The tag from the song object.
This object is statically allocated (within another struct), and holds buffer allocations and the sta...
uint64_t GetSeekFrame() override
Call this when you have received the DecoderCommand::SEEK command.
void Ready(AudioFormat audio_format, bool seekable, SignedSongTime duration) override
Notify the client that it has finished initialization and that it has read the song's meta data...
const Storage const char * uri
A bridge between the DecoderClient interface and the MPD core (DecoderControl, MusicPipe etc...
InputStreamPtr OpenUri(const char *uri) override
Open a new InputStream and wait until it's ready.