mirror of
https://github.com/badaix/snapcast.git
synced 2025-05-01 19:26:58 +02:00
35 lines
719 B
C++
35 lines
719 B
C++
#ifndef CONTROLLER_H
|
|
#define CONTROLLER_H
|
|
|
|
#include <thread>
|
|
#include <atomic>
|
|
#include "common/message.h"
|
|
#include "common/socketConnection.h"
|
|
#include "streamClient.h"
|
|
#include "decoder.h"
|
|
#include "stream.h"
|
|
|
|
|
|
class Controller : public MessageReceiver
|
|
{
|
|
public:
|
|
Controller();
|
|
void start(const std::string& _ip, size_t _port, int _bufferMs);
|
|
void stop();
|
|
virtual void onMessageReceived(SocketConnection* connection, const BaseMessage& baseMessage, char* buffer);
|
|
|
|
private:
|
|
void worker();
|
|
std::atomic<bool> active_;
|
|
std::thread* controllerThread;
|
|
ClientConnection* controlConnection;
|
|
Stream* stream;
|
|
int bufferMs;
|
|
std::string ip;
|
|
std::shared_ptr<SampleFormat> sampleFormat;
|
|
Decoder* decoder;
|
|
};
|
|
|
|
|
|
#endif
|
|
|