diff --git a/source/list/cachedlist.cpp b/source/list/cachedlist.cpp index 6d237ef4..31299d9c 100644 --- a/source/list/cachedlist.cpp +++ b/source/list/cachedlist.cpp @@ -2,7 +2,7 @@ #include template -void CachedList::Load(string path, string containing, string m_lastLanguage) /* Load All */ +void CachedList::Load(string path, string containing, string m_lastLanguage, Config &m_plugin) /* Load All */ { gprintf("\nLoading files containing %s in %s\n", containing.c_str(), path.c_str()); m_loaded = false; diff --git a/source/list/cachedlist.hpp b/source/list/cachedlist.hpp index b9eaffc5..510bde17 100644 --- a/source/list/cachedlist.hpp +++ b/source/list/cachedlist.hpp @@ -51,7 +51,7 @@ class CachedList : public safe_vector } } - void Load(string path, string containing, string m_lastLanguage); + void Load(string path, string containing, string m_lastLanguage, Config &m_plugin); void LoadChannels(string path, u32 channelType, string m_lastLanguage); void Unload(){if(m_loaded) {this->clear(); m_loaded = false; m_database = "";}}; @@ -64,8 +64,6 @@ class CachedList : public safe_vector void Remove(u32 index) {if(m_loaded) CCache(*this, m_database, index, REMOVE);} /* Remove One */ void SetLanguage(string curLanguage) { m_curLanguage = curLanguage; } - void LoadPluginConfig(const char* name) { m_plugin.load(name); } - void UnloadPluginConfig() {m_plugin.unload(); }; private: string make_db_name(string path); @@ -82,7 +80,6 @@ class CachedList : public safe_vector string m_lastLanguage; string m_discinf; string m_DMLgameDir; - Config m_plugin; }; #endif diff --git a/source/menu/menu.cpp b/source/menu/menu.cpp index 05573817..d9ae197b 100644 --- a/source/menu/menu.cpp +++ b/source/menu/menu.cpp @@ -1914,9 +1914,10 @@ bool CMenu::_loadGameList(void) if(!DeviceHandler::Instance()->IsInserted(currentPartition)) return false; + Config tmpcfg; gprintf("%s\n", DeviceName[currentPartition]); DeviceHandler::Instance()->Open_WBFS(currentPartition); - m_gameList.Load(sfmt(GAMES_DIR, DeviceName[currentPartition]), ".wbfs|.iso", m_cfg.getString("GAMES", "lastlanguage", "EN").c_str()); + m_gameList.Load(sfmt(GAMES_DIR, DeviceName[currentPartition]), ".wbfs|.iso", m_cfg.getString("GAMES", "lastlanguage", "EN").c_str(), tmpcfg); m_cfg.setString("GAMES", "lastlanguage", m_loc.getString(m_curLanguage, "gametdb_code", "EN")); m_cfg.save(); return m_gameList.size() > 0 ? true : false; @@ -1928,9 +1929,10 @@ bool CMenu::_loadHomebrewList() if(!DeviceHandler::Instance()->IsInserted(currentPartition)) return false; + Config tmpcfg; gprintf("%s\n", DeviceName[currentPartition]); DeviceHandler::Instance()->Open_WBFS(currentPartition); - m_gameList.Load(sfmt(HOMEBREW_DIR, DeviceName[currentPartition]), ".dol|.elf", m_cfg.getString("HOMEBREW", "lastlanguage", "EN").c_str()); + m_gameList.Load(sfmt(HOMEBREW_DIR, DeviceName[currentPartition]), ".dol|.elf", m_cfg.getString("HOMEBREW", "lastlanguage", "EN").c_str(), tmpcfg); m_cfg.setString("HOMEBREW", "lastlanguage", m_loc.getString(m_curLanguage, "gametdb_code", "EN")); m_cfg.save(); return m_gameList.size() > 0 ? true : false; @@ -1942,12 +1944,13 @@ bool CMenu::_loadDmlList() if(!DeviceHandler::Instance()->IsInserted(currentPartition)) return false; + Config tmpcfg; gprintf("%s\n", DeviceName[currentPartition]); DeviceHandler::Instance()->Open_WBFS(currentPartition); if(currentPartition != SD) - m_gameList.Load(sfmt(m_DMLgameDir.c_str(), DeviceName[currentPartition]), "boot.bin|.iso", m_cfg.getString("DML", "lastlanguage", "EN").c_str()); + m_gameList.Load(sfmt(m_DMLgameDir.c_str(), DeviceName[currentPartition]), "boot.bin|.iso", m_cfg.getString("DML", "lastlanguage", "EN").c_str(), tmpcfg); else - m_gameList.Load(sfmt(DML_DIR, DeviceName[currentPartition]), "boot.bin|.iso", m_cfg.getString("DML", "lastlanguage", "EN").c_str()); + m_gameList.Load(sfmt(DML_DIR, DeviceName[currentPartition]), "boot.bin|.iso", m_cfg.getString("DML", "lastlanguage", "EN").c_str(), tmpcfg); m_cfg.setString("DML", "lastlanguage", m_loc.getString(m_curLanguage, "gametdb_code", "EN")); m_cfg.save(); return m_gameList.size() > 0 ? true : false; @@ -1985,11 +1988,9 @@ bool CMenu::_loadEmuList() m_gameList.clear(); if(strcasestr(m_plugin_cfg.getString("PLUGIN","romDir","").c_str(), "scummvm.ini") == NULL) { - m_gameList.LoadPluginConfig(fmt("%s/%s", m_pluginsDir.c_str(), pent->d_name)); - m_gameList.Load(sfmt("%s:/%s", DeviceName[currentPartition], m_plugin_cfg.getString("PLUGIN","romDir","").c_str()), m_plugin_cfg.getString("PLUGIN","fileTypes","").c_str(), m_cfg.getString("EMULATOR", "lastlanguage", "EN").c_str()); + m_gameList.Load(sfmt("%s:/%s", DeviceName[currentPartition], m_plugin_cfg.getString("PLUGIN","romDir","").c_str()), m_plugin_cfg.getString("PLUGIN","fileTypes","").c_str(), m_cfg.getString("EMULATOR", "lastlanguage", "EN").c_str(), m_plugin_cfg); for(safe_vector::iterator tmp_itr = m_gameList.begin(); tmp_itr != m_gameList.end(); tmp_itr++) emuList.push_back(*tmp_itr); - m_gameList.UnloadPluginConfig(); } else { diff --git a/source/music/musicplayer.cpp b/source/music/musicplayer.cpp index 3cdb7821..cb6ee874 100644 --- a/source/music/musicplayer.cpp +++ b/source/music/musicplayer.cpp @@ -34,10 +34,10 @@ void MusicPlayer::Init(Config &cfg, string musicDir, string themeMusicDir) m_music_files.Init(cfg.getString("GENERAL", "dir_list_cache"), std::string(), std::string(), std::string(), false); if (dir & THEME_MUSIC) - m_music_files.Load(themeMusicDir, ".ogg|.mp3", "EN"); //|.mod|.xm|.s3m|.wav|.aiff"); + m_music_files.Load(themeMusicDir, ".ogg|.mp3", "EN", cfg); //|.mod|.xm|.s3m|.wav|.aiff"); if (dir & NORMAL_MUSIC) - m_music_files.Load(musicDir, ".ogg|.mp3", "EN"); //|.mod|.xm|.s3m|.wav|.aiff"); + m_music_files.Load(musicDir, ".ogg|.mp3", "EN", cfg); //|.mod|.xm|.s3m|.wav|.aiff"); if (cfg.getBool("GENERAL", "randomize_music", false) && m_music_files.size() > 0) {