| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
#pragma once |
| 10 |
|
| 11 |
#include "guilib/guiinfo/GUIInfoProvider.h" |
| 12 |
#include "utils/GpuInfo.h" |
| 13 |
#include "utils/Temperature.h" |
| 14 |
|
| 15 |
#include <memory> |
| 16 |
|
| 17 |
namespace KODI |
| 18 |
{ |
| 19 |
namespace GUILIB |
| 20 |
{ |
| 21 |
namespace GUIINFO |
| 22 |
{ |
| 23 |
|
| 24 |
class CGUIInfo; |
| 25 |
|
| 26 |
class CSystemGUIInfo : public CGUIInfoProvider |
| 27 |
{ |
| 28 |
public: |
| 29 |
CSystemGUIInfo(); |
| 30 |
~CSystemGUIInfo() override = default; |
| 31 |
|
| 32 |
|
| 33 |
bool InitCurrentItem(CFileItem *item) override; |
| 34 |
bool GetLabel(std::string& value, const CFileItem *item, int contextWindow, const CGUIInfo &info, std::string *fallback) const override; |
| 35 |
bool GetInt(int& value, const CGUIListItem *item, int contextWindow, const CGUIInfo &info) const override; |
| 36 |
bool GetBool(bool& value, const CGUIListItem *item, int contextWindow, const CGUIInfo &info) const override; |
| 37 |
|
| 38 |
float GetFPS() const { return m_fps; } |
| 39 |
void UpdateFPS(); |
| 40 |
|
| 41 |
private: |
| 42 |
std::string GetSystemHeatInfo(int info) const; |
| 43 |
|
| 44 |
std::unique_ptr<CGPUInfo> m_gpuInfo; |
| 45 |
|
| 46 |
static const int SYSTEM_HEAT_UPDATE_INTERVAL = 60000; |
| 47 |
|
| 48 |
mutable unsigned int m_lastSysHeatInfoTime; |
| 49 |
mutable CTemperature m_gpuTemp; |
| 50 |
mutable CTemperature m_cpuTemp; |
| 51 |
int m_fanSpeed = 0; |
| 52 |
float m_fps = 0.0; |
| 53 |
unsigned int m_frameCounter = 0; |
| 54 |
unsigned int m_lastFPSTime = 0; |
| 55 |
}; |
| 56 |
|
| 57 |
} |
| 58 |
} |
| 59 |
} |