From ae941a766547f4b33d3f1d47bb7f2cf65b83d9ac Mon Sep 17 00:00:00 2001 From: Christopher Zimmermann Date: Sat, 16 Sep 2017 07:57:34 +0200 Subject: [PATCH] SndioOutput: Move class definition to header no change in behaviour. --- src/output/plugins/SndioOutputPlugin.cxx | 25 +++++------------------- src/output/plugins/SndioOutputPlugin.hxx | 19 ++++++++++++++++++ 2 files changed, 24 insertions(+), 20 deletions(-) diff --git a/src/output/plugins/SndioOutputPlugin.cxx b/src/output/plugins/SndioOutputPlugin.cxx index 5f3ab23c5..bcda3126a 100644 --- a/src/output/plugins/SndioOutputPlugin.cxx +++ b/src/output/plugins/SndioOutputPlugin.cxx @@ -19,7 +19,6 @@ #include "config.h" #include "SndioOutputPlugin.hxx" -#include "../OutputAPI.hxx" #include "util/Domain.hxx" #include "Log.hxx" @@ -44,25 +43,6 @@ static constexpr unsigned MPD_SNDIO_BUFFER_TIME_MS = 250; static constexpr Domain sndio_output_domain("sndio_output"); -class SndioOutput final : AudioOutput { - const char *const device; - const unsigned buffer_time; /* in ms */ - struct sio_hdl *sio_hdl; - -public: - SndioOutput(const ConfigBlock &block); - - static AudioOutput *Create(EventLoop &, - const ConfigBlock &block) { - return new SndioOutput(block); - } - -private: - void Open(AudioFormat &audio_format) override; - void Close() noexcept override; - size_t Play(const void *chunk, size_t size) override; -}; - SndioOutput::SndioOutput(const ConfigBlock &block) :AudioOutput(0), device(block.GetBlockValue("device", SIO_DEVANY)), @@ -71,6 +51,11 @@ SndioOutput::SndioOutput(const ConfigBlock &block) { } +AudioOutput * +SndioOutput::Create(EventLoop &, const ConfigBlock &block) { + return new SndioOutput(block); +} + static bool sndio_test_default_device() { diff --git a/src/output/plugins/SndioOutputPlugin.hxx b/src/output/plugins/SndioOutputPlugin.hxx index 5ad43f0f6..288042d40 100644 --- a/src/output/plugins/SndioOutputPlugin.hxx +++ b/src/output/plugins/SndioOutputPlugin.hxx @@ -17,9 +17,28 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#include "../OutputAPI.hxx" + #ifndef MPD_SNDIO_OUTPUT_PLUGIN_HXX #define MPD_SNDIO_OUTPUT_PLUGIN_HXX extern const struct AudioOutputPlugin sndio_output_plugin; +class SndioOutput final : AudioOutput { + const char *const device; + const unsigned buffer_time; /* in ms */ + struct sio_hdl *sio_hdl; + +public: + SndioOutput(const ConfigBlock &block); + + static AudioOutput *Create(EventLoop &, + const ConfigBlock &block); + +private: + void Open(AudioFormat &audio_format) override; + void Close() noexcept override; + size_t Play(const void *chunk, size_t size) override; +}; + #endif