SndioOutput: Move class definition to header

no change in behaviour.
This commit is contained in:
Christopher Zimmermann 2017-09-16 07:57:34 +02:00
parent 4d563e08e1
commit ae941a7665
2 changed files with 24 additions and 20 deletions

View File

@ -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()
{

View File

@ -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