-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhyper.h
66 lines (49 loc) · 1.38 KB
/
hyper.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#ifndef HYPER_H
#define HYPER_H
#include <QObject>
#include <QtNetwork>
#include <QMediaPlayer>
#include <QMediaPlaylist>
class CuteHyper : public QObject
{
Q_OBJECT
Q_PROPERTY(QString status MEMBER m_status NOTIFY statusChanged)
Q_PROPERTY(int speed MEMBER m_speed NOTIFY speedChanged)
Q_PROPERTY(int loop MEMBER m_loop NOTIFY loopChanged)
public:
explicit CuteHyper(QObject *parent = nullptr);
Q_INVOKABLE void setStatus(QString status);
Q_INVOKABLE void setTimecode(int tc);
Q_INVOKABLE void setDuration(int du);
Q_INVOKABLE void setClips(int clips);
Q_INVOKABLE QMediaPlaylist *getPlaylist(void) { return m_playlist; };
signals:
void play();
void stop();
void record();
void statusChanged();
void speedChanged();
void loopChanged();
protected slots:
private slots:
void onReadyRead();
void disconnectRemoteAccess();
void newConnection();
private:
QTcpServer *m_server;
QMediaPlaylist *m_playlist;
uint m_connections;
QString m_status;
int m_tc;
int m_speed;
int m_clips;
int m_clip_len;
bool m_slot_1;
bool m_slot_2;
int m_clip;
int m_loop;
void writeResponse(QTcpSocket *con, QString key, QString val);
void writeResponse(QTcpSocket *con, QString key, bool val);
void writeResponse(QTcpSocket *con, QString key, int val);
};
#endif // HYPER_H