CButtonTranslator::CButtonTranslator()
{
- m_baseMap.clear();
m_deviceList.clear();
m_Loaded = false;
}
};
bool success = false;
- // If we've already loaded the m_baseMap we don't need to load it
- // again - this speeds up reloads caused by plugging and unplugging
- // HID devices. However if AlwaysLoad is true always load the keymaps
- // from scratch.
- if (m_Loaded && !AlwaysLoad)
- {
- m_translatorMap = m_baseMap;
- }
-
- // Else load the standard mappings
- else
{
for(unsigned int dirIndex = 0; dirIndex < sizeof(DIRS_TO_CHECK)/sizeof(DIRS_TO_CHECK[0]); ++dirIndex) {
if( XFILE::CDirectory::Exists(DIRS_TO_CHECK[dirIndex]) )
CLog::Log(LOGERROR, "CButtonTranslator::Load - unable to load remote map %s", REMOTEMAP);
// don't return false - it is to only indicate a fatal error (which this is not)
#endif
-
- // Standard mappings have been loaded into m_translatorMap, copy them to
- // m_baseMap for future reuse.
- m_baseMap = m_translatorMap;
}
// Load mappings for any HID devices we have connected
private:
typedef std::multimap<uint32_t, CButtonAction> buttonMap; // our button map to fill in
- // m_baseMap contains all the standard mappings
- std::map<int, buttonMap> m_baseMap;
// m_translatorMap contains all mappings i.e. m_BaseMap + HID device mappings
std::map<int, buttonMap> m_translatorMap;
// m_deviceList contains the list of connected HID devices