diff options
-rw-r--r-- | xbmc/addons/AddonSystemSettings.cpp | 44 | ||||
-rw-r--r-- | xbmc/addons/AddonSystemSettings.h | 4 | ||||
-rw-r--r-- | xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp | 1 | ||||
-rw-r--r-- | xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEBuffer.cpp | 6 |
4 files changed, 27 insertions, 28 deletions
diff --git a/xbmc/addons/AddonSystemSettings.cpp b/xbmc/addons/AddonSystemSettings.cpp index fccc680bd1..6df9d33b35 100644 --- a/xbmc/addons/AddonSystemSettings.cpp +++ b/xbmc/addons/AddonSystemSettings.cpp @@ -31,6 +31,23 @@ namespace ADDON { +CAddonSystemSettings::CAddonSystemSettings() : + m_activeSettings{ + {ADDON_VIZ, CSettings::SETTING_MUSICPLAYER_VISUALISATION}, + {ADDON_SCREENSAVER, CSettings::SETTING_SCREENSAVER_MODE}, + {ADDON_SCRAPER_ALBUMS, CSettings::SETTING_MUSICLIBRARY_ALBUMSSCRAPER}, + {ADDON_SCRAPER_ARTISTS, CSettings::SETTING_MUSICLIBRARY_ARTISTSSCRAPER}, + {ADDON_SCRAPER_MOVIES, CSettings::SETTING_SCRAPERS_MOVIESDEFAULT}, + {ADDON_SCRAPER_MUSICVIDEOS, CSettings::SETTING_SCRAPERS_MUSICVIDEOSDEFAULT}, + {ADDON_SCRAPER_TVSHOWS, CSettings::SETTING_SCRAPERS_TVSHOWSDEFAULT}, + {ADDON_WEB_INTERFACE, CSettings::SETTING_SERVICES_WEBSKIN}, + {ADDON_RESOURCE_LANGUAGE, CSettings::SETTING_LOCALE_LANGUAGE}, + {ADDON_SCRIPT_WEATHER, CSettings::SETTING_WEATHER_ADDON}, + {ADDON_SKIN, CSettings::SETTING_LOOKANDFEEL_SKIN}, + {ADDON_RESOURCE_UISOUNDS, CSettings::SETTING_LOOKANDFEEL_SOUNDSKIN}, + } +{} + CAddonSystemSettings& CAddonSystemSettings::GetInstance() { static CAddonSystemSettings inst; @@ -63,25 +80,10 @@ void CAddonSystemSettings::OnSettingChanged(const CSetting* setting) } } -static const std::map<ADDON::TYPE, std::string> settingMap = { - {ADDON_VIZ, CSettings::SETTING_MUSICPLAYER_VISUALISATION}, - {ADDON_SCREENSAVER, CSettings::SETTING_SCREENSAVER_MODE}, - {ADDON_SCRAPER_ALBUMS, CSettings::SETTING_MUSICLIBRARY_ALBUMSSCRAPER}, - {ADDON_SCRAPER_ARTISTS, CSettings::SETTING_MUSICLIBRARY_ARTISTSSCRAPER}, - {ADDON_SCRAPER_MOVIES, CSettings::SETTING_SCRAPERS_MOVIESDEFAULT}, - {ADDON_SCRAPER_MUSICVIDEOS, CSettings::SETTING_SCRAPERS_MUSICVIDEOSDEFAULT}, - {ADDON_SCRAPER_TVSHOWS, CSettings::SETTING_SCRAPERS_TVSHOWSDEFAULT}, - {ADDON_WEB_INTERFACE, CSettings::SETTING_SERVICES_WEBSKIN}, - {ADDON_RESOURCE_LANGUAGE, CSettings::SETTING_LOCALE_LANGUAGE}, - {ADDON_SCRIPT_WEATHER, CSettings::SETTING_WEATHER_ADDON}, - {ADDON_SKIN, CSettings::SETTING_LOOKANDFEEL_SKIN}, - {ADDON_RESOURCE_UISOUNDS, CSettings::SETTING_LOOKANDFEEL_SOUNDSKIN}, -}; - bool CAddonSystemSettings::GetActive(const TYPE& type, AddonPtr& addon) { - auto it = settingMap.find(type); - if (it != settingMap.end()) + auto it = m_activeSettings.find(type); + if (it != m_activeSettings.end()) { auto settingValue = CSettings::GetInstance().GetString(it->second); return CAddonMgr::GetInstance().GetAddon(settingValue, addon, type); @@ -91,8 +93,8 @@ bool CAddonSystemSettings::GetActive(const TYPE& type, AddonPtr& addon) bool CAddonSystemSettings::SetActive(const TYPE& type, const std::string& addonID) { - auto it = settingMap.find(type); - if (it != settingMap.end()) + auto it = m_activeSettings.find(type); + if (it != m_activeSettings.end()) { CSettings::GetInstance().SetString(it->second, addonID); return true; @@ -108,8 +110,8 @@ bool CAddonSystemSettings::IsActive(const IAddon& addon) bool CAddonSystemSettings::UnsetActive(const AddonPtr& addon) { - auto it = settingMap.find(addon->Type()); - if (it == settingMap.end()) + auto it = m_activeSettings.find(addon->Type()); + if (it == m_activeSettings.end()) return true; auto setting = static_cast<CSettingString*>(CSettings::GetInstance().GetSetting(it->second)); diff --git a/xbmc/addons/AddonSystemSettings.h b/xbmc/addons/AddonSystemSettings.h index 42a5345aad..f23c9eb119 100644 --- a/xbmc/addons/AddonSystemSettings.h +++ b/xbmc/addons/AddonSystemSettings.h @@ -53,11 +53,13 @@ public: std::vector<std::string> MigrateAddons(); private: - CAddonSystemSettings() = default; + CAddonSystemSettings(); CAddonSystemSettings(const CAddonSystemSettings&) = default; CAddonSystemSettings& operator=(const CAddonSystemSettings&) = default; CAddonSystemSettings(CAddonSystemSettings&&); CAddonSystemSettings& operator=(CAddonSystemSettings&&); virtual ~CAddonSystemSettings() = default; + + const std::map<ADDON::TYPE, std::string> m_activeSettings; }; };
\ No newline at end of file diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp index 08e7991982..5b2243f309 100644 --- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp +++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp @@ -1317,6 +1317,7 @@ void CActiveAE::Configure(AEAudioFormat *desiredFmt) AEAudioFormat vizFormat = m_internalFormat; vizFormat.m_channelLayout = AE_CH_LAYOUT_2_0; vizFormat.m_dataFormat = AE_FMT_FLOAT; + vizFormat.m_sampleRate = 44100; // input buffers m_vizBuffersInput = new CActiveAEBufferPool(m_internalFormat); diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEBuffer.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEBuffer.cpp index 3ca667c2be..362fae6d4e 100644 --- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEBuffer.cpp +++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEBuffer.cpp @@ -737,12 +737,6 @@ bool CActiveAEBufferPoolAtempo::ProcessBuffers() } else if (m_procSample || !m_freeSamples.empty()) { - int free_samples; - if (m_procSample) - free_samples = m_procSample->pkt->max_nb_samples - m_procSample->pkt->nb_samples; - else - free_samples = m_format.m_frames; - bool skipInput = false; // avoid that bufferscr grows too large |