RecordControlApplication/TcpController.h
2024-01-17 23:41:43 -08:00

30 lines
670 B
C++

#ifndef TCPCONTROLLER_H
#define TCPCONTROLLER_H
#include <QMap>
#include <QObject>
#include <QTcpSocket>
#include <functional>
using Routes = QMap<QString, std::function<void(QTcpSocket*)>>;
class TcpController : public QObject {
Q_OBJECT
public:
TcpController(QObject* parent = nullptr);
Routes getRoutes();
private:
Routes routes;
void setIpaddr(QTcpSocket* socket);
void setVideoEnc(QTcpSocket* socket);
void getFileList(QTcpSocket* socket);
void downloadFile(QTcpSocket* socket);
void deleteFile(QTcpSocket* socket);
void playLive(QTcpSocket* socket);
void playFile(QTcpSocket* socket);
};
#endif // TCPCONTROLLER_H