2014-07-06 16:19:27 -07:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <QStatusBar>
|
|
|
|
#include <QPointer>
|
|
|
|
#include <QTimer>
|
|
|
|
#include <util/platform.h>
|
|
|
|
#include <obs.h>
|
|
|
|
|
|
|
|
class QLabel;
|
|
|
|
|
|
|
|
class OBSBasicStatusBar : public QStatusBar {
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
private:
|
2015-09-06 16:19:53 -07:00
|
|
|
QLabel *delayInfo;
|
2014-07-06 16:19:27 -07:00
|
|
|
QLabel *droppedFrames;
|
|
|
|
QLabel *sessionTime;
|
|
|
|
QLabel *cpuUsage;
|
|
|
|
QLabel *kbps;
|
2016-12-07 18:00:56 -08:00
|
|
|
QLabel *statusSquare;
|
2014-07-06 16:19:27 -07:00
|
|
|
|
2014-09-25 17:44:05 -07:00
|
|
|
obs_output_t *streamOutput = nullptr;
|
|
|
|
obs_output_t *recordOutput = nullptr;
|
2015-09-06 16:19:53 -07:00
|
|
|
bool active = false;
|
2016-08-13 07:36:17 -07:00
|
|
|
bool overloadedNotify = true;
|
2014-07-06 16:19:27 -07:00
|
|
|
|
|
|
|
int retries = 0;
|
|
|
|
int totalSeconds = 0;
|
|
|
|
|
2015-05-10 16:18:11 -07:00
|
|
|
int reconnectTimeout = 0;
|
|
|
|
|
2015-09-06 16:19:53 -07:00
|
|
|
int delaySecTotal = 0;
|
|
|
|
int delaySecStarting = 0;
|
|
|
|
int delaySecStopping = 0;
|
|
|
|
|
2016-01-23 01:59:16 -08:00
|
|
|
int startSkippedFrameCount = 0;
|
|
|
|
int startTotalFrameCount = 0;
|
|
|
|
int lastSkippedFrameCount = 0;
|
|
|
|
|
2014-07-06 16:19:27 -07:00
|
|
|
int bitrateUpdateSeconds = 0;
|
|
|
|
uint64_t lastBytesSent = 0;
|
|
|
|
uint64_t lastBytesSentTime = 0;
|
|
|
|
|
2016-12-07 18:00:56 -08:00
|
|
|
QPixmap transparentPixmap;
|
|
|
|
QPixmap greenPixmap;
|
|
|
|
QPixmap grayPixmap;
|
|
|
|
QPixmap redPixmap;
|
|
|
|
|
|
|
|
float lastCongestion = 0.0f;
|
|
|
|
|
2014-07-06 16:19:27 -07:00
|
|
|
QPointer<QTimer> refreshTimer;
|
|
|
|
|
2014-09-25 17:44:05 -07:00
|
|
|
obs_output_t *GetOutput();
|
2014-07-06 16:19:27 -07:00
|
|
|
|
2015-09-06 16:19:53 -07:00
|
|
|
void Activate();
|
|
|
|
void Deactivate();
|
|
|
|
|
|
|
|
void UpdateDelayMsg();
|
2014-07-06 16:19:27 -07:00
|
|
|
void UpdateBandwidth();
|
|
|
|
void UpdateSessionTime();
|
|
|
|
void UpdateDroppedFrames();
|
|
|
|
|
2014-09-25 17:44:05 -07:00
|
|
|
static void OBSOutputReconnect(void *data, calldata_t *params);
|
|
|
|
static void OBSOutputReconnectSuccess(void *data, calldata_t *params);
|
2014-07-06 16:19:27 -07:00
|
|
|
|
|
|
|
private slots:
|
2015-05-10 16:18:11 -07:00
|
|
|
void Reconnect(int seconds);
|
2014-07-06 16:19:27 -07:00
|
|
|
void ReconnectSuccess();
|
|
|
|
void UpdateStatusBar();
|
|
|
|
void UpdateCPUUsage();
|
|
|
|
|
|
|
|
public:
|
|
|
|
OBSBasicStatusBar(QWidget *parent);
|
|
|
|
|
2015-09-06 16:19:53 -07:00
|
|
|
void StreamDelayStarting(int sec);
|
|
|
|
void StreamDelayStopping(int sec);
|
2014-09-25 17:44:05 -07:00
|
|
|
void StreamStarted(obs_output_t *output);
|
2014-07-06 16:19:27 -07:00
|
|
|
void StreamStopped();
|
2014-09-25 17:44:05 -07:00
|
|
|
void RecordingStarted(obs_output_t *output);
|
2014-07-06 16:19:27 -07:00
|
|
|
void RecordingStopped();
|
2016-06-21 04:15:31 -07:00
|
|
|
|
|
|
|
void ReconnectClear();
|
2014-07-06 16:19:27 -07:00
|
|
|
};
|