From 00830a20e3231460bf8927844fd6fed0ddad5c0a Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 3 Aug 2019 07:48:50 +0200 Subject: [PATCH] decoder/mad: convert to class, make almost everything private --- src/decoder/plugins/MadDecoderPlugin.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/decoder/plugins/MadDecoderPlugin.cxx b/src/decoder/plugins/MadDecoderPlugin.cxx index f30c3d7ae..8bddf14be 100644 --- a/src/decoder/plugins/MadDecoderPlugin.cxx +++ b/src/decoder/plugins/MadDecoderPlugin.cxx @@ -106,7 +106,7 @@ mad_plugin_init(const ConfigBlock &block) return true; } -struct MadDecoder { +class MadDecoder { static constexpr size_t READ_BUFFER_SIZE = 40960; static constexpr size_t MP3_DATA_OUTPUT_BUFFER_SIZE = 2048; @@ -136,12 +136,14 @@ struct MadDecoder { InputStream &input_stream; enum mad_layer layer = mad_layer(0); +public: MadDecoder(DecoderClient *client, InputStream &input_stream) noexcept; ~MadDecoder() noexcept; void RunDecoder() noexcept; bool RunScan(TagHandler &handler) noexcept; +private: bool Seek(long offset) noexcept; bool FillBuffer() noexcept; void ParseId3(size_t tagsize, Tag *tag) noexcept;