controller

git-svn-id: svn://elaine/murooma/trunk@242 d8a302eb-03bc-478d-80e4-98257eca68ef
This commit is contained in:
(no author) 2014-09-09 20:31:03 +00:00
parent e342a4108e
commit 00fac3eccb
15 changed files with 126 additions and 116 deletions

View file

@ -1,9 +1,10 @@
#ifndef CONTROLLER_H
#define CONTROLLER_H
#include <string>
#include <thread>
#include <atomic>
#include "common/message.h"
#include "decoder.h"
#include "serverConnection.h"
@ -11,14 +12,19 @@ class Controller : public MessageReceiver
{
public:
Controller();
void start();
void start(std::string& _ip, size_t _port, int _bufferMs);
void stop();
virtual void onMessageReceived(BaseMessage* message);
virtual void onMessageReceived(tcp::socket* socket, const BaseMessage& baseMessage, char* buffer);
private:
void worker();
std::atomic<bool> active_;
std::thread* controllerThread;
ServerConnection* connection;
SampleFormat* sampleFormat;
Decoder* decoder;
Stream* stream;
int bufferMs;
};