M2-PT-DRP/source/behavior/tasks/server/ServerTask.hpp
study-faraphel a7c1bba666 reorganised some parts of the code
Utils moved to subdirectories
Task activation have been moved to static member of the Task class, instead of being manually activated.
2024-11-26 21:57:37 +01:00

37 lines
660 B
C++

#pragma once
#include <mpg123.h>
#include <netdb.h>
#include "../base/BaseTask.hpp"
namespace drp::task {
/**
* the audio Server.
* Read and broadcast audio data.
*/
class ServerTask : public BaseTask {
public:
explicit ServerTask();
~ServerTask() override;
/**
* Set this task as the current one.
* @param context the context to apply the state on.
* @param server the server to use.
*/
static void use(Context& context, const std::shared_ptr<RemotePeer>& server);
void handle(Context& context) override;
private:
mpg123_handle* mpgHandle;
long sampleRate;
int channels;
int encoding;
};
}