-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathObsAutoRecord.hpp
59 lines (52 loc) · 1.43 KB
/
ObsAutoRecord.hpp
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
#ifndef OBSAUTORECORD_H
#define OBSAUTORECORD_H
#include <QHash>
#include <QJsonObject>
#include <QSet>
#include <QString>
#include <QtCore/QObject>
#include <QTimer>
#include "ObsAutoRecordState.hpp"
#include "ObsUtils.hpp"
#include "ObsWebSocket.hpp"
class ObsAutoRecord : public QObject
{
Q_OBJECT
public:
explicit ObsAutoRecord(
const QUrl &url,
const int &interval,
const QString &folder,
QHash<QString, QString> &appsToWatch,
bool debug = false,
QObject *parent = nullptr);
void setAddress(const QUrl &url);
void setInterval(const int &interval);
void setFolder(const QString &folder);
void toggleIsPaused();
signals:
void onStateUpdate(ObsAutoRecordState state);
private slots:
void pingStatus();
void startRecording();
void setFilenameFormatting(const QString &appName, int msgid);
void changeFolderBack();
void onStatus(const QJsonObject &msg);
void setIsConnected(bool isConnected);
private:
void pingStatusOverrideTimer();
void internalUpdateState();
ObsWebSocket m_obsWebSocket;
QUrl m_url;
int m_interval;
QString m_folder;
QHash<QString, QString> &m_appsToWatch;
bool m_debug;
int m_msgid = 0;
QTimer *timer;
QString defaultFilenameFormatting = "%CCYY-%MM-%DD %hh-%mm-%ss";
QSet<int> idsWaitToRecord;
bool m_isConnected = false;
bool m_isPaused = false;
};
#endif // OBSAUTORECORD_H