output/httpd: use AudioOutputWrapper

This commit is contained in:
Max Kellermann
2017-01-25 10:03:17 +01:00
parent ddd8b16f2b
commit 8d70d10aba
2 changed files with 43 additions and 96 deletions

View File

@@ -26,6 +26,7 @@
#define MPD_OUTPUT_HTTPD_INTERNAL_H
#include "HttpdClient.hxx"
#include "output/Wrapper.hxx"
#include "output/Internal.hxx"
#include "output/Timer.hxx"
#include "thread/Mutex.hxx"
@@ -49,6 +50,8 @@ class Encoder;
struct Tag;
class HttpdOutput final : ServerSocket, DeferredMonitor {
friend struct AudioOutputWrapper<HttpdOutput>;
AudioOutput base;
/**
@@ -152,9 +155,7 @@ public:
HttpdOutput(EventLoop &_loop, const ConfigBlock &block);
~HttpdOutput();
operator AudioOutput *() {
return &base;
}
static HttpdOutput *Create(const ConfigBlock &block);
#if CLANG_OR_GCC_VERSION(4,7)
constexpr
@@ -168,6 +169,14 @@ public:
void Bind();
void Unbind();
void Enable() {
Bind();
}
void Disable() {
Unbind();
}
/**
* Caller must lock the mutex.
*
@@ -249,6 +258,9 @@ public:
void CancelAllClients();
void Cancel();
bool Pause();
private:
virtual void RunDeferred() override;