forked from obsproject/obs-studio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwindow-basic-status-bar.hpp
72 lines (54 loc) · 1.44 KB
/
window-basic-status-bar.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
60
61
62
63
64
65
66
67
68
69
70
71
72
#pragma once
#include <QStatusBar>
#include <QPointer>
#include <QTimer>
#include <util/platform.h>
#include <obs.h>
class QLabel;
class OBSBasicStatusBar : public QStatusBar {
Q_OBJECT
private:
QLabel *delayInfo;
QLabel *droppedFrames;
QLabel *sessionTime;
QLabel *cpuUsage;
QLabel *kbps;
obs_output_t *streamOutput = nullptr;
obs_output_t *recordOutput = nullptr;
bool active = false;
int retries = 0;
int totalSeconds = 0;
int reconnectTimeout = 0;
int delaySecTotal = 0;
int delaySecStarting = 0;
int delaySecStopping = 0;
int startSkippedFrameCount = 0;
int startTotalFrameCount = 0;
int lastSkippedFrameCount = 0;
int bitrateUpdateSeconds = 0;
uint64_t lastBytesSent = 0;
uint64_t lastBytesSentTime = 0;
QPointer<QTimer> refreshTimer;
obs_output_t *GetOutput();
void Activate();
void Deactivate();
void UpdateDelayMsg();
void UpdateBandwidth();
void UpdateSessionTime();
void UpdateDroppedFrames();
static void OBSOutputReconnect(void *data, calldata_t *params);
static void OBSOutputReconnectSuccess(void *data, calldata_t *params);
private slots:
void Reconnect(int seconds);
void ReconnectSuccess();
void UpdateStatusBar();
void UpdateCPUUsage();
public:
OBSBasicStatusBar(QWidget *parent);
void StreamDelayStarting(int sec);
void StreamDelayStopping(int sec);
void StreamStarted(obs_output_t *output);
void StreamStopped();
void RecordingStarted(obs_output_t *output);
void RecordingStopped();
};