output/roar: use AudioOutputWrapper::Init()

This commit is contained in:
Max Kellermann 2017-01-25 09:56:51 +01:00
parent b79ce77ec5
commit ddd8b16f2b

View File

@ -58,6 +58,10 @@ public:
return &base; return &base;
} }
static RoarOutput *Create(const ConfigBlock &block) {
return new RoarOutput(block);
}
void Open(AudioFormat &audio_format); void Open(AudioFormat &audio_format);
void Close(); void Close();
@ -133,12 +137,6 @@ roar_output_set_volume(RoarOutput &roar, unsigned volume)
roar.SetVolume(volume); roar.SetVolume(volume);
} }
static AudioOutput *
roar_init(const ConfigBlock &block)
{
return *new RoarOutput(block);
}
static void static void
roar_use_audio_format(struct roar_audio_info *info, roar_use_audio_format(struct roar_audio_info *info,
AudioFormat &audio_format) AudioFormat &audio_format)
@ -348,26 +346,19 @@ RoarOutput::SendTag(const Tag &tag)
roar_vs_meta(vss, vals, cnt, &(err)); roar_vs_meta(vss, vals, cnt, &(err));
} }
static void
roar_send_tag(AudioOutput *ao, const Tag &meta)
{
RoarOutput *self = (RoarOutput *)ao;
self->SendTag(meta);
}
typedef AudioOutputWrapper<RoarOutput> Wrapper; typedef AudioOutputWrapper<RoarOutput> Wrapper;
const struct AudioOutputPlugin roar_output_plugin = { const struct AudioOutputPlugin roar_output_plugin = {
"roar", "roar",
nullptr, nullptr,
roar_init, &Wrapper::Init,
&Wrapper::Finish, &Wrapper::Finish,
nullptr, nullptr,
nullptr, nullptr,
&Wrapper::Open, &Wrapper::Open,
&Wrapper::Close, &Wrapper::Close,
nullptr, nullptr,
roar_send_tag, &Wrapper::SendTag,
&Wrapper::Play, &Wrapper::Play,
nullptr, nullptr,
&Wrapper::Cancel, &Wrapper::Cancel,