obs-studio/UI/window-basic-stats.hpp
jp9000 0e1ae62355 UI: Add stats dialog
Shows performance stats, and streaming/recording stats, and helps warn
the user when they have less-than-optimal values with coloring on the
values (e.g. yellow when getting low on disk space, red when getting
really low)
2017-05-13 01:52:54 -07:00

58 lines
1.0 KiB
C++

#pragma once
#include <obs.hpp>
#include <util/platform.h>
#include <QPointer>
#include <QDialog>
#include <QTimer>
#include <QLabel>
#include <QList>
class QGridLayout;
class OBSBasicStats : public QDialog {
Q_OBJECT
QLabel *fps = nullptr;
QLabel *cpuUsage = nullptr;
QLabel *hddSpace = nullptr;
QLabel *memUsage = nullptr;
QLabel *renderTime = nullptr;
QLabel *skippedFrames = nullptr;
QLabel *missedFrames = nullptr;
QGridLayout *outputLayout = nullptr;
os_cpu_usage_info_t *cpu_info = nullptr;
QTimer timer;
struct OutputLabels {
QPointer<QLabel> name;
QPointer<QLabel> status;
QPointer<QLabel> droppedFrames;
QPointer<QLabel> megabytesSent;
QPointer<QLabel> bitrate;
uint64_t lastBytesSent = 0;
uint64_t lastBytesSentTime = 0;
int first_total = 0;
int first_dropped = 0;
void Update(obs_output_t *output);
void Reset(obs_output_t *output);
};
QList<OutputLabels> outputLabels;
void AddOutputLabels(QString name);
void Update();
void Reset();
public:
OBSBasicStats(QWidget *parent = nullptr);
~OBSBasicStats();
};