提交 a9b3da01 编写于 作者: J jp9000

Add function to main window to query CPU usage

上级 0364672c
......@@ -88,6 +88,8 @@ OBSBasic::OBSBasic(QWidget *parent)
this,
SLOT(SceneItemNameEdited(QWidget*,
QAbstractItemDelegate::EndEditHint)));
cpuUsageInfo = os_cpu_usage_info_start();
}
static void SaveAudioDevice(const char *name, int channel, obs_data_t parent)
......@@ -550,6 +552,8 @@ OBSBasic::~OBSBasic()
* can be freed, and we have no control over the destruction order of
* the Qt UI stuff, so we have to manually clear any references to
* libobs. */
os_cpu_usage_info_destroy(cpuUsageInfo);
delete properties;
delete transformWindow;
......
......@@ -28,6 +28,7 @@
#include "window-basic-properties.hpp"
#include "window-basic-transform.hpp"
#include <util/platform.h>
#include <util/util.hpp>
#include <QPointer>
......@@ -61,6 +62,8 @@ private:
QNetworkAccessManager networkManager;
os_cpu_usage_info_t cpuUsageInfo = nullptr;
QBuffer logUploadPostData;
QNetworkReply *logUploadReply = nullptr;
QByteArray logUploadReturnData;
......@@ -199,6 +202,11 @@ public:
cy = previewCY;
}
inline double GetCPUUsage() const
{
return os_cpu_usage_info_query(cpuUsageInfo);
}
protected:
virtual void closeEvent(QCloseEvent *event) override;
virtual void changeEvent(QEvent *event) override;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册