kodi
IRTranslator.h
1 /*
2  * Copyright (C) 2017-2024 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 
20 namespace KODI
21 {
22 namespace KEYMAP
23 {
28 {
29 public:
30  CIRTranslator() = default;
31 
35  void Load(const std::string& irMapName);
36 
40  void Clear();
41 
42  unsigned int TranslateButton(const std::string& szDevice, const std::string& szButton);
43 
44  static uint32_t TranslateString(std::string strButton);
45  static uint32_t TranslateUniversalRemoteString(const std::string& szButton);
46 
47 private:
48  bool LoadIRMap(const std::string& irMapPath);
49  void MapRemote(tinyxml2::XMLNode* pRemote, const std::string& szDevice);
50 
51  using IRButtonMap = std::map<std::string, std::string>;
52 
53  std::map<std::string, std::shared_ptr<IRButtonMap>> m_irRemotesMap;
54 };
55 } // namespace KEYMAP
56 } // namespace KODI
Definition: IRTranslator.h:27
Definition: SkinTimerManager.h:18
Definition: AudioDecoder.h:18