62fa2b0086
* UI: Fix mem leak with projectors * UI: Fix mem leak with ScaleFilteringMenu * UI: Fix mem leak with sourceProjector * UI: Fix leak with preview projector in Source menu and Preview * UI: Fix mem leaks with background color menu * UI: Fix leak with deinterlace Menu * UI: Fix leak with scene transition override menu * UI: Fix leak with scene projector menu * UI: Fix leak with filter shortcut in Main * UI: Fix leak with filter shortcut in stats
65 lines
1.2 KiB
C++
65 lines
1.2 KiB
C++
#pragma once
|
|
|
|
#include <obs.hpp>
|
|
#include <util/platform.h>
|
|
#include <QPointer>
|
|
#include <QWidget>
|
|
#include <QTimer>
|
|
#include <QLabel>
|
|
#include <QList>
|
|
|
|
class QGridLayout;
|
|
class QCloseEvent;
|
|
|
|
class OBSBasicStats : public QWidget {
|
|
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, bool rec);
|
|
void Reset(obs_output_t *output);
|
|
};
|
|
|
|
QList<OutputLabels> outputLabels;
|
|
|
|
void AddOutputLabels(QString name);
|
|
void Update();
|
|
void Reset();
|
|
|
|
virtual void closeEvent(QCloseEvent *event) override;
|
|
|
|
public:
|
|
OBSBasicStats(QWidget *parent = nullptr, bool closable = true);
|
|
~OBSBasicStats();
|
|
|
|
static void InitializeValues();
|
|
private:
|
|
QPointer<QObject> shortcutFilter;
|
|
};
|