SndioOutput: Move class definition to header
no change in behaviour.
This commit is contained in:
parent
4d563e08e1
commit
ae941a7665
@ -19,7 +19,6 @@
|
|||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "SndioOutputPlugin.hxx"
|
#include "SndioOutputPlugin.hxx"
|
||||||
#include "../OutputAPI.hxx"
|
|
||||||
#include "util/Domain.hxx"
|
#include "util/Domain.hxx"
|
||||||
#include "Log.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");
|
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)
|
SndioOutput::SndioOutput(const ConfigBlock &block)
|
||||||
:AudioOutput(0),
|
:AudioOutput(0),
|
||||||
device(block.GetBlockValue("device", SIO_DEVANY)),
|
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
|
static bool
|
||||||
sndio_test_default_device()
|
sndio_test_default_device()
|
||||||
{
|
{
|
||||||
|
@ -17,9 +17,28 @@
|
|||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "../OutputAPI.hxx"
|
||||||
|
|
||||||
#ifndef MPD_SNDIO_OUTPUT_PLUGIN_HXX
|
#ifndef MPD_SNDIO_OUTPUT_PLUGIN_HXX
|
||||||
#define MPD_SNDIO_OUTPUT_PLUGIN_HXX
|
#define MPD_SNDIO_OUTPUT_PLUGIN_HXX
|
||||||
|
|
||||||
extern const struct AudioOutputPlugin sndio_output_plugin;
|
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
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user