xbmc
IRTranslator.h
1 /*
2  * Copyright (C) 2017-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 <map>
12 #include <memory>
13 #include <string>
14 
15 namespace tinyxml2
16 {
17 class XMLNode;
18 }
19 
21 {
22 public:
23  CIRTranslator() = default;
24 
28  void Load(const std::string& irMapName);
29 
33  void Clear();
34 
35  unsigned int TranslateButton(const std::string& szDevice, const std::string& szButton);
36 
37  static uint32_t TranslateString(std::string strButton);
38  static uint32_t TranslateUniversalRemoteString(const std::string& szButton);
39 
40 private:
41  bool LoadIRMap(const std::string& irMapPath);
42  void MapRemote(tinyxml2::XMLNode* pRemote, const std::string& szDevice);
43 
44  using IRButtonMap = std::map<std::string, std::string>;
45 
46  std::map<std::string, std::shared_ptr<IRButtonMap>> m_irRemotesMap;
47 };
Definition: SkinTimerManager.h:18
Definition: IRTranslator.h:20