decoder/Bridge: make many attributes private

This commit is contained in:
Max Kellermann
2019-04-05 08:38:40 +02:00
parent 6be3c99876
commit a19eee78c6
2 changed files with 25 additions and 10 deletions

View File

@@ -40,6 +40,7 @@ class DecoderBridge final : public DecoderClient {
public:
DecoderControl &dc;
private:
/**
* For converting input data to the configured audio format.
* nullptr means no conversion necessary.
@@ -83,12 +84,14 @@ public:
*/
std::unique_ptr<Tag> song_tag;
public:
/** the last tag received from the stream */
std::unique_ptr<Tag> stream_tag;
/** the last tag received from the decoder plugin */
std::unique_ptr<Tag> decoder_tag;
private:
/** the chunk currently being written to */
MusicChunkPtr current_chunk;
@@ -106,11 +109,16 @@ public:
*/
std::exception_ptr error;
public:
DecoderBridge(DecoderControl &_dc, bool _initial_seek_pending,
std::unique_ptr<Tag> _tag) noexcept;
~DecoderBridge() noexcept;
void Reset() noexcept {
error = {};
}
/**
* Should be read operation be cancelled? That is the case when the
* player thread has sent a command such as "STOP".
@@ -135,6 +143,16 @@ public:
*/
void FlushChunk() noexcept;
void CheckFlushChunk() {
if (current_chunk != nullptr)
FlushChunk();
}
void CheckRethrowError() {
if (error)
std::rethrow_exception(error);
}
/* virtual methods from DecoderClient */
void Ready(AudioFormat audio_format,
bool seekable, SignedSongTime duration) override;