From ec41caade4ce07aca9097cf8298c9da04eea35e2 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 7 Jan 2015 19:20:09 +0100 Subject: output/wrapper: add method SendTag() --- src/output/Wrapper.hxx | 6 ++++++ src/output/plugins/RecorderOutputPlugin.cxx | 10 +--------- 2 files changed, 7 insertions(+), 9 deletions(-) (limited to 'src/output') diff --git a/src/output/Wrapper.hxx b/src/output/Wrapper.hxx index f4184440f..e6af29634 100644 --- a/src/output/Wrapper.hxx +++ b/src/output/Wrapper.hxx @@ -67,6 +67,12 @@ struct AudioOutputWrapper { return t.Delay(); } + gcc_pure + static void SendTag(AudioOutput *ao, const Tag &tag) { + T &t = Cast(*ao); + t.SendTag(tag); + } + static size_t Play(AudioOutput *ao, const void *chunk, size_t size, Error &error) { T &t = Cast(*ao); diff --git a/src/output/plugins/RecorderOutputPlugin.cxx b/src/output/plugins/RecorderOutputPlugin.cxx index aedd54707..8f5379d74 100644 --- a/src/output/plugins/RecorderOutputPlugin.cxx +++ b/src/output/plugins/RecorderOutputPlugin.cxx @@ -227,14 +227,6 @@ RecorderOutput::SendTag(const Tag &tag) LogError(error); } -static void -recorder_output_send_tag(AudioOutput *ao, const Tag &tag) -{ - RecorderOutput &recorder = *(RecorderOutput *)ao; - - recorder.SendTag(tag); -} - inline size_t RecorderOutput::Play(const void *chunk, size_t size, Error &error) { @@ -255,7 +247,7 @@ const struct AudioOutputPlugin recorder_output_plugin = { &Wrapper::Open, &Wrapper::Close, nullptr, - recorder_output_send_tag, + &Wrapper::SendTag, &Wrapper::Play, nullptr, nullptr, -- cgit v1.2.3