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:
|
|
|
|
QLabel *droppedFrames;
|
|
|
|
QLabel *sessionTime;
|
|
|
|
QLabel *cpuUsage;
|
|
|
|
QLabel *kbps;
|
|
|
|
|
2014-09-25 17:44:05 -07:00
|
|
|
obs_output_t *streamOutput = nullptr;
|
|
|
|
obs_output_t *recordOutput = nullptr;
|
2014-07-06 16:19:27 -07:00
|
|
|
|
|
|
|
int retries = 0;
|
|
|
|
int activeRefs = 0;
|
|
|
|
int totalSeconds = 0;
|
|
|
|
|
|
|
|
int bitrateUpdateSeconds = 0;
|
|
|
|
uint64_t lastBytesSent = 0;
|
|
|
|
uint64_t lastBytesSentTime = 0;
|
|
|
|
|
|
|
|
QPointer<QTimer> refreshTimer;
|
|
|
|
|
|
|
|
void DecRef();
|
|
|
|
void IncRef();
|
|
|
|
|
2014-09-25 17:44:05 -07:00
|
|
|
obs_output_t *GetOutput();
|
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:
|
|
|
|
void Reconnect();
|
|
|
|
void ReconnectSuccess();
|
|
|
|
void UpdateStatusBar();
|
|
|
|
void UpdateCPUUsage();
|
|
|
|
|
|
|
|
public:
|
|
|
|
OBSBasicStatusBar(QWidget *parent);
|
|
|
|
|
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();
|
|
|
|
};
|