xbmc
SkinTimerManager.h
1 /*
2  * Copyright (C) 2005-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 "SkinTimer.h"
12 
13 #include <map>
14 #include <memory>
15 #include <string>
16 
17 class CGUIInfoManager;
18 namespace tinyxml2
19 {
20 class XMLNode;
21 }
22 
31 {
32 public:
37  CSkinTimerManager() = delete;
38 
40  ~CSkinTimerManager() = default;
41 
45  void LoadTimers(const std::string& path);
46 
48  void Stop();
49 
53  size_t GetTimerCount() const;
54 
59  bool TimerExists(const std::string& timer) const;
60 
65  std::unique_ptr<CSkinTimer> GrabTimer(const std::string& timer);
66 
71  bool TimerIsRunning(const std::string& timer) const;
72 
77  float GetTimerElapsedSeconds(const std::string& timer) const;
78 
82  void TimerStart(const std::string& timer) const;
83 
87  void TimerStop(const std::string& timer) const;
88 
89  // CThread methods
90 
92  void Process();
93 
94 private:
99  void LoadTimerInternal(const tinyxml2::XMLNode* node);
100 
102  std::map<std::string, std::unique_ptr<CSkinTimer>> m_timers;
103  CGUIInfoManager& m_infoMgr;
104 };
Definition: GUIInfoManager.h:57
CSkinTimerManager is the container and manager for Skin timers. Its role is that of checking if the t...
Definition: SkinTimerManager.h:30
Definition: SkinTimerManager.h:18