snapcast/client/controller.h
(no author) 6354d55f78 server buffer
git-svn-id: svn://elaine/murooma/trunk@296 d8a302eb-03bc-478d-80e4-98257eca68ef
2014-09-25 16:34:13 +00:00

34 lines
746 B
C++

#ifndef CONTROLLER_H
#define CONTROLLER_H
#include <thread>
#include <atomic>
#include "message/message.h"
#include "clientConnection.h"
#include "decoder.h"
#include "stream.h"
class Controller : public MessageReceiver
{
public:
Controller();
void start(const std::string& _ip, size_t _port);
void stop();
virtual void onMessageReceived(ClientConnection* connection, const BaseMessage& baseMessage, char* buffer);
virtual void onException(ClientConnection* connection, const std::exception& exception);
private:
void worker();
std::atomic<bool> active_;
std::thread* controllerThread;
ClientConnection* clientConnection;
Stream* stream;
std::string ip;
std::shared_ptr<SampleFormat> sampleFormat;
Decoder* decoder;
};
#endif