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/Temperature.h"
13 
14 namespace KODI
15 {
16 namespace GUILIB
17 {
18 namespace GUIINFO
19 {
20 
21 class CGUIInfo;
22 
24 {
25 public:
27  ~CSystemGUIInfo() override = default;
28 
29  // KODI::GUILIB::GUIINFO::IGUIInfoProvider implementation
30  bool InitCurrentItem(CFileItem *item) override;
31  bool GetLabel(std::string& value, const CFileItem *item, int contextWindow, const CGUIInfo &info, std::string *fallback) const override;
32  bool GetInt(int& value, const CGUIListItem *item, int contextWindow, const CGUIInfo &info) const override;
33  bool GetBool(bool& value, const CGUIListItem *item, int contextWindow, const CGUIInfo &info) const override;
34 
35  float GetFPS() const { return m_fps; }
36  void UpdateFPS();
37 
38 private:
39  std::string GetSystemHeatInfo(int info) const;
40  CTemperature GetGPUTemperature() const;
41 
42  static const int SYSTEM_HEAT_UPDATE_INTERVAL = 60000;
43 
44  mutable unsigned int m_lastSysHeatInfoTime;
45  mutable CTemperature m_gpuTemp;
46  mutable CTemperature m_cpuTemp;
47  int m_fanSpeed = 0;
48  float m_fps = 0.0;
49  unsigned int m_frameCounter = 0;
50  unsigned int m_lastFPSTime = 0;
51 };
52 
53 } // namespace GUIINFO
54 } // namespace GUILIB
55 } // 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:139
Definition: GUIInfoProvider.h:23
Definition: SystemGUIInfo.h:23
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:144
bool GetInt(int &value, const CGUIListItem *item, int contextWindow, const CGUIInfo &info) const override
Get a GUIInfoManager integer value.
Definition: SystemGUIInfo.cpp:436
Controller configuration window.
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:472
Represents a file on a share.
Definition: FileItem.h:102