RecordControlApplication/TcpController.h

30 lines
670 B
C
Raw Normal View History

2024-01-18 15:41:43 +08:00
#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