diff options
author | vdrfan <vdrfan@svn> | 2010-10-06 21:11:22 +0000 |
---|---|---|
committer | vdrfan <vdrfan@svn> | 2010-10-06 21:11:22 +0000 |
commit | 649ac9615deb0f510f72273f26f09b4e58a355ab (patch) | |
tree | d8dcd6af45ecefad7a3f177299c39cfa496941d9 | |
parent | 244eaa6e458ed91f71b8be6cf26e4de649bedc79 (diff) |
added: altname support to lirc mapping (#10420 - thanks dandel!)
(cherry picked from commit cf3d44497677b3b9d4746845dee01420d1a9066d)
git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/branches/Dharma@34514 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
-rw-r--r-- | xbmc/ButtonTranslator.cpp | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/xbmc/ButtonTranslator.cpp b/xbmc/ButtonTranslator.cpp index c9a9b48e02..28a581e400 100644 --- a/xbmc/ButtonTranslator.cpp +++ b/xbmc/ButtonTranslator.cpp @@ -454,6 +454,7 @@ void CButtonTranslator::MapRemote(TiXmlNode *pRemote, const char* szDevice) { CLog::Log(LOGINFO, "* Adding remote mapping for device '%s'", szDevice); lircButtonMap buttons; + vector<string> RemoteNames; map<CStdString, lircButtonMap>::iterator it = lircRemotesMap.find(szDevice); if (it != lircRemotesMap.end()) { @@ -464,12 +465,32 @@ void CButtonTranslator::MapRemote(TiXmlNode *pRemote, const char* szDevice) TiXmlElement *pButton = pRemote->FirstChildElement(); while (pButton) { - if (pButton->FirstChild() && pButton->FirstChild()->Value()) - buttons[pButton->FirstChild()->Value()] = pButton->Value(); + if (strcmpi(pButton->Value(), "altname")==0) + RemoteNames.push_back(string(pButton->GetText())); + else + { + if (pButton->FirstChild() && pButton->FirstChild()->Value()) + buttons[pButton->FirstChild()->Value()] = pButton->Value(); + } + pButton = pButton->NextSiblingElement(); } lircRemotesMap[szDevice] = buttons; + vector<string>::iterator itr = RemoteNames.begin(); + while (itr!=RemoteNames.end()) + { + it = lircRemotesMap.find(itr->c_str()); + if (it != lircRemotesMap.end()) + { + buttons = it->second; + lircRemotesMap.erase(it); + } + CLog::Log(LOGINFO, "* Linking remote mapping for '%s' to '%s'", szDevice, itr->c_str()); + lircRemotesMap.insert(it,pair<CStdString, lircButtonMap>(itr->c_str(),buttons)); + itr++; + } + RemoteNames.clear(); } int CButtonTranslator::TranslateLircRemoteString(const char* szDevice, const char *szButton) |