Debian Codegraph @

xbmc/guilib/guiinfo/SystemGUIInfo.h

raw symbols SCIP
1 /*
2 * Copyright (C) 2012-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
4 *
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
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 // KODI::GUILIB::GUIINFO::IGUIInfoProvider implementation
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 } // namespace GUIINFO
58 } // namespace GUILIB
59 } // namespace KODI