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 class TiXmlNode;
16 
18 {
19 public:
20  CIRTranslator() = default;
21 
25  void Load(const std::string& irMapName);
26 
30  void Clear();
31 
32  unsigned int TranslateButton(const std::string& szDevice, const std::string& szButton);
33 
34  static uint32_t TranslateString(std::string strButton);
35  static uint32_t TranslateUniversalRemoteString(const std::string& szButton);
36 
37 private:
38  bool LoadIRMap(const std::string& irMapPath);
39  void MapRemote(TiXmlNode* pRemote, const std::string& szDevice);
40 
41  using IRButtonMap = std::map<std::string, std::string>;
42 
43  std::map<std::string, std::shared_ptr<IRButtonMap>> m_irRemotesMap;
44 };
Definition: IRTranslator.h:17
void Load(const std::string &irMapName)
Loads Lircmap.xml/IRSSmap.xml.
Definition: IRTranslator.cpp:24
void Clear()
Clears the map.
Definition: IRTranslator.cpp:129