M2-PT-DRP/source/behavior/tasks/server/ServerTask.hpp

36 lines
573 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.
*/
// void use(Context &context);
void handle(Context& context) override;
private:
mpg123_handle* mpgHandle;
long sampleRate;
int channels;
int encoding;
};
}