xbmc
SystemGUIInfo.h
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 
27 {
28 public:
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
Definition: GUIListItem.h:30
bool InitCurrentItem(CFileItem *item) override
Init a new current guiinfo manager item. Gets called whenever the active guiinfo manager item changes...
Definition: SystemGUIInfo.cpp:105
Definition: GUIInfoProvider.h:23
Definition: SystemGUIInfo.h:26
bool GetLabel(std::string &value, const CFileItem *item, int contextWindow, const CGUIInfo &info, std::string *fallback) const override
Get a GUIInfoManager label string.
Definition: SystemGUIInfo.cpp:110
bool GetInt(int &value, const CGUIListItem *item, int contextWindow, const CGUIInfo &info) const override
Get a GUIInfoManager integer value.
Definition: SystemGUIInfo.cpp:334
Definition: AudioDecoder.h:18
Definition: Temperature.h:15
Definition: GUIInfo.h:23
bool GetBool(bool &value, const CGUIListItem *item, int contextWindow, const CGUIInfo &info) const override
Get a GUIInfoManager bool value.
Definition: SystemGUIInfo.cpp:370
Represents a file on a share.
Definition: FileItem.h:102