aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xbmc/Application.cpp156
-rw-r--r--xbmc/Application.h2
-rw-r--r--xbmc/AutoSwitch.cpp2
-rw-r--r--xbmc/Autorun.cpp18
-rw-r--r--xbmc/FileItem.cpp8
-rw-r--r--xbmc/GUIPassword.cpp14
-rw-r--r--xbmc/LangInfo.cpp44
-rw-r--r--xbmc/SeekHandler.cpp6
-rw-r--r--xbmc/ServiceBroker.cpp16
-rw-r--r--xbmc/ServiceBroker.h8
-rw-r--r--xbmc/ServiceManager.cpp23
-rw-r--r--xbmc/ServiceManager.h3
-rw-r--r--xbmc/Util.cpp22
-rw-r--r--xbmc/addons/AddonInstaller.cpp4
-rw-r--r--xbmc/addons/AddonSystemSettings.cpp12
-rw-r--r--xbmc/addons/FontResource.cpp2
-rw-r--r--xbmc/addons/GUIDialogAddonInfo.cpp2
-rw-r--r--xbmc/addons/GUIWindowAddonBrowser.cpp18
-rw-r--r--xbmc/addons/LanguageResource.cpp4
-rw-r--r--xbmc/addons/RepositoryUpdater.cpp10
-rw-r--r--xbmc/addons/Skin.cpp8
-rw-r--r--xbmc/addons/UISoundsResource.cpp2
-rw-r--r--xbmc/addons/interfaces/General.cpp2
-rw-r--r--xbmc/cdrip/CDDARipJob.cpp6
-rw-r--r--xbmc/cdrip/CDDARipper.cpp14
-rw-r--r--xbmc/cdrip/EncoderFFmpeg.cpp2
-rw-r--r--xbmc/cores/AudioEngine/AEResampleFactory.cpp2
-rw-r--r--xbmc/cores/AudioEngine/Encoders/AEEncoderFFmpeg.cpp2
-rw-r--r--xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp86
-rw-r--r--xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESettings.cpp20
-rw-r--r--xbmc/cores/AudioEngine/Sinks/AESinkPi.cpp10
-rw-r--r--xbmc/cores/DllLoader/exports/emu_msvcrt.cpp20
-rw-r--r--xbmc/cores/VideoPlayer/DVDCodecs/Overlay/DVDOverlayCodecTX3G.cpp2
-rw-r--r--xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAmlogic.cpp10
-rw-r--r--xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAndroidMediaCodec.cpp6
-rw-r--r--xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.cpp4
-rw-r--r--xbmc/cores/VideoPlayer/DVDCodecs/Video/DXVA.cpp2
-rw-r--r--xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp6
-rw-r--r--xbmc/cores/VideoPlayer/DVDCodecs/Video/VAAPI.cpp24
-rw-r--r--xbmc/cores/VideoPlayer/DVDCodecs/Video/VDPAU.cpp22
-rw-r--r--xbmc/cores/VideoPlayer/DVDCodecs/Video/VTB.cpp4
-rw-r--r--xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp4
-rw-r--r--xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamBluray.cpp4
-rw-r--r--xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamNavigator.cpp4
-rw-r--r--xbmc/cores/VideoPlayer/DVDInputStreams/InputStreamPVRBase.cpp2
-rw-r--r--xbmc/cores/VideoPlayer/DVDSubtitles/DVDSubtitlesLibass.cpp6
-rw-r--r--xbmc/cores/VideoPlayer/VideoPlayer.cpp32
-rw-r--r--xbmc/cores/VideoPlayer/VideoPlayerAudio.cpp6
-rw-r--r--xbmc/cores/VideoPlayer/VideoPlayerRadioRDS.cpp6
-rw-r--r--xbmc/cores/VideoPlayer/VideoReferenceClock.cpp2
-rw-r--r--xbmc/cores/VideoPlayer/VideoRenderers/BaseRenderer.cpp12
-rw-r--r--xbmc/cores/VideoPlayer/VideoRenderers/ColorManager.cpp52
-rw-r--r--xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp2
-rw-r--r--xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererDRMPRIME.cpp4
-rw-r--r--xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererVDPAU.cpp4
-rw-r--r--xbmc/cores/VideoPlayer/VideoRenderers/LinuxRendererGL.cpp8
-rw-r--r--xbmc/cores/VideoPlayer/VideoRenderers/LinuxRendererGLES.cpp4
-rw-r--r--xbmc/cores/VideoPlayer/VideoRenderers/OverlayRenderer.cpp16
-rw-r--r--xbmc/cores/VideoPlayer/VideoRenderers/OverlayRendererGUI.cpp2
-rw-r--r--xbmc/cores/VideoPlayer/VideoRenderers/OverlayRendererUtil.cpp2
-rw-r--r--xbmc/cores/VideoPlayer/VideoRenderers/RenderManager.cpp4
-rw-r--r--xbmc/cores/VideoPlayer/VideoRenderers/WinRenderer.cpp8
-rw-r--r--xbmc/cores/omxplayer/OMXAudio.cpp22
-rw-r--r--xbmc/cores/omxplayer/OMXHelper.cpp14
-rw-r--r--xbmc/cores/omxplayer/OMXImage.cpp2
-rw-r--r--xbmc/cores/omxplayer/OMXPlayerVideo.cpp2
-rw-r--r--xbmc/cores/omxplayer/OMXVideo.cpp4
-rw-r--r--xbmc/cores/paplayer/AudioDecoder.cpp8
-rw-r--r--xbmc/cores/paplayer/PAPlayer.cpp8
-rw-r--r--xbmc/cores/playercorefactory/PlayerCoreFactory.cpp12
-rw-r--r--xbmc/cores/playercorefactory/PlayerCoreFactory.h10
-rw-r--r--xbmc/cores/playercorefactory/PlayerSelectionRule.cpp2
-rw-r--r--xbmc/dialogs/GUIDialogContextMenu.cpp8
-rw-r--r--xbmc/dialogs/GUIDialogKeyboardGeneric.cpp6
-rw-r--r--xbmc/dialogs/GUIDialogMediaSource.cpp4
-rw-r--r--xbmc/dialogs/GUIDialogSimpleMenu.cpp2
-rw-r--r--xbmc/dialogs/GUIDialogSmartPlaylistEditor.cpp2
-rw-r--r--xbmc/dialogs/GUIDialogSmartPlaylistRule.cpp2
-rw-r--r--xbmc/events/EventLog.cpp4
-rw-r--r--xbmc/events/windows/GUIWindowEventLog.cpp4
-rw-r--r--xbmc/filesystem/AddonsDirectory.cpp2
-rw-r--r--xbmc/filesystem/CurlFile.cpp21
-rw-r--r--xbmc/filesystem/Directory.cpp2
-rw-r--r--xbmc/filesystem/MusicDatabaseDirectory/DirectoryNodeArtist.cpp2
-rw-r--r--xbmc/filesystem/PluginDirectory.cpp14
-rw-r--r--xbmc/filesystem/RSSDirectory.cpp2
-rw-r--r--xbmc/filesystem/SmartPlaylistDirectory.cpp4
-rw-r--r--xbmc/filesystem/SpecialProtocol.cpp6
-rw-r--r--xbmc/filesystem/UPnPDirectory.cpp4
-rw-r--r--xbmc/filesystem/VideoDatabaseDirectory.cpp6
-rw-r--r--xbmc/filesystem/VideoDatabaseDirectory/DirectoryNodeOverview.cpp6
-rw-r--r--xbmc/filesystem/test/TestFileFactory.cpp10
-rw-r--r--xbmc/filesystem/test/TestZipFile.cpp10
-rw-r--r--xbmc/games/GameServices.cpp3
-rw-r--r--xbmc/games/GameServices.h2
-rw-r--r--xbmc/games/GameSettings.cpp20
-rw-r--r--xbmc/games/GameSettings.h4
-rw-r--r--xbmc/games/dialogs/osd/DialogGameVideoSelect.cpp2
-rw-r--r--xbmc/games/windows/GUIWindowGames.cpp4
-rw-r--r--xbmc/guilib/GUIAudioManager.cpp13
-rw-r--r--xbmc/guilib/GUIAudioManager.h4
-rw-r--r--xbmc/guilib/GUIBaseContainer.cpp2
-rw-r--r--xbmc/guilib/GUIComponent.cpp4
-rw-r--r--xbmc/guilib/GUIKeyboardFactory.cpp2
-rw-r--r--xbmc/guilib/GUIRSSControl.cpp4
-rw-r--r--xbmc/guilib/GUIVisualisationControl.cpp2
-rw-r--r--xbmc/guilib/StereoscopicsManager.cpp23
-rw-r--r--xbmc/guilib/StereoscopicsManager.h4
-rw-r--r--xbmc/guilib/TextureBundleXBT.cpp4
-rw-r--r--xbmc/guilib/guiinfo/GUIControlsGUIInfo.cpp2
-rw-r--r--xbmc/guilib/guiinfo/SkinGUIInfo.cpp8
-rw-r--r--xbmc/guilib/guiinfo/SystemGUIInfo.cpp6
-rw-r--r--xbmc/guilib/guiinfo/VideoGUIInfo.cpp4
-rw-r--r--xbmc/guilib/guiinfo/VisualisationGUIInfo.cpp4
-rw-r--r--xbmc/guilib/guiinfo/WeatherGUIInfo.cpp2
-rw-r--r--xbmc/input/InputManager.cpp6
-rw-r--r--xbmc/input/joysticks/dialogs/GUIDialogNewJoystick.cpp4
-rw-r--r--xbmc/interfaces/builtins/ApplicationBuiltins.cpp4
-rw-r--r--xbmc/interfaces/builtins/Builtins.cpp2
-rw-r--r--xbmc/interfaces/builtins/PlayerBuiltins.cpp8
-rw-r--r--xbmc/interfaces/builtins/SkinBuiltins.cpp26
-rw-r--r--xbmc/interfaces/json-rpc/AudioLibrary.cpp6
-rw-r--r--xbmc/interfaces/json-rpc/GUIOperations.cpp2
-rw-r--r--xbmc/interfaces/json-rpc/SettingsOperations.cpp20
-rw-r--r--xbmc/interfaces/legacy/ModuleXbmc.cpp2
-rw-r--r--xbmc/listproviders/DirectoryProvider.cpp4
-rw-r--r--xbmc/music/GUIViewStateMusic.cpp38
-rw-r--r--xbmc/music/MusicDatabase.cpp10
-rw-r--r--xbmc/music/MusicInfoLoader.cpp2
-rw-r--r--xbmc/music/dialogs/GUIDialogInfoProviderSettings.cpp16
-rw-r--r--xbmc/music/dialogs/GUIDialogMusicInfo.cpp4
-rw-r--r--xbmc/music/dialogs/GUIDialogMusicOSD.cpp4
-rw-r--r--xbmc/music/infoscanner/MusicInfoScanner.cpp16
-rw-r--r--xbmc/music/windows/GUIWindowMusicBase.cpp8
-rw-r--r--xbmc/music/windows/GUIWindowMusicNav.cpp22
-rw-r--r--xbmc/music/windows/GUIWindowMusicPlaylist.cpp10
-rw-r--r--xbmc/music/windows/GUIWindowMusicPlaylistEditor.cpp4
-rw-r--r--xbmc/music/windows/GUIWindowVisualisation.cpp10
-rw-r--r--xbmc/music/windows/MusicFileItemListModifier.cpp2
-rw-r--r--xbmc/network/AirPlayServer.cpp4
-rw-r--r--xbmc/network/AirTunesServer.cpp2
-rw-r--r--xbmc/network/EventClient.h4
-rw-r--r--xbmc/network/EventServer.cpp8
-rw-r--r--xbmc/network/Network.cpp6
-rw-r--r--xbmc/network/Network.h2
-rw-r--r--xbmc/network/NetworkServices.cpp102
-rw-r--r--xbmc/network/NetworkServices.h4
-rw-r--r--xbmc/network/WakeOnAccess.cpp2
-rw-r--r--xbmc/network/WebServer.cpp2
-rw-r--r--xbmc/network/Zeroconf.cpp6
-rw-r--r--xbmc/network/upnp/UPnP.cpp4
-rw-r--r--xbmc/network/upnp/UPnPInternal.cpp4
-rw-r--r--xbmc/network/upnp/UPnPServer.cpp2
-rw-r--r--xbmc/peripherals/Peripherals.cpp8
-rw-r--r--xbmc/peripherals/bus/virtual/PeripheralBusApplication.cpp2
-rw-r--r--xbmc/pictures/GUIViewStatePictures.cpp2
-rw-r--r--xbmc/pictures/GUIWindowPictures.cpp18
-rw-r--r--xbmc/pictures/GUIWindowSlideShow.cpp6
-rw-r--r--xbmc/pictures/PictureInfoLoader.cpp2
-rw-r--r--xbmc/pictures/PictureThumbLoader.cpp2
-rw-r--r--xbmc/pictures/SlideShowPicture.cpp16
-rw-r--r--xbmc/platform/android/network/NetworkAndroid.cpp4
-rw-r--r--xbmc/platform/android/network/NetworkAndroid.h2
-rw-r--r--xbmc/platform/darwin/osx/XBMCHelper.cpp12
-rw-r--r--xbmc/platform/linux/LinuxTimezone.cpp4
-rw-r--r--xbmc/platform/linux/OMXClock.cpp2
-rw-r--r--xbmc/platform/linux/RBP.cpp2
-rw-r--r--xbmc/platform/linux/network/NetworkLinux.cpp4
-rw-r--r--xbmc/platform/linux/network/NetworkLinux.h2
-rw-r--r--xbmc/platform/posix/filesystem/SMBFile.cpp26
-rw-r--r--xbmc/platform/win10/network/NetworkWin10.cpp4
-rw-r--r--xbmc/platform/win10/network/NetworkWin10.h2
-rw-r--r--xbmc/platform/win32/network/NetworkWin32.cpp4
-rw-r--r--xbmc/platform/win32/network/NetworkWin32.h2
-rw-r--r--xbmc/powermanagement/PowerManager.cpp10
-rw-r--r--xbmc/powermanagement/PowerManager.h4
-rw-r--r--xbmc/profiles/ProfilesManager.cpp33
-rw-r--r--xbmc/profiles/ProfilesManager.h4
-rw-r--r--xbmc/programs/GUIViewStatePrograms.cpp2
-rw-r--r--xbmc/pvr/PVRActionListener.cpp12
-rw-r--r--xbmc/pvr/PVRDatabase.cpp2
-rw-r--r--xbmc/pvr/PVRGUIChannelNavigator.cpp4
-rw-r--r--xbmc/pvr/PVRGUIInfo.cpp6
-rw-r--r--xbmc/pvr/PVRGUITimesInfo.cpp4
-rw-r--r--xbmc/pvr/PVRSettings.cpp10
-rw-r--r--xbmc/pvr/channels/PVRChannelGroup.cpp18
-rw-r--r--xbmc/pvr/channels/PVRChannelGroups.cpp6
-rw-r--r--xbmc/pvr/dialogs/GUIDialogPVRChannelManager.cpp4
-rw-r--r--xbmc/pvr/epg/Epg.cpp8
-rw-r--r--xbmc/pvr/epg/EpgInfoTag.cpp2
-rw-r--r--xbmc/pvr/recordings/PVRRecordings.cpp2
-rw-r--r--xbmc/pvr/timers/PVRTimerInfoTag.cpp6
-rw-r--r--xbmc/pvr/windows/GUIViewStatePVR.cpp4
-rw-r--r--xbmc/pvr/windows/GUIWindowPVRGuide.cpp2
-rw-r--r--xbmc/pvr/windows/GUIWindowPVRRecordings.cpp6
-rw-r--r--xbmc/pvr/windows/GUIWindowPVRTimersBase.cpp6
-rw-r--r--xbmc/settings/AdvancedSettings.cpp10
-rw-r--r--xbmc/settings/DisplaySettings.cpp22
-rw-r--r--xbmc/settings/SkinSettings.cpp2
-rw-r--r--xbmc/settings/dialogs/GUIDialogLibExportSettings.cpp32
-rw-r--r--xbmc/settings/windows/GUIWindowSettingsCategory.cpp8
-rw-r--r--xbmc/settings/windows/GUIWindowSettingsCategory.h2
-rw-r--r--xbmc/settings/windows/GUIWindowSettingsScreenCalibration.cpp2
-rw-r--r--xbmc/storage/MediaManager.cpp6
-rw-r--r--xbmc/test/TestBasicEnvironment.cpp10
-rw-r--r--xbmc/test/TestBasicEnvironment.h4
-rw-r--r--xbmc/utils/FileUtils.cpp2
-rw-r--r--xbmc/utils/LabelFormatter.cpp2
-rw-r--r--xbmc/utils/RecentlyAddedJob.cpp2
-rw-r--r--xbmc/utils/Screenshot.cpp2
-rw-r--r--xbmc/utils/SystemInfo.cpp2
-rw-r--r--xbmc/utils/test/TestCharsetConverter.cpp16
-rw-r--r--xbmc/utils/test/TestLabelFormatter.cpp16
-rw-r--r--xbmc/video/GUIViewStateVideo.cpp18
-rw-r--r--xbmc/video/PlayerController.cpp10
-rw-r--r--xbmc/video/VideoDatabase.cpp8
-rw-r--r--xbmc/video/VideoInfoScanner.cpp4
-rw-r--r--xbmc/video/VideoThumbLoader.cpp6
-rw-r--r--xbmc/video/dialogs/GUIDialogAudioSettings.cpp8
-rw-r--r--xbmc/video/dialogs/GUIDialogCMSSettings.cpp36
-rw-r--r--xbmc/video/dialogs/GUIDialogSubtitleSettings.cpp6
-rw-r--r--xbmc/video/dialogs/GUIDialogSubtitles.cpp14
-rw-r--r--xbmc/video/dialogs/GUIDialogTeletext.cpp2
-rw-r--r--xbmc/video/dialogs/GUIDialogVideoBookmarks.cpp2
-rw-r--r--xbmc/video/dialogs/GUIDialogVideoInfo.cpp14
-rw-r--r--xbmc/video/dialogs/GUIDialogVideoSettings.cpp4
-rw-r--r--xbmc/video/tags/VideoInfoTagLoaderFactory.cpp2
-rw-r--r--xbmc/video/windows/GUIWindowFullScreen.cpp2
-rw-r--r--xbmc/video/windows/GUIWindowVideoBase.cpp20
-rw-r--r--xbmc/video/windows/GUIWindowVideoNav.cpp18
-rw-r--r--xbmc/video/windows/GUIWindowVideoPlaylist.cpp6
-rw-r--r--xbmc/video/windows/VideoFileItemListModifier.cpp2
-rw-r--r--xbmc/view/GUIViewState.cpp14
-rw-r--r--xbmc/weather/WeatherJob.cpp4
-rw-r--r--xbmc/weather/WeatherManager.cpp12
-rw-r--r--xbmc/windowing/GraphicContext.cpp8
-rw-r--r--xbmc/windowing/Resolution.cpp4
-rw-r--r--xbmc/windowing/WinSystem.cpp2
-rw-r--r--xbmc/windowing/X11/WinSystemX11.cpp12
-rw-r--r--xbmc/windowing/amlogic/WinSystemAmlogic.cpp2
-rw-r--r--xbmc/windowing/android/AndroidUtils.cpp2
-rw-r--r--xbmc/windowing/android/WinSystemAndroid.cpp2
-rw-r--r--xbmc/windowing/gbm/WinSystemGbm.cpp4
-rw-r--r--xbmc/windowing/osx/WinSystemIOS.mm2
-rw-r--r--xbmc/windowing/osx/WinSystemOSX.mm16
-rw-r--r--xbmc/windowing/rpi/RPIUtils.cpp2
-rw-r--r--xbmc/windowing/rpi/WinSystemRpi.cpp2
-rw-r--r--xbmc/windowing/wayland/WinSystemWayland.cpp6
-rw-r--r--xbmc/windowing/win10/WinSystemWin10.cpp4
-rw-r--r--xbmc/windowing/windows/WinEventsWin32.cpp2
-rw-r--r--xbmc/windowing/windows/WinSystemWin32.cpp8
-rw-r--r--xbmc/windowing/windows/WinSystemWin32DX.cpp2
-rw-r--r--xbmc/windows/GUIMediaWindow.cpp2
-rw-r--r--xbmc/windows/GUIWindowFileManager.cpp6
-rw-r--r--xbmc/windows/GUIWindowLoginScreen.cpp2
-rw-r--r--xbmc/windows/GUIWindowScreensaver.cpp2
256 files changed, 1136 insertions, 1111 deletions
diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp
index e6b5e6efad..95c79295d8 100644
--- a/xbmc/Application.cpp
+++ b/xbmc/Application.cpp
@@ -246,6 +246,8 @@ CApplication::~CApplication(void)
delete m_pInertialScrollingHandler;
m_actionListeners.clear();
+
+ CServiceBroker::UnregisterSettings();
}
bool CApplication::OnEvent(XBMC_Event& newEvent)
@@ -275,9 +277,9 @@ void CApplication::HandlePortEvents()
if (!g_advancedSettings.m_fullScreen)
{
CServiceBroker::GetWinSystem()->GetGfxContext().ApplyWindowResize(newEvent.resize.w, newEvent.resize.h);
- CServiceBroker::GetSettings().SetInt(CSettings::SETTING_WINDOW_WIDTH, newEvent.resize.w);
- CServiceBroker::GetSettings().SetInt(CSettings::SETTING_WINDOW_HEIGHT, newEvent.resize.h);
- CServiceBroker::GetSettings().Save();
+ CServiceBroker::GetSettings()->SetInt(CSettings::SETTING_WINDOW_WIDTH, newEvent.resize.w);
+ CServiceBroker::GetSettings()->SetInt(CSettings::SETTING_WINDOW_HEIGHT, newEvent.resize.h);
+ CServiceBroker::GetSettings()->Save();
}
}
break;
@@ -353,6 +355,9 @@ bool CApplication::Create(const CAppParamParser &params)
// Grab a handle to our thread to be used later in identifying the render thread.
m_threadID = CThread::GetCurrentThreadId();
+ m_pSettings.reset(new CSettings());
+ CServiceBroker::RegisterSettings(m_pSettings);
+
// Announement service
m_pAnnouncementManager = std::make_shared<ANNOUNCEMENT::CAnnouncementManager>();
m_pAnnouncementManager->Start();
@@ -523,21 +528,21 @@ bool CApplication::Create(const CAppParamParser &params)
// Initialize default Settings - don't move
CLog::Log(LOGNOTICE, "load settings...");
- if (!m_ServiceManager->GetSettings().Initialize())
+ if (!CServiceBroker::GetSettings()->Initialize())
return false;
// load the actual values
- if (!m_ServiceManager->GetSettings().Load())
+ if (!CServiceBroker::GetSettings()->Load())
{
CLog::Log(LOGFATAL, "unable to load settings");
return false;
}
- m_ServiceManager->GetSettings().SetLoaded();
+ CServiceBroker::GetSettings()->SetLoaded();
CLog::Log(LOGINFO, "creating subdirectories");
CLog::Log(LOGINFO, "userdata folder: %s", CURL::GetRedacted(m_ServiceManager->GetProfileManager().GetProfileUserDataFolder()).c_str());
- CLog::Log(LOGINFO, "recording folder: %s", CURL::GetRedacted(m_ServiceManager->GetSettings().GetString(CSettings::SETTING_AUDIOCDS_RECORDINGPATH)).c_str());
- CLog::Log(LOGINFO, "screenshots folder: %s", CURL::GetRedacted(m_ServiceManager->GetSettings().GetString(CSettings::SETTING_DEBUG_SCREENSHOTPATH)).c_str());
+ CLog::Log(LOGINFO, "recording folder: %s", CURL::GetRedacted(CServiceBroker::GetSettings()->GetString(CSettings::SETTING_AUDIOCDS_RECORDINGPATH)).c_str());
+ CLog::Log(LOGINFO, "screenshots folder: %s", CURL::GetRedacted(CServiceBroker::GetSettings()->GetString(CSettings::SETTING_DEBUG_SCREENSHOTPATH)).c_str());
CDirectory::Create(m_ServiceManager->GetProfileManager().GetUserDataFolder());
CDirectory::Create(m_ServiceManager->GetProfileManager().GetProfileUserDataFolder());
m_ServiceManager->GetProfileManager().CreateProfileFolders();
@@ -570,10 +575,10 @@ bool CApplication::Create(const CAppParamParser &params)
CServiceBroker::GetActiveAE()->SetMute(m_muted);
// initialize m_replayGainSettings
- m_replayGainSettings.iType = m_ServiceManager->GetSettings().GetInt(CSettings::SETTING_MUSICPLAYER_REPLAYGAINTYPE);
- m_replayGainSettings.iPreAmp = m_ServiceManager->GetSettings().GetInt(CSettings::SETTING_MUSICPLAYER_REPLAYGAINPREAMP);
- m_replayGainSettings.iNoGainPreAmp = m_ServiceManager->GetSettings().GetInt(CSettings::SETTING_MUSICPLAYER_REPLAYGAINNOGAINPREAMP);
- m_replayGainSettings.bAvoidClipping = m_ServiceManager->GetSettings().GetBool(CSettings::SETTING_MUSICPLAYER_REPLAYGAINAVOIDCLIPPING);
+ m_replayGainSettings.iType = CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_MUSICPLAYER_REPLAYGAINTYPE);
+ m_replayGainSettings.iPreAmp = CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_MUSICPLAYER_REPLAYGAINPREAMP);
+ m_replayGainSettings.iNoGainPreAmp = CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_MUSICPLAYER_REPLAYGAINNOGAINPREAMP);
+ m_replayGainSettings.bAvoidClipping = CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_MUSICPLAYER_REPLAYGAINAVOIDCLIPPING);
// load the keyboard layouts
if (!CKeyboardLayoutManager::GetInstance().Load())
@@ -608,7 +613,6 @@ bool CApplication::CreateGUI()
return false;
}
-
// Retrieve the matching resolution based on GUI settings
bool sav_res = false;
CDisplaySettings::GetInstance().SetCurrentResolution(CDisplaySettings::GetInstance().GetDisplayResolution());
@@ -622,7 +626,7 @@ bool CApplication::CreateGUI()
}
// update the window resolution
- CServiceBroker::GetWinSystem()->SetWindowResolution(m_ServiceManager->GetSettings().GetInt(CSettings::SETTING_WINDOW_WIDTH), m_ServiceManager->GetSettings().GetInt(CSettings::SETTING_WINDOW_HEIGHT));
+ CServiceBroker::GetWinSystem()->SetWindowResolution(CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_WINDOW_WIDTH), CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_WINDOW_HEIGHT));
if (g_advancedSettings.m_startFullScreen && CDisplaySettings::GetInstance().GetCurrentResolution() == RES_WINDOW)
{
@@ -644,7 +648,7 @@ bool CApplication::CreateGUI()
}
// Set default screen saver mode
- auto screensaverModeSetting = std::static_pointer_cast<CSettingString>(m_ServiceManager->GetSettings().GetSetting(CSettings::SETTING_SCREENSAVER_MODE));
+ auto screensaverModeSetting = std::static_pointer_cast<CSettingString>(CServiceBroker::GetSettings()->GetSetting(CSettings::SETTING_SCREENSAVER_MODE));
// Can only set this after windowing has been initialized since it depends on it
if (CServiceBroker::GetWinSystem()->GetOSScreenSaver())
{
@@ -1026,7 +1030,7 @@ bool CApplication::Initialize()
bool uiInitializationFinished = false;
if (CServiceBroker::GetGUI()->GetWindowManager().Initialized())
{
- m_ServiceManager->GetSettings().GetSetting(CSettings::SETTING_POWERMANAGEMENT_DISPLAYSOFF)->SetRequirementsMet(m_dpms->IsSupported());
+ CServiceBroker::GetSettings()->GetSetting(CSettings::SETTING_POWERMANAGEMENT_DISPLAYSOFF)->SetRequirementsMet(m_dpms->IsSupported());
CServiceBroker::GetGUI()->GetWindowManager().CreateWindows();
@@ -1056,10 +1060,10 @@ bool CApplication::Initialize()
m_incompatibleAddons = incompatibleAddons;
m_confirmSkinChange = true;
- std::string defaultSkin = std::static_pointer_cast<const CSettingString>(m_ServiceManager->GetSettings().GetSetting(CSettings::SETTING_LOOKANDFEEL_SKIN))->GetDefault();
- if (!LoadSkin(m_ServiceManager->GetSettings().GetString(CSettings::SETTING_LOOKANDFEEL_SKIN)))
+ std::string defaultSkin = std::static_pointer_cast<const CSettingString>(CServiceBroker::GetSettings()->GetSetting(CSettings::SETTING_LOOKANDFEEL_SKIN))->GetDefault();
+ if (!LoadSkin(CServiceBroker::GetSettings()->GetString(CSettings::SETTING_LOOKANDFEEL_SKIN)))
{
- CLog::Log(LOGERROR, "Failed to load skin '%s'", m_ServiceManager->GetSettings().GetString(CSettings::SETTING_LOOKANDFEEL_SKIN).c_str());
+ CLog::Log(LOGERROR, "Failed to load skin '%s'", CServiceBroker::GetSettings()->GetString(CSettings::SETTING_LOOKANDFEEL_SKIN).c_str());
if (!LoadSkin(defaultSkin))
{
CLog::Log(LOGFATAL, "Default skin '%s' could not be loaded! Terminating..", defaultSkin.c_str());
@@ -1072,7 +1076,7 @@ bool CApplication::Initialize()
// rendered while we load the main window or enter the master lock key
CServiceBroker::GetGUI()->GetWindowManager().ActivateWindow(WINDOW_SPLASH);
- if (m_ServiceManager->GetSettings().GetBool(CSettings::SETTING_MASTERLOCK_STARTUPLOCK) &&
+ if (CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_MASTERLOCK_STARTUPLOCK) &&
m_ServiceManager->GetProfileManager().GetMasterProfile().getLockMode() != LOCK_MODE_EVERYONE &&
!m_ServiceManager->GetProfileManager().GetMasterProfile().getLockCode().empty())
{
@@ -1154,44 +1158,44 @@ bool CApplication::StartServer(enum ESERVERS eServer, bool bStart, bool bWait/*
{
case ES_WEBSERVER:
// the callback will take care of starting/stopping webserver
- ret = m_ServiceManager->GetSettings().SetBool(CSettings::SETTING_SERVICES_WEBSERVER, bStart);
+ ret = CServiceBroker::GetSettings()->SetBool(CSettings::SETTING_SERVICES_WEBSERVER, bStart);
break;
case ES_AIRPLAYSERVER:
// the callback will take care of starting/stopping airplay
- ret = m_ServiceManager->GetSettings().SetBool(CSettings::SETTING_SERVICES_AIRPLAY, bStart);
+ ret = CServiceBroker::GetSettings()->SetBool(CSettings::SETTING_SERVICES_AIRPLAY, bStart);
break;
case ES_JSONRPCSERVER:
// the callback will take care of starting/stopping jsonrpc server
- ret = m_ServiceManager->GetSettings().SetBool(CSettings::SETTING_SERVICES_ESENABLED, bStart);
+ ret = CServiceBroker::GetSettings()->SetBool(CSettings::SETTING_SERVICES_ESENABLED, bStart);
break;
case ES_UPNPSERVER:
// the callback will take care of starting/stopping upnp server
- ret = m_ServiceManager->GetSettings().SetBool(CSettings::SETTING_SERVICES_UPNPSERVER, bStart);
+ ret = CServiceBroker::GetSettings()->SetBool(CSettings::SETTING_SERVICES_UPNPSERVER, bStart);
break;
case ES_UPNPRENDERER:
// the callback will take care of starting/stopping upnp renderer
- ret = m_ServiceManager->GetSettings().SetBool(CSettings::SETTING_SERVICES_UPNPRENDERER, bStart);
+ ret = CServiceBroker::GetSettings()->SetBool(CSettings::SETTING_SERVICES_UPNPRENDERER, bStart);
break;
case ES_EVENTSERVER:
// the callback will take care of starting/stopping event server
- ret = m_ServiceManager->GetSettings().SetBool(CSettings::SETTING_SERVICES_ESENABLED, bStart);
+ ret = CServiceBroker::GetSettings()->SetBool(CSettings::SETTING_SERVICES_ESENABLED, bStart);
break;
case ES_ZEROCONF:
// the callback will take care of starting/stopping zeroconf
- ret = m_ServiceManager->GetSettings().SetBool(CSettings::SETTING_SERVICES_ZEROCONF, bStart);
+ ret = CServiceBroker::GetSettings()->SetBool(CSettings::SETTING_SERVICES_ZEROCONF, bStart);
break;
default:
ret = false;
break;
}
- m_ServiceManager->GetSettings().Save();
+ CServiceBroker::GetSettings()->Save();
return ret;
}
@@ -1238,21 +1242,21 @@ void CApplication::OnSettingChanged(std::shared_ptr<const CSetting> setting)
// the it to the default value
if (settingId == CSettings::SETTING_LOOKANDFEEL_SKIN)
{
- SettingPtr skinRelatedSetting = m_ServiceManager->GetSettings().GetSetting(CSettings::SETTING_LOOKANDFEEL_SKINCOLORS);
+ SettingPtr skinRelatedSetting = CServiceBroker::GetSettings()->GetSetting(CSettings::SETTING_LOOKANDFEEL_SKINCOLORS);
if (!skinRelatedSetting->IsDefault())
{
m_ignoreSkinSettingChanges = true;
skinRelatedSetting->Reset();
}
- skinRelatedSetting = m_ServiceManager->GetSettings().GetSetting(CSettings::SETTING_LOOKANDFEEL_SKINTHEME);
+ skinRelatedSetting = CServiceBroker::GetSettings()->GetSetting(CSettings::SETTING_LOOKANDFEEL_SKINTHEME);
if (!skinRelatedSetting->IsDefault())
{
m_ignoreSkinSettingChanges = true;
skinRelatedSetting->Reset();
}
- skinRelatedSetting = m_ServiceManager->GetSettings().GetSetting(CSettings::SETTING_LOOKANDFEEL_FONT);
+ skinRelatedSetting = CServiceBroker::GetSettings()->GetSetting(CSettings::SETTING_LOOKANDFEEL_FONT);
if (!skinRelatedSetting->IsDefault())
{
m_ignoreSkinSettingChanges = true;
@@ -1261,7 +1265,7 @@ void CApplication::OnSettingChanged(std::shared_ptr<const CSetting> setting)
}
else if (settingId == CSettings::SETTING_LOOKANDFEEL_SKINTHEME)
{
- std::shared_ptr<CSettingString> skinColorsSetting = std::static_pointer_cast<CSettingString>(m_ServiceManager->GetSettings().GetSetting(CSettings::SETTING_LOOKANDFEEL_SKINCOLORS));
+ std::shared_ptr<CSettingString> skinColorsSetting = std::static_pointer_cast<CSettingString>(CServiceBroker::GetSettings()->GetSetting(CSettings::SETTING_LOOKANDFEEL_SKINCOLORS));
m_ignoreSkinSettingChanges = true;
// we also need to adjust the skin color setting
@@ -1325,13 +1329,13 @@ void CApplication::OnSettingAction(std::shared_ptr<const CSetting> setting)
else if (settingId == CSettings::SETTING_SCREENSAVER_SETTINGS)
{
AddonPtr addon;
- if (CServiceBroker::GetAddonMgr().GetAddon(m_ServiceManager->GetSettings().GetString(CSettings::SETTING_SCREENSAVER_MODE), addon, ADDON_SCREENSAVER))
+ if (CServiceBroker::GetAddonMgr().GetAddon(CServiceBroker::GetSettings()->GetString(CSettings::SETTING_SCREENSAVER_MODE), addon, ADDON_SCREENSAVER))
CGUIDialogAddonSettings::ShowForAddon(addon);
}
else if (settingId == CSettings::SETTING_AUDIOCDS_SETTINGS)
{
AddonPtr addon;
- if (CServiceBroker::GetAddonMgr().GetAddon(m_ServiceManager->GetSettings().GetString(CSettings::SETTING_AUDIOCDS_ENCODER), addon, ADDON_AUDIOENCODER))
+ if (CServiceBroker::GetAddonMgr().GetAddon(CServiceBroker::GetSettings()->GetString(CSettings::SETTING_AUDIOCDS_ENCODER), addon, ADDON_AUDIOENCODER))
CGUIDialogAddonSettings::ShowForAddon(addon);
}
else if (settingId == CSettings::SETTING_VIDEOSCREEN_GUICALIBRATION)
@@ -1410,7 +1414,7 @@ void CApplication::ReloadSkin(bool confirm/*=false*/)
CGUIMessage msg(GUI_MSG_LOAD_SKIN, -1, CServiceBroker::GetGUI()->GetWindowManager().GetActiveWindow());
CServiceBroker::GetGUI()->GetWindowManager().SendMessage(msg);
- std::string newSkin = m_ServiceManager->GetSettings().GetString(CSettings::SETTING_LOOKANDFEEL_SKIN);
+ std::string newSkin = CServiceBroker::GetSettings()->GetString(CSettings::SETTING_LOOKANDFEEL_SKIN);
if (LoadSkin(newSkin))
{
/* The Reset() or SetString() below will cause recursion, so the m_confirmSkinChange boolean is set so as to not prompt the
@@ -1421,18 +1425,18 @@ void CApplication::ReloadSkin(bool confirm/*=false*/)
DialogResponse::YES)
{
m_confirmSkinChange = false;
- m_ServiceManager->GetSettings().SetString(CSettings::SETTING_LOOKANDFEEL_SKIN, oldSkin);
+ CServiceBroker::GetSettings()->SetString(CSettings::SETTING_LOOKANDFEEL_SKIN, oldSkin);
}
}
}
else
{
// skin failed to load - we revert to the default only if we didn't fail loading the default
- std::string defaultSkin = std::static_pointer_cast<CSettingString>(m_ServiceManager->GetSettings().GetSetting(CSettings::SETTING_LOOKANDFEEL_SKIN))->GetDefault();
+ std::string defaultSkin = std::static_pointer_cast<CSettingString>(CServiceBroker::GetSettings()->GetSetting(CSettings::SETTING_LOOKANDFEEL_SKIN))->GetDefault();
if (newSkin != defaultSkin)
{
m_confirmSkinChange = false;
- m_ServiceManager->GetSettings().GetSetting(CSettings::SETTING_LOOKANDFEEL_SKIN)->Reset();
+ CServiceBroker::GetSettings()->GetSetting(CSettings::SETTING_LOOKANDFEEL_SKIN)->Reset();
CGUIDialogKaiToast::QueueNotification(CGUIDialogKaiToast::Error, g_localizeStrings.Get(24102), g_localizeStrings.Get(24103));
}
}
@@ -1543,17 +1547,17 @@ bool CApplication::LoadSkin(const std::string& skinID)
CServiceBroker::GetWinSystem()->GetGfxContext().SetMediaDir(skin->Path());
g_directoryCache.ClearSubPaths(skin->Path());
- CServiceBroker::GetGUI()->GetColorManager().Load(m_ServiceManager->GetSettings().GetString(CSettings::SETTING_LOOKANDFEEL_SKINCOLORS));
+ CServiceBroker::GetGUI()->GetColorManager().Load(CServiceBroker::GetSettings()->GetString(CSettings::SETTING_LOOKANDFEEL_SKINCOLORS));
g_SkinInfo->LoadIncludes();
- g_fontManager.LoadFonts(m_ServiceManager->GetSettings().GetString(CSettings::SETTING_LOOKANDFEEL_FONT));
+ g_fontManager.LoadFonts(CServiceBroker::GetSettings()->GetString(CSettings::SETTING_LOOKANDFEEL_FONT));
// load in the skin strings
std::string langPath = URIUtils::AddFileToFolder(skin->Path(), "language");
URIUtils::AddSlashAtEnd(langPath);
- g_localizeStrings.LoadSkinStrings(langPath, m_ServiceManager->GetSettings().GetString(CSettings::SETTING_LOCALE_LANGUAGE));
+ g_localizeStrings.LoadSkinStrings(langPath, CServiceBroker::GetSettings()->GetString(CSettings::SETTING_LOCALE_LANGUAGE));
int64_t start;
@@ -2203,8 +2207,8 @@ bool CApplication::OnAction(const CAction &action)
if (action.GetID() == ACTION_TOGGLE_DIGITAL_ANALOG)
{
- bool passthrough = m_ServiceManager->GetSettings().GetBool(CSettings::SETTING_AUDIOOUTPUT_PASSTHROUGH);
- m_ServiceManager->GetSettings().SetBool(CSettings::SETTING_AUDIOOUTPUT_PASSTHROUGH, !passthrough);
+ bool passthrough = CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_AUDIOOUTPUT_PASSTHROUGH);
+ CServiceBroker::GetSettings()->SetBool(CSettings::SETTING_AUDIOOUTPUT_PASSTHROUGH, !passthrough);
if (CServiceBroker::GetGUI()->GetWindowManager().GetActiveWindow() == WINDOW_SETTINGS_SYSTEM)
{
@@ -2222,7 +2226,7 @@ bool CApplication::OnAction(const CAction &action)
if (m_muted)
UnMute();
float volume = m_volumeLevel;
- int volumesteps = m_ServiceManager->GetSettings().GetInt(CSettings::SETTING_AUDIOOUTPUT_VOLUMESTEPS);
+ int volumesteps = CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_AUDIOOUTPUT_VOLUMESTEPS);
// sanity check
if (volumesteps == 0)
volumesteps = 90;
@@ -2515,7 +2519,7 @@ void CApplication::OnApplicationMessage(ThreadMessage* pMsg)
{
if (items.Size() == 0)
{
- m_ServiceManager->GetSettings().SetString(CSettings::SETTING_SCREENSAVER_MODE, "screensaver.xbmc.builtin.dim");
+ CServiceBroker::GetSettings()->SetString(CSettings::SETTING_SCREENSAVER_MODE, "screensaver.xbmc.builtin.dim");
ActivateScreenSaver();
}
else
@@ -2542,7 +2546,7 @@ void CApplication::OnApplicationMessage(ThreadMessage* pMsg)
void CApplication::HandleShutdownMessage()
{
- switch (m_ServiceManager->GetSettings().GetInt(CSettings::SETTING_POWERMANAGEMENT_SHUTDOWNSTATE))
+ switch (CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_POWERMANAGEMENT_SHUTDOWNSTATE))
{
case POWERSTATE_SHUTDOWN:
CApplicationMessenger::GetInstance().PostMsg(TMSG_POWERDOWN);
@@ -2649,7 +2653,7 @@ void CApplication::FrameMove(bool processEvents, bool processGUI)
// This code reduces rendering fps of the GUI layer when playing videos in fullscreen mode
// it makes only sense on architectures with multiple layers
if (CServiceBroker::GetWinSystem()->GetGfxContext().IsFullScreenVideo() && !m_appPlayer.IsPausedPlayback() && m_appPlayer.IsRenderingVideoLayer())
- fps = m_ServiceManager->GetSettings().GetInt(CSettings::SETTING_VIDEOPLAYER_LIMITGUIUPDATE);
+ fps = CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_VIDEOPLAYER_LIMITGUIUPDATE);
unsigned int now = XbmcThreads::SystemClockMillis();
unsigned int frameTime = now - m_lastRenderTime;
@@ -2725,7 +2729,7 @@ bool CApplication::Cleanup()
if (m_ServiceManager)
m_ServiceManager->DeinitStageTwo();
- m_ServiceManager->GetSettings().Uninitialize();
+ CServiceBroker::GetSettings()->Uninitialize();
g_advancedSettings.Clear();
CSpecialProtocol::UnregisterProfileManager();
@@ -2805,7 +2809,7 @@ void CApplication::Stop(int exitCode)
if (CFile::Exists(m_ServiceManager->GetProfileManager().GetSettingsFile()))
{
CLog::Log(LOGNOTICE, "Saving settings");
- m_ServiceManager->GetSettings().Save();
+ CServiceBroker::GetSettings()->Save();
}
else
CLog::Log(LOGNOTICE, "Not saving settings (settings.xml is not present)");
@@ -3250,7 +3254,7 @@ void CApplication::PlaybackCleanup()
if (!m_appPlayer.IsPlayingAudio() && CServiceBroker::GetPlaylistPlayer().GetCurrentPlaylist() == PLAYLIST_NONE && CServiceBroker::GetGUI()->GetWindowManager().GetActiveWindow() == WINDOW_VISUALISATION)
{
- m_ServiceManager->GetSettings().Save(); // save vis settings
+ CServiceBroker::GetSettings()->Save(); // save vis settings
WakeUpScreenSaverAndDPMS();
CServiceBroker::GetGUI()->GetWindowManager().PreviousWindow();
}
@@ -3259,7 +3263,7 @@ void CApplication::PlaybackCleanup()
if (!m_appPlayer.IsPlayingAudio() && (m_itemCurrentFile->IsCDDA() || m_itemCurrentFile->IsOnDVD()) && !g_mediaManager.IsDiscInDrive() && CServiceBroker::GetGUI()->GetWindowManager().GetActiveWindow() == WINDOW_VISUALISATION)
{
// yes, disable vis
- m_ServiceManager->GetSettings().Save(); // save vis settings
+ CServiceBroker::GetSettings()->Save(); // save vis settings
WakeUpScreenSaverAndDPMS();
CServiceBroker::GetGUI()->GetWindowManager().PreviousWindow();
}
@@ -3670,7 +3674,7 @@ bool CApplication::WakeUpScreenSaver(bool bPowerOffKeyPressed /* = false */)
{
if (m_iScreenSaveLock == 0)
if (m_ServiceManager->GetProfileManager().GetMasterProfile().getLockMode() != LOCK_MODE_EVERYONE &&
- (m_ServiceManager->GetProfileManager().UsingLoginScreen() || m_ServiceManager->GetSettings().GetBool(CSettings::SETTING_MASTERLOCK_STARTUPLOCK)) &&
+ (m_ServiceManager->GetProfileManager().UsingLoginScreen() || CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_MASTERLOCK_STARTUPLOCK)) &&
m_ServiceManager->GetProfileManager().GetCurrentProfile().getLockMode() != LOCK_MODE_EVERYONE &&
m_screensaverIdInUse != "screensaver.xbmc.builtin.dim" && m_screensaverIdInUse != "screensaver.xbmc.builtin.black" && m_screensaverIdInUse != "visualization")
{
@@ -3732,7 +3736,7 @@ bool CApplication::WakeUpScreenSaver(bool bPowerOffKeyPressed /* = false */)
void CApplication::CheckOSScreenSaverInhibitionSetting()
{
// Kodi screen saver overrides OS one: always inhibit OS screen saver then
- if (!m_ServiceManager->GetSettings().GetString(CSettings::SETTING_SCREENSAVER_MODE).empty() &&
+ if (!CServiceBroker::GetSettings()->GetString(CSettings::SETTING_SCREENSAVER_MODE).empty() &&
CServiceBroker::GetWinSystem()->GetOSScreenSaver())
{
if (!m_globalScreensaverInhibitor)
@@ -3753,7 +3757,7 @@ void CApplication::CheckScreenSaverAndDPMS()
maybeScreensaver = false;
else if (m_screensaverActive)
maybeScreensaver = false;
- else if (m_ServiceManager->GetSettings().GetString(CSettings::SETTING_SCREENSAVER_MODE).empty())
+ else if (CServiceBroker::GetSettings()->GetString(CSettings::SETTING_SCREENSAVER_MODE).empty())
maybeScreensaver = false;
bool maybeDPMS = true;
@@ -3761,7 +3765,7 @@ void CApplication::CheckScreenSaverAndDPMS()
maybeDPMS = false;
else if (!m_dpms->IsSupported())
maybeDPMS = false;
- else if (m_ServiceManager->GetSettings().GetInt(CSettings::SETTING_POWERMANAGEMENT_DISPLAYSOFF) <= 0)
+ else if (CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_POWERMANAGEMENT_DISPLAYSOFF) <= 0)
maybeDPMS = false;
// whether the current state of the application should be regarded as active even when there is no
@@ -3775,7 +3779,7 @@ void CApplication::CheckScreenSaverAndDPMS()
// Are we playing some music in fullscreen vis?
else if (m_appPlayer.IsPlayingAudio() &&
CServiceBroker::GetGUI()->GetWindowManager().GetActiveWindow() == WINDOW_VISUALISATION &&
- !m_ServiceManager->GetSettings().GetString(CSettings::SETTING_MUSICPLAYER_VISUALISATION).empty())
+ !CServiceBroker::GetSettings()->GetString(CSettings::SETTING_MUSICPLAYER_VISUALISATION).empty())
{
haveIdleActivity = true;
}
@@ -3817,13 +3821,13 @@ void CApplication::CheckScreenSaverAndDPMS()
// DPMS has priority (it makes the screensaver not needed)
if (maybeDPMS
- && elapsed > m_ServiceManager->GetSettings().GetInt(CSettings::SETTING_POWERMANAGEMENT_DISPLAYSOFF) * 60)
+ && elapsed > CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_POWERMANAGEMENT_DISPLAYSOFF) * 60)
{
ToggleDPMS(false);
WakeUpScreenSaver();
}
else if (maybeScreensaver
- && elapsed > m_ServiceManager->GetSettings().GetInt(CSettings::SETTING_SCREENSAVER_TIME) * 60)
+ && elapsed > CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_SCREENSAVER_TIME) * 60)
{
ActivateScreenSaver();
}
@@ -3834,8 +3838,8 @@ void CApplication::CheckScreenSaverAndDPMS()
// the type of screensaver displayed
void CApplication::ActivateScreenSaver(bool forceType /*= false */)
{
- if (m_appPlayer.IsPlayingAudio() && m_ServiceManager->GetSettings().GetBool(CSettings::SETTING_SCREENSAVER_USEMUSICVISINSTEAD) &&
- !m_ServiceManager->GetSettings().GetString(CSettings::SETTING_MUSICPLAYER_VISUALISATION).empty())
+ if (m_appPlayer.IsPlayingAudio() && CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_SCREENSAVER_USEMUSICVISINSTEAD) &&
+ !CServiceBroker::GetSettings()->GetString(CSettings::SETTING_MUSICPLAYER_VISUALISATION).empty())
{ // just activate the visualisation if user toggled the usemusicvisinstead option
CServiceBroker::GetGUI()->GetWindowManager().ActivateWindow(WINDOW_VISUALISATION);
return;
@@ -3853,7 +3857,7 @@ void CApplication::ActivateScreenSaver(bool forceType /*= false */)
{
if (CServiceBroker::GetGUI()->GetWindowManager().HasModalDialog(true))
bUseDim = true;
- else if (m_appPlayer.IsPlayingVideo() && m_ServiceManager->GetSettings().GetBool(CSettings::SETTING_SCREENSAVER_USEDIMONPAUSE))
+ else if (m_appPlayer.IsPlayingVideo() && CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_SCREENSAVER_USEDIMONPAUSE))
bUseDim = true;
else if (CServiceBroker::GetPVRManager().GUIActions()->IsRunningChannelScan())
bUseDim = true;
@@ -3862,7 +3866,7 @@ void CApplication::ActivateScreenSaver(bool forceType /*= false */)
if (bUseDim)
m_screensaverIdInUse = "screensaver.xbmc.builtin.dim";
else // Get Screensaver Mode
- m_screensaverIdInUse = m_ServiceManager->GetSettings().GetString(CSettings::SETTING_SCREENSAVER_MODE);
+ m_screensaverIdInUse = CServiceBroker::GetSettings()->GetString(CSettings::SETTING_SCREENSAVER_MODE);
if (m_screensaverIdInUse == "screensaver.xbmc.builtin.dim" ||
m_screensaverIdInUse == "screensaver.xbmc.builtin.black")
@@ -3906,7 +3910,7 @@ void CApplication::CheckShutdown()
}
float elapsed = m_shutdownTimer.IsRunning() ? m_shutdownTimer.GetElapsedSeconds() : 0.f;
- if ( elapsed > m_ServiceManager->GetSettings().GetInt(CSettings::SETTING_POWERMANAGEMENT_SHUTDOWNTIME) * 60 )
+ if ( elapsed > CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_POWERMANAGEMENT_SHUTDOWNTIME) * 60 )
{
// Since it is a sleep instead of a shutdown, let's set everything to reset when we wake up.
m_shutdownTimer.Stop();
@@ -4321,9 +4325,9 @@ void CApplication::ProcessSlow()
// Check if we need to shutdown (if enabled).
#if defined(TARGET_DARWIN)
- if (m_ServiceManager->GetSettings().GetInt(CSettings::SETTING_POWERMANAGEMENT_SHUTDOWNTIME) && g_advancedSettings.m_fullScreen)
+ if (CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_POWERMANAGEMENT_SHUTDOWNTIME) && g_advancedSettings.m_fullScreen)
#else
- if (m_ServiceManager->GetSettings().GetInt(CSettings::SETTING_POWERMANAGEMENT_SHUTDOWNTIME))
+ if (CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_POWERMANAGEMENT_SHUTDOWNTIME))
#endif
{
CheckShutdown();
@@ -4356,7 +4360,7 @@ void CApplication::ProcessSlow()
// update upnp server/renderer states
#ifdef HAS_UPNP
- if (CServiceBroker::GetSettings().GetBool(CSettings::SETTING_SERVICES_UPNP) && UPNP::CUPnP::IsInstantiated())
+ if (CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_SERVICES_UPNP) && UPNP::CUPnP::IsInstantiated())
UPNP::CUPnP::GetInstance()->UpdateState();
#endif
@@ -4796,16 +4800,16 @@ CApplicationStackHelper& CApplication::GetAppStackHelper()
void CApplication::UpdateLibraries()
{
- if (m_ServiceManager->GetSettings().GetBool(CSettings::SETTING_VIDEOLIBRARY_UPDATEONSTARTUP))
+ if (CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_VIDEOLIBRARY_UPDATEONSTARTUP))
{
CLog::LogF(LOGNOTICE, "Starting video library startup scan");
- StartVideoScan("", !m_ServiceManager->GetSettings().GetBool(CSettings::SETTING_VIDEOLIBRARY_BACKGROUNDUPDATE));
+ StartVideoScan("", !CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_VIDEOLIBRARY_BACKGROUNDUPDATE));
}
- if (m_ServiceManager->GetSettings().GetBool(CSettings::SETTING_MUSICLIBRARY_UPDATEONSTARTUP))
+ if (CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_MUSICLIBRARY_UPDATEONSTARTUP))
{
CLog::LogF(LOGNOTICE, "Starting music library startup scan");
- StartMusicScan("", !m_ServiceManager->GetSettings().GetBool(CSettings::SETTING_MUSICLIBRARY_BACKGROUNDUPDATE));
+ StartMusicScan("", !CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_MUSICLIBRARY_BACKGROUNDUPDATE));
}
}
@@ -4906,10 +4910,10 @@ void CApplication::StartMusicScan(const std::string &strDirectory, bool userInit
// Setup default flags
if (!flags)
{ // Online scraping of additional info during scanning
- if (m_ServiceManager->GetSettings().GetBool(CSettings::SETTING_MUSICLIBRARY_DOWNLOADINFO))
+ if (CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_MUSICLIBRARY_DOWNLOADINFO))
flags |= CMusicInfoScanner::SCAN_ONLINE;
}
- if (!userInitiated || m_ServiceManager->GetSettings().GetBool(CSettings::SETTING_MUSICLIBRARY_BACKGROUNDUPDATE))
+ if (!userInitiated || CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_MUSICLIBRARY_BACKGROUNDUPDATE))
flags |= CMusicInfoScanner::SCAN_BACKGROUND;
CMusicLibraryQueue::GetInstance().ScanLibrary(strDirectory, flags, !(flags & CMusicInfoScanner::SCAN_BACKGROUND));
@@ -4986,10 +4990,10 @@ void CApplication::SetRenderGUI(bool renderGUI)
bool CApplication::SetLanguage(const std::string &strLanguage)
{
// nothing to be done if the language hasn't changed
- if (strLanguage == m_ServiceManager->GetSettings().GetString(CSettings::SETTING_LOCALE_LANGUAGE))
+ if (strLanguage == CServiceBroker::GetSettings()->GetString(CSettings::SETTING_LOCALE_LANGUAGE))
return true;
- return m_ServiceManager->GetSettings().SetString(CSettings::SETTING_LOCALE_LANGUAGE, strLanguage);
+ return CServiceBroker::GetSettings()->SetString(CSettings::SETTING_LOCALE_LANGUAGE, strLanguage);
}
bool CApplication::LoadLanguage(bool reload)
@@ -4999,8 +5003,8 @@ bool CApplication::LoadLanguage(bool reload)
return false;
// set the proper audio and subtitle languages
- g_langInfo.SetAudioLanguage(m_ServiceManager->GetSettings().GetString(CSettings::SETTING_LOCALE_AUDIOLANGUAGE));
- g_langInfo.SetSubtitleLanguage(m_ServiceManager->GetSettings().GetString(CSettings::SETTING_LOCALE_SUBTITLELANGUAGE));
+ g_langInfo.SetAudioLanguage(CServiceBroker::GetSettings()->GetString(CSettings::SETTING_LOCALE_AUDIOLANGUAGE));
+ g_langInfo.SetSubtitleLanguage(CServiceBroker::GetSettings()->GetString(CSettings::SETTING_LOCALE_SUBTITLELANGUAGE));
return true;
}
diff --git a/xbmc/Application.h b/xbmc/Application.h
index b60aa23be1..7ec43e6bcf 100644
--- a/xbmc/Application.h
+++ b/xbmc/Application.h
@@ -56,6 +56,7 @@ class CBookmark;
class IActionListener;
class CGUIComponent;
class CAppInboundProtocol;
+class CSettings;
namespace ADDON
{
@@ -400,6 +401,7 @@ protected:
bool NotifyActionListeners(const CAction &action) const;
std::shared_ptr<ANNOUNCEMENT::CAnnouncementManager> m_pAnnouncementManager;
+ std::shared_ptr<CSettings> m_pSettings;
std::unique_ptr<CGUIComponent> m_pGUI;
std::unique_ptr<CWinSystemBase> m_pWinSystem;
std::unique_ptr<ActiveAE::CActiveAE> m_pActiveAE;
diff --git a/xbmc/AutoSwitch.cpp b/xbmc/AutoSwitch.cpp
index dc2a874bb0..42351d09e1 100644
--- a/xbmc/AutoSwitch.cpp
+++ b/xbmc/AutoSwitch.cpp
@@ -32,7 +32,7 @@ int CAutoSwitch::GetView(const CFileItemList &vecItems)
int iSortMethod = -1;
int iPercent = 0;
int iCurrentWindow = CServiceBroker::GetGUI()->GetWindowManager().GetActiveWindow();
- bool bHideParentFolderItems = !CServiceBroker::GetSettings().GetBool(CSettings::SETTING_FILELISTS_SHOWPARENTDIRITEMS);
+ bool bHideParentFolderItems = !CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_FILELISTS_SHOWPARENTDIRITEMS);
switch (iCurrentWindow)
{
diff --git a/xbmc/Autorun.cpp b/xbmc/Autorun.cpp
index 4ab1f67084..1403283f5d 100644
--- a/xbmc/Autorun.cpp
+++ b/xbmc/Autorun.cpp
@@ -80,7 +80,7 @@ void CAutorun::ExecuteAutorun(const std::string& path, bool bypassSettings, bool
#ifdef HAS_CDDA_RIPPER
const CProfilesManager &profileManager = CServiceBroker::GetProfileManager();
- if (CServiceBroker::GetSettings().GetInt(CSettings::SETTING_AUDIOCDS_AUTOACTION) == AUTOCD_RIP &&
+ if (CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_AUDIOCDS_AUTOACTION) == AUTOCD_RIP &&
pInfo->IsAudio(1) && !profileManager.GetCurrentProfile().musicLocked())
{
CCDDARipper::GetInstance().RipCD();
@@ -93,7 +93,7 @@ void CAutorun::ExecuteAutorun(const std::string& path, bool bypassSettings, bool
bool CAutorun::PlayDisc(const std::string& path, bool bypassSettings, bool startFromBeginning)
{
- if ( !bypassSettings && CServiceBroker::GetSettings().GetInt(CSettings::SETTING_AUDIOCDS_AUTOACTION) != AUTOCD_PLAY && !CServiceBroker::GetSettings().GetBool(CSettings::SETTING_DVDS_AUTORUN))
+ if ( !bypassSettings && CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_AUDIOCDS_AUTOACTION) != AUTOCD_PLAY && !CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_DVDS_AUTORUN))
return false;
int nSize = CServiceBroker::GetPlaylistPlayer().GetPlaylist( PLAYLIST_MUSIC ).size();
@@ -182,7 +182,7 @@ bool CAutorun::RunDisc(IDirectory* pDir, const std::string& strDrive, int& nAdde
// Check if the current foldername indicates a DVD structure (name is "VIDEO_TS")
if (StringUtils::EqualsNoCase(name, "VIDEO_TS") && bAllowVideo
- && (bypassSettings || CServiceBroker::GetSettings().GetBool(CSettings::SETTING_DVDS_AUTORUN)))
+ && (bypassSettings || CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_DVDS_AUTORUN)))
{
std::string path = URIUtils::AddFileToFolder(pItem->GetPath(), "VIDEO_TS.IFO");
if(!CFile::Exists(path))
@@ -206,7 +206,7 @@ bool CAutorun::RunDisc(IDirectory* pDir, const std::string& strDrive, int& nAdde
// A BR should also include an "AACS" folder for encryption, Sony-BRs can also include update folders for PS3 (PS3_UPDATE / PS3_VPRM).
//! @todo for the time being, the DVD autorun settings are used to determine if the BR should be started automatically.
if (StringUtils::EqualsNoCase(name, "BDMV") && bAllowVideo
- && (bypassSettings || CServiceBroker::GetSettings().GetBool(CSettings::SETTING_DVDS_AUTORUN)))
+ && (bypassSettings || CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_DVDS_AUTORUN)))
{
CFileItemPtr item(new CFileItem(URIUtils::AddFileToFolder(pItem->GetPath(), "index.bdmv"), false));
item->SetLabel(g_mediaManager.GetDiskLabel(strDrive));
@@ -247,7 +247,7 @@ bool CAutorun::RunDisc(IDirectory* pDir, const std::string& strDrive, int& nAdde
// Standard Content HD DVD (few discs?)
if (StringUtils::EqualsNoCase(name, "HVDVD_TS") && bAllowVideo
- && (bypassSettings || CServiceBroker::GetSettings().GetBool(CSettings::SETTING_DVDS_AUTORUN)))
+ && (bypassSettings || CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_DVDS_AUTORUN)))
{
if (hddvdname == "")
{
@@ -340,7 +340,7 @@ bool CAutorun::RunDisc(IDirectory* pDir, const std::string& strDrive, int& nAdde
// If a file format was extracted we are sure this is a VCD. Autoplay if settings indicate we should.
if (!strExt.empty() && bAllowVideo
- && (bypassSettings || CServiceBroker::GetSettings().GetBool(CSettings::SETTING_DVDS_AUTORUN)))
+ && (bypassSettings || CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_DVDS_AUTORUN)))
{
CFileItemList items;
CDirectory::GetDirectory(pItem->GetPath(), items, strExt, DIR_FLAG_DEFAULTS);
@@ -369,12 +369,12 @@ bool CAutorun::RunDisc(IDirectory* pDir, const std::string& strDrive, int& nAdde
}
// check video first
- if (!nAddedToPlaylist && !bPlaying && (bypassSettings || CServiceBroker::GetSettings().GetBool(CSettings::SETTING_DVDS_AUTORUN)))
+ if (!nAddedToPlaylist && !bPlaying && (bypassSettings || CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_DVDS_AUTORUN)))
{
// stack video files
CFileItemList tempItems;
tempItems.Append(vecItems);
- if (CServiceBroker::GetSettings().GetBool(CSettings::SETTING_MYVIDEOS_STACKVIDEOS))
+ if (CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_MYVIDEOS_STACKVIDEOS))
tempItems.Stack();
CFileItemList itemlist;
@@ -413,7 +413,7 @@ bool CAutorun::RunDisc(IDirectory* pDir, const std::string& strDrive, int& nAdde
}
}
// then music
- if (!bPlaying && (bypassSettings || CServiceBroker::GetSettings().GetInt(CSettings::SETTING_AUDIOCDS_AUTOACTION) == AUTOCD_PLAY) && bAllowMusic)
+ if (!bPlaying && (bypassSettings || CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_AUDIOCDS_AUTOACTION) == AUTOCD_PLAY) && bAllowMusic)
{
for (int i = 0; i < vecItems.Size(); i++)
{
diff --git a/xbmc/FileItem.cpp b/xbmc/FileItem.cpp
index 3e36a34690..016ee06311 100644
--- a/xbmc/FileItem.cpp
+++ b/xbmc/FileItem.cpp
@@ -124,7 +124,7 @@ void CFileItem::FillMusicInfoTag(const CPVRChannelPtr& channel, const CPVREpgInf
musictag->SetGenre(tag->Genre());
musictag->SetDuration(tag->GetDuration());
}
- else if (CServiceBroker::GetSettings().GetBool(CSettings::SETTING_EPG_HIDENOINFOAVAILABLE))
+ else if (CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_EPG_HIDENOINFOAVAILABLE))
{
musictag->SetTitle(g_localizeStrings.Get(19055)); // no information available
}
@@ -168,7 +168,7 @@ CFileItem::CFileItem(const CPVRChannelPtr& channel)
m_pvrChannelInfoTag = channel;
SetLabel(channel->ChannelName());
m_strLabel2 = epgNow ? epgNow->Title() :
- CServiceBroker::GetSettings().GetBool(CSettings::SETTING_EPG_HIDENOINFOAVAILABLE) ?
+ CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_EPG_HIDENOINFOAVAILABLE) ?
"" : g_localizeStrings.Get(19055); // no information available
if (!channel->IconPath().empty())
@@ -2844,7 +2844,7 @@ void CFileItemList::StackFiles()
// item->m_bIsFolder = true; // don't treat stacked files as folders
// the label may be in a different char set from the filename (eg over smb
// the label is converted from utf8, but the filename is not)
- if (!CServiceBroker::GetSettings().GetBool(CSettings::SETTING_FILELISTS_SHOWEXTENSIONS))
+ if (!CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_FILELISTS_SHOWEXTENSIONS))
URIUtils::RemoveExtension(stackName);
item1->SetLabel(stackName);
@@ -2980,7 +2980,7 @@ std::string CFileItem::GetUserMusicThumb(bool alwaysCheckRemote /* = false */, b
}
// if a folder, check for folder.jpg
- if (m_bIsFolder && !IsFileFolder() && (!IsRemote() || alwaysCheckRemote || CServiceBroker::GetSettings().GetBool(CSettings::SETTING_MUSICFILES_FINDREMOTETHUMBS)))
+ if (m_bIsFolder && !IsFileFolder() && (!IsRemote() || alwaysCheckRemote || CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_MUSICFILES_FINDREMOTETHUMBS)))
{
std::vector<std::string> thumbs = StringUtils::Split(g_advancedSettings.m_musicThumbs, "|");
for (std::vector<std::string>::const_iterator i = thumbs.begin(); i != thumbs.end(); ++i)
diff --git a/xbmc/GUIPassword.cpp b/xbmc/GUIPassword.cpp
index d9500a6a70..d2520c97a0 100644
--- a/xbmc/GUIPassword.cpp
+++ b/xbmc/GUIPassword.cpp
@@ -62,7 +62,7 @@ bool CGUIPassword::IsItemUnlocked(CFileItem* pItem, const std::string &strType)
}
else
{
- if (0 != CServiceBroker::GetSettings().GetInt(CSettings::SETTING_MASTERLOCK_MAXRETRIES) && pItem->m_iBadPwdCount >= CServiceBroker::GetSettings().GetInt(CSettings::SETTING_MASTERLOCK_MAXRETRIES))
+ if (0 != CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_MASTERLOCK_MAXRETRIES) && pItem->m_iBadPwdCount >= CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_MASTERLOCK_MAXRETRIES))
{ // user previously exhausted all retries, show access denied error
HELPERS::ShowOKDialogText(CVariant{12345}, CVariant{12346});
return false;
@@ -97,7 +97,7 @@ bool CGUIPassword::IsItemUnlocked(CFileItem* pItem, const std::string &strType)
case 1:
{
// password entry failed
- if (0 != CServiceBroker::GetSettings().GetInt(CSettings::SETTING_MASTERLOCK_MAXRETRIES))
+ if (0 != CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_MASTERLOCK_MAXRETRIES))
pItem->m_iBadPwdCount++;
sprintf(buffer,"%i",pItem->m_iBadPwdCount);
CMediaSourceSettings::GetInstance().UpdateSource(strType, strLabel, "badpwdcount", buffer);
@@ -123,7 +123,7 @@ bool CGUIPassword::CheckStartUpLock()
std::string strHeader = g_localizeStrings.Get(20075);
if (iMasterLockRetriesLeft == -1)
- iMasterLockRetriesLeft = CServiceBroker::GetSettings().GetInt(CSettings::SETTING_MASTERLOCK_MAXRETRIES);
+ iMasterLockRetriesLeft = CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_MASTERLOCK_MAXRETRIES);
if (g_passwordManager.iMasterLockRetriesLeft == 0)
g_passwordManager.iMasterLockRetriesLeft = 1;
@@ -156,7 +156,7 @@ bool CGUIPassword::CheckStartUpLock()
if (iVerifyPasswordResult == 0)
{
- g_passwordManager.iMasterLockRetriesLeft = CServiceBroker::GetSettings().GetInt(CSettings::SETTING_MASTERLOCK_MAXRETRIES);
+ g_passwordManager.iMasterLockRetriesLeft = CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_MASTERLOCK_MAXRETRIES);
return true; // OK The MasterCode Accepted! XBMC Can Run!
}
else
@@ -241,7 +241,7 @@ bool CGUIPassword::IsMasterLockUnlocked(bool bPromptUser, bool& bCanceled)
bCanceled = false;
if (iMasterLockRetriesLeft == -1)
- iMasterLockRetriesLeft = CServiceBroker::GetSettings().GetInt(CSettings::SETTING_MASTERLOCK_MAXRETRIES);
+ iMasterLockRetriesLeft = CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_MASTERLOCK_MAXRETRIES);
const CProfilesManager &profileManager = CServiceBroker::GetProfileManager();
@@ -286,7 +286,7 @@ void CGUIPassword::UpdateMasterLockRetryCount(bool bResetCount)
if (!bResetCount)
{
// Bad mastercode entered
- if (0 < CServiceBroker::GetSettings().GetInt(CSettings::SETTING_MASTERLOCK_MAXRETRIES))
+ if (0 < CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_MASTERLOCK_MAXRETRIES))
{
// We're keeping track of how many bad passwords are entered
if (1 < g_passwordManager.iMasterLockRetriesLeft)
@@ -311,7 +311,7 @@ void CGUIPassword::UpdateMasterLockRetryCount(bool bResetCount)
HELPERS::ShowOKDialogLines(CVariant{20075}, CVariant{12345}, CVariant{std::move(dlgLine1)}, CVariant{0});
}
else
- g_passwordManager.iMasterLockRetriesLeft = CServiceBroker::GetSettings().GetInt(CSettings::SETTING_MASTERLOCK_MAXRETRIES); // user entered correct mastercode, reset retries to max allowed
+ g_passwordManager.iMasterLockRetriesLeft = CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_MASTERLOCK_MAXRETRIES); // user entered correct mastercode, reset retries to max allowed
}
bool CGUIPassword::CheckLock(LockType btnType, const std::string& strPassword, int iHeading)
diff --git a/xbmc/LangInfo.cpp b/xbmc/LangInfo.cpp
index b36cccffe9..6212f00cfd 100644
--- a/xbmc/LangInfo.cpp
+++ b/xbmc/LangInfo.cpp
@@ -333,7 +333,7 @@ void CLangInfo::OnSettingChanged(std::shared_ptr<const CSetting> setting)
else if (settingId == CSettings::SETTING_LOCALE_LANGUAGE)
{
if (!SetLanguage(std::static_pointer_cast<const CSettingString>(setting)->GetValue()))
- std::static_pointer_cast<CSettingString>(CServiceBroker::GetSettings().GetSetting(CSettings::SETTING_LOCALE_LANGUAGE))->Reset();
+ std::static_pointer_cast<CSettingString>(CServiceBroker::GetSettings()->GetSetting(CSettings::SETTING_LOCALE_LANGUAGE))->Reset();
}
else if (settingId == CSettings::SETTING_LOCALE_COUNTRY)
SetCurrentRegion(std::static_pointer_cast<const CSettingString>(setting)->GetValue());
@@ -348,7 +348,7 @@ void CLangInfo::OnSettingChanged(std::shared_ptr<const CSetting> setting)
Set24HourClock(std::static_pointer_cast<const CSettingString>(setting)->GetValue());
// update the time format
- CServiceBroker::GetSettings().SetString(CSettings::SETTING_LOCALE_TIMEFORMAT, PrepareTimeFormat(GetTimeFormat(), m_use24HourClock));
+ CServiceBroker::GetSettings()->SetString(CSettings::SETTING_LOCALE_TIMEFORMAT, PrepareTimeFormat(GetTimeFormat(), m_use24HourClock));
}
else if (settingId == CSettings::SETTING_LOCALE_TEMPERATUREUNIT)
SetTemperatureUnit(std::static_pointer_cast<const CSettingString>(setting)->GetValue());
@@ -359,12 +359,12 @@ void CLangInfo::OnSettingChanged(std::shared_ptr<const CSetting> setting)
void CLangInfo::OnSettingsLoaded()
{
// set the temperature and speed units based on the settings
- SetShortDateFormat(CServiceBroker::GetSettings().GetString(CSettings::SETTING_LOCALE_SHORTDATEFORMAT));
- SetLongDateFormat(CServiceBroker::GetSettings().GetString(CSettings::SETTING_LOCALE_LONGDATEFORMAT));
- Set24HourClock(CServiceBroker::GetSettings().GetString(CSettings::SETTING_LOCALE_USE24HOURCLOCK));
- SetTimeFormat(CServiceBroker::GetSettings().GetString(CSettings::SETTING_LOCALE_TIMEFORMAT));
- SetTemperatureUnit(CServiceBroker::GetSettings().GetString(CSettings::SETTING_LOCALE_TEMPERATUREUNIT));
- SetSpeedUnit(CServiceBroker::GetSettings().GetString(CSettings::SETTING_LOCALE_SPEEDUNIT));
+ SetShortDateFormat(CServiceBroker::GetSettings()->GetString(CSettings::SETTING_LOCALE_SHORTDATEFORMAT));
+ SetLongDateFormat(CServiceBroker::GetSettings()->GetString(CSettings::SETTING_LOCALE_LONGDATEFORMAT));
+ Set24HourClock(CServiceBroker::GetSettings()->GetString(CSettings::SETTING_LOCALE_USE24HOURCLOCK));
+ SetTimeFormat(CServiceBroker::GetSettings()->GetString(CSettings::SETTING_LOCALE_TIMEFORMAT));
+ SetTemperatureUnit(CServiceBroker::GetSettings()->GetString(CSettings::SETTING_LOCALE_TEMPERATUREUNIT));
+ SetSpeedUnit(CServiceBroker::GetSettings()->GetString(CSettings::SETTING_LOCALE_SPEEDUNIT));
}
bool CLangInfo::Load(const std::string& strLanguage)
@@ -514,7 +514,7 @@ bool CLangInfo::Load(const std::string& strLanguage)
pRegion=pRegion->NextSiblingElement("region");
}
- const std::string& strName = CServiceBroker::GetSettings().GetString(CSettings::SETTING_LOCALE_COUNTRY);
+ const std::string& strName = CServiceBroker::GetSettings()->GetString(CSettings::SETTING_LOCALE_COUNTRY);
SetCurrentRegion(strName);
}
g_charsetConverter.reinitCharsetsFromSettings();
@@ -591,7 +591,7 @@ void CLangInfo::SetDefaults()
std::string CLangInfo::GetGuiCharSet() const
{
- std::shared_ptr<CSettingString> charsetSetting = std::static_pointer_cast<CSettingString>(CServiceBroker::GetSettings().GetSetting(CSettings::SETTING_LOCALE_CHARSET));
+ std::shared_ptr<CSettingString> charsetSetting = std::static_pointer_cast<CSettingString>(CServiceBroker::GetSettings()->GetSetting(CSettings::SETTING_LOCALE_CHARSET));
if (charsetSetting == NULL || charsetSetting->IsDefault())
return m_strGuiCharSet;
@@ -600,7 +600,7 @@ std::string CLangInfo::GetGuiCharSet() const
std::string CLangInfo::GetSubtitleCharSet() const
{
- std::shared_ptr<CSettingString> charsetSetting = std::static_pointer_cast<CSettingString>(CServiceBroker::GetSettings().GetSetting(CSettings::SETTING_SUBTITLES_CHARSET));
+ std::shared_ptr<CSettingString> charsetSetting = std::static_pointer_cast<CSettingString>(CServiceBroker::GetSettings()->GetSetting(CSettings::SETTING_SUBTITLES_CHARSET));
if (charsetSetting->IsDefault())
return m_strSubtitleCharSet;
@@ -615,7 +615,7 @@ LanguageResourcePtr CLangInfo::GetLanguageAddon(const std::string& locale /* = "
std::string addonId = ADDON::CLanguageResource::GetAddonId(locale);
if (addonId.empty())
- addonId = CServiceBroker::GetSettings().GetString(CSettings::SETTING_LOCALE_LANGUAGE);
+ addonId = CServiceBroker::GetSettings()->GetString(CSettings::SETTING_LOCALE_LANGUAGE);
ADDON::AddonPtr addon;
if (CServiceBroker::GetAddonMgr().GetAddon(addonId, addon, ADDON::ADDON_RESOURCE_LANGUAGE, true) && addon != NULL)
@@ -636,13 +636,13 @@ std::string CLangInfo::GetEnglishLanguageName(const std::string& locale /* = ""
bool CLangInfo::SetLanguage(std::string language /* = "" */, bool reloadServices /* = true */)
{
if (language.empty())
- language = CServiceBroker::GetSettings().GetString(CSettings::SETTING_LOCALE_LANGUAGE);
+ language = CServiceBroker::GetSettings()->GetString(CSettings::SETTING_LOCALE_LANGUAGE);
ADDON::AddonPtr addon;
if (!CServiceBroker::GetAddonMgr().GetAddon(language, addon, ADDON::ADDON_RESOURCE_LANGUAGE, false))
{
CLog::Log(LOGWARNING, "CLangInfo: could not find language add-on '%s', loading default..", language.c_str());
- language = std::static_pointer_cast<const CSettingString>(CServiceBroker::GetSettings().GetSetting(
+ language = std::static_pointer_cast<const CSettingString>(CServiceBroker::GetSettings()->GetSetting(
CSettings::SETTING_LOCALE_LANGUAGE))->GetDefault();
if (!CServiceBroker::GetAddonMgr().GetAddon(language, addon, ADDON::ADDON_RESOURCE_LANGUAGE, false))
@@ -669,7 +669,7 @@ bool CLangInfo::SetLanguage(std::string language /* = "" */, bool reloadServices
ADDON::VECADDONS addons;
if (CServiceBroker::GetAddonMgr().GetInstalledAddons(addons))
{
- auto locale = CServiceBroker::GetSettings().GetString(CSettings::SETTING_LOCALE_LANGUAGE);
+ auto locale = CServiceBroker::GetSettings()->GetString(CSettings::SETTING_LOCALE_LANGUAGE);
for (const auto& addon : addons)
{
auto path = URIUtils::AddFileToFolder(addon->Path(), "resources", "language/");
@@ -923,22 +923,22 @@ void CLangInfo::SetCurrentRegion(const std::string& strName)
m_currentRegion->SetGlobalLocale();
- if (CServiceBroker::GetSettings().GetString(CSettings::SETTING_LOCALE_SHORTDATEFORMAT) == SETTING_REGIONAL_DEFAULT)
+ if (CServiceBroker::GetSettings()->GetString(CSettings::SETTING_LOCALE_SHORTDATEFORMAT) == SETTING_REGIONAL_DEFAULT)
SetShortDateFormat(m_currentRegion->m_strDateFormatShort);
- if (CServiceBroker::GetSettings().GetString(CSettings::SETTING_LOCALE_LONGDATEFORMAT) == SETTING_REGIONAL_DEFAULT)
+ if (CServiceBroker::GetSettings()->GetString(CSettings::SETTING_LOCALE_LONGDATEFORMAT) == SETTING_REGIONAL_DEFAULT)
SetLongDateFormat(m_currentRegion->m_strDateFormatLong);
- if (CServiceBroker::GetSettings().GetString(CSettings::SETTING_LOCALE_USE24HOURCLOCK) == SETTING_REGIONAL_DEFAULT)
+ if (CServiceBroker::GetSettings()->GetString(CSettings::SETTING_LOCALE_USE24HOURCLOCK) == SETTING_REGIONAL_DEFAULT)
{
Set24HourClock(m_currentRegion->m_strTimeFormat);
// update the time format
- SetTimeFormat(CServiceBroker::GetSettings().GetString(CSettings::SETTING_LOCALE_TIMEFORMAT));
+ SetTimeFormat(CServiceBroker::GetSettings()->GetString(CSettings::SETTING_LOCALE_TIMEFORMAT));
}
- if (CServiceBroker::GetSettings().GetString(CSettings::SETTING_LOCALE_TIMEFORMAT) == SETTING_REGIONAL_DEFAULT)
+ if (CServiceBroker::GetSettings()->GetString(CSettings::SETTING_LOCALE_TIMEFORMAT) == SETTING_REGIONAL_DEFAULT)
SetTimeFormat(m_currentRegion->m_strTimeFormat);
- if (CServiceBroker::GetSettings().GetString(CSettings::SETTING_LOCALE_TEMPERATUREUNIT) == SETTING_REGIONAL_DEFAULT)
+ if (CServiceBroker::GetSettings()->GetString(CSettings::SETTING_LOCALE_TEMPERATUREUNIT) == SETTING_REGIONAL_DEFAULT)
SetTemperatureUnit(m_currentRegion->m_tempUnit);
- if (CServiceBroker::GetSettings().GetString(CSettings::SETTING_LOCALE_SPEEDUNIT) == SETTING_REGIONAL_DEFAULT)
+ if (CServiceBroker::GetSettings()->GetString(CSettings::SETTING_LOCALE_SPEEDUNIT) == SETTING_REGIONAL_DEFAULT)
SetSpeedUnit(m_currentRegion->m_speedUnit);
}
diff --git a/xbmc/SeekHandler.cpp b/xbmc/SeekHandler.cpp
index 8b98c8c6e7..48fafbd192 100644
--- a/xbmc/SeekHandler.cpp
+++ b/xbmc/SeekHandler.cpp
@@ -39,8 +39,8 @@ void CSeekHandler::Configure()
Reset();
m_seekDelays.clear();
- m_seekDelays.insert(std::make_pair(SEEK_TYPE_VIDEO, CServiceBroker::GetSettings().GetInt(CSettings::SETTING_VIDEOPLAYER_SEEKDELAY)));
- m_seekDelays.insert(std::make_pair(SEEK_TYPE_MUSIC, CServiceBroker::GetSettings().GetInt(CSettings::SETTING_MUSICPLAYER_SEEKDELAY)));
+ m_seekDelays.insert(std::make_pair(SEEK_TYPE_VIDEO, CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_VIDEOPLAYER_SEEKDELAY)));
+ m_seekDelays.insert(std::make_pair(SEEK_TYPE_MUSIC, CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_MUSICPLAYER_SEEKDELAY)));
m_forwardSeekSteps.clear();
m_backwardSeekSteps.clear();
@@ -54,7 +54,7 @@ void CSeekHandler::Configure()
std::vector<int> forwardSeekSteps;
std::vector<int> backwardSeekSteps;
- std::vector<CVariant> seekSteps = CServiceBroker::GetSettings().GetList(it->second);
+ std::vector<CVariant> seekSteps = CServiceBroker::GetSettings()->GetList(it->second);
for (std::vector<CVariant>::iterator it = seekSteps.begin(); it != seekSteps.end(); ++it)
{
int stepSeconds = static_cast<int>((*it).asInteger());
diff --git a/xbmc/ServiceBroker.cpp b/xbmc/ServiceBroker.cpp
index 07f76a87ba..da8dae1455 100644
--- a/xbmc/ServiceBroker.cpp
+++ b/xbmc/ServiceBroker.cpp
@@ -74,9 +74,21 @@ PLAYLIST::CPlayListPlayer &CServiceBroker::GetPlaylistPlayer()
return g_application.m_ServiceManager->GetPlaylistPlayer();
}
-CSettings& CServiceBroker::GetSettings()
+std::shared_ptr<CSettings> CServiceBroker::m_pSettings;
+
+std::shared_ptr<CSettings> CServiceBroker::GetSettings()
+{
+ return m_pSettings;
+}
+
+void CServiceBroker::RegisterSettings(std::shared_ptr<CSettings> settings)
+{
+ m_pSettings = settings;
+}
+
+void CServiceBroker::UnregisterSettings()
{
- return g_application.m_ServiceManager->GetSettings();
+ m_pSettings.reset();
}
GAME::CControllerManager& CServiceBroker::GetGameControllerManager()
diff --git a/xbmc/ServiceBroker.h b/xbmc/ServiceBroker.h
index b11bb7d498..a8983ddb94 100644
--- a/xbmc/ServiceBroker.h
+++ b/xbmc/ServiceBroker.h
@@ -53,6 +53,7 @@ class CProfilesManager;
class CEventLog;
class CGUIComponent;
class CAppInboundProtocol;
+class CSettings;
namespace KODI
{
@@ -89,7 +90,6 @@ public:
static CContextMenuManager& GetContextMenuManager();
static CDataCacheCore& GetDataCacheCore();
static PLAYLIST::CPlayListPlayer& GetPlaylistPlayer();
- static CSettings& GetSettings();
static KODI::GAME::CControllerManager& GetGameControllerManager();
static KODI::GAME::CGameServices& GetGameServices();
static KODI::RETRO::CGUIGameRenderManager& GetGameRenderManager();
@@ -113,6 +113,10 @@ public:
static void RegisterGUI(CGUIComponent *gui);
static void UnregisterGUI();
+ static void RegisterSettings(std::shared_ptr<CSettings> settings);
+ static void UnregisterSettings();
+ static std::shared_ptr<CSettings> GetSettings();
+
static void RegisterWinSystem(CWinSystemBase *winsystem);
static void UnregisterWinSystem();
static CWinSystemBase* GetWinSystem();
@@ -132,4 +136,6 @@ private:
static CWinSystemBase* m_pWinSystem;
static IAE* m_pActiveAE;
static std::shared_ptr<CAppInboundProtocol> m_pAppPort;
+ static std::shared_ptr<CSettings> m_pSettings;
+
};
diff --git a/xbmc/ServiceManager.cpp b/xbmc/ServiceManager.cpp
index 6206c77318..88f495f125 100644
--- a/xbmc/ServiceManager.cpp
+++ b/xbmc/ServiceManager.cpp
@@ -52,10 +52,9 @@ CServiceManager::~CServiceManager()
bool CServiceManager::InitForTesting()
{
- m_settings.reset(new CSettings());
- m_network.reset(new CNetwork(*m_settings));
+ m_network.reset(new CNetwork());
- m_profileManager.reset(new CProfilesManager(*m_settings));
+ m_profileManager.reset(new CProfilesManager());
CProfile profile("special://temp");
m_profileManager.get()->AddProfile(profile);
m_profileManager.get()->CreateProfileFolders();
@@ -92,7 +91,6 @@ void CServiceManager::DeinitTesting()
m_databaseManager.reset();
m_profileManager.reset();
m_network.reset();
- m_settings.reset();
}
bool CServiceManager::InitStageOne()
@@ -104,8 +102,7 @@ bool CServiceManager::InitStageOne()
m_playlistPlayer.reset(new PLAYLIST::CPlayListPlayer());
- m_settings.reset(new CSettings());
- m_network.reset(new CNetwork(*m_settings));
+ m_network.reset(new CNetwork());
init_level = 1;
return true;
@@ -113,7 +110,7 @@ bool CServiceManager::InitStageOne()
bool CServiceManager::InitStageOnePointFive()
{
- m_profileManager.reset(new CProfilesManager(*m_settings));
+ m_profileManager.reset(new CProfilesManager());
if (!m_profileManager->Load())
return false;
@@ -172,7 +169,7 @@ bool CServiceManager::InitStageTwo(const CAppParamParser &params)
m_fileExtensionProvider.reset(new CFileExtensionProvider(*m_addonMgr,
*m_binaryAddonManager));
- m_powerManager.reset(new CPowerManager(*m_settings));
+ m_powerManager.reset(new CPowerManager());
m_powerManager->Initialize();
m_powerManager->SetDefaults();
@@ -190,15 +187,13 @@ bool CServiceManager::InitStageThree()
m_gameServices.reset(new GAME::CGameServices(*m_gameControllerManager,
*m_gameRenderManager,
- *m_settings,
*m_peripherals,
*m_profileManager));
m_contextMenuManager->Init();
m_PVRManager->Init();
- m_playerCoreFactory.reset(new CPlayerCoreFactory(*m_settings,
- *m_profileManager));
+ m_playerCoreFactory.reset(new CPlayerCoreFactory(*m_profileManager));
init_level = 3;
return true;
@@ -250,7 +245,6 @@ void CServiceManager::DeinitStageOne()
init_level = 0;
m_network.reset();
- m_settings.reset();
m_playlistPlayer.reset();
#ifdef HAS_PYTHON
CScriptInvocationManager::GetInstance().UnregisterLanguageInvocationHandler(m_XBPython.get());
@@ -320,11 +314,6 @@ PLAYLIST::CPlayListPlayer& CServiceManager::GetPlaylistPlayer()
return *m_playlistPlayer;
}
-CSettings& CServiceManager::GetSettings()
-{
- return *m_settings;
-}
-
GAME::CControllerManager& CServiceManager::GetGameControllerManager()
{
return *m_gameControllerManager;
diff --git a/xbmc/ServiceManager.h b/xbmc/ServiceManager.h
index 415f7a4d96..3f35767109 100644
--- a/xbmc/ServiceManager.h
+++ b/xbmc/ServiceManager.h
@@ -37,7 +37,6 @@ class CContextMenuManager;
class XBPython;
#endif
class CDataCacheCore;
-class CSettings;
class CFavouritesService;
class CNetworkBase;
class CWinSystemBase;
@@ -110,7 +109,6 @@ public:
PLAYLIST::CPlayListPlayer& GetPlaylistPlayer();
int init_level = 0;
- CSettings& GetSettings();
CFavouritesService& GetFavouritesService();
CInputManager &GetInputManager();
CFileExtensionProvider &GetFileExtensionProvider();
@@ -157,7 +155,6 @@ protected:
std::unique_ptr<CDataCacheCore, delete_dataCacheCore> m_dataCacheCore;
std::unique_ptr<CPlatform> m_Platform;
std::unique_ptr<PLAYLIST::CPlayListPlayer> m_playlistPlayer;
- std::unique_ptr<CSettings> m_settings;
std::unique_ptr<KODI::GAME::CControllerManager> m_gameControllerManager;
std::unique_ptr<KODI::GAME::CGameServices> m_gameServices;
std::unique_ptr<KODI::RETRO::CGUIGameRenderManager> m_gameRenderManager;
diff --git a/xbmc/Util.cpp b/xbmc/Util.cpp
index 6b70278ea2..d0bc4d9fe3 100644
--- a/xbmc/Util.cpp
+++ b/xbmc/Util.cpp
@@ -365,7 +365,7 @@ std::string CUtil::GetTitleFromPath(const CURL& url, bool bIsFolder /* = false *
strFilename = URIUtils::GetFileName(url.GetHostName());
// now remove the extension if needed
- if (!CServiceBroker::GetSettings().GetBool(CSettings::SETTING_FILELISTS_SHOWEXTENSIONS) && !bIsFolder)
+ if (!CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_FILELISTS_SHOWEXTENSIONS) && !bIsFolder)
{
URIUtils::RemoveExtension(strFilename);
return strFilename;
@@ -1030,7 +1030,7 @@ std::string CUtil::ValidatePath(const std::string &path, bool bFixDoubleSlashes
bool CUtil::IsUsingTTFSubtitles()
{
- return URIUtils::HasExtension(CServiceBroker::GetSettings().GetString(CSettings::SETTING_SUBTITLES_FONT), ".ttf");
+ return URIUtils::HasExtension(CServiceBroker::GetSettings()->GetString(CSettings::SETTING_SUBTITLES_FONT), ".ttf");
}
void CUtil::SplitExecFunction(const std::string &execString, std::string &function, std::vector<std::string> &parameters)
@@ -1319,7 +1319,7 @@ std::string CUtil::TranslateSpecialSource(const std::string &strSpecial)
return URIUtils::AddFileToFolder("special://cdrips/", strSpecial.substr(7));
// this one will be removed post 2.0
else if (StringUtils::StartsWithNoCase(strSpecial, "$playlists"))
- return URIUtils::AddFileToFolder(CServiceBroker::GetSettings().GetString(CSettings::SETTING_SYSTEM_PLAYLISTSPATH), strSpecial.substr(10));
+ return URIUtils::AddFileToFolder(CServiceBroker::GetSettings()->GetString(CSettings::SETTING_SYSTEM_PLAYLISTSPATH), strSpecial.substr(10));
}
return strSpecial;
}
@@ -1327,16 +1327,16 @@ std::string CUtil::TranslateSpecialSource(const std::string &strSpecial)
std::string CUtil::MusicPlaylistsLocation()
{
std::vector<std::string> vec;
- vec.push_back(URIUtils::AddFileToFolder(CServiceBroker::GetSettings().GetString(CSettings::SETTING_SYSTEM_PLAYLISTSPATH), "music"));
- vec.push_back(URIUtils::AddFileToFolder(CServiceBroker::GetSettings().GetString(CSettings::SETTING_SYSTEM_PLAYLISTSPATH), "mixed"));
+ vec.push_back(URIUtils::AddFileToFolder(CServiceBroker::GetSettings()->GetString(CSettings::SETTING_SYSTEM_PLAYLISTSPATH), "music"));
+ vec.push_back(URIUtils::AddFileToFolder(CServiceBroker::GetSettings()->GetString(CSettings::SETTING_SYSTEM_PLAYLISTSPATH), "mixed"));
return XFILE::CMultiPathDirectory::ConstructMultiPath(vec);
}
std::string CUtil::VideoPlaylistsLocation()
{
std::vector<std::string> vec;
- vec.push_back(URIUtils::AddFileToFolder(CServiceBroker::GetSettings().GetString(CSettings::SETTING_SYSTEM_PLAYLISTSPATH), "video"));
- vec.push_back(URIUtils::AddFileToFolder(CServiceBroker::GetSettings().GetString(CSettings::SETTING_SYSTEM_PLAYLISTSPATH), "mixed"));
+ vec.push_back(URIUtils::AddFileToFolder(CServiceBroker::GetSettings()->GetString(CSettings::SETTING_SYSTEM_PLAYLISTSPATH), "video"));
+ vec.push_back(URIUtils::AddFileToFolder(CServiceBroker::GetSettings()->GetString(CSettings::SETTING_SYSTEM_PLAYLISTSPATH), "mixed"));
return XFILE::CMultiPathDirectory::ConstructMultiPath(vec);
}
@@ -1999,14 +1999,14 @@ void CUtil::ScanForExternalSubtitles(const std::string& strMovie, std::vector<st
const std::vector<std::string> common_sub_dirs = { "subs", "subtitles", "vobsubs", "sub", "vobsub", "subtitle" };
GetItemsToScan(strBasePath, CServiceBroker::GetFileExtensionProvider().GetSubtitleExtensions(), common_sub_dirs, items);
- if (!CMediaSettings::GetInstance().GetAdditionalSubtitleDirectoryChecked() && !CServiceBroker::GetSettings().GetString(CSettings::SETTING_SUBTITLES_CUSTOMPATH).empty()) // to avoid checking non-existent directories (network) every time..
+ if (!CMediaSettings::GetInstance().GetAdditionalSubtitleDirectoryChecked() && !CServiceBroker::GetSettings()->GetString(CSettings::SETTING_SUBTITLES_CUSTOMPATH).empty()) // to avoid checking non-existent directories (network) every time..
{
- if (!CServiceBroker::GetNetwork().IsAvailable() && !URIUtils::IsHD(CServiceBroker::GetSettings().GetString(CSettings::SETTING_SUBTITLES_CUSTOMPATH)))
+ if (!CServiceBroker::GetNetwork().IsAvailable() && !URIUtils::IsHD(CServiceBroker::GetSettings()->GetString(CSettings::SETTING_SUBTITLES_CUSTOMPATH)))
{
CLog::Log(LOGINFO, "CUtil::CacheSubtitles: disabling alternate subtitle directory for this session, it's inaccessible");
CMediaSettings::GetInstance().SetAdditionalSubtitleDirectoryChecked(-1); // disabled
}
- else if (!CDirectory::Exists(CServiceBroker::GetSettings().GetString(CSettings::SETTING_SUBTITLES_CUSTOMPATH)))
+ else if (!CDirectory::Exists(CServiceBroker::GetSettings()->GetString(CSettings::SETTING_SUBTITLES_CUSTOMPATH)))
{
CLog::Log(LOGINFO, "CUtil::CacheSubtitles: disabling alternate subtitle directory for this session, it's nonexistent");
CMediaSettings::GetInstance().SetAdditionalSubtitleDirectoryChecked(-1); // disabled
@@ -2019,7 +2019,7 @@ void CUtil::ScanForExternalSubtitles(const std::string& strMovie, std::vector<st
// this is last because we dont want to check any common subdirs or cd-dirs in the alternate <subtitles> dir.
if (CMediaSettings::GetInstance().GetAdditionalSubtitleDirectoryChecked() == 1)
{
- std::string strPath2 = CServiceBroker::GetSettings().GetString(CSettings::SETTING_SUBTITLES_CUSTOMPATH);
+ std::string strPath2 = CServiceBroker::GetSettings()->GetString(CSettings::SETTING_SUBTITLES_CUSTOMPATH);
URIUtils::AddSlashAtEnd(strPath2);
strLookInPaths.push_back(strPath2);
}
diff --git a/xbmc/addons/AddonInstaller.cpp b/xbmc/addons/AddonInstaller.cpp
index 9ce448d61c..12ef89c12c 100644
--- a/xbmc/addons/AddonInstaller.cpp
+++ b/xbmc/addons/AddonInstaller.cpp
@@ -624,7 +624,7 @@ bool CAddonInstallJob::DoWork()
}
g_localizeStrings.LoadAddonStrings(URIUtils::AddFileToFolder(m_addon->Path(), "resources/language/"),
- CServiceBroker::GetSettings().GetString(CSettings::SETTING_LOCALE_LANGUAGE), m_addon->ID());
+ CServiceBroker::GetSettings()->GetString(CSettings::SETTING_LOCALE_LANGUAGE), m_addon->ID());
ADDON::OnPostInstall(m_addon, m_isUpdate, IsModal());
@@ -636,7 +636,7 @@ bool CAddonInstallJob::DoWork()
database.SetLastUpdated(m_addon->ID(), CDateTime::GetCurrentDateTime());
}
- bool notify = (CServiceBroker::GetSettings().GetBool(CSettings::SETTING_ADDONS_NOTIFICATIONS)
+ bool notify = (CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_ADDONS_NOTIFICATIONS)
|| !m_isAutoUpdate) && !IsModal();
CServiceBroker::GetEventLog().Add(
EventPtr(new CAddonManagementEvent(m_addon, m_isUpdate ? 24065 : 24084)), notify, false);
diff --git a/xbmc/addons/AddonSystemSettings.cpp b/xbmc/addons/AddonSystemSettings.cpp
index f33b850d21..7653604eaa 100644
--- a/xbmc/addons/AddonSystemSettings.cpp
+++ b/xbmc/addons/AddonSystemSettings.cpp
@@ -64,10 +64,10 @@ void CAddonSystemSettings::OnSettingChanged(std::shared_ptr<const CSetting> sett
using namespace KODI::MESSAGING::HELPERS;
if (setting->GetId() == CSettings::SETTING_ADDONS_ALLOW_UNKNOWN_SOURCES
- && CServiceBroker::GetSettings().GetBool(CSettings::SETTING_ADDONS_ALLOW_UNKNOWN_SOURCES)
+ && CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_ADDONS_ALLOW_UNKNOWN_SOURCES)
&& ShowYesNoDialogText(19098, 36618) != DialogResponse::YES)
{
- CServiceBroker::GetSettings().SetBool(CSettings::SETTING_ADDONS_ALLOW_UNKNOWN_SOURCES, false);
+ CServiceBroker::GetSettings()->SetBool(CSettings::SETTING_ADDONS_ALLOW_UNKNOWN_SOURCES, false);
}
}
@@ -76,7 +76,7 @@ bool CAddonSystemSettings::GetActive(const TYPE& type, AddonPtr& addon)
auto it = m_activeSettings.find(type);
if (it != m_activeSettings.end())
{
- auto settingValue = CServiceBroker::GetSettings().GetString(it->second);
+ auto settingValue = CServiceBroker::GetSettings()->GetString(it->second);
return CServiceBroker::GetAddonMgr().GetAddon(settingValue, addon, type);
}
return false;
@@ -87,7 +87,7 @@ bool CAddonSystemSettings::SetActive(const TYPE& type, const std::string& addonI
auto it = m_activeSettings.find(type);
if (it != m_activeSettings.end())
{
- CServiceBroker::GetSettings().SetString(it->second, addonID);
+ CServiceBroker::GetSettings()->SetString(it->second, addonID);
return true;
}
return false;
@@ -105,7 +105,7 @@ bool CAddonSystemSettings::UnsetActive(const AddonPtr& addon)
if (it == m_activeSettings.end())
return true;
- auto setting = std::static_pointer_cast<CSettingString>(CServiceBroker::GetSettings().GetSetting(it->second));
+ auto setting = std::static_pointer_cast<CSettingString>(CServiceBroker::GetSettings()->GetSetting(it->second));
if (setting->GetValue() != addon->ID())
return true;
@@ -130,7 +130,7 @@ std::vector<std::string> CAddonSystemSettings::MigrateAddons(std::function<void(
if (getIncompatible().empty())
return std::vector<std::string>();
- if (CServiceBroker::GetSettings().GetInt(CSettings::SETTING_ADDONS_AUTOUPDATES) == AUTO_UPDATES_ON)
+ if (CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_ADDONS_AUTOUPDATES) == AUTO_UPDATES_ON)
{
onMigrate();
diff --git a/xbmc/addons/FontResource.cpp b/xbmc/addons/FontResource.cpp
index 7a1870cd42..3c7fd7928d 100644
--- a/xbmc/addons/FontResource.cpp
+++ b/xbmc/addons/FontResource.cpp
@@ -32,7 +32,7 @@ std::unique_ptr<CFontResource> CFontResource::FromExtension(CAddonInfo addonInfo
void CFontResource::OnPostInstall(bool update, bool modal)
{
- std::string skin = CServiceBroker::GetSettings().GetString(CSettings::SETTING_LOOKANDFEEL_SKIN);
+ std::string skin = CServiceBroker::GetSettings()->GetString(CSettings::SETTING_LOOKANDFEEL_SKIN);
const auto& deps = CServiceBroker::GetAddonMgr().GetDepsRecursive(skin);
for (const auto& it : deps)
if (it.id == ID())
diff --git a/xbmc/addons/GUIDialogAddonInfo.cpp b/xbmc/addons/GUIDialogAddonInfo.cpp
index 5327ca9f51..1c88d384f6 100644
--- a/xbmc/addons/GUIDialogAddonInfo.cpp
+++ b/xbmc/addons/GUIDialogAddonInfo.cpp
@@ -182,7 +182,7 @@ void CGUIDialogAddonInfo::UpdateControls()
CONTROL_ENABLE_ON_CONDITION(CONTROL_BTN_UPDATE, isInstalled);
- bool autoUpdatesOn = CServiceBroker::GetSettings().GetInt(CSettings::SETTING_ADDONS_AUTOUPDATES) == AUTO_UPDATES_ON;
+ bool autoUpdatesOn = CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_ADDONS_AUTOUPDATES) == AUTO_UPDATES_ON;
CONTROL_ENABLE_ON_CONDITION(CONTROL_BTN_AUTOUPDATE, isInstalled && autoUpdatesOn);
SET_CONTROL_SELECTED(GetID(), CONTROL_BTN_AUTOUPDATE, isInstalled && autoUpdatesOn &&
!CServiceBroker::GetAddonMgr().IsBlacklisted(m_localAddon->ID()));
diff --git a/xbmc/addons/GUIWindowAddonBrowser.cpp b/xbmc/addons/GUIWindowAddonBrowser.cpp
index 7a8ce78f06..4fbb69aa1f 100644
--- a/xbmc/addons/GUIWindowAddonBrowser.cpp
+++ b/xbmc/addons/GUIWindowAddonBrowser.cpp
@@ -80,15 +80,15 @@ bool CGUIWindowAddonBrowser::OnMessage(CGUIMessage& message)
int iControl = message.GetSenderId();
if (iControl == CONTROL_FOREIGNFILTER)
{
- CServiceBroker::GetSettings().ToggleBool(CSettings::SETTING_GENERAL_ADDONFOREIGNFILTER);
- CServiceBroker::GetSettings().Save();
+ CServiceBroker::GetSettings()->ToggleBool(CSettings::SETTING_GENERAL_ADDONFOREIGNFILTER);
+ CServiceBroker::GetSettings()->Save();
Refresh();
return true;
}
else if (iControl == CONTROL_BROKENFILTER)
{
- CServiceBroker::GetSettings().ToggleBool(CSettings::SETTING_GENERAL_ADDONBROKENFILTER);
- CServiceBroker::GetSettings().Save();
+ CServiceBroker::GetSettings()->ToggleBool(CSettings::SETTING_GENERAL_ADDONBROKENFILTER);
+ CServiceBroker::GetSettings()->Save();
Refresh();
return true;
}
@@ -175,7 +175,7 @@ void CGUIWindowAddonBrowser::InstallFromZip()
{
using namespace KODI::MESSAGING::HELPERS;
- if (!CServiceBroker::GetSettings().GetBool(CSettings::SETTING_ADDONS_ALLOW_UNKNOWN_SOURCES))
+ if (!CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_ADDONS_ALLOW_UNKNOWN_SOURCES))
{
if (ShowYesNoDialogText(13106, 36617, 186, 10004) == DialogResponse::YES)
CServiceBroker::GetGUI()->GetWindowManager().ActivateWindow(WINDOW_SETTINGS_SYSTEM, CSettings::SETTING_ADDONS_ALLOW_UNKNOWN_SOURCES);
@@ -235,8 +235,8 @@ bool CGUIWindowAddonBrowser::OnClick(int iItem, const std::string &player)
void CGUIWindowAddonBrowser::UpdateButtons()
{
- SET_CONTROL_SELECTED(GetID(),CONTROL_FOREIGNFILTER, CServiceBroker::GetSettings().GetBool(CSettings::SETTING_GENERAL_ADDONFOREIGNFILTER));
- SET_CONTROL_SELECTED(GetID(),CONTROL_BROKENFILTER, CServiceBroker::GetSettings().GetBool(CSettings::SETTING_GENERAL_ADDONBROKENFILTER));
+ SET_CONTROL_SELECTED(GetID(),CONTROL_FOREIGNFILTER, CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_GENERAL_ADDONFOREIGNFILTER));
+ SET_CONTROL_SELECTED(GetID(),CONTROL_BROKENFILTER, CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_GENERAL_ADDONBROKENFILTER));
CONTROL_ENABLE(CONTROL_CHECK_FOR_UPDATES);
CONTROL_ENABLE(CONTROL_SETTINGS);
@@ -272,7 +272,7 @@ bool CGUIWindowAddonBrowser::GetDirectory(const std::string& strDirectory, CFile
if (result && CAddonsDirectory::IsRepoDirectory(CURL(strDirectory)))
{
- if (CServiceBroker::GetSettings().GetBool(CSettings::SETTING_GENERAL_ADDONFOREIGNFILTER))
+ if (CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_GENERAL_ADDONFOREIGNFILTER))
{
int i = 0;
while (i < items.Size())
@@ -284,7 +284,7 @@ bool CGUIWindowAddonBrowser::GetDirectory(const std::string& strDirectory, CFile
++i;
}
}
- if (CServiceBroker::GetSettings().GetBool(CSettings::SETTING_GENERAL_ADDONBROKENFILTER))
+ if (CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_GENERAL_ADDONBROKENFILTER))
{
for (int i = items.Size() - 1; i >= 0; i--)
{
diff --git a/xbmc/addons/LanguageResource.cpp b/xbmc/addons/LanguageResource.cpp
index e6d343fb55..6e959a2e84 100644
--- a/xbmc/addons/LanguageResource.cpp
+++ b/xbmc/addons/LanguageResource.cpp
@@ -118,7 +118,7 @@ CLanguageResource::CLanguageResource(
bool CLanguageResource::IsInUse() const
{
- return StringUtils::EqualsNoCase(CServiceBroker::GetSettings().GetString(CSettings::SETTING_LOCALE_LANGUAGE), ID());
+ return StringUtils::EqualsNoCase(CServiceBroker::GetSettings()->GetString(CSettings::SETTING_LOCALE_LANGUAGE), ID());
}
void CLanguageResource::OnPostInstall(bool update, bool modal)
@@ -133,7 +133,7 @@ void CLanguageResource::OnPostInstall(bool update, bool modal)
if (IsInUse())
g_langInfo.SetLanguage(ID());
else
- CServiceBroker::GetSettings().SetString(CSettings::SETTING_LOCALE_LANGUAGE, ID());
+ CServiceBroker::GetSettings()->SetString(CSettings::SETTING_LOCALE_LANGUAGE, ID());
}
}
diff --git a/xbmc/addons/RepositoryUpdater.cpp b/xbmc/addons/RepositoryUpdater.cpp
index 9689989064..0042a4b247 100644
--- a/xbmc/addons/RepositoryUpdater.cpp
+++ b/xbmc/addons/RepositoryUpdater.cpp
@@ -39,7 +39,7 @@ CRepositoryUpdater::CRepositoryUpdater(CAddonMgr& addonMgr) :
// Register settings
std::set<std::string> settingSet;
settingSet.insert(CSettings::SETTING_ADDONS_AUTOUPDATES);
- CServiceBroker::GetSettings().RegisterCallback(this, settingSet);
+ CServiceBroker::GetSettings()->RegisterCallback(this, settingSet);
}
void CRepositoryUpdater::Start()
@@ -51,7 +51,7 @@ void CRepositoryUpdater::Start()
CRepositoryUpdater::~CRepositoryUpdater()
{
// Unregister settings
- CServiceBroker::GetSettings().UnregisterCallback(this);
+ CServiceBroker::GetSettings()->UnregisterCallback(this);
m_addonMgr.Events().Unsubscribe(this);
}
@@ -76,7 +76,7 @@ void CRepositoryUpdater::OnJobComplete(unsigned int jobID, bool success, CJob* j
VECADDONS updates = m_addonMgr.GetAvailableUpdates();
- if (CServiceBroker::GetSettings().GetInt(CSettings::SETTING_ADDONS_AUTOUPDATES) == AUTO_UPDATES_NOTIFY)
+ if (CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_ADDONS_AUTOUPDATES) == AUTO_UPDATES_NOTIFY)
{
if (!updates.empty())
{
@@ -94,7 +94,7 @@ void CRepositoryUpdater::OnJobComplete(unsigned int jobID, bool success, CJob* j
}
}
- if (CServiceBroker::GetSettings().GetInt(CSettings::SETTING_ADDONS_AUTOUPDATES) == AUTO_UPDATES_ON)
+ if (CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_ADDONS_AUTOUPDATES) == AUTO_UPDATES_ON)
{
CAddonInstaller::GetInstance().InstallUpdates();
}
@@ -204,7 +204,7 @@ void CRepositoryUpdater::ScheduleUpdate()
CSingleLock lock(m_criticalSection);
m_timer.Stop(true);
- if (CServiceBroker::GetSettings().GetInt(CSettings::SETTING_ADDONS_AUTOUPDATES) == AUTO_UPDATES_NEVER)
+ if (CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_ADDONS_AUTOUPDATES) == AUTO_UPDATES_NEVER)
return;
if (!m_addonMgr.HasAddons(ADDON_REPOSITORY))
diff --git a/xbmc/addons/Skin.cpp b/xbmc/addons/Skin.cpp
index e045aec92f..20d786eebe 100644
--- a/xbmc/addons/Skin.cpp
+++ b/xbmc/addons/Skin.cpp
@@ -311,7 +311,7 @@ void CSkinInfo::ResolveIncludes(TiXmlElement *node, std::map<INFO::InfoPtr, bool
int CSkinInfo::GetStartWindow() const
{
- int windowID = CServiceBroker::GetSettings().GetInt(CSettings::SETTING_LOOKANDFEEL_STARTUPWINDOW);
+ int windowID = CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_LOOKANDFEEL_STARTUPWINDOW);
assert(m_startupWindows.size());
for (std::vector<CStartupWindow>::const_iterator it = m_startupWindows.begin(); it != m_startupWindows.end(); ++it)
{
@@ -381,7 +381,7 @@ int CSkinInfo::GetFirstWindow() const
bool CSkinInfo::IsInUse() const
{
// Could extend this to prompt for reverting to the standard skin perhaps
- return CServiceBroker::GetSettings().GetString(CSettings::SETTING_LOOKANDFEEL_SKIN) == ID();
+ return CServiceBroker::GetSettings()->GetString(CSettings::SETTING_LOOKANDFEEL_SKIN) == ID();
}
const INFO::CSkinVariableString* CSkinInfo::CreateSkinVariable(const std::string& name, int context)
@@ -407,10 +407,10 @@ void CSkinInfo::OnPostInstall(bool update, bool modal)
toast->ResetTimer();
toast->Close(true);
}
- if (CServiceBroker::GetSettings().GetString(CSettings::SETTING_LOOKANDFEEL_SKIN) == ID())
+ if (CServiceBroker::GetSettings()->GetString(CSettings::SETTING_LOOKANDFEEL_SKIN) == ID())
CApplicationMessenger::GetInstance().PostMsg(TMSG_EXECUTE_BUILT_IN, -1, -1, nullptr, "ReloadSkin");
else
- CServiceBroker::GetSettings().SetString(CSettings::SETTING_LOOKANDFEEL_SKIN, ID());
+ CServiceBroker::GetSettings()->SetString(CSettings::SETTING_LOOKANDFEEL_SKIN, ID());
}
}
diff --git a/xbmc/addons/UISoundsResource.cpp b/xbmc/addons/UISoundsResource.cpp
index efe4e4e574..60ed5aa606 100644
--- a/xbmc/addons/UISoundsResource.cpp
+++ b/xbmc/addons/UISoundsResource.cpp
@@ -24,7 +24,7 @@ bool CUISoundsResource::IsAllowed(const std::string& file) const
bool CUISoundsResource::IsInUse() const
{
- return CServiceBroker::GetSettings().GetString(CSettings::SETTING_LOOKANDFEEL_SOUNDSKIN) == ID();
+ return CServiceBroker::GetSettings()->GetString(CSettings::SETTING_LOOKANDFEEL_SOUNDSKIN) == ID();
}
void CUISoundsResource::OnPostInstall(bool update, bool modal)
diff --git a/xbmc/addons/interfaces/General.cpp b/xbmc/addons/interfaces/General.cpp
index 00780b5cad..799707c808 100644
--- a/xbmc/addons/interfaces/General.cpp
+++ b/xbmc/addons/interfaces/General.cpp
@@ -417,7 +417,7 @@ char* Interface_General::get_current_skin_id(void* kodiBase)
return nullptr;
}
- return strdup(CServiceBroker::GetSettings().GetString(CSettings::SETTING_LOOKANDFEEL_SKIN).c_str());
+ return strdup(CServiceBroker::GetSettings()->GetString(CSettings::SETTING_LOOKANDFEEL_SKIN).c_str());
}
void Interface_General::kodi_version(void* kodiBase, char** compile_name, int* major, int* minor, char** revision, char** tag, char** tagversion)
diff --git a/xbmc/cdrip/CDDARipJob.cpp b/xbmc/cdrip/CDDARipJob.cpp
index 33af6a1d57..c1b3729b33 100644
--- a/xbmc/cdrip/CDDARipJob.cpp
+++ b/xbmc/cdrip/CDDARipJob.cpp
@@ -172,15 +172,15 @@ int CCDDARipJob::RipChunk(CFile& reader, CEncoder* encoder, int& percent)
CEncoder* CCDDARipJob::SetupEncoder(CFile& reader)
{
CEncoder* encoder = NULL;
- if (CServiceBroker::GetSettings().GetString(CSettings::SETTING_AUDIOCDS_ENCODER) == "audioencoder.kodi.builtin.aac" ||
- CServiceBroker::GetSettings().GetString(CSettings::SETTING_AUDIOCDS_ENCODER) == "audioencoder.kodi.builtin.wma")
+ if (CServiceBroker::GetSettings()->GetString(CSettings::SETTING_AUDIOCDS_ENCODER) == "audioencoder.kodi.builtin.aac" ||
+ CServiceBroker::GetSettings()->GetString(CSettings::SETTING_AUDIOCDS_ENCODER) == "audioencoder.kodi.builtin.wma")
{
std::shared_ptr<IEncoder> enc(new CEncoderFFmpeg());
encoder = new CEncoder(enc);
}
else
{
- const BinaryAddonBasePtr addonInfo = CServiceBroker::GetBinaryAddonManager().GetInstalledAddonInfo(CServiceBroker::GetSettings().GetString(CSettings::SETTING_AUDIOCDS_ENCODER), ADDON_AUDIOENCODER);
+ const BinaryAddonBasePtr addonInfo = CServiceBroker::GetBinaryAddonManager().GetInstalledAddonInfo(CServiceBroker::GetSettings()->GetString(CSettings::SETTING_AUDIOCDS_ENCODER), ADDON_AUDIOENCODER);
if (addonInfo)
{
std::shared_ptr<IEncoder> enc = std::make_shared<CAudioEncoder>(addonInfo);
diff --git a/xbmc/cdrip/CDDARipper.cpp b/xbmc/cdrip/CDDARipper.cpp
index 02474d3285..d800b13a50 100644
--- a/xbmc/cdrip/CDDARipper.cpp
+++ b/xbmc/cdrip/CDDARipper.cpp
@@ -72,7 +72,7 @@ bool CCDDARipper::RipTrack(CFileItem* pItem)
AddJob(new CCDDARipJob(pItem->GetPath(),strFile,
*pItem->GetMusicInfoTag(),
- CServiceBroker::GetSettings().GetInt(CSettings::SETTING_AUDIOCDS_ENCODER)));
+ CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_AUDIOCDS_ENCODER)));
return true;
}
@@ -124,11 +124,11 @@ bool CCDDARipper::RipCD()
if (item->GetPath().find(".cdda") == std::string::npos)
continue;
- bool eject = CServiceBroker::GetSettings().GetBool(CSettings::SETTING_AUDIOCDS_EJECTONRIP) &&
+ bool eject = CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_AUDIOCDS_EJECTONRIP) &&
i == vecItems.Size()-1;
AddJob(new CCDDARipJob(item->GetPath(),strFile,
*item->GetMusicInfoTag(),
- CServiceBroker::GetSettings().GetInt(CSettings::SETTING_AUDIOCDS_ENCODER), eject));
+ CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_AUDIOCDS_ENCODER), eject));
}
return true;
@@ -136,7 +136,7 @@ bool CCDDARipper::RipCD()
bool CCDDARipper::CreateAlbumDir(const MUSIC_INFO::CMusicInfoTag& infoTag, std::string& strDirectory, int& legalType)
{
- std::shared_ptr<CSettingPath> recordingpathSetting = std::static_pointer_cast<CSettingPath>(CServiceBroker::GetSettings().GetSetting(CSettings::SETTING_AUDIOCDS_RECORDINGPATH));
+ std::shared_ptr<CSettingPath> recordingpathSetting = std::static_pointer_cast<CSettingPath>(CServiceBroker::GetSettings()->GetSetting(CSettings::SETTING_AUDIOCDS_RECORDINGPATH));
if (recordingpathSetting != NULL)
{
strDirectory = recordingpathSetting->GetValue();
@@ -192,7 +192,7 @@ std::string CCDDARipper::GetAlbumDirName(const MUSIC_INFO::CMusicInfoTag& infoTa
// use audiocds.trackpathformat setting to format
// directory name where CD tracks will be stored,
// use only format part ending at the last '/'
- strAlbumDir = CServiceBroker::GetSettings().GetString(CSettings::SETTING_AUDIOCDS_TRACKPATHFORMAT);
+ strAlbumDir = CServiceBroker::GetSettings()->GetString(CSettings::SETTING_AUDIOCDS_TRACKPATHFORMAT);
size_t pos = strAlbumDir.find_last_of("/\\");
if (pos == std::string::npos)
return ""; // no directory
@@ -259,7 +259,7 @@ std::string CCDDARipper::GetTrackName(CFileItem *item)
// get track file name format from audiocds.trackpathformat setting,
// use only format part starting from the last '/'
- std::string strFormat = CServiceBroker::GetSettings().GetString(CSettings::SETTING_AUDIOCDS_TRACKPATHFORMAT);
+ std::string strFormat = CServiceBroker::GetSettings()->GetString(CSettings::SETTING_AUDIOCDS_TRACKPATHFORMAT);
size_t pos = strFormat.find_last_of("/\\");
if (pos != std::string::npos)
strFormat.erase(0, pos+1);
@@ -272,7 +272,7 @@ std::string CCDDARipper::GetTrackName(CFileItem *item)
if (track.empty())
track = StringUtils::Format("%s%02i", "Track-", trackNumber);
- const BinaryAddonBasePtr addonInfo = CServiceBroker::GetBinaryAddonManager().GetInstalledAddonInfo(CServiceBroker::GetSettings().GetString(CSettings::SETTING_AUDIOCDS_ENCODER), ADDON_AUDIOENCODER);
+ const BinaryAddonBasePtr addonInfo = CServiceBroker::GetBinaryAddonManager().GetInstalledAddonInfo(CServiceBroker::GetSettings()->GetString(CSettings::SETTING_AUDIOCDS_ENCODER), ADDON_AUDIOENCODER);
if (addonInfo)
track += addonInfo->Type(ADDON_AUDIOENCODER)->GetValue("@extension").asString();
diff --git a/xbmc/cdrip/EncoderFFmpeg.cpp b/xbmc/cdrip/EncoderFFmpeg.cpp
index b3dfd3036b..abe1098be5 100644
--- a/xbmc/cdrip/EncoderFFmpeg.cpp
+++ b/xbmc/cdrip/EncoderFFmpeg.cpp
@@ -74,7 +74,7 @@ bool CEncoderFFmpeg::Init(AddonToKodiFuncTable_AudioEncoder& callbacks)
}
AddonPtr addon;
- CServiceBroker::GetAddonMgr().GetAddon(CServiceBroker::GetSettings().GetString(CSettings::SETTING_AUDIOCDS_ENCODER), addon);
+ CServiceBroker::GetAddonMgr().GetAddon(CServiceBroker::GetSettings()->GetString(CSettings::SETTING_AUDIOCDS_ENCODER), addon);
if (addon)
{
m_Format->bit_rate = (128+32*strtol(addon->GetSetting("bitrate").c_str(), NULL, 10))*1000;
diff --git a/xbmc/cores/AudioEngine/AEResampleFactory.cpp b/xbmc/cores/AudioEngine/AEResampleFactory.cpp
index 14960fd301..2c9a7eddf9 100644
--- a/xbmc/cores/AudioEngine/AEResampleFactory.cpp
+++ b/xbmc/cores/AudioEngine/AEResampleFactory.cpp
@@ -20,7 +20,7 @@ namespace ActiveAE
IAEResample *CAEResampleFactory::Create(uint32_t flags /* = 0 */)
{
#if defined(TARGET_RASPBERRY_PI)
- if (!(flags & AERESAMPLEFACTORY_QUICK_RESAMPLE) && CServiceBroker::GetSettings().GetInt(CSettings::SETTING_AUDIOOUTPUT_PROCESSQUALITY) == AE_QUALITY_GPU)
+ if (!(flags & AERESAMPLEFACTORY_QUICK_RESAMPLE) && CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_AUDIOOUTPUT_PROCESSQUALITY) == AE_QUALITY_GPU)
return new CActiveAEResamplePi();
#endif
return new CActiveAEResampleFFMPEG();
diff --git a/xbmc/cores/AudioEngine/Encoders/AEEncoderFFmpeg.cpp b/xbmc/cores/AudioEngine/Encoders/AEEncoderFFmpeg.cpp
index 217b2fb999..433d8ddd66 100644
--- a/xbmc/cores/AudioEngine/Encoders/AEEncoderFFmpeg.cpp
+++ b/xbmc/cores/AudioEngine/Encoders/AEEncoderFFmpeg.cpp
@@ -80,7 +80,7 @@ bool CAEEncoderFFmpeg::Initialize(AEAudioFormat &format, bool allow_planar_input
{
Reset();
- bool ac3 = CServiceBroker::GetSettings().GetBool(CSettings::SETTING_AUDIOOUTPUT_AC3PASSTHROUGH);
+ bool ac3 = CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_AUDIOOUTPUT_AC3PASSTHROUGH);
AVCodec *codec = NULL;
diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp
index 4c2f88b236..b9c1f43319 100644
--- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp
+++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp
@@ -2579,31 +2579,31 @@ void CActiveAE::Deamplify(CSoundPacket &dstSample)
void CActiveAE::LoadSettings()
{
- m_settings.device = CServiceBroker::GetSettings().GetString(CSettings::SETTING_AUDIOOUTPUT_AUDIODEVICE);
- m_settings.passthroughdevice = CServiceBroker::GetSettings().GetString(CSettings::SETTING_AUDIOOUTPUT_PASSTHROUGHDEVICE);
+ m_settings.device = CServiceBroker::GetSettings()->GetString(CSettings::SETTING_AUDIOOUTPUT_AUDIODEVICE);
+ m_settings.passthroughdevice = CServiceBroker::GetSettings()->GetString(CSettings::SETTING_AUDIOOUTPUT_PASSTHROUGHDEVICE);
- m_settings.config = CServiceBroker::GetSettings().GetInt(CSettings::SETTING_AUDIOOUTPUT_CONFIG);
- m_settings.channels = (m_sink.GetDeviceType(m_settings.device) == AE_DEVTYPE_IEC958) ? AE_CH_LAYOUT_2_0 : CServiceBroker::GetSettings().GetInt(CSettings::SETTING_AUDIOOUTPUT_CHANNELS);
- m_settings.samplerate = CServiceBroker::GetSettings().GetInt(CSettings::SETTING_AUDIOOUTPUT_SAMPLERATE);
+ m_settings.config = CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_AUDIOOUTPUT_CONFIG);
+ m_settings.channels = (m_sink.GetDeviceType(m_settings.device) == AE_DEVTYPE_IEC958) ? AE_CH_LAYOUT_2_0 : CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_AUDIOOUTPUT_CHANNELS);
+ m_settings.samplerate = CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_AUDIOOUTPUT_SAMPLERATE);
- m_settings.stereoupmix = IsSettingVisible(CSettings::SETTING_AUDIOOUTPUT_STEREOUPMIX) ? CServiceBroker::GetSettings().GetBool(CSettings::SETTING_AUDIOOUTPUT_STEREOUPMIX) : false;
- m_settings.normalizelevels = !CServiceBroker::GetSettings().GetBool(CSettings::SETTING_AUDIOOUTPUT_MAINTAINORIGINALVOLUME);
- m_settings.guisoundmode = CServiceBroker::GetSettings().GetInt(CSettings::SETTING_AUDIOOUTPUT_GUISOUNDMODE);
+ m_settings.stereoupmix = IsSettingVisible(CSettings::SETTING_AUDIOOUTPUT_STEREOUPMIX) ? CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_AUDIOOUTPUT_STEREOUPMIX) : false;
+ m_settings.normalizelevels = !CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_AUDIOOUTPUT_MAINTAINORIGINALVOLUME);
+ m_settings.guisoundmode = CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_AUDIOOUTPUT_GUISOUNDMODE);
- m_settings.passthrough = m_settings.config == AE_CONFIG_FIXED ? false : CServiceBroker::GetSettings().GetBool(CSettings::SETTING_AUDIOOUTPUT_PASSTHROUGH);
+ m_settings.passthrough = m_settings.config == AE_CONFIG_FIXED ? false : CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_AUDIOOUTPUT_PASSTHROUGH);
if (!m_sink.HasPassthroughDevice())
m_settings.passthrough = false;
- m_settings.ac3passthrough = CServiceBroker::GetSettings().GetBool(CSettings::SETTING_AUDIOOUTPUT_AC3PASSTHROUGH);
- m_settings.ac3transcode = CServiceBroker::GetSettings().GetBool(CSettings::SETTING_AUDIOOUTPUT_AC3TRANSCODE);
- m_settings.eac3passthrough = CServiceBroker::GetSettings().GetBool(CSettings::SETTING_AUDIOOUTPUT_EAC3PASSTHROUGH);
- m_settings.truehdpassthrough = CServiceBroker::GetSettings().GetBool(CSettings::SETTING_AUDIOOUTPUT_TRUEHDPASSTHROUGH);
- m_settings.dtspassthrough = CServiceBroker::GetSettings().GetBool(CSettings::SETTING_AUDIOOUTPUT_DTSPASSTHROUGH);
- m_settings.dtshdpassthrough = CServiceBroker::GetSettings().GetBool(CSettings::SETTING_AUDIOOUTPUT_DTSHDPASSTHROUGH);
+ m_settings.ac3passthrough = CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_AUDIOOUTPUT_AC3PASSTHROUGH);
+ m_settings.ac3transcode = CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_AUDIOOUTPUT_AC3TRANSCODE);
+ m_settings.eac3passthrough = CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_AUDIOOUTPUT_EAC3PASSTHROUGH);
+ m_settings.truehdpassthrough = CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_AUDIOOUTPUT_TRUEHDPASSTHROUGH);
+ m_settings.dtspassthrough = CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_AUDIOOUTPUT_DTSPASSTHROUGH);
+ m_settings.dtshdpassthrough = CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_AUDIOOUTPUT_DTSHDPASSTHROUGH);
- m_settings.resampleQuality = static_cast<AEQuality>(CServiceBroker::GetSettings().GetInt(CSettings::SETTING_AUDIOOUTPUT_PROCESSQUALITY));
- m_settings.atempoThreshold = CServiceBroker::GetSettings().GetInt(CSettings::SETTING_AUDIOOUTPUT_ATEMPOTHRESHOLD) / 100.0;
- m_settings.streamNoise = CServiceBroker::GetSettings().GetBool(CSettings::SETTING_AUDIOOUTPUT_STREAMNOISE);
- m_settings.silenceTimeout = CServiceBroker::GetSettings().GetInt(CSettings::SETTING_AUDIOOUTPUT_STREAMSILENCE) * 60000;
+ m_settings.resampleQuality = static_cast<AEQuality>(CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_AUDIOOUTPUT_PROCESSQUALITY));
+ m_settings.atempoThreshold = CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_AUDIOOUTPUT_ATEMPOTHRESHOLD) / 100.0;
+ m_settings.streamNoise = CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_AUDIOOUTPUT_STREAMNOISE);
+ m_settings.silenceTimeout = CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_AUDIOOUTPUT_STREAMSILENCE) * 60000;
}
void CActiveAE::Start()
@@ -2642,11 +2642,11 @@ void CActiveAE::OnSettingsChange()
bool CActiveAE::SupportsRaw(AEAudioFormat &format)
{
// check if passthrough is enabled
- if (!CServiceBroker::GetSettings().GetBool(CSettings::SETTING_AUDIOOUTPUT_PASSTHROUGH))
+ if (!CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_AUDIOOUTPUT_PASSTHROUGH))
return false;
// fixed config disabled passthrough
- if (CServiceBroker::GetSettings().GetInt(CSettings::SETTING_AUDIOOUTPUT_CONFIG) == AE_CONFIG_FIXED)
+ if (CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_AUDIOOUTPUT_CONFIG) == AE_CONFIG_FIXED)
return false;
// check if the format is enabled in settings
@@ -2667,7 +2667,7 @@ bool CActiveAE::SupportsRaw(AEAudioFormat &format)
if (format.m_streamInfo.m_type == CAEStreamInfo::STREAM_TYPE_DTSHD && !m_settings.dtshdpassthrough)
return false;
- if (!m_sink.SupportsFormat(CServiceBroker::GetSettings().GetString(CSettings::SETTING_AUDIOOUTPUT_PASSTHROUGHDEVICE), format))
+ if (!m_sink.SupportsFormat(CServiceBroker::GetSettings()->GetString(CSettings::SETTING_AUDIOOUTPUT_PASSTHROUGHDEVICE), format))
return false;
return true;
@@ -2680,16 +2680,16 @@ bool CActiveAE::SupportsSilenceTimeout()
bool CActiveAE::HasStereoAudioChannelCount()
{
- std::string device = CServiceBroker::GetSettings().GetString(CSettings::SETTING_AUDIOOUTPUT_AUDIODEVICE);
- int numChannels = (m_sink.GetDeviceType(device) == AE_DEVTYPE_IEC958) ? AE_CH_LAYOUT_2_0 : CServiceBroker::GetSettings().GetInt(CSettings::SETTING_AUDIOOUTPUT_CHANNELS);
- bool passthrough = CServiceBroker::GetSettings().GetInt(CSettings::SETTING_AUDIOOUTPUT_CONFIG) == AE_CONFIG_FIXED ? false : CServiceBroker::GetSettings().GetBool(CSettings::SETTING_AUDIOOUTPUT_PASSTHROUGH);
+ std::string device = CServiceBroker::GetSettings()->GetString(CSettings::SETTING_AUDIOOUTPUT_AUDIODEVICE);
+ int numChannels = (m_sink.GetDeviceType(device) == AE_DEVTYPE_IEC958) ? AE_CH_LAYOUT_2_0 : CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_AUDIOOUTPUT_CHANNELS);
+ bool passthrough = CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_AUDIOOUTPUT_CONFIG) == AE_CONFIG_FIXED ? false : CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_AUDIOOUTPUT_PASSTHROUGH);
return numChannels == AE_CH_LAYOUT_2_0 && !passthrough;
}
bool CActiveAE::HasHDAudioChannelCount()
{
- std::string device = CServiceBroker::GetSettings().GetString(CSettings::SETTING_AUDIOOUTPUT_AUDIODEVICE);
- int numChannels = (m_sink.GetDeviceType(device) == AE_DEVTYPE_IEC958) ? AE_CH_LAYOUT_2_0 : CServiceBroker::GetSettings().GetInt(CSettings::SETTING_AUDIOOUTPUT_CHANNELS);
+ std::string device = CServiceBroker::GetSettings()->GetString(CSettings::SETTING_AUDIOOUTPUT_AUDIODEVICE);
+ int numChannels = (m_sink.GetDeviceType(device) == AE_DEVTYPE_IEC958) ? AE_CH_LAYOUT_2_0 : CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_AUDIOOUTPUT_CHANNELS);
return numChannels > AE_CH_LAYOUT_5_1;
}
@@ -2709,19 +2709,19 @@ bool CActiveAE::IsSettingVisible(const std::string &settingId)
{
if (settingId == CSettings::SETTING_AUDIOOUTPUT_SAMPLERATE)
{
- if (m_sink.GetDeviceType(CServiceBroker::GetSettings().GetString(CSettings::SETTING_AUDIOOUTPUT_AUDIODEVICE)) == AE_DEVTYPE_IEC958)
+ if (m_sink.GetDeviceType(CServiceBroker::GetSettings()->GetString(CSettings::SETTING_AUDIOOUTPUT_AUDIODEVICE)) == AE_DEVTYPE_IEC958)
return true;
- if (CServiceBroker::GetSettings().GetInt(CSettings::SETTING_AUDIOOUTPUT_CONFIG) == AE_CONFIG_FIXED)
+ if (CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_AUDIOOUTPUT_CONFIG) == AE_CONFIG_FIXED)
return true;
}
else if (settingId == CSettings::SETTING_AUDIOOUTPUT_CHANNELS)
{
- if (m_sink.GetDeviceType(CServiceBroker::GetSettings().GetString(CSettings::SETTING_AUDIOOUTPUT_AUDIODEVICE)) != AE_DEVTYPE_IEC958)
+ if (m_sink.GetDeviceType(CServiceBroker::GetSettings()->GetString(CSettings::SETTING_AUDIOOUTPUT_AUDIODEVICE)) != AE_DEVTYPE_IEC958)
return true;
}
else if (settingId == CSettings::SETTING_AUDIOOUTPUT_PASSTHROUGH)
{
- if (m_sink.HasPassthroughDevice() && CServiceBroker::GetSettings().GetInt(CSettings::SETTING_AUDIOOUTPUT_CONFIG) != AE_CONFIG_FIXED)
+ if (m_sink.HasPassthroughDevice() && CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_AUDIOOUTPUT_CONFIG) != AE_CONFIG_FIXED)
return true;
}
else if (settingId == CSettings::SETTING_AUDIOOUTPUT_DTSPASSTHROUGH)
@@ -2730,8 +2730,8 @@ bool CActiveAE::IsSettingVisible(const std::string &settingId)
format.m_dataFormat = AE_FMT_RAW;
format.m_streamInfo.m_type = CAEStreamInfo::STREAM_TYPE_DTS_512;
format.m_sampleRate = 48000;
- if (m_sink.SupportsFormat(CServiceBroker::GetSettings().GetString(CSettings::SETTING_AUDIOOUTPUT_PASSTHROUGHDEVICE), format) &&
- CServiceBroker::GetSettings().GetInt(CSettings::SETTING_AUDIOOUTPUT_CONFIG) != AE_CONFIG_FIXED)
+ if (m_sink.SupportsFormat(CServiceBroker::GetSettings()->GetString(CSettings::SETTING_AUDIOOUTPUT_PASSTHROUGHDEVICE), format) &&
+ CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_AUDIOOUTPUT_CONFIG) != AE_CONFIG_FIXED)
return true;
}
else if (settingId == CSettings::SETTING_AUDIOOUTPUT_TRUEHDPASSTHROUGH)
@@ -2740,8 +2740,8 @@ bool CActiveAE::IsSettingVisible(const std::string &settingId)
format.m_dataFormat = AE_FMT_RAW;
format.m_streamInfo.m_type = CAEStreamInfo::STREAM_TYPE_TRUEHD;
format.m_streamInfo.m_sampleRate = 192000;
- if (m_sink.SupportsFormat(CServiceBroker::GetSettings().GetString(CSettings::SETTING_AUDIOOUTPUT_PASSTHROUGHDEVICE), format) &&
- CServiceBroker::GetSettings().GetInt(CSettings::SETTING_AUDIOOUTPUT_CONFIG) != AE_CONFIG_FIXED)
+ if (m_sink.SupportsFormat(CServiceBroker::GetSettings()->GetString(CSettings::SETTING_AUDIOOUTPUT_PASSTHROUGHDEVICE), format) &&
+ CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_AUDIOOUTPUT_CONFIG) != AE_CONFIG_FIXED)
return true;
}
else if (settingId == CSettings::SETTING_AUDIOOUTPUT_DTSHDPASSTHROUGH)
@@ -2749,8 +2749,8 @@ bool CActiveAE::IsSettingVisible(const std::string &settingId)
AEAudioFormat format;
format.m_dataFormat = AE_FMT_RAW;
format.m_streamInfo.m_type = CAEStreamInfo::STREAM_TYPE_DTSHD;
- if (m_sink.SupportsFormat(CServiceBroker::GetSettings().GetString(CSettings::SETTING_AUDIOOUTPUT_PASSTHROUGHDEVICE), format) &&
- CServiceBroker::GetSettings().GetInt(CSettings::SETTING_AUDIOOUTPUT_CONFIG) != AE_CONFIG_FIXED)
+ if (m_sink.SupportsFormat(CServiceBroker::GetSettings()->GetString(CSettings::SETTING_AUDIOOUTPUT_PASSTHROUGHDEVICE), format) &&
+ CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_AUDIOOUTPUT_CONFIG) != AE_CONFIG_FIXED)
return true;
}
else if (settingId == CSettings::SETTING_AUDIOOUTPUT_EAC3PASSTHROUGH)
@@ -2758,22 +2758,22 @@ bool CActiveAE::IsSettingVisible(const std::string &settingId)
AEAudioFormat format;
format.m_dataFormat = AE_FMT_RAW;
format.m_streamInfo.m_type = CAEStreamInfo::STREAM_TYPE_EAC3;
- if (m_sink.SupportsFormat(CServiceBroker::GetSettings().GetString(CSettings::SETTING_AUDIOOUTPUT_PASSTHROUGHDEVICE), format) &&
- CServiceBroker::GetSettings().GetInt(CSettings::SETTING_AUDIOOUTPUT_CONFIG) != AE_CONFIG_FIXED)
+ if (m_sink.SupportsFormat(CServiceBroker::GetSettings()->GetString(CSettings::SETTING_AUDIOOUTPUT_PASSTHROUGHDEVICE), format) &&
+ CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_AUDIOOUTPUT_CONFIG) != AE_CONFIG_FIXED)
return true;
}
else if (settingId == CSettings::SETTING_AUDIOOUTPUT_STEREOUPMIX)
{
if (m_sink.HasPassthroughDevice() ||
- CServiceBroker::GetSettings().GetInt(CSettings::SETTING_AUDIOOUTPUT_CHANNELS) > AE_CH_LAYOUT_2_0)
+ CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_AUDIOOUTPUT_CHANNELS) > AE_CH_LAYOUT_2_0)
return true;
}
else if (settingId == CSettings::SETTING_AUDIOOUTPUT_AC3TRANSCODE)
{
if (m_sink.HasPassthroughDevice() &&
- CServiceBroker::GetSettings().GetBool(CSettings::SETTING_AUDIOOUTPUT_AC3PASSTHROUGH) &&
- CServiceBroker::GetSettings().GetInt(CSettings::SETTING_AUDIOOUTPUT_CONFIG) != AE_CONFIG_FIXED &&
- (CServiceBroker::GetSettings().GetInt(CSettings::SETTING_AUDIOOUTPUT_CHANNELS) <= AE_CH_LAYOUT_2_0 || m_sink.GetDeviceType(CServiceBroker::GetSettings().GetString(CSettings::SETTING_AUDIOOUTPUT_AUDIODEVICE)) == AE_DEVTYPE_IEC958))
+ CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_AUDIOOUTPUT_AC3PASSTHROUGH) &&
+ CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_AUDIOOUTPUT_CONFIG) != AE_CONFIG_FIXED &&
+ (CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_AUDIOOUTPUT_CHANNELS) <= AE_CH_LAYOUT_2_0 || m_sink.GetDeviceType(CServiceBroker::GetSettings()->GetString(CSettings::SETTING_AUDIOOUTPUT_AUDIODEVICE)) == AE_DEVTYPE_IEC958))
return true;
}
return false;
diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESettings.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESettings.cpp
index c39ca1d8a1..d8c4648afa 100644
--- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESettings.cpp
+++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESettings.cpp
@@ -48,26 +48,26 @@ CActiveAESettings::CActiveAESettings(CActiveAE &ae) : m_audioEngine(ae)
settingSet.insert(CSettings::SETTING_AUDIOOUTPUT_STREAMSILENCE);
settingSet.insert(CSettings::SETTING_AUDIOOUTPUT_STREAMNOISE);
settingSet.insert(CSettings::SETTING_AUDIOOUTPUT_MAINTAINORIGINALVOLUME);
- CServiceBroker::GetSettings().GetSettingsManager()->RegisterCallback(this, settingSet);
+ CServiceBroker::GetSettings()->GetSettingsManager()->RegisterCallback(this, settingSet);
- CServiceBroker::GetSettings().GetSettingsManager()->RegisterSettingOptionsFiller("aequalitylevels",
+ CServiceBroker::GetSettings()->GetSettingsManager()->RegisterSettingOptionsFiller("aequalitylevels",
SettingOptionsAudioQualityLevelsFiller);
- CServiceBroker::GetSettings().GetSettingsManager()->RegisterSettingOptionsFiller("audiodevices",
+ CServiceBroker::GetSettings()->GetSettingsManager()->RegisterSettingOptionsFiller("audiodevices",
SettingOptionsAudioDevicesFiller);
- CServiceBroker::GetSettings().GetSettingsManager()->RegisterSettingOptionsFiller("audiodevicespassthrough",
+ CServiceBroker::GetSettings()->GetSettingsManager()->RegisterSettingOptionsFiller("audiodevicespassthrough",
SettingOptionsAudioDevicesPassthroughFiller);
- CServiceBroker::GetSettings().GetSettingsManager()->RegisterSettingOptionsFiller("audiostreamsilence",
+ CServiceBroker::GetSettings()->GetSettingsManager()->RegisterSettingOptionsFiller("audiostreamsilence",
SettingOptionsAudioStreamsilenceFiller);
}
CActiveAESettings::~CActiveAESettings()
{
CSingleLock lock(m_cs);
- CServiceBroker::GetSettings().GetSettingsManager()->UnregisterSettingOptionsFiller("aequalitylevels");
- CServiceBroker::GetSettings().GetSettingsManager()->UnregisterSettingOptionsFiller("audiodevices");
- CServiceBroker::GetSettings().GetSettingsManager()->UnregisterSettingOptionsFiller("audiodevicespassthrough");
- CServiceBroker::GetSettings().GetSettingsManager()->UnregisterSettingOptionsFiller("audiostreamsilence");
- CServiceBroker::GetSettings().GetSettingsManager()->UnregisterCallback(this);
+ CServiceBroker::GetSettings()->GetSettingsManager()->UnregisterSettingOptionsFiller("aequalitylevels");
+ CServiceBroker::GetSettings()->GetSettingsManager()->UnregisterSettingOptionsFiller("audiodevices");
+ CServiceBroker::GetSettings()->GetSettingsManager()->UnregisterSettingOptionsFiller("audiodevicespassthrough");
+ CServiceBroker::GetSettings()->GetSettingsManager()->UnregisterSettingOptionsFiller("audiostreamsilence");
+ CServiceBroker::GetSettings()->GetSettingsManager()->UnregisterCallback(this);
m_instance = nullptr;
}
diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkPi.cpp b/xbmc/cores/AudioEngine/Sinks/AESinkPi.cpp
index 75e41e1594..724e3afb66 100644
--- a/xbmc/cores/AudioEngine/Sinks/AESinkPi.cpp
+++ b/xbmc/cores/AudioEngine/Sinks/AESinkPi.cpp
@@ -197,13 +197,13 @@ bool CAESinkPi::Initialize(AEAudioFormat &format, std::string &device)
m_initDevice = device;
m_initFormat = format;
- if (m_passthrough || CServiceBroker::GetSettings().GetString(CSettings::SETTING_AUDIOOUTPUT_AUDIODEVICE) == "PI:HDMI")
+ if (m_passthrough || CServiceBroker::GetSettings()->GetString(CSettings::SETTING_AUDIOOUTPUT_AUDIODEVICE) == "PI:HDMI")
m_output = AESINKPI_HDMI;
- else if (CServiceBroker::GetSettings().GetString(CSettings::SETTING_AUDIOOUTPUT_AUDIODEVICE) == "PI:Analogue")
+ else if (CServiceBroker::GetSettings()->GetString(CSettings::SETTING_AUDIOOUTPUT_AUDIODEVICE) == "PI:Analogue")
m_output = AESINKPI_ANALOGUE;
- else if (CServiceBroker::GetSettings().GetString(CSettings::SETTING_AUDIOOUTPUT_AUDIODEVICE) == "PI:Both")
+ else if (CServiceBroker::GetSettings()->GetString(CSettings::SETTING_AUDIOOUTPUT_AUDIODEVICE) == "PI:Both")
m_output = AESINKPI_BOTH;
- else if (CServiceBroker::GetSettings().GetString(CSettings::SETTING_AUDIOOUTPUT_AUDIODEVICE) == "Default")
+ else if (CServiceBroker::GetSettings()->GetString(CSettings::SETTING_AUDIOOUTPUT_AUDIODEVICE) == "Default")
m_output = AESINKPI_HDMI;
else assert(0);
@@ -227,7 +227,7 @@ bool CAESinkPi::Initialize(AEAudioFormat &format, std::string &device)
CLog::Log(LOGDEBUG, "%s:%s Format:%d Channels:%d Samplerate:%d framesize:%d bufsize:%d bytes/s=%.2f dest=%s", CLASSNAME, __func__,
m_format.m_dataFormat, channels, m_format.m_sampleRate, m_format.m_frameSize, m_format.m_frameSize * m_format.m_frames, 1.0/m_sinkbuffer_sec_per_byte,
- CServiceBroker::GetSettings().GetString(CSettings::SETTING_AUDIOOUTPUT_AUDIODEVICE).c_str());
+ CServiceBroker::GetSettings()->GetString(CSettings::SETTING_AUDIOOUTPUT_AUDIODEVICE).c_str());
// magic value used when omxplayer is playing - want sink to be disabled
if (m_passthrough && m_format.m_streamInfo.m_sampleRate == 16000)
diff --git a/xbmc/cores/DllLoader/exports/emu_msvcrt.cpp b/xbmc/cores/DllLoader/exports/emu_msvcrt.cpp
index a531d60f76..31def9cdc1 100644
--- a/xbmc/cores/DllLoader/exports/emu_msvcrt.cpp
+++ b/xbmc/cores/DllLoader/exports/emu_msvcrt.cpp
@@ -187,22 +187,22 @@ extern "C" void __stdcall init_emu_environ()
extern "C" void __stdcall update_emu_environ()
{
// Use a proxy, if the GUI was configured as such
- if (CServiceBroker::GetSettings().GetBool(CSettings::SETTING_NETWORK_USEHTTPPROXY)
- && !CServiceBroker::GetSettings().GetString(CSettings::SETTING_NETWORK_HTTPPROXYSERVER).empty()
- && CServiceBroker::GetSettings().GetInt(CSettings::SETTING_NETWORK_HTTPPROXYPORT) > 0
- && CServiceBroker::GetSettings().GetInt(CSettings::SETTING_NETWORK_HTTPPROXYTYPE) == 0)
+ if (CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_NETWORK_USEHTTPPROXY)
+ && !CServiceBroker::GetSettings()->GetString(CSettings::SETTING_NETWORK_HTTPPROXYSERVER).empty()
+ && CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_NETWORK_HTTPPROXYPORT) > 0
+ && CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_NETWORK_HTTPPROXYTYPE) == 0)
{
std::string strProxy;
- if (!CServiceBroker::GetSettings().GetString(CSettings::SETTING_NETWORK_HTTPPROXYUSERNAME).empty() &&
- !CServiceBroker::GetSettings().GetString(CSettings::SETTING_NETWORK_HTTPPROXYPASSWORD).empty())
+ if (!CServiceBroker::GetSettings()->GetString(CSettings::SETTING_NETWORK_HTTPPROXYUSERNAME).empty() &&
+ !CServiceBroker::GetSettings()->GetString(CSettings::SETTING_NETWORK_HTTPPROXYPASSWORD).empty())
{
strProxy = StringUtils::Format("%s:%s@",
- CServiceBroker::GetSettings().GetString(CSettings::SETTING_NETWORK_HTTPPROXYUSERNAME).c_str(),
- CServiceBroker::GetSettings().GetString(CSettings::SETTING_NETWORK_HTTPPROXYPASSWORD).c_str());
+ CServiceBroker::GetSettings()->GetString(CSettings::SETTING_NETWORK_HTTPPROXYUSERNAME).c_str(),
+ CServiceBroker::GetSettings()->GetString(CSettings::SETTING_NETWORK_HTTPPROXYPASSWORD).c_str());
}
- strProxy += CServiceBroker::GetSettings().GetString(CSettings::SETTING_NETWORK_HTTPPROXYSERVER);
- strProxy += StringUtils::Format(":%d", CServiceBroker::GetSettings().GetInt(CSettings::SETTING_NETWORK_HTTPPROXYPORT));
+ strProxy += CServiceBroker::GetSettings()->GetString(CSettings::SETTING_NETWORK_HTTPPROXYSERVER);
+ strProxy += StringUtils::Format(":%d", CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_NETWORK_HTTPPROXYPORT));
CEnvironment::setenv( "HTTP_PROXY", "http://" + strProxy, true );
CEnvironment::setenv( "HTTPS_PROXY", "http://" + strProxy, true );
diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Overlay/DVDOverlayCodecTX3G.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Overlay/DVDOverlayCodecTX3G.cpp
index de526d6b2c..3d62756f3f 100644
--- a/xbmc/cores/VideoPlayer/DVDCodecs/Overlay/DVDOverlayCodecTX3G.cpp
+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Overlay/DVDOverlayCodecTX3G.cpp
@@ -60,7 +60,7 @@ CDVDOverlayCodecTX3G::CDVDOverlayCodecTX3G() : CDVDOverlayCodec("TX3G Subtitle D
m_pOverlay = NULL;
// stupid, this comes from a static global in GUIWindowFullScreen.cpp
uint32_t colormap[8] = { 0xFFFFFF00, 0xFFFFFFFF, 0xFF0099FF, 0xFF00FF00, 0xFFCCFF00, 0xFF00FFFF, 0xFFE5E5E5, 0xFFC0C0C0 };
- m_textColor = colormap[CServiceBroker::GetSettings().GetInt(CSettings::SETTING_SUBTITLES_COLOR)];
+ m_textColor = colormap[CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_SUBTITLES_COLOR)];
}
CDVDOverlayCodecTX3G::~CDVDOverlayCodecTX3G()
diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAmlogic.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAmlogic.cpp
index 2a0e6e434f..a636814f7d 100644
--- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAmlogic.cpp
+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAmlogic.cpp
@@ -95,7 +95,7 @@ std::atomic<bool> CDVDVideoCodecAmlogic::m_InstanceGuard(false);
bool CDVDVideoCodecAmlogic::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options)
{
- if (!CServiceBroker::GetSettings().GetBool(CSettings::SETTING_VIDEOPLAYER_USEAMCODEC))
+ if (!CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_VIDEOPLAYER_USEAMCODEC))
return false;
if (hints.stills || hints.width == 0)
return false;
@@ -126,7 +126,7 @@ bool CDVDVideoCodecAmlogic::Open(CDVDStreamInfo &hints, CDVDCodecOptions &option
break;
case AV_CODEC_ID_MPEG1VIDEO:
case AV_CODEC_ID_MPEG2VIDEO:
- if (m_hints.width <= CServiceBroker::GetSettings().GetInt(CSettings::SETTING_VIDEOPLAYER_USEAMCODECMPEG2))
+ if (m_hints.width <= CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_VIDEOPLAYER_USEAMCODECMPEG2))
goto FAIL;
m_mpeg2_sequence_pts = 0;
m_mpeg2_sequence = new mpeg2_sequence;
@@ -138,9 +138,9 @@ bool CDVDVideoCodecAmlogic::Open(CDVDStreamInfo &hints, CDVDCodecOptions &option
m_pFormatName = "am-mpeg2";
break;
case AV_CODEC_ID_H264:
- if (m_hints.width <= CServiceBroker::GetSettings().GetInt(CSettings::SETTING_VIDEOPLAYER_USEAMCODECH264))
+ if (m_hints.width <= CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_VIDEOPLAYER_USEAMCODECH264))
{
- CLog::Log(LOGDEBUG, "CDVDVideoCodecAmlogic::h264 size check failed %d",CServiceBroker::GetSettings().GetInt(CSettings::SETTING_VIDEOPLAYER_USEAMCODECH264));
+ CLog::Log(LOGDEBUG, "CDVDVideoCodecAmlogic::h264 size check failed %d",CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_VIDEOPLAYER_USEAMCODECH264));
goto FAIL;
}
switch(hints.profile)
@@ -182,7 +182,7 @@ bool CDVDVideoCodecAmlogic::Open(CDVDStreamInfo &hints, CDVDCodecOptions &option
case AV_CODEC_ID_MPEG4:
case AV_CODEC_ID_MSMPEG4V2:
case AV_CODEC_ID_MSMPEG4V3:
- if (m_hints.width <= CServiceBroker::GetSettings().GetInt(CSettings::SETTING_VIDEOPLAYER_USEAMCODECMPEG4))
+ if (m_hints.width <= CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_VIDEOPLAYER_USEAMCODECMPEG4))
goto FAIL;
m_pFormatName = "am-mpeg4";
break;
diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAndroidMediaCodec.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAndroidMediaCodec.cpp
index 3b77509fdc..0fc2158394 100644
--- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAndroidMediaCodec.cpp
+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAndroidMediaCodec.cpp
@@ -404,11 +404,11 @@ bool CDVDVideoCodecAndroidMediaCodec::Open(CDVDStreamInfo &hints, CDVDCodecOptio
CLog::Log(LOGERROR, "CDVDVideoCodecAndroidMediaCodec::Open - %s\n", "Surface does not support orientation before API 23");
goto FAIL;
}
- else if (!CServiceBroker::GetSettings().GetBool(CSettings::SETTING_VIDEOPLAYER_USEMEDIACODEC) &&
- !CServiceBroker::GetSettings().GetBool(CSettings::SETTING_VIDEOPLAYER_USEMEDIACODECSURFACE))
+ else if (!CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_VIDEOPLAYER_USEMEDIACODEC) &&
+ !CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_VIDEOPLAYER_USEMEDIACODECSURFACE))
goto FAIL;
- m_render_surface = CServiceBroker::GetSettings().GetBool(CSettings::SETTING_VIDEOPLAYER_USEMEDIACODECSURFACE);
+ m_render_surface = CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_VIDEOPLAYER_USEMEDIACODECSURFACE);
m_state = MEDIACODEC_STATE_UNINITIALIZED;
m_noPictureLoop = 0;
m_codecControlFlags = 0;
diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.cpp
index 3b0d0d832d..58d25829d3 100644
--- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.cpp
+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.cpp
@@ -132,14 +132,14 @@ CDVDVideoCodecDRMPRIME::~CDVDVideoCodecDRMPRIME()
CDVDVideoCodec* CDVDVideoCodecDRMPRIME::Create(CProcessInfo& processInfo)
{
- if (CServiceBroker::GetSettings().GetBool(CSettings::SETTING_VIDEOPLAYER_USEPRIMEDECODER))
+ if (CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_VIDEOPLAYER_USEPRIMEDECODER))
return new CDVDVideoCodecDRMPRIME(processInfo);
return nullptr;
}
void CDVDVideoCodecDRMPRIME::Register()
{
- CServiceBroker::GetSettings().GetSetting(CSettings::SETTING_VIDEOPLAYER_USEPRIMEDECODER)->SetVisible(true);
+ CServiceBroker::GetSettings()->GetSetting(CSettings::SETTING_VIDEOPLAYER_USEPRIMEDECODER)->SetVisible(true);
CDVDFactoryCodec::RegisterHWVideoCodec("drm_prime", CDVDVideoCodecDRMPRIME::Create);
}
diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DXVA.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DXVA.cpp
index 651f5c764c..51d38ad2d5 100644
--- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DXVA.cpp
+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DXVA.cpp
@@ -810,7 +810,7 @@ bool CDXVABufferPool::HasRefs()
IHardwareDecoder* CDecoder::Create(CDVDStreamInfo &hint, CProcessInfo &processInfo, AVPixelFormat fmt)
{
- if (DXVA::CDecoder::Supports(fmt) && CServiceBroker::GetSettings().GetBool(CSettings::SETTING_VIDEOPLAYER_USEDXVA2))
+ if (DXVA::CDecoder::Supports(fmt) && CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_VIDEOPLAYER_USEDXVA2))
return new CDecoder(processInfo);
return nullptr;
diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp
index 9428df6a32..1723460a09 100644
--- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp
+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp
@@ -334,13 +334,13 @@ bool CMMALVideo::SendCodecConfigData()
bool CMMALVideo::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options)
{
CSingleLock lock(m_sharedSection);
- CLog::Log(LOGDEBUG, LOGVIDEO, "%s::%s usemmal:%d options:%x %dx%d", CLASSNAME, __func__, CServiceBroker::GetSettings().GetBool(CSettings::SETTING_VIDEOPLAYER_USEMMAL), hints.codecOptions, hints.width, hints.height);
+ CLog::Log(LOGDEBUG, LOGVIDEO, "%s::%s usemmal:%d options:%x %dx%d", CLASSNAME, __func__, CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_VIDEOPLAYER_USEMMAL), hints.codecOptions, hints.width, hints.height);
// This occurs at start of m2ts files before streams have been fully identified - just ignore
if (!hints.width)
return false;
// we always qualify even if DVDFactoryCodec does this too.
- if (!CServiceBroker::GetSettings().GetBool(CSettings::SETTING_VIDEOPLAYER_USEMMAL) || (hints.codecOptions & CODEC_FORCE_SOFTWARE))
+ if (!CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_VIDEOPLAYER_USEMMAL) || (hints.codecOptions & CODEC_FORCE_SOFTWARE))
return false;
std::list<EINTERLACEMETHOD> deintMethods;
@@ -380,7 +380,7 @@ bool CMMALVideo::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options)
}
m_codingType = MMAL_ENCODING_H264;
m_pFormatName = "mmal-h264";
- if (CServiceBroker::GetSettings().GetBool(CSettings::SETTING_VIDEOPLAYER_SUPPORTMVC))
+ if (CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_VIDEOPLAYER_SUPPORTMVC))
{
m_codingType = MMAL_ENCODING_MVC;
m_pFormatName= "mmal-mvc";
diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/VAAPI.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/VAAPI.cpp
index 1b37621957..9b8099c8ec 100644
--- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/VAAPI.cpp
+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/VAAPI.cpp
@@ -511,8 +511,8 @@ bool CDecoder::Open(AVCodecContext* avctx, AVCodecContext* mainctx, const enum A
auto entry = settings_map.find(avctx->codec_id);
if (entry != settings_map.end())
{
- bool enabled = CServiceBroker::GetSettings().GetBool(entry->second) &&
- CServiceBroker::GetSettings().GetSetting(entry->second)->IsVisible();
+ bool enabled = CServiceBroker::GetSettings()->GetBool(entry->second) &&
+ CServiceBroker::GetSettings()->GetSetting(entry->second)->IsVisible();
if (!enabled)
return false;
}
@@ -1182,7 +1182,7 @@ void CDecoder::ReturnRenderPicture(CVaapiRenderPicture *renderPic)
IHardwareDecoder* CDecoder::Create(CDVDStreamInfo &hint, CProcessInfo &processInfo, AVPixelFormat fmt)
{
- if (fmt == AV_PIX_FMT_VAAPI_VLD && CServiceBroker::GetSettings().GetBool(SETTING_VIDEOPLAYER_USEVAAPI))
+ if (fmt == AV_PIX_FMT_VAAPI_VLD && CServiceBroker::GetSettings()->GetBool(SETTING_VIDEOPLAYER_USEVAAPI))
return new VAAPI::CDecoder(processInfo);
return nullptr;
@@ -1201,13 +1201,13 @@ void CDecoder::Register(IVaapiWinSystem *winSystem, bool deepColor)
CDVDFactoryCodec::RegisterHWAccel("vaapi", CDecoder::Create);
config.context->Release(nullptr);
- CServiceBroker::GetSettings().GetSetting(SETTING_VIDEOPLAYER_USEVAAPI)->SetVisible(true);
- CServiceBroker::GetSettings().GetSetting(SETTING_VIDEOPLAYER_USEVAAPIMPEG4)->SetVisible(true);
- CServiceBroker::GetSettings().GetSetting(SETTING_VIDEOPLAYER_USEVAAPIVC1)->SetVisible(true);
- CServiceBroker::GetSettings().GetSetting(SETTING_VIDEOPLAYER_USEVAAPIMPEG2)->SetVisible(true);
- CServiceBroker::GetSettings().GetSetting(SETTING_VIDEOPLAYER_USEVAAPIVP8)->SetVisible(true);
- CServiceBroker::GetSettings().GetSetting(SETTING_VIDEOPLAYER_USEVAAPIVP9)->SetVisible(true);
- CServiceBroker::GetSettings().GetSetting(SETTING_VIDEOPLAYER_USEVAAPIHEVC)->SetVisible(true);
+ CServiceBroker::GetSettings()->GetSetting(SETTING_VIDEOPLAYER_USEVAAPI)->SetVisible(true);
+ CServiceBroker::GetSettings()->GetSetting(SETTING_VIDEOPLAYER_USEVAAPIMPEG4)->SetVisible(true);
+ CServiceBroker::GetSettings()->GetSetting(SETTING_VIDEOPLAYER_USEVAAPIVC1)->SetVisible(true);
+ CServiceBroker::GetSettings()->GetSetting(SETTING_VIDEOPLAYER_USEVAAPIMPEG2)->SetVisible(true);
+ CServiceBroker::GetSettings()->GetSetting(SETTING_VIDEOPLAYER_USEVAAPIVP8)->SetVisible(true);
+ CServiceBroker::GetSettings()->GetSetting(SETTING_VIDEOPLAYER_USEVAAPIVP9)->SetVisible(true);
+ CServiceBroker::GetSettings()->GetSetting(SETTING_VIDEOPLAYER_USEVAAPIHEVC)->SetVisible(true);
}
//-----------------------------------------------------------------------------
@@ -2023,7 +2023,7 @@ void COutput::InitCycle()
}
if (!m_pp)
{
- const bool preferVaapiRender = CServiceBroker::GetSettings().GetBool(SETTING_VIDEOPLAYER_PREFERVAAPIRENDER);
+ const bool preferVaapiRender = CServiceBroker::GetSettings()->GetBool(SETTING_VIDEOPLAYER_PREFERVAAPIRENDER);
// For 1080p/i or below, always use CVppPostproc even when not deinterlacing
// Reason is: mesa cannot dynamically switch surfaces between use for VAAPI post-processing
// and use for direct export, so we run into trouble if we or the user want to switch
@@ -3149,7 +3149,7 @@ bool CFFmpegPostproc::UpdateDeintMethod(EINTERLACEMETHOD method)
else if (method == VS_INTERLACEMETHOD_RENDER_BOB)
return true;
else if (method == VS_INTERLACEMETHOD_NONE &&
- !CServiceBroker::GetSettings().GetBool(SETTING_VIDEOPLAYER_PREFERVAAPIRENDER))
+ !CServiceBroker::GetSettings()->GetBool(SETTING_VIDEOPLAYER_PREFERVAAPIRENDER))
return true;
return false;
diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/VDPAU.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/VDPAU.cpp
index ff55df5642..59954eebf0 100644
--- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/VDPAU.cpp
+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/VDPAU.cpp
@@ -510,8 +510,8 @@ bool CDecoder::Open(AVCodecContext* avctx, AVCodecContext* mainctx, const enum A
auto entry = settings_map.find(avctx->codec_id);
if (entry != settings_map.end())
{
- bool enabled = CServiceBroker::GetSettings().GetBool(entry->second) &&
- CServiceBroker::GetSettings().GetSetting(entry->second)->IsVisible();
+ bool enabled = CServiceBroker::GetSettings()->GetBool(entry->second) &&
+ CServiceBroker::GetSettings()->GetSetting(entry->second)->IsVisible();
if (!enabled)
return false;
}
@@ -1280,7 +1280,7 @@ bool CDecoder::CheckStatus(VdpStatus vdp_st, int line)
IHardwareDecoder* CDecoder::Create(CDVDStreamInfo &hint, CProcessInfo &processInfo, AVPixelFormat fmt)
{
- if (CDecoder::IsVDPAUFormat(fmt) && CServiceBroker::GetSettings().GetBool(CSettings::SETTING_VIDEOPLAYER_USEVDPAU))
+ if (CDecoder::IsVDPAUFormat(fmt) && CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_VIDEOPLAYER_USEVDPAU))
return new VDPAU::CDecoder(processInfo);
return nullptr;
@@ -1302,14 +1302,14 @@ void CDecoder::Register()
std::transform(gpuvendor.begin(), gpuvendor.end(), gpuvendor.begin(), ::tolower);
bool isNvidia = (gpuvendor.compare(0, 6, "nvidia") == 0);
- CServiceBroker::GetSettings().GetSetting(CSettings::SETTING_VIDEOPLAYER_USEVDPAU)->SetVisible(true);
+ CServiceBroker::GetSettings()->GetSetting(CSettings::SETTING_VIDEOPLAYER_USEVDPAU)->SetVisible(true);
if (!isNvidia)
{
- CServiceBroker::GetSettings().GetSetting(CSettings::SETTING_VIDEOPLAYER_USEVDPAUMPEG4)->SetVisible(true);
- CServiceBroker::GetSettings().GetSetting(CSettings::SETTING_VIDEOPLAYER_USEVDPAUVC1)->SetVisible(true);
- CServiceBroker::GetSettings().GetSetting(CSettings::SETTING_VIDEOPLAYER_USEVDPAUMPEG2)->SetVisible(true);
- CServiceBroker::GetSettings().GetSetting(CSettings::SETTING_VIDEOPLAYER_USEVDPAUMIXER)->SetVisible(true);
+ CServiceBroker::GetSettings()->GetSetting(CSettings::SETTING_VIDEOPLAYER_USEVDPAUMPEG4)->SetVisible(true);
+ CServiceBroker::GetSettings()->GetSetting(CSettings::SETTING_VIDEOPLAYER_USEVDPAUVC1)->SetVisible(true);
+ CServiceBroker::GetSettings()->GetSetting(CSettings::SETTING_VIDEOPLAYER_USEVDPAUMPEG2)->SetVisible(true);
+ CServiceBroker::GetSettings()->GetSetting(CSettings::SETTING_VIDEOPLAYER_USEVDPAUMIXER)->SetVisible(true);
}
}
@@ -2070,7 +2070,7 @@ void CMixer::SetColor()
}
VdpVideoMixerAttribute attributes[] = { VDP_VIDEO_MIXER_ATTRIBUTE_CSC_MATRIX };
- if (CServiceBroker::GetSettings().GetBool(CSettings::SETTING_VIDEOSCREEN_LIMITEDRANGE))
+ if (CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_VIDEOSCREEN_LIMITEDRANGE))
{
float studioCSC[3][4];
GenerateStudioCSCMatrix(colorStandard, studioCSC);
@@ -2195,7 +2195,7 @@ void CMixer::SetDeinterlacing()
SetDeintSkipChroma();
- m_config.useInteropYuv = !CServiceBroker::GetSettings().GetBool(CSettings::SETTING_VIDEOPLAYER_USEVDPAUMIXER);
+ m_config.useInteropYuv = !CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_VIDEOPLAYER_USEVDPAUMIXER);
std::string deintStr = GetDeintStrFromInterlaceMethod(method);
// update deinterlacing method used in processInfo (none if progressive)
@@ -2392,7 +2392,7 @@ void CMixer::Init()
m_vdpError = false;
m_config.upscale = g_advancedSettings.m_videoVDPAUScaling;
- m_config.useInteropYuv = !CServiceBroker::GetSettings().GetBool(CSettings::SETTING_VIDEOPLAYER_USEVDPAUMIXER);
+ m_config.useInteropYuv = !CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_VIDEOPLAYER_USEVDPAUMIXER);
CreateVdpauMixer();
diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/VTB.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/VTB.cpp
index 3e93cf6a29..1956920971 100644
--- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/VTB.cpp
+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/VTB.cpp
@@ -129,7 +129,7 @@ void CVideoBufferPoolVTB::Return(int id)
IHardwareDecoder* CDecoder::Create(CDVDStreamInfo &hint, CProcessInfo &processInfo, AVPixelFormat fmt)
{
- if (fmt == AV_PIX_FMT_VIDEOTOOLBOX && CServiceBroker::GetSettings().GetBool(CSettings::SETTING_VIDEOPLAYER_USEVTB))
+ if (fmt == AV_PIX_FMT_VIDEOTOOLBOX && CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_VIDEOPLAYER_USEVTB))
return new VTB::CDecoder(processInfo);
return nullptr;
@@ -161,7 +161,7 @@ void CDecoder::Close()
bool CDecoder::Open(AVCodecContext *avctx, AVCodecContext* mainctx, enum AVPixelFormat fmt)
{
- if (!CServiceBroker::GetSettings().GetBool(CSettings::SETTING_VIDEOPLAYER_USEVTB))
+ if (!CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_VIDEOPLAYER_USEVTB))
return false;
AVBufferRef *deviceRef = av_hwdevice_ctx_alloc(AV_HWDEVICE_TYPE_VIDEOTOOLBOX);
diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp
index d79cafc4f0..1663f0c809 100644
--- a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp
+++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp
@@ -1520,7 +1520,7 @@ CDemuxStream* CDVDDemuxFFmpeg::AddStream(int streamIdx)
}
case AVMEDIA_TYPE_SUBTITLE:
{
- if (pStream->codecpar->codec_id == AV_CODEC_ID_DVB_TELETEXT && CServiceBroker::GetSettings().GetBool(CSettings::SETTING_VIDEOPLAYER_TELETEXTENABLED))
+ if (pStream->codecpar->codec_id == AV_CODEC_ID_DVB_TELETEXT && CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_VIDEOPLAYER_TELETEXTENABLED))
{
CDemuxStreamTeletext* st = new CDemuxStreamTeletext();
stream = st;
@@ -1882,7 +1882,7 @@ unsigned int CDVDDemuxFFmpeg::HLSSelectProgram()
{
unsigned int prog = UINT_MAX;
- int bandwidth = CServiceBroker::GetSettings().GetInt(CSettings::SETTING_NETWORK_BANDWIDTH) * 1000;
+ int bandwidth = CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_NETWORK_BANDWIDTH) * 1000;
if (bandwidth <= 0)
bandwidth = INT_MAX;
diff --git a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamBluray.cpp b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamBluray.cpp
index 85d7e4c336..01f5b32572 100644
--- a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamBluray.cpp
+++ b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamBluray.cpp
@@ -274,7 +274,7 @@ bool CDVDInputStreamBluray::Open()
return false;
}
- int mode = CServiceBroker::GetSettings().GetInt(CSettings::SETTING_DISC_PLAYBACK);
+ int mode = CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_DISC_PLAYBACK);
if (URIUtils::HasExtension(filename, ".mpls"))
{
@@ -1093,7 +1093,7 @@ bool CDVDInputStreamBluray::HasMenu()
void CDVDInputStreamBluray::SetupPlayerSettings()
{
- int region = CServiceBroker::GetSettings().GetInt(CSettings::SETTING_BLURAY_PLAYERREGION);
+ int region = CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_BLURAY_PLAYERREGION);
if ( region != BLURAY_REGION_A
&& region != BLURAY_REGION_B
&& region != BLURAY_REGION_C)
diff --git a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamNavigator.cpp b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamNavigator.cpp
index fccced1872..7c9e73ac74 100644
--- a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamNavigator.cpp
+++ b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamNavigator.cpp
@@ -124,7 +124,7 @@ bool CDVDInputStreamNavigator::Open()
return false;
}
- int region = CServiceBroker::GetSettings().GetInt(CSettings::SETTING_DVDS_PLAYERREGION);
+ int region = CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_DVDS_PLAYERREGION);
int mask = 0;
if(region > 0)
mask = 1 << (region-1);
@@ -202,7 +202,7 @@ bool CDVDInputStreamNavigator::Open()
}
// jump directly to title menu
- if(CServiceBroker::GetSettings().GetBool(CSettings::SETTING_DVDS_AUTOMENU))
+ if(CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_DVDS_AUTOMENU))
{
int len, event;
uint8_t buf[2048];
diff --git a/xbmc/cores/VideoPlayer/DVDInputStreams/InputStreamPVRBase.cpp b/xbmc/cores/VideoPlayer/DVDInputStreams/InputStreamPVRBase.cpp
index 46ec8ed2fa..4c0df09662 100644
--- a/xbmc/cores/VideoPlayer/DVDInputStreams/InputStreamPVRBase.cpp
+++ b/xbmc/cores/VideoPlayer/DVDInputStreams/InputStreamPVRBase.cpp
@@ -322,7 +322,7 @@ void CInputStreamPVRBase::UpdateStreamMap()
dStream = streamSubtitle;
}
else if (stream.iCodecType == XBMC_CODEC_TYPE_RDS &&
- CServiceBroker::GetSettings().GetBool("pvrplayback.enableradiords"))
+ CServiceBroker::GetSettings()->GetBool("pvrplayback.enableradiords"))
{
std::shared_ptr<CDemuxStreamRadioRDS> streamRadioRDS;
diff --git a/xbmc/cores/VideoPlayer/DVDSubtitles/DVDSubtitlesLibass.cpp b/xbmc/cores/VideoPlayer/DVDSubtitles/DVDSubtitlesLibass.cpp
index a6a30c9d71..34882825d0 100644
--- a/xbmc/cores/VideoPlayer/DVDSubtitles/DVDSubtitlesLibass.cpp
+++ b/xbmc/cores/VideoPlayer/DVDSubtitles/DVDSubtitlesLibass.cpp
@@ -54,10 +54,10 @@ CDVDSubtitlesLibass::CDVDSubtitlesLibass()
return;
//Setting default font to the Arial in \media\fonts (used if FontConfig fails)
- strPath = URIUtils::AddFileToFolder("special://home/media/Fonts/", CServiceBroker::GetSettings().GetString(CSettings::SETTING_SUBTITLES_FONT));
+ strPath = URIUtils::AddFileToFolder("special://home/media/Fonts/", CServiceBroker::GetSettings()->GetString(CSettings::SETTING_SUBTITLES_FONT));
if (!XFILE::CFile::Exists(strPath))
- strPath = URIUtils::AddFileToFolder("special://xbmc/media/Fonts/", CServiceBroker::GetSettings().GetString(CSettings::SETTING_SUBTITLES_FONT));
- int fc = !CServiceBroker::GetSettings().GetBool(CSettings::SETTING_SUBTITLES_OVERRIDEASSFONTS);
+ strPath = URIUtils::AddFileToFolder("special://xbmc/media/Fonts/", CServiceBroker::GetSettings()->GetString(CSettings::SETTING_SUBTITLES_FONT));
+ int fc = !CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_SUBTITLES_OVERRIDEASSFONTS);
ass_set_margins(m_renderer, 0, 0, 0, 0);
ass_set_use_margins(m_renderer, 0);
diff --git a/xbmc/cores/VideoPlayer/VideoPlayer.cpp b/xbmc/cores/VideoPlayer/VideoPlayer.cpp
index a16eb99f40..2b51c80e5a 100644
--- a/xbmc/cores/VideoPlayer/VideoPlayer.cpp
+++ b/xbmc/cores/VideoPlayer/VideoPlayer.cpp
@@ -108,9 +108,9 @@ public:
*/
explicit PredicateSubtitleFilter(const std::string& lang, int subStream)
: audiolang(lang),
- original(StringUtils::EqualsNoCase(CServiceBroker::GetSettings().GetString(CSettings::SETTING_LOCALE_SUBTITLELANGUAGE), "original")),
- nosub(StringUtils::EqualsNoCase(CServiceBroker::GetSettings().GetString(CSettings::SETTING_LOCALE_SUBTITLELANGUAGE), "none")),
- onlyforced(StringUtils::EqualsNoCase(CServiceBroker::GetSettings().GetString(CSettings::SETTING_LOCALE_SUBTITLELANGUAGE), "forced_only")),
+ original(StringUtils::EqualsNoCase(CServiceBroker::GetSettings()->GetString(CSettings::SETTING_LOCALE_SUBTITLELANGUAGE), "original")),
+ nosub(StringUtils::EqualsNoCase(CServiceBroker::GetSettings()->GetString(CSettings::SETTING_LOCALE_SUBTITLELANGUAGE), "none")),
+ onlyforced(StringUtils::EqualsNoCase(CServiceBroker::GetSettings()->GetString(CSettings::SETTING_LOCALE_SUBTITLELANGUAGE), "forced_only")),
currentSubStream(subStream)
{
};
@@ -170,9 +170,9 @@ public:
, rh.type_index == currentAudioStream);
- if (!StringUtils::EqualsNoCase(CServiceBroker::GetSettings().GetString(CSettings::SETTING_LOCALE_AUDIOLANGUAGE), "mediadefault"))
+ if (!StringUtils::EqualsNoCase(CServiceBroker::GetSettings()->GetString(CSettings::SETTING_LOCALE_AUDIOLANGUAGE), "mediadefault"))
{
- if (!StringUtils::EqualsNoCase(CServiceBroker::GetSettings().GetString(CSettings::SETTING_LOCALE_AUDIOLANGUAGE), "original"))
+ if (!StringUtils::EqualsNoCase(CServiceBroker::GetSettings()->GetString(CSettings::SETTING_LOCALE_AUDIOLANGUAGE), "original"))
{
std::string audio_language = g_langInfo.GetAudioLanguage();
PREDICATE_RETURN(g_LangCodeExpander.CompareISO639Codes(audio_language, lh.language)
@@ -184,16 +184,16 @@ public:
rh.flags & StreamFlags::FLAG_ORIGINAL);
}
- bool hearingimp = CServiceBroker::GetSettings().GetBool(CSettings::SETTING_ACCESSIBILITY_AUDIOHEARING);
+ bool hearingimp = CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_ACCESSIBILITY_AUDIOHEARING);
PREDICATE_RETURN(!hearingimp ? !(lh.flags & StreamFlags::FLAG_HEARING_IMPAIRED) : lh.flags & StreamFlags::FLAG_HEARING_IMPAIRED
, !hearingimp ? !(rh.flags & StreamFlags::FLAG_HEARING_IMPAIRED) : rh.flags & StreamFlags::FLAG_HEARING_IMPAIRED);
- bool visualimp = CServiceBroker::GetSettings().GetBool(CSettings::SETTING_ACCESSIBILITY_AUDIOVISUAL);
+ bool visualimp = CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_ACCESSIBILITY_AUDIOVISUAL);
PREDICATE_RETURN(!visualimp ? !(lh.flags & StreamFlags::FLAG_VISUAL_IMPAIRED) : lh.flags & StreamFlags::FLAG_VISUAL_IMPAIRED
, !visualimp ? !(rh.flags & StreamFlags::FLAG_VISUAL_IMPAIRED) : rh.flags & StreamFlags::FLAG_VISUAL_IMPAIRED);
}
- if (CServiceBroker::GetSettings().GetBool(CSettings::SETTING_VIDEOPLAYER_PREFERDEFAULTFLAG))
+ if (CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_VIDEOPLAYER_PREFERDEFAULTFLAG))
{
PREDICATE_RETURN(lh.flags & StreamFlags::FLAG_DEFAULT,
rh.flags & StreamFlags::FLAG_DEFAULT);
@@ -240,7 +240,7 @@ private:
public:
explicit PredicateSubtitlePriority(const std::string& lang, int stream, bool ison)
: audiolang(lang),
- original(StringUtils::EqualsNoCase(CServiceBroker::GetSettings().GetString(CSettings::SETTING_LOCALE_SUBTITLELANGUAGE), "original")),
+ original(StringUtils::EqualsNoCase(CServiceBroker::GetSettings()->GetString(CSettings::SETTING_LOCALE_SUBTITLELANGUAGE), "original")),
subson(ison),
filter(lang, stream),
subStream(stream)
@@ -292,7 +292,7 @@ public:
PREDICATE_RETURN(g_LangCodeExpander.CompareISO639Codes(subtitle_language, lh.language)
, g_LangCodeExpander.CompareISO639Codes(subtitle_language, rh.language));
- bool hearingimp = CServiceBroker::GetSettings().GetBool(CSettings::SETTING_ACCESSIBILITY_SUBHEARING);
+ bool hearingimp = CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_ACCESSIBILITY_SUBHEARING);
PREDICATE_RETURN(!hearingimp ? !(lh.flags & StreamFlags::FLAG_HEARING_IMPAIRED) : lh.flags & StreamFlags::FLAG_HEARING_IMPAIRED
, !hearingimp ? !(rh.flags & StreamFlags::FLAG_HEARING_IMPAIRED) : rh.flags & StreamFlags::FLAG_HEARING_IMPAIRED);
}
@@ -652,7 +652,7 @@ CVideoPlayer::CVideoPlayer(IPlayerCallback& callback)
m_OmxPlayerState.threshold = 0.2f;
m_OmxPlayerState.interlace_method = VS_INTERLACEMETHOD_MAX;
#ifdef TARGET_RASPBERRY_PI
- m_omxplayer_mode = CServiceBroker::GetSettings().GetBool(CSettings::SETTING_VIDEOPLAYER_USEOMXPLAYER);
+ m_omxplayer_mode = CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_VIDEOPLAYER_USEOMXPLAYER);
#else
m_omxplayer_mode = false;
#endif
@@ -1276,7 +1276,7 @@ void CVideoPlayer::Prepare()
{
if (!m_OmxPlayerState.av_clock.OMXInitialize(&m_clock))
m_bAbortRequest = true;
- if (CServiceBroker::GetSettings().GetInt(CSettings::SETTING_VIDEOPLAYER_ADJUSTREFRESHRATE) != ADJUST_REFRESHRATE_OFF)
+ if (CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_VIDEOPLAYER_ADJUSTREFRESHRATE) != ADJUST_REFRESHRATE_OFF)
m_OmxPlayerState.av_clock.HDMIClockSync();
m_OmxPlayerState.av_clock.OMXStateIdle();
m_OmxPlayerState.av_clock.OMXStateExecute();
@@ -1590,7 +1590,7 @@ void CVideoPlayer::Process()
CheckBetterStream(m_CurrentRadioRDS, pStream);
// demux video stream
- if (CServiceBroker::GetSettings().GetBool(CSettings::SETTING_SUBTITLES_PARSECAPTIONS) && CheckIsCurrent(m_CurrentVideo, pStream, pPacket))
+ if (CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_SUBTITLES_PARSECAPTIONS) && CheckIsCurrent(m_CurrentVideo, pStream, pPacket))
{
if (m_pCCDemuxer)
{
@@ -3697,7 +3697,7 @@ bool CVideoPlayer::OpenVideoStream(CDVDStreamInfo& hint, bool reset)
// set framerate if not set by demuxer
if (hint.fpsrate == 0 || hint.fpsscale == 0)
{
- int fpsidx = CServiceBroker::GetSettings().GetInt(CSettings::SETTING_PVRPLAYBACK_FPS);
+ int fpsidx = CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_PVRPLAYBACK_FPS);
if (fpsidx == 1)
{
hint.fpsscale = 1000;
@@ -3732,7 +3732,7 @@ bool CVideoPlayer::OpenVideoStream(CDVDStreamInfo& hint, bool reset)
if (m_playerOptions.fullscreen && CServiceBroker::GetWinSystem()->GetGfxContext().IsFullScreenRoot() &&
hint.fpsrate != 0 && hint.fpsscale != 0)
{
- if (CServiceBroker::GetSettings().GetInt(CSettings::SETTING_VIDEOPLAYER_ADJUSTREFRESHRATE) != ADJUST_REFRESHRATE_OFF)
+ if (CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_VIDEOPLAYER_ADJUSTREFRESHRATE) != ADJUST_REFRESHRATE_OFF)
{
double framerate = DVD_TIME_BASE / CDVDCodecUtils::NormalizeFrameduration((double)DVD_TIME_BASE * hint.fpsscale / hint.fpsrate);
m_renderManager.TriggerUpdateResolution(static_cast<float>(framerate), hint.width, hint.stereo_mode);
@@ -4738,7 +4738,7 @@ void CVideoPlayer::UpdatePlayState(double timeout)
bool realtime = m_pInputStream->IsRealtime();
- if (CServiceBroker::GetSettings().GetBool(CSettings::SETTING_VIDEOPLAYER_USEDISPLAYASCLOCK) &&
+ if (CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_VIDEOPLAYER_USEDISPLAYASCLOCK) &&
!realtime)
{
state.cantempo = true;
diff --git a/xbmc/cores/VideoPlayer/VideoPlayerAudio.cpp b/xbmc/cores/VideoPlayer/VideoPlayerAudio.cpp
index 1cef284024..45fbb0cc5b 100644
--- a/xbmc/cores/VideoPlayer/VideoPlayerAudio.cpp
+++ b/xbmc/cores/VideoPlayer/VideoPlayerAudio.cpp
@@ -76,7 +76,7 @@ CVideoPlayerAudio::~CVideoPlayerAudio()
bool CVideoPlayerAudio::OpenStream(CDVDStreamInfo hints)
{
CLog::Log(LOGNOTICE, "Finding audio codec for: %i", hints.codec);
- bool allowpassthrough = !CServiceBroker::GetSettings().GetBool(CSettings::SETTING_VIDEOPLAYER_USEDISPLAYASCLOCK);
+ bool allowpassthrough = !CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_VIDEOPLAYER_USEDISPLAYASCLOCK);
if (m_processInfo.IsRealtimeStream())
allowpassthrough = false;
@@ -131,7 +131,7 @@ void CVideoPlayerAudio::OpenStream(CDVDStreamInfo &hints, CDVDAudioCodec* codec)
m_prevsynctype = -1;
m_synctype = SYNC_DISCON;
- if (CServiceBroker::GetSettings().GetBool(CSettings::SETTING_VIDEOPLAYER_USEDISPLAYASCLOCK))
+ if (CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_VIDEOPLAYER_USEDISPLAYASCLOCK))
m_synctype = SYNC_RESAMPLE;
else if (m_processInfo.IsRealtimeStream())
m_synctype = SYNC_RESAMPLE;
@@ -602,7 +602,7 @@ bool CVideoPlayerAudio::AcceptsData() const
bool CVideoPlayerAudio::SwitchCodecIfNeeded()
{
CLog::Log(LOGDEBUG, "CVideoPlayerAudio: stream props changed, checking for passthrough");
- bool allowpassthrough = !CServiceBroker::GetSettings().GetBool(CSettings::SETTING_VIDEOPLAYER_USEDISPLAYASCLOCK);
+ bool allowpassthrough = !CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_VIDEOPLAYER_USEDISPLAYASCLOCK);
if (m_processInfo.IsRealtimeStream() || m_synctype == SYNC_RESAMPLE)
allowpassthrough = false;
diff --git a/xbmc/cores/VideoPlayer/VideoPlayerRadioRDS.cpp b/xbmc/cores/VideoPlayer/VideoPlayerRadioRDS.cpp
index 7bb7ca665d..3c27059aa6 100644
--- a/xbmc/cores/VideoPlayer/VideoPlayerRadioRDS.cpp
+++ b/xbmc/cores/VideoPlayer/VideoPlayerRadioRDS.cpp
@@ -929,12 +929,12 @@ unsigned int CDVDRadioRDSData::DecodeTA_TP(uint8_t *msgElement)
bool traffic_announcement = (msgElement[3] & 1) != 0;
bool traffic_programme = (msgElement[3] & 2) != 0;
- if (traffic_announcement && !m_TA_TP_TrafficAdvisory && traffic_programme && dsn == 0 && CServiceBroker::GetSettings().GetBool("pvrplayback.trafficadvisory"))
+ if (traffic_announcement && !m_TA_TP_TrafficAdvisory && traffic_programme && dsn == 0 && CServiceBroker::GetSettings()->GetBool("pvrplayback.trafficadvisory"))
{
CGUIDialogKaiToast::QueueNotification(CGUIDialogKaiToast::Warning, g_localizeStrings.Get(19021), g_localizeStrings.Get(29930));
m_TA_TP_TrafficAdvisory = true;
m_TA_TP_TrafficVolume = g_application.GetVolume();
- float trafAdvVol = (float)CServiceBroker::GetSettings().GetInt("pvrplayback.trafficadvisoryvolume");
+ float trafAdvVol = (float)CServiceBroker::GetSettings()->GetInt("pvrplayback.trafficadvisoryvolume");
if (trafAdvVol)
g_application.SetVolume(m_TA_TP_TrafficVolume+trafAdvVol);
@@ -943,7 +943,7 @@ unsigned int CDVDRadioRDSData::DecodeTA_TP(uint8_t *msgElement)
CServiceBroker::GetAnnouncementManager()->Announce(ANNOUNCEMENT::PVR, "xbmc", "RDSRadioTA", data);
}
- if (!traffic_announcement && m_TA_TP_TrafficAdvisory && CServiceBroker::GetSettings().GetBool("pvrplayback.trafficadvisory"))
+ if (!traffic_announcement && m_TA_TP_TrafficAdvisory && CServiceBroker::GetSettings()->GetBool("pvrplayback.trafficadvisory"))
{
m_TA_TP_TrafficAdvisory = false;
g_application.SetVolume(m_TA_TP_TrafficVolume);
diff --git a/xbmc/cores/VideoPlayer/VideoReferenceClock.cpp b/xbmc/cores/VideoPlayer/VideoReferenceClock.cpp
index a77901fdc5..102e1657b2 100644
--- a/xbmc/cores/VideoPlayer/VideoReferenceClock.cpp
+++ b/xbmc/cores/VideoPlayer/VideoReferenceClock.cpp
@@ -41,7 +41,7 @@ CVideoReferenceClock::~CVideoReferenceClock()
void CVideoReferenceClock::Start()
{
- if(CServiceBroker::GetSettings().GetBool(CSettings::SETTING_VIDEOPLAYER_USEDISPLAYASCLOCK) && !IsRunning())
+ if(CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_VIDEOPLAYER_USEDISPLAYASCLOCK) && !IsRunning())
Create();
}
diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/BaseRenderer.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/BaseRenderer.cpp
index ae6a1ee347..940061a629 100644
--- a/xbmc/cores/VideoPlayer/VideoRenderers/BaseRenderer.cpp
+++ b/xbmc/cores/VideoPlayer/VideoRenderers/BaseRenderer.cpp
@@ -121,7 +121,7 @@ void CBaseRenderer::CalcNormalRenderRect(float offsetX, float offsetY, float wid
// allow a certain error to maximize size of render area
float fCorrection = width / height / outputFrameRatio - 1.0f;
- float fAllowed = CServiceBroker::GetSettings().GetInt(CSettings::SETTING_VIDEOPLAYER_ERRORINASPECT) * 0.01f;
+ float fAllowed = CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_VIDEOPLAYER_ERRORINASPECT) * 0.01f;
if (fCorrection > fAllowed)
fCorrection = fAllowed;
if (fCorrection < -fAllowed)
@@ -380,7 +380,7 @@ void CBaseRenderer::SetViewMode(int viewMode)
CDisplaySettings::GetInstance().SetNonLinearStretched(false);
if (m_videoSettings.m_ViewMode == ViewModeZoom ||
- (is43 && CServiceBroker::GetSettings().GetInt(CSettings::SETTING_VIDEOPLAYER_STRETCH43) == ViewModeZoom))
+ (is43 && CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_VIDEOPLAYER_STRETCH43) == ViewModeZoom))
{ // zoom image so no black bars
CDisplaySettings::GetInstance().SetPixelRatio(1.0);
// calculate the desired output ratio
@@ -404,7 +404,7 @@ void CBaseRenderer::SetViewMode(int viewMode)
CDisplaySettings::GetInstance().SetPixelRatio((4.0f / 3.0f) / sourceFrameRatio);
}
else if (m_videoSettings.m_ViewMode == ViewModeWideZoom ||
- (is43 && CServiceBroker::GetSettings().GetInt(CSettings::SETTING_VIDEOPLAYER_STRETCH43) == ViewModeWideZoom))
+ (is43 && CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_VIDEOPLAYER_STRETCH43) == ViewModeWideZoom))
{ // super zoom
float stretchAmount = (screenWidth / screenHeight) * info.fPixelRatio / sourceFrameRatio;
CDisplaySettings::GetInstance().SetPixelRatio(pow(stretchAmount, float(2.0/3.0)));
@@ -413,14 +413,14 @@ void CBaseRenderer::SetViewMode(int viewMode)
}
else if (m_videoSettings.m_ViewMode == ViewModeStretch16x9 ||
m_videoSettings.m_ViewMode == ViewModeStretch16x9Nonlin ||
- (is43 && (CServiceBroker::GetSettings().GetInt(CSettings::SETTING_VIDEOPLAYER_STRETCH43) == ViewModeStretch16x9 ||
- CServiceBroker::GetSettings().GetInt(CSettings::SETTING_VIDEOPLAYER_STRETCH43) == ViewModeStretch16x9Nonlin)))
+ (is43 && (CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_VIDEOPLAYER_STRETCH43) == ViewModeStretch16x9 ||
+ CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_VIDEOPLAYER_STRETCH43) == ViewModeStretch16x9Nonlin)))
{ // stretch image to 16:9 ratio
CDisplaySettings::GetInstance().SetZoomAmount(1.0);
// stretch to the limits of the 16:9 screen.
// incorrect behaviour, but it's what the users want, so...
CDisplaySettings::GetInstance().SetPixelRatio((screenWidth / screenHeight) * info.fPixelRatio / sourceFrameRatio);
- bool nonlin = (is43 && CServiceBroker::GetSettings().GetInt(CSettings::SETTING_VIDEOPLAYER_STRETCH43) == ViewModeStretch16x9Nonlin) ||
+ bool nonlin = (is43 && CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_VIDEOPLAYER_STRETCH43) == ViewModeStretch16x9Nonlin) ||
m_videoSettings.m_ViewMode == ViewModeStretch16x9Nonlin;
CDisplaySettings::GetInstance().SetNonLinearStretched(nonlin);
}
diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/ColorManager.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/ColorManager.cpp
index 7ca653e48e..76b811a146 100644
--- a/xbmc/cores/VideoPlayer/VideoRenderers/ColorManager.cpp
+++ b/xbmc/cores/VideoPlayer/VideoRenderers/ColorManager.cpp
@@ -45,20 +45,20 @@ CColorManager::~CColorManager()
bool CColorManager::IsEnabled() const
{
- return CServiceBroker::GetSettings().GetBool("videoscreen.cmsenabled") && IsValid();
+ return CServiceBroker::GetSettings()->GetBool("videoscreen.cmsenabled") && IsValid();
}
bool CColorManager::IsValid() const
{
- if (!CServiceBroker::GetSettings().GetBool("videoscreen.cmsenabled"))
+ if (!CServiceBroker::GetSettings()->GetBool("videoscreen.cmsenabled"))
return true;
- int cmsmode = CServiceBroker::GetSettings().GetInt("videoscreen.cmsmode");
+ int cmsmode = CServiceBroker::GetSettings()->GetInt("videoscreen.cmsmode");
switch (cmsmode)
{
case CMS_MODE_3DLUT:
{
- std::string fileName = CServiceBroker::GetSettings().GetString("videoscreen.cms3dlut");
+ std::string fileName = CServiceBroker::GetSettings()->GetString("videoscreen.cms3dlut");
if (fileName.empty())
return false;
if (!CFile::Exists(fileName))
@@ -68,7 +68,7 @@ bool CColorManager::IsValid() const
#if defined(HAVE_LCMS2)
case CMS_MODE_PROFILE:
{
- int cmslutsize = CServiceBroker::GetSettings().GetInt("videoscreen.cmslutsize");
+ int cmslutsize = CServiceBroker::GetSettings()->GetInt("videoscreen.cmslutsize");
if (cmslutsize <= 0)
return false;
return true;
@@ -98,12 +98,12 @@ CMS_PRIMARIES videoFlagsToPrimaries(int flags)
bool CColorManager::Get3dLutSize(CMS_DATA_FORMAT format, int *clutSize, int *dataSize)
{
- int cmsmode = CServiceBroker::GetSettings().GetInt("videoscreen.cmsmode");
+ int cmsmode = CServiceBroker::GetSettings()->GetInt("videoscreen.cmsmode");
switch (cmsmode)
{
case CMS_MODE_3DLUT:
{
- std::string fileName = CServiceBroker::GetSettings().GetString("videoscreen.cms3dlut");
+ std::string fileName = CServiceBroker::GetSettings()->GetString("videoscreen.cms3dlut");
if (fileName.empty())
return false;
@@ -123,7 +123,7 @@ bool CColorManager::Get3dLutSize(CMS_DATA_FORMAT format, int *clutSize, int *dat
}
case CMS_MODE_PROFILE:
{
- int cmslutsize = CServiceBroker::GetSettings().GetInt("videoscreen.cmslutsize");
+ int cmslutsize = CServiceBroker::GetSettings()->GetInt("videoscreen.cmslutsize");
if (cmslutsize <= 0)
return false;
@@ -148,11 +148,11 @@ bool CColorManager::GetVideo3dLut(int videoFlags, int *cmsToken, CMS_DATA_FORMAT
{
CMS_PRIMARIES videoPrimaries = videoFlagsToPrimaries(videoFlags);
CLog::Log(LOGDEBUG, "ColorManager: video primaries: %d\n", (int)videoPrimaries);
- switch (CServiceBroker::GetSettings().GetInt("videoscreen.cmsmode"))
+ switch (CServiceBroker::GetSettings()->GetInt("videoscreen.cmsmode"))
{
case CMS_MODE_3DLUT:
CLog::Log(LOGDEBUG, "ColorManager: CMS_MODE_3DLUT\n");
- m_cur3dlutFile = CServiceBroker::GetSettings().GetString("videoscreen.cms3dlut");
+ m_cur3dlutFile = CServiceBroker::GetSettings()->GetString("videoscreen.cms3dlut");
if (!Load3dLut(m_cur3dlutFile, format, clutSize, clutData))
return false;
m_curCmsMode = CMS_MODE_3DLUT;
@@ -163,13 +163,13 @@ bool CColorManager::GetVideo3dLut(int videoFlags, int *cmsToken, CMS_DATA_FORMAT
#if defined(HAVE_LCMS2)
{
// check if display profile is not loaded, or has changed
- if (m_curIccProfile != CServiceBroker::GetSettings().GetString("videoscreen.displayprofile"))
+ if (m_curIccProfile != CServiceBroker::GetSettings()->GetString("videoscreen.displayprofile"))
{
// free old profile if there is one
if (m_hProfile)
cmsCloseProfile(m_hProfile);
// load profile
- m_hProfile = LoadIccDisplayProfile(CServiceBroker::GetSettings().GetString("videoscreen.displayprofile"));
+ m_hProfile = LoadIccDisplayProfile(CServiceBroker::GetSettings()->GetString("videoscreen.displayprofile"));
if (!m_hProfile)
return false;
// detect blackpoint
@@ -177,18 +177,18 @@ bool CColorManager::GetVideo3dLut(int videoFlags, int *cmsToken, CMS_DATA_FORMAT
{
CLog::Log(LOGDEBUG, "ColorManager: black point: %f\n", m_blackPoint.Y);
}
- m_curIccProfile = CServiceBroker::GetSettings().GetString("videoscreen.displayprofile");
+ m_curIccProfile = CServiceBroker::GetSettings()->GetString("videoscreen.displayprofile");
}
// create gamma curve
cmsToneCurve* gammaCurve;
- m_m_curIccGammaMode = (CMS_TRC_TYPE)CServiceBroker::GetSettings().GetInt("videoscreen.cmsgammamode");
- m_curIccGamma = CServiceBroker::GetSettings().GetInt("videoscreen.cmsgamma");
+ m_m_curIccGammaMode = (CMS_TRC_TYPE)CServiceBroker::GetSettings()->GetInt("videoscreen.cmsgammamode");
+ m_curIccGamma = CServiceBroker::GetSettings()->GetInt("videoscreen.cmsgamma");
gammaCurve =
CreateToneCurve(m_m_curIccGammaMode, m_curIccGamma/100.0f, m_blackPoint);
// create source profile
- m_curIccWhitePoint = (CMS_WHITEPOINT)CServiceBroker::GetSettings().GetInt("videoscreen.cmswhitepoint");
- m_curIccPrimaries = (CMS_PRIMARIES)CServiceBroker::GetSettings().GetInt("videoscreen.cmsprimaries");
+ m_curIccWhitePoint = (CMS_WHITEPOINT)CServiceBroker::GetSettings()->GetInt("videoscreen.cmswhitepoint");
+ m_curIccPrimaries = (CMS_PRIMARIES)CServiceBroker::GetSettings()->GetInt("videoscreen.cmsprimaries");
CLog::Log(LOGDEBUG, "ColorManager: primaries setting: %d\n", (int)m_curIccPrimaries);
if (m_curIccPrimaries == CMS_PRIMARIES_AUTO)
m_curIccPrimaries = videoPrimaries;
@@ -217,7 +217,7 @@ bool CColorManager::GetVideo3dLut(int videoFlags, int *cmsToken, CMS_DATA_FORMAT
#endif //defined(HAVE_LCMS2)
default:
- CLog::Log(LOGDEBUG, "ColorManager: unknown CMS mode %d\n", CServiceBroker::GetSettings().GetInt("videoscreen.cmsmode"));
+ CLog::Log(LOGDEBUG, "ColorManager: unknown CMS mode %d\n", CServiceBroker::GetSettings()->GetInt("videoscreen.cmsmode"));
return false;
}
@@ -232,31 +232,31 @@ bool CColorManager::CheckConfiguration(int cmsToken, int flags)
{
if (cmsToken != m_curCmsToken)
return false;
- if (m_curCmsMode != CServiceBroker::GetSettings().GetInt("videoscreen.cmsmode"))
+ if (m_curCmsMode != CServiceBroker::GetSettings()->GetInt("videoscreen.cmsmode"))
return false; // CMS mode has changed
switch (m_curCmsMode)
{
case CMS_MODE_3DLUT:
- if (m_cur3dlutFile != CServiceBroker::GetSettings().GetString("videoscreen.cms3dlut"))
+ if (m_cur3dlutFile != CServiceBroker::GetSettings()->GetString("videoscreen.cms3dlut"))
return false; // different 3dlut file selected
break;
case CMS_MODE_PROFILE:
#if defined(HAVE_LCMS2)
- if (m_curIccProfile != CServiceBroker::GetSettings().GetString("videoscreen.displayprofile"))
+ if (m_curIccProfile != CServiceBroker::GetSettings()->GetString("videoscreen.displayprofile"))
return false; // different ICC profile selected
- if (m_curIccWhitePoint != CServiceBroker::GetSettings().GetInt("videoscreen.cmswhitepoint"))
+ if (m_curIccWhitePoint != CServiceBroker::GetSettings()->GetInt("videoscreen.cmswhitepoint"))
return false; // whitepoint changed
{
- CMS_PRIMARIES primaries = (CMS_PRIMARIES)CServiceBroker::GetSettings().GetInt("videoscreen.cmsprimaries");
+ CMS_PRIMARIES primaries = (CMS_PRIMARIES)CServiceBroker::GetSettings()->GetInt("videoscreen.cmsprimaries");
if (primaries == CMS_PRIMARIES_AUTO) primaries = videoFlagsToPrimaries(flags);
if (m_curIccPrimaries != primaries)
return false; // primaries changed
}
- if (m_m_curIccGammaMode != (CMS_TRC_TYPE)CServiceBroker::GetSettings().GetInt("videoscreen.cmsgammamode"))
+ if (m_m_curIccGammaMode != (CMS_TRC_TYPE)CServiceBroker::GetSettings()->GetInt("videoscreen.cmsgammamode"))
return false; // gamma mode changed
- if (m_curIccGamma != CServiceBroker::GetSettings().GetInt("videoscreen.cmsgamma"))
+ if (m_curIccGamma != CServiceBroker::GetSettings()->GetInt("videoscreen.cmsgamma"))
return false; // effective gamma changed
- if (m_curClutSize != 1 << CServiceBroker::GetSettings().GetInt("videoscreen.cmslutsize"))
+ if (m_curClutSize != 1 << CServiceBroker::GetSettings()->GetInt("videoscreen.cmslutsize"))
return false; // CLUT size changed
// TODO: check other parameters
#else //defined(HAVE_LCMS2)
diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp
index 249867b11b..ced559ce33 100644
--- a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp
+++ b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp
@@ -553,7 +553,7 @@ bool CMMALRenderer::CheckConfigurationVout(uint32_t width, uint32_t height, uint
return false;
}
- if (!m_queue_render && !CServiceBroker::GetSettings().GetBool("videoplayer.usedisplayasclock"))
+ if (!m_queue_render && !CServiceBroker::GetSettings()->GetBool("videoplayer.usedisplayasclock"))
{
m_queue_render = mmal_queue_create();
CThread::Create();
diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererDRMPRIME.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererDRMPRIME.cpp
index 2b914c9523..1e850cffd8 100644
--- a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererDRMPRIME.cpp
+++ b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererDRMPRIME.cpp
@@ -29,7 +29,7 @@ CRendererDRMPRIME::~CRendererDRMPRIME()
CBaseRenderer* CRendererDRMPRIME::Create(CVideoBuffer* buffer)
{
if (buffer && dynamic_cast<CVideoBufferDRMPRIME*>(buffer) &&
- CServiceBroker::GetSettings().GetInt(SETTING_VIDEOPLAYER_USEPRIMERENDERER) == 0)
+ CServiceBroker::GetSettings()->GetInt(SETTING_VIDEOPLAYER_USEPRIMERENDERER) == 0)
{
CWinSystemGbmEGLContext* winSystem = dynamic_cast<CWinSystemGbmEGLContext*>(CServiceBroker::GetWinSystem());
if (winSystem && winSystem->GetDrm()->GetPrimaryPlane()->plane &&
@@ -46,7 +46,7 @@ void CRendererDRMPRIME::Register()
if (winSystem && winSystem->GetDrm()->GetPrimaryPlane()->plane &&
std::dynamic_pointer_cast<CDRMAtomic>(winSystem->GetDrm()))
{
- CServiceBroker::GetSettings().GetSetting(SETTING_VIDEOPLAYER_USEPRIMERENDERER)->SetVisible(true);
+ CServiceBroker::GetSettings()->GetSetting(SETTING_VIDEOPLAYER_USEPRIMERENDERER)->SetVisible(true);
VIDEOPLAYER::CRendererFactory::RegisterRenderer("drm_prime", CRendererDRMPRIME::Create);
return;
}
diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererVDPAU.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererVDPAU.cpp
index ec823c7045..03b367d3db 100644
--- a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererVDPAU.cpp
+++ b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererVDPAU.cpp
@@ -115,7 +115,7 @@ bool CRendererVDPAU::Supports(ERENDERFEATURE feature)
if(feature == RENDERFEATURE_BRIGHTNESS ||
feature == RENDERFEATURE_CONTRAST)
{
- if (!m_isYuv && !CServiceBroker::GetSettings().GetBool(CSettings::SETTING_VIDEOSCREEN_LIMITEDRANGE))
+ if (!m_isYuv && !CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_VIDEOSCREEN_LIMITEDRANGE))
return true;
return (m_renderMethod & RENDER_GLSL);
@@ -160,7 +160,7 @@ bool CRendererVDPAU::Supports(ESCALINGMETHOD method)
// if scaling is below level, avoid hq scaling
float scaleX = fabs(((float)m_sourceWidth - m_destRect.Width())/m_sourceWidth)*100;
float scaleY = fabs(((float)m_sourceHeight - m_destRect.Height())/m_sourceHeight)*100;
- int minScale = CServiceBroker::GetSettings().GetInt("videoplayer.hqscalers");
+ int minScale = CServiceBroker::GetSettings()->GetInt("videoplayer.hqscalers");
if (scaleX < minScale && scaleY < minScale)
return false;
diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/LinuxRendererGL.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/LinuxRendererGL.cpp
index 1440bde494..2481137c60 100644
--- a/xbmc/cores/VideoPlayer/VideoRenderers/LinuxRendererGL.cpp
+++ b/xbmc/cores/VideoPlayer/VideoRenderers/LinuxRendererGL.cpp
@@ -116,8 +116,8 @@ CLinuxRendererGL::CLinuxRendererGL()
m_iFlags = 0;
m_format = AV_PIX_FMT_NONE;
- m_useDithering = CServiceBroker::GetSettings().GetBool("videoscreen.dither");
- m_ditherDepth = CServiceBroker::GetSettings().GetInt("videoscreen.ditherdepth");
+ m_useDithering = CServiceBroker::GetSettings()->GetBool("videoscreen.dither");
+ m_ditherDepth = CServiceBroker::GetSettings()->GetInt("videoscreen.ditherdepth");
m_fullRange = !CServiceBroker::GetWinSystem()->UseLimitedColor();
m_fbo.width = 0.0;
@@ -874,7 +874,7 @@ void CLinuxRendererGL::LoadShaders(int field)
if (!LoadShadersHook())
{
- int requestedMethod = CServiceBroker::GetSettings().GetInt(CSettings::SETTING_VIDEOPLAYER_RENDERMETHOD);
+ int requestedMethod = CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_VIDEOPLAYER_RENDERMETHOD);
CLog::Log(LOGDEBUG, "GL: Requested render method: %d", requestedMethod);
if (m_pYUVShader)
@@ -2603,7 +2603,7 @@ bool CLinuxRendererGL::Supports(ESCALINGMETHOD method)
// if scaling is below level, avoid hq scaling
float scaleX = fabs(((float)m_sourceWidth - m_destRect.Width())/m_sourceWidth)*100;
float scaleY = fabs(((float)m_sourceHeight - m_destRect.Height())/m_sourceHeight)*100;
- int minScale = CServiceBroker::GetSettings().GetInt(CSettings::SETTING_VIDEOPLAYER_HQSCALERS);
+ int minScale = CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_VIDEOPLAYER_HQSCALERS);
if (scaleX < minScale && scaleY < minScale)
return false;
diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/LinuxRendererGLES.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/LinuxRendererGLES.cpp
index ac92ad06e3..109897e8db 100644
--- a/xbmc/cores/VideoPlayer/VideoRenderers/LinuxRendererGLES.cpp
+++ b/xbmc/cores/VideoPlayer/VideoRenderers/LinuxRendererGLES.cpp
@@ -517,7 +517,7 @@ void CLinuxRendererGLES::LoadShaders(int field)
if (!LoadShadersHook())
{
- int requestedMethod = CServiceBroker::GetSettings().GetInt(CSettings::SETTING_VIDEOPLAYER_RENDERMETHOD);
+ int requestedMethod = CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_VIDEOPLAYER_RENDERMETHOD);
CLog::Log(LOGDEBUG, "GLES: Requested render method: %d", requestedMethod);
ReleaseShaders();
@@ -1504,7 +1504,7 @@ bool CLinuxRendererGLES::Supports(ESCALINGMETHOD method)
// if scaling is below level, avoid hq scaling
float scaleX = fabs(((float)m_sourceWidth - m_destRect.Width())/m_sourceWidth)*100;
float scaleY = fabs(((float)m_sourceHeight - m_destRect.Height())/m_sourceHeight)*100;
- int minScale = CServiceBroker::GetSettings().GetInt(CSettings::SETTING_VIDEOPLAYER_HQSCALERS);
+ int minScale = CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_VIDEOPLAYER_HQSCALERS);
if (scaleX < minScale && scaleY < minScale)
return false;
diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/OverlayRenderer.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/OverlayRenderer.cpp
index 130b88111f..6afcba268b 100644
--- a/xbmc/cores/VideoPlayer/VideoRenderers/OverlayRenderer.cpp
+++ b/xbmc/cores/VideoPlayer/VideoRenderers/OverlayRenderer.cpp
@@ -165,7 +165,7 @@ void CRenderer::Render(int idx)
float total_height = 0.0f;
float cur_height = 0.0f;
- int subalign = CServiceBroker::GetSettings().GetInt(CSettings::SETTING_SUBTITLES_ALIGN);
+ int subalign = CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_SUBTITLES_ALIGN);
for (std::vector<COverlay*>::iterator it = render.begin(); it != render.end(); ++it)
{
COverlay* o = nullptr;
@@ -174,8 +174,8 @@ void CRenderer::Render(int idx)
{
// Compute the color to be used for the overlay background (depending on the opacity)
- UTILS::Color bgcolor = bgcolors[CServiceBroker::GetSettings().GetInt(CSettings::SETTING_SUBTITLES_BGCOLOR)];
- int bgopacity = CServiceBroker::GetSettings().GetInt(CSettings::SETTING_SUBTITLES_BGOPACITY);
+ UTILS::Color bgcolor = bgcolors[CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_SUBTITLES_BGCOLOR)];
+ int bgopacity = CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_SUBTITLES_BGOPACITY);
if (bgopacity > 0 && bgopacity < 100)
{
bgcolor = ColorUtils::ChangeOpacity(bgcolor, bgopacity / 100.0f);
@@ -185,10 +185,10 @@ void CRenderer::Render(int idx)
bgcolor = UTILS::COLOR::NONE;
}
- text->PrepareRender(CServiceBroker::GetSettings().GetString(CSettings::SETTING_SUBTITLES_FONT),
- CServiceBroker::GetSettings().GetInt(CSettings::SETTING_SUBTITLES_COLOR),
- CServiceBroker::GetSettings().GetInt(CSettings::SETTING_SUBTITLES_HEIGHT),
- CServiceBroker::GetSettings().GetInt(CSettings::SETTING_SUBTITLES_STYLE),
+ text->PrepareRender(CServiceBroker::GetSettings()->GetString(CSettings::SETTING_SUBTITLES_FONT),
+ CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_SUBTITLES_COLOR),
+ CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_SUBTITLES_HEIGHT),
+ CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_SUBTITLES_STYLE),
m_font, m_fontBorder, bgcolor);
o = text;
}
@@ -342,7 +342,7 @@ COverlay* CRenderer::Convert(CDVDOverlaySSA* o, double pts)
int targetHeight = MathUtils::round_int(m_rv.Height());
int useMargin;
- int subalign = CServiceBroker::GetSettings().GetInt(CSettings::SETTING_SUBTITLES_ALIGN);
+ int subalign = CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_SUBTITLES_ALIGN);
if(subalign == SUBTITLE_ALIGN_BOTTOM_OUTSIDE
|| subalign == SUBTITLE_ALIGN_TOP_OUTSIDE
||(subalign == SUBTITLE_ALIGN_MANUAL && g_advancedSettings.m_videoAssFixedWorks))
diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/OverlayRendererGUI.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/OverlayRendererGUI.cpp
index e5a5307d17..0c57a2b15c 100644
--- a/xbmc/cores/VideoPlayer/VideoRenderers/OverlayRendererGUI.cpp
+++ b/xbmc/cores/VideoPlayer/VideoRenderers/OverlayRendererGUI.cpp
@@ -105,7 +105,7 @@ COverlayText::COverlayText(CDVDOverlayText * src)
StringUtils::Replace(m_text, "</b", "[/B]");
StringUtils::Replace(m_text, "</u", "");
- m_subalign = CServiceBroker::GetSettings().GetInt(CSettings::SETTING_SUBTITLES_ALIGN);
+ m_subalign = CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_SUBTITLES_ALIGN);
if (m_subalign == SUBTITLE_ALIGN_MANUAL)
{
m_align = ALIGN_SUBTITLE;
diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/OverlayRendererUtil.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/OverlayRendererUtil.cpp
index c52aba4705..b6b6659ab3 100644
--- a/xbmc/cores/VideoPlayer/VideoRenderers/OverlayRendererUtil.cpp
+++ b/xbmc/cores/VideoPlayer/VideoRenderers/OverlayRendererUtil.cpp
@@ -290,7 +290,7 @@ int GetStereoscopicDepth()
if(CServiceBroker::GetWinSystem()->GetGfxContext().GetStereoMode() != RENDER_STEREO_MODE_MONO
&& CServiceBroker::GetWinSystem()->GetGfxContext().GetStereoMode() != RENDER_STEREO_MODE_OFF)
{
- depth = CServiceBroker::GetSettings().GetInt(CSettings::SETTING_SUBTITLES_STEREOSCOPICDEPTH);
+ depth = CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_SUBTITLES_STEREOSCOPICDEPTH);
depth *= (CServiceBroker::GetWinSystem()->GetGfxContext().GetStereoView() == RENDER_STEREO_VIEW_LEFT ? 1 : -1);
}
diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/RenderManager.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/RenderManager.cpp
index 2110611ccf..69bfafd6ef 100644
--- a/xbmc/cores/VideoPlayer/VideoRenderers/RenderManager.cpp
+++ b/xbmc/cores/VideoPlayer/VideoRenderers/RenderManager.cpp
@@ -675,7 +675,7 @@ RESOLUTION CRenderManager::GetResolution()
if (m_renderState == STATE_UNCONFIGURED)
return res;
- if (CServiceBroker::GetSettings().GetInt(CSettings::SETTING_VIDEOPLAYER_ADJUSTREFRESHRATE) != ADJUST_REFRESHRATE_OFF)
+ if (CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_VIDEOPLAYER_ADJUSTREFRESHRATE) != ADJUST_REFRESHRATE_OFF)
res = CResolutionUtils::ChooseBestResolution(m_fps, m_width, m_height, !m_stereomode.empty());
return res;
@@ -863,7 +863,7 @@ void CRenderManager::UpdateResolution()
{
if (CServiceBroker::GetWinSystem()->GetGfxContext().IsFullScreenVideo() && CServiceBroker::GetWinSystem()->GetGfxContext().IsFullScreenRoot())
{
- if (CServiceBroker::GetSettings().GetInt(CSettings::SETTING_VIDEOPLAYER_ADJUSTREFRESHRATE) != ADJUST_REFRESHRATE_OFF && m_fps > 0.0f)
+ if (CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_VIDEOPLAYER_ADJUSTREFRESHRATE) != ADJUST_REFRESHRATE_OFF && m_fps > 0.0f)
{
RESOLUTION res = CResolutionUtils::ChooseBestResolution(m_fps, m_width, m_height, !m_stereomode.empty());
CServiceBroker::GetWinSystem()->GetGfxContext().SetVideoResolution(res, false);
diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/WinRenderer.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/WinRenderer.cpp
index aca6daaf23..b55f294003 100644
--- a/xbmc/cores/VideoPlayer/VideoRenderers/WinRenderer.cpp
+++ b/xbmc/cores/VideoPlayer/VideoRenderers/WinRenderer.cpp
@@ -94,8 +94,8 @@ CWinRenderer::CWinRenderer() : CBaseRenderer()
m_colorManager = std::make_unique<CColorManager>();
m_outputShader.reset();
- m_useDithering = CServiceBroker::GetSettings().GetBool("videoscreen.dither");
- m_ditherDepth = CServiceBroker::GetSettings().GetInt("videoscreen.ditherdepth");
+ m_useDithering = CServiceBroker::GetSettings()->GetBool("videoscreen.dither");
+ m_ditherDepth = CServiceBroker::GetSettings()->GetInt("videoscreen.ditherdepth");
PreInit();
}
@@ -327,7 +327,7 @@ void CWinRenderer::PreInit()
m_bConfigured = false;
UnInit();
- m_iRequestedMethod = CServiceBroker::GetSettings().GetInt(CSettings::SETTING_VIDEOPLAYER_RENDERMETHOD);
+ m_iRequestedMethod = CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_VIDEOPLAYER_RENDERMETHOD);
m_processor = std::make_unique<DXVA::CProcessorHD>();
if (!m_processor->PreInit())
@@ -1090,7 +1090,7 @@ bool CWinRenderer::Supports(ESCALINGMETHOD method)
// if scaling is below level, avoid hq scaling
float scaleX = fabs((static_cast<float>(m_sourceWidth) - m_destRect.Width())/m_sourceWidth)*100;
float scaleY = fabs((static_cast<float>(m_sourceHeight) - m_destRect.Height())/m_sourceHeight)*100;
- int minScale = CServiceBroker::GetSettings().GetInt(CSettings::SETTING_VIDEOPLAYER_HQSCALERS);
+ int minScale = CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_VIDEOPLAYER_HQSCALERS);
if (scaleX < minScale && scaleY < minScale)
return false;
return true;
diff --git a/xbmc/cores/omxplayer/OMXAudio.cpp b/xbmc/cores/omxplayer/OMXAudio.cpp
index 83d81a94ce..51f04ab587 100644
--- a/xbmc/cores/omxplayer/OMXAudio.cpp
+++ b/xbmc/cores/omxplayer/OMXAudio.cpp
@@ -151,7 +151,7 @@ bool COMXAudio::PortSettingsChanged()
// round up to power of 2
m_pcm_output.nChannels = m_OutputChannels > 4 ? 8 : m_OutputChannels > 2 ? 4 : m_OutputChannels;
/* limit samplerate (through resampling) if requested */
- m_pcm_output.nSamplingRate = std::min(std::max((int)m_pcm_output.nSamplingRate, 8000), CServiceBroker::GetSettings().GetInt(CSettings::SETTING_AUDIOOUTPUT_SAMPLERATE));
+ m_pcm_output.nSamplingRate = std::min(std::max((int)m_pcm_output.nSamplingRate, 8000), CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_AUDIOOUTPUT_SAMPLERATE));
m_pcm_output.nPortIndex = m_omx_mixer.GetOutputPort();
omx_err = m_omx_mixer.SetParameter(OMX_IndexParamAudioPcm, &m_pcm_output);
@@ -244,7 +244,7 @@ bool COMXAudio::PortSettingsChanged()
{
// By default audio_render is the clock master, and if output samples don't fit the timestamps, it will speed up/slow down the clock.
// This tends to be better for maintaining audio sync and avoiding audio glitches, but can affect video/display sync
- if(CServiceBroker::GetSettings().GetBool(CSettings::SETTING_VIDEOPLAYER_USEDISPLAYASCLOCK) || m_output == AESINKPI_BOTH)
+ if(CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_VIDEOPLAYER_USEDISPLAYASCLOCK) || m_output == AESINKPI_BOTH)
{
OMX_CONFIG_BOOLEANTYPE configBool;
OMX_INIT_STRUCTURE(configBool);
@@ -270,7 +270,7 @@ bool COMXAudio::PortSettingsChanged()
{
// By default audio_render is the clock master, and if output samples don't fit the timestamps, it will speed up/slow down the clock.
// This tends to be better for maintaining audio sync and avoiding audio glitches, but can affect video/display sync
- if(CServiceBroker::GetSettings().GetBool(CSettings::SETTING_VIDEOPLAYER_USEDISPLAYASCLOCK))
+ if(CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_VIDEOPLAYER_USEDISPLAYASCLOCK))
{
OMX_CONFIG_BOOLEANTYPE configBool;
OMX_INIT_STRUCTURE(configBool);
@@ -554,13 +554,13 @@ bool COMXAudio::Initialize(AEAudioFormat format, OMXClock *clock, CDVDStreamInfo
SetCodingType(format);
- if (m_Passthrough || CServiceBroker::GetSettings().GetString(CSettings::SETTING_AUDIOOUTPUT_AUDIODEVICE) == "PI:HDMI")
+ if (m_Passthrough || CServiceBroker::GetSettings()->GetString(CSettings::SETTING_AUDIOOUTPUT_AUDIODEVICE) == "PI:HDMI")
m_output = AESINKPI_HDMI;
- else if (CServiceBroker::GetSettings().GetString(CSettings::SETTING_AUDIOOUTPUT_AUDIODEVICE) == "PI:Analogue")
+ else if (CServiceBroker::GetSettings()->GetString(CSettings::SETTING_AUDIOOUTPUT_AUDIODEVICE) == "PI:Analogue")
m_output = AESINKPI_ANALOGUE;
- else if (CServiceBroker::GetSettings().GetString(CSettings::SETTING_AUDIOOUTPUT_AUDIODEVICE) == "PI:Both")
+ else if (CServiceBroker::GetSettings()->GetString(CSettings::SETTING_AUDIOOUTPUT_AUDIODEVICE) == "PI:Both")
m_output = AESINKPI_BOTH;
- else if (CServiceBroker::GetSettings().GetString(CSettings::SETTING_AUDIOOUTPUT_AUDIODEVICE) == "Default")
+ else if (CServiceBroker::GetSettings()->GetString(CSettings::SETTING_AUDIOOUTPUT_AUDIODEVICE) == "Default")
m_output = AESINKPI_HDMI;
else assert(0);
@@ -584,11 +584,11 @@ bool COMXAudio::Initialize(AEAudioFormat format, OMXClock *clock, CDVDStreamInfo
if (!m_Passthrough)
{
- bool upmix = CServiceBroker::GetSettings().GetBool(CSettings::SETTING_AUDIOOUTPUT_STEREOUPMIX);
- bool normalize = !CServiceBroker::GetSettings().GetBool(CSettings::SETTING_AUDIOOUTPUT_MAINTAINORIGINALVOLUME);
+ bool upmix = CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_AUDIOOUTPUT_STEREOUPMIX);
+ bool normalize = !CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_AUDIOOUTPUT_MAINTAINORIGINALVOLUME);
void *remapLayout = NULL;
- CAEChannelInfo stdLayout = (enum AEStdChLayout)CServiceBroker::GetSettings().GetInt(CSettings::SETTING_AUDIOOUTPUT_CHANNELS);
+ CAEChannelInfo stdLayout = (enum AEStdChLayout)CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_AUDIOOUTPUT_CHANNELS);
// ignore layout setting for analogue
if (m_output == AESINKPI_ANALOGUE || m_output == AESINKPI_BOTH)
@@ -597,7 +597,7 @@ bool COMXAudio::Initialize(AEAudioFormat format, OMXClock *clock, CDVDStreamInfo
CAEChannelInfo resolvedMap = channelMap;
resolvedMap.ResolveChannels(stdLayout);
- if (CServiceBroker::GetSettings().GetInt(CSettings::SETTING_AUDIOOUTPUT_CONFIG) == AE_CONFIG_FIXED || (upmix && channelMap.Count() <= 2))
+ if (CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_AUDIOOUTPUT_CONFIG) == AE_CONFIG_FIXED || (upmix && channelMap.Count() <= 2))
resolvedMap = stdLayout;
uint64_t m_dst_chan_layout = GetAVChannelLayout(resolvedMap);
diff --git a/xbmc/cores/omxplayer/OMXHelper.cpp b/xbmc/cores/omxplayer/OMXHelper.cpp
index 57bcd3438c..fcdf373c11 100644
--- a/xbmc/cores/omxplayer/OMXHelper.cpp
+++ b/xbmc/cores/omxplayer/OMXHelper.cpp
@@ -24,23 +24,23 @@
bool OMXPlayerUnsuitable(bool m_HasVideo, bool m_HasAudio, CDVDDemux* m_pDemuxer, std::shared_ptr<CDVDInputStream> m_pInputStream, CSelectionStreams &m_SelectionStreams)
{
// if no OMXPlayer acceleration then it is not suitable
- if (!CServiceBroker::GetSettings().GetBool(CSettings::SETTING_VIDEOPLAYER_USEOMXPLAYER))
+ if (!CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_VIDEOPLAYER_USEOMXPLAYER))
return true;
// if no MMAL acceleration stick with omxplayer regardless
- if (!CServiceBroker::GetSettings().GetBool(CSettings::SETTING_VIDEOPLAYER_USEMMAL))
+ if (!CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_VIDEOPLAYER_USEMMAL))
return false;
// omxplayer only handles Pi sink
- if (CServiceBroker::GetSettings().GetString(CSettings::SETTING_AUDIOOUTPUT_AUDIODEVICE) != "PI:Analogue" &&
- CServiceBroker::GetSettings().GetString(CSettings::SETTING_AUDIOOUTPUT_AUDIODEVICE) != "PI:HDMI" &&
- CServiceBroker::GetSettings().GetString(CSettings::SETTING_AUDIOOUTPUT_AUDIODEVICE) != "PI:Both" &&
- CServiceBroker::GetSettings().GetString(CSettings::SETTING_AUDIOOUTPUT_AUDIODEVICE) != "Default")
+ if (CServiceBroker::GetSettings()->GetString(CSettings::SETTING_AUDIOOUTPUT_AUDIODEVICE) != "PI:Analogue" &&
+ CServiceBroker::GetSettings()->GetString(CSettings::SETTING_AUDIOOUTPUT_AUDIODEVICE) != "PI:HDMI" &&
+ CServiceBroker::GetSettings()->GetString(CSettings::SETTING_AUDIOOUTPUT_AUDIODEVICE) != "PI:Both" &&
+ CServiceBroker::GetSettings()->GetString(CSettings::SETTING_AUDIOOUTPUT_AUDIODEVICE) != "Default")
{
CLog::Log(LOGNOTICE, "%s OMXPlayer unsuitable due to audio sink", __func__);
return true;
}
// omxplayer doesn't handle ac3 transcode
- if (CServiceBroker::GetSettings().GetBool(CSettings::SETTING_AUDIOOUTPUT_AC3TRANSCODE))
+ if (CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_AUDIOOUTPUT_AC3TRANSCODE))
{
CLog::Log(LOGNOTICE, "%s OMXPlayer unsuitable due to ac3transcode", __func__);
return true;
diff --git a/xbmc/cores/omxplayer/OMXImage.cpp b/xbmc/cores/omxplayer/OMXImage.cpp
index 6b57df2414..149c8ad875 100644
--- a/xbmc/cores/omxplayer/OMXImage.cpp
+++ b/xbmc/cores/omxplayer/OMXImage.cpp
@@ -249,7 +249,7 @@ bool COMXImage::AllocTextureInternal(EGLDisplay egl_display, EGLContext egl_cont
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
- GLenum type = CServiceBroker::GetSettings().GetBool("videoscreen.textures32") ? GL_UNSIGNED_BYTE:GL_UNSIGNED_SHORT_5_6_5;
+ GLenum type = CServiceBroker::GetSettings()->GetBool("videoscreen.textures32") ? GL_UNSIGNED_BYTE:GL_UNSIGNED_SHORT_5_6_5;
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, tex->width, tex->height, 0, GL_RGB, type, 0);
tex->egl_image = eglCreateImageKHR(egl_display, egl_context, EGL_GL_TEXTURE_2D_KHR, (EGLClientBuffer)tex->texture, NULL);
if (!tex->egl_image)
diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp
index be7c521fa5..3aadcfd9fa 100644
--- a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp
+++ b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp
@@ -93,7 +93,7 @@ OMXPlayerVideo::~OMXPlayerVideo()
bool OMXPlayerVideo::OpenStream(CDVDStreamInfo hints)
{
m_hints = hints;
- m_hdmi_clock_sync = (CServiceBroker::GetSettings().GetInt(CSettings::SETTING_VIDEOPLAYER_ADJUSTREFRESHRATE) != ADJUST_REFRESHRATE_OFF);
+ m_hdmi_clock_sync = (CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_VIDEOPLAYER_ADJUSTREFRESHRATE) != ADJUST_REFRESHRATE_OFF);
m_syncState = IDVDStreamPlayer::SYNC_STARTING;
m_flush = false;
m_stalled = m_messageQueue.GetPacketCount(CDVDMsg::DEMUXER_PACKET) == 0;
diff --git a/xbmc/cores/omxplayer/OMXVideo.cpp b/xbmc/cores/omxplayer/OMXVideo.cpp
index c03659e835..81342abe62 100644
--- a/xbmc/cores/omxplayer/OMXVideo.cpp
+++ b/xbmc/cores/omxplayer/OMXVideo.cpp
@@ -419,7 +419,7 @@ bool COMXVideo::Open(CDVDStreamInfo &hints, OMXClock *clock, bool hdmi_clock_syn
break;
}
}
- if (CServiceBroker::GetSettings().GetBool(CSettings::SETTING_VIDEOPLAYER_SUPPORTMVC))
+ if (CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_VIDEOPLAYER_SUPPORTMVC))
{
m_codingType = OMX_VIDEO_CodingMVC;
m_video_codec_name = "omx-mvc";
@@ -575,7 +575,7 @@ bool COMXVideo::Open(CDVDStreamInfo &hints, OMXClock *clock, bool hdmi_clock_syn
}
// request portsettingschanged on refresh rate change
- if (CServiceBroker::GetSettings().GetInt(CSettings::SETTING_VIDEOPLAYER_ADJUSTREFRESHRATE) == ADJUST_REFRESHRATE_ALWAYS)
+ if (CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_VIDEOPLAYER_ADJUSTREFRESHRATE) == ADJUST_REFRESHRATE_ALWAYS)
{
notifications.nIndex = OMX_IndexParamPortDefinition;
omx_err = m_omx_decoder.SetParameter((OMX_INDEXTYPE)OMX_IndexConfigRequestCallback, &notifications);
diff --git a/xbmc/cores/paplayer/AudioDecoder.cpp b/xbmc/cores/paplayer/AudioDecoder.cpp
index c2c92363d8..ee47f43e01 100644
--- a/xbmc/cores/paplayer/AudioDecoder.cpp
+++ b/xbmc/cores/paplayer/AudioDecoder.cpp
@@ -64,13 +64,13 @@ bool CAudioDecoder::Create(const CFileItem &file, int64_t seekOffset)
m_eof = false;
// get correct cache size
- unsigned int filecache = CServiceBroker::GetSettings().GetInt(CSettings::SETTING_CACHEAUDIO_INTERNET);
+ unsigned int filecache = CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_CACHEAUDIO_INTERNET);
if ( file.IsHD() )
- filecache = CServiceBroker::GetSettings().GetInt(CSettings::SETTING_CACHE_HARDDISK);
+ filecache = CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_CACHE_HARDDISK);
else if ( file.IsOnDVD() )
- filecache = CServiceBroker::GetSettings().GetInt(CSettings::SETTING_CACHEAUDIO_DVDROM);
+ filecache = CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_CACHEAUDIO_DVDROM);
else if ( file.IsOnLAN() )
- filecache = CServiceBroker::GetSettings().GetInt(CSettings::SETTING_CACHEAUDIO_LAN);
+ filecache = CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_CACHEAUDIO_LAN);
// create our codec
m_codec=CodecFactory::CreateCodecDemux(file, filecache * 1024);
diff --git a/xbmc/cores/paplayer/PAPlayer.cpp b/xbmc/cores/paplayer/PAPlayer.cpp
index ce854df183..c7076aea23 100644
--- a/xbmc/cores/paplayer/PAPlayer.cpp
+++ b/xbmc/cores/paplayer/PAPlayer.cpp
@@ -215,7 +215,7 @@ void PAPlayer::CloseAllStreams(bool fade/* = true */)
bool PAPlayer::OpenFile(const CFileItem& file, const CPlayerOptions &options)
{
- m_defaultCrossfadeMS = CServiceBroker::GetSettings().GetInt(CSettings::SETTING_MUSICPLAYER_CROSSFADE) * 1000;
+ m_defaultCrossfadeMS = CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_MUSICPLAYER_CROSSFADE) * 1000;
if (m_streams.size() > 1 || !m_defaultCrossfadeMS || m_isPaused)
{
@@ -270,12 +270,12 @@ void PAPlayer::UpdateCrossfadeTime(const CFileItem& file)
if (file.IsCDDA())
m_upcomingCrossfadeMS = 0;
else
- m_upcomingCrossfadeMS = m_defaultCrossfadeMS = CServiceBroker::GetSettings().GetInt(CSettings::SETTING_MUSICPLAYER_CROSSFADE) * 1000;
+ m_upcomingCrossfadeMS = m_defaultCrossfadeMS = CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_MUSICPLAYER_CROSSFADE) * 1000;
if (m_upcomingCrossfadeMS)
{
if (!m_currentStream ||
- (file.HasMusicInfoTag() && !CServiceBroker::GetSettings().GetBool(CSettings::SETTING_MUSICPLAYER_CROSSFADEALBUMTRACKS) &&
+ (file.HasMusicInfoTag() && !CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_MUSICPLAYER_CROSSFADEALBUMTRACKS) &&
m_currentStream->m_fileItem.HasMusicInfoTag() &&
(m_currentStream->m_fileItem.GetMusicInfoTag()->GetAlbum() != "") &&
(m_currentStream->m_fileItem.GetMusicInfoTag()->GetAlbum() == file.GetMusicInfoTag()->GetAlbum()) &&
@@ -466,7 +466,7 @@ inline bool PAPlayer::PrepareStream(StreamInfo *si)
if (peak * gain <= 1.0)
// No clipping protection needed
si->m_stream->SetReplayGain(gain);
- else if (CServiceBroker::GetSettings().GetBool(CSettings::SETTING_MUSICPLAYER_REPLAYGAINAVOIDCLIPPING))
+ else if (CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_MUSICPLAYER_REPLAYGAINAVOIDCLIPPING))
// Normalise volume reducing replaygain to avoid needing clipping protection, plays file at lower level
si->m_stream->SetReplayGain(1.0f / fabs(peak));
else
diff --git a/xbmc/cores/playercorefactory/PlayerCoreFactory.cpp b/xbmc/cores/playercorefactory/PlayerCoreFactory.cpp
index 4ee28efb40..5ea7d37d9f 100644
--- a/xbmc/cores/playercorefactory/PlayerCoreFactory.cpp
+++ b/xbmc/cores/playercorefactory/PlayerCoreFactory.cpp
@@ -27,20 +27,20 @@
#define PLAYERCOREFACTORY_XML "playercorefactory.xml"
-CPlayerCoreFactory::CPlayerCoreFactory(CSettings &settings,
- const CProfilesManager &profileManager) :
- m_settings(settings),
+CPlayerCoreFactory::CPlayerCoreFactory(const CProfilesManager &profileManager) :
m_profileManager(profileManager)
{
- if (m_settings.IsLoaded())
+ m_settings = CServiceBroker::GetSettings();
+
+ if (m_settings->IsLoaded())
OnSettingsLoaded();
- m_settings.GetSettingsManager()->RegisterSettingsHandler(this);
+ m_settings->GetSettingsManager()->RegisterSettingsHandler(this);
}
CPlayerCoreFactory::~CPlayerCoreFactory()
{
- m_settings.GetSettingsManager()->UnregisterSettingsHandler(this);
+ m_settings->GetSettingsManager()->UnregisterSettingsHandler(this);
for(std::vector<CPlayerCoreConfig *>::iterator it = m_vecPlayerConfigs.begin(); it != m_vecPlayerConfigs.end(); ++it)
delete *it;
diff --git a/xbmc/cores/playercorefactory/PlayerCoreFactory.h b/xbmc/cores/playercorefactory/PlayerCoreFactory.h
index c8d1701734..142d73fae8 100644
--- a/xbmc/cores/playercorefactory/PlayerCoreFactory.h
+++ b/xbmc/cores/playercorefactory/PlayerCoreFactory.h
@@ -8,11 +8,12 @@
#pragma once
-#include <vector>
-
#include "settings/lib/ISettingsHandler.h"
#include "threads/CriticalSection.h"
+
+#include <memory>
#include <string>
+#include <vector>
// forward references
@@ -28,8 +29,7 @@ class IPlayerCallback;
class CPlayerCoreFactory : public ISettingsHandler
{
public:
- CPlayerCoreFactory(CSettings &settings,
- const CProfilesManager &profileManager);
+ CPlayerCoreFactory(const CProfilesManager &profileManager);
CPlayerCoreFactory(const CPlayerCoreFactory&) = delete;
CPlayerCoreFactory& operator=(CPlayerCoreFactory const&) = delete;
~CPlayerCoreFactory() override;
@@ -54,7 +54,7 @@ public:
private:
// Construction parameters
- CSettings &m_settings;
+ std::shared_ptr<CSettings> m_settings;
const CProfilesManager &m_profileManager;
int GetPlayerIndex(const std::string& strCoreName) const;
diff --git a/xbmc/cores/playercorefactory/PlayerSelectionRule.cpp b/xbmc/cores/playercorefactory/PlayerSelectionRule.cpp
index 99e68def45..28a4ca22bc 100644
--- a/xbmc/cores/playercorefactory/PlayerSelectionRule.cpp
+++ b/xbmc/cores/playercorefactory/PlayerSelectionRule.cpp
@@ -64,7 +64,7 @@ void CPlayerSelectionRule::Initialize(TiXmlElement* pRule)
m_bStreamDetails = m_audioCodec.length() > 0 || m_audioChannels.length() > 0 ||
m_videoCodec.length() > 0 || m_videoResolution.length() > 0 || m_videoAspect.length() > 0;
- if (m_bStreamDetails && !CServiceBroker::GetSettings().GetBool(CSettings::SETTING_MYVIDEOS_EXTRACTFLAGS))
+ if (m_bStreamDetails && !CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_MYVIDEOS_EXTRACTFLAGS))
{
CLog::Log(LOGWARNING, "CPlayerSelectionRule::Initialize: rule: %s needs media flagging, which is disabled", m_name.c_str());
}
diff --git a/xbmc/dialogs/GUIDialogContextMenu.cpp b/xbmc/dialogs/GUIDialogContextMenu.cpp
index b191ff3b18..f94fa74019 100644
--- a/xbmc/dialogs/GUIDialogContextMenu.cpp
+++ b/xbmc/dialogs/GUIDialogContextMenu.cpp
@@ -243,8 +243,8 @@ void CGUIDialogContextMenu::GetContextButtons(const std::string &type, const CFi
buttons.Add(CONTEXT_BUTTON_REMOVE_LOCK, 12335);
bool maxRetryExceeded = false;
- if (CServiceBroker::GetSettings().GetInt(CSettings::SETTING_MASTERLOCK_MAXRETRIES) != 0)
- maxRetryExceeded = (share->m_iBadPwdCount >= CServiceBroker::GetSettings().GetInt(CSettings::SETTING_MASTERLOCK_MAXRETRIES));
+ if (CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_MASTERLOCK_MAXRETRIES) != 0)
+ maxRetryExceeded = (share->m_iBadPwdCount >= CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_MASTERLOCK_MAXRETRIES));
if (maxRetryExceeded)
buttons.Add(CONTEXT_BUTTON_RESET_LOCK, 12334);
@@ -449,8 +449,8 @@ bool CGUIDialogContextMenu::OnContextButton(const std::string &type, const CFile
case CONTEXT_BUTTON_REACTIVATE_LOCK:
{
bool maxRetryExceeded = false;
- if (CServiceBroker::GetSettings().GetInt(CSettings::SETTING_MASTERLOCK_MAXRETRIES) != 0)
- maxRetryExceeded = (share->m_iBadPwdCount >= CServiceBroker::GetSettings().GetInt(CSettings::SETTING_MASTERLOCK_MAXRETRIES));
+ if (CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_MASTERLOCK_MAXRETRIES) != 0)
+ maxRetryExceeded = (share->m_iBadPwdCount >= CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_MASTERLOCK_MAXRETRIES));
if (!maxRetryExceeded)
{
// don't prompt user for mastercode when reactivating a lock
diff --git a/xbmc/dialogs/GUIDialogKeyboardGeneric.cpp b/xbmc/dialogs/GUIDialogKeyboardGeneric.cpp
index 48b7e50085..9b125be0e0 100644
--- a/xbmc/dialogs/GUIDialogKeyboardGeneric.cpp
+++ b/xbmc/dialogs/GUIDialogKeyboardGeneric.cpp
@@ -128,8 +128,8 @@ void CGUIDialogKeyboardGeneric::OnInitWindow()
m_currentLayout = 0;
m_layouts.clear();
const KeyboardLayouts& keyboardLayouts = CKeyboardLayoutManager::GetInstance().GetLayouts();
- std::vector<CVariant> layoutNames = CServiceBroker::GetSettings().GetList(CSettings::SETTING_LOCALE_KEYBOARDLAYOUTS);
- std::string activeLayout = CServiceBroker::GetSettings().GetString(CSettings::SETTING_LOCALE_ACTIVEKEYBOARDLAYOUT);
+ std::vector<CVariant> layoutNames = CServiceBroker::GetSettings()->GetList(CSettings::SETTING_LOCALE_KEYBOARDLAYOUTS);
+ std::string activeLayout = CServiceBroker::GetSettings()->GetString(CSettings::SETTING_LOCALE_ACTIVEKEYBOARDLAYOUT);
for (std::vector<CVariant>::const_iterator layoutName = layoutNames.begin(); layoutName != layoutNames.end(); ++layoutName)
{
@@ -530,7 +530,7 @@ void CGUIDialogKeyboardGeneric::OnLayout()
if (m_currentLayout >= m_layouts.size())
m_currentLayout = 0;
CKeyboardLayout layout = m_layouts.empty() ? CKeyboardLayout() : m_layouts[m_currentLayout];
- CServiceBroker::GetSettings().SetString(CSettings::SETTING_LOCALE_ACTIVEKEYBOARDLAYOUT, layout.GetName());
+ CServiceBroker::GetSettings()->SetString(CSettings::SETTING_LOCALE_ACTIVEKEYBOARDLAYOUT, layout.GetName());
UpdateButtons();
}
diff --git a/xbmc/dialogs/GUIDialogMediaSource.cpp b/xbmc/dialogs/GUIDialogMediaSource.cpp
index 2944e85a6e..229354d708 100644
--- a/xbmc/dialogs/GUIDialogMediaSource.cpp
+++ b/xbmc/dialogs/GUIDialogMediaSource.cpp
@@ -287,7 +287,7 @@ void CGUIDialogMediaSource::OnPathBrowse(int item)
extraShares.push_back(share1);
}
- if (CServiceBroker::GetSettings().GetString(CSettings::SETTING_AUDIOCDS_RECORDINGPATH) != "")
+ if (CServiceBroker::GetSettings()->GetString(CSettings::SETTING_AUDIOCDS_RECORDINGPATH) != "")
{
share1.strPath = "special://recordings/";
share1.strName = g_localizeStrings.Get(21883);
@@ -384,7 +384,7 @@ void CGUIDialogMediaSource::OnPathBrowse(int item)
#endif
share1.m_ignore = true;
- if (CServiceBroker::GetSettings().GetString(CSettings::SETTING_DEBUG_SCREENSHOTPATH) != "")
+ if (CServiceBroker::GetSettings()->GetString(CSettings::SETTING_DEBUG_SCREENSHOTPATH) != "")
{
share1.strPath = "special://screenshots/";
share1.strName = g_localizeStrings.Get(20008);
diff --git a/xbmc/dialogs/GUIDialogSimpleMenu.cpp b/xbmc/dialogs/GUIDialogSimpleMenu.cpp
index e86802dd46..cf97297c56 100644
--- a/xbmc/dialogs/GUIDialogSimpleMenu.cpp
+++ b/xbmc/dialogs/GUIDialogSimpleMenu.cpp
@@ -48,7 +48,7 @@ protected:
bool CGUIDialogSimpleMenu::ShowPlaySelection(CFileItem& item)
{
- if (CServiceBroker::GetSettings().GetInt(CSettings::SETTING_DISC_PLAYBACK) != BD_PLAYBACK_SIMPLE_MENU)
+ if (CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_DISC_PLAYBACK) != BD_PLAYBACK_SIMPLE_MENU)
return true;
std::string path;
diff --git a/xbmc/dialogs/GUIDialogSmartPlaylistEditor.cpp b/xbmc/dialogs/GUIDialogSmartPlaylistEditor.cpp
index 2a79213679..56794fe724 100644
--- a/xbmc/dialogs/GUIDialogSmartPlaylistEditor.cpp
+++ b/xbmc/dialogs/GUIDialogSmartPlaylistEditor.cpp
@@ -218,7 +218,7 @@ void CGUIDialogSmartPlaylistEditor::OnRuleList(int item)
void CGUIDialogSmartPlaylistEditor::OnOK()
{
- std::string systemPlaylistsPath = CServiceBroker::GetSettings().GetString(CSettings::SETTING_SYSTEM_PLAYLISTSPATH);
+ std::string systemPlaylistsPath = CServiceBroker::GetSettings()->GetString(CSettings::SETTING_SYSTEM_PLAYLISTSPATH);
// save our playlist
if (m_path.empty())
{
diff --git a/xbmc/dialogs/GUIDialogSmartPlaylistRule.cpp b/xbmc/dialogs/GUIDialogSmartPlaylistRule.cpp
index b829a87501..7bdae39ca7 100644
--- a/xbmc/dialogs/GUIDialogSmartPlaylistRule.cpp
+++ b/xbmc/dialogs/GUIDialogSmartPlaylistRule.cpp
@@ -346,7 +346,7 @@ void CGUIDialogSmartPlaylistRule::OnBrowse()
}
// sort the items
- items.Sort(SortByLabel, SortOrderAscending, CServiceBroker::GetSettings().GetBool(CSettings::SETTING_FILELISTS_IGNORETHEWHENSORTING) ? SortAttributeIgnoreArticle : SortAttributeNone);
+ items.Sort(SortByLabel, SortOrderAscending, CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_FILELISTS_IGNORETHEWHENSORTING) ? SortAttributeIgnoreArticle : SortAttributeNone);
CGUIDialogSelect* pDialog = CServiceBroker::GetGUI()->GetWindowManager().GetWindow<CGUIDialogSelect>(WINDOW_DIALOG_SELECT);
pDialog->Reset();
diff --git a/xbmc/events/EventLog.cpp b/xbmc/events/EventLog.cpp
index 72a8163ae7..2f7500c465 100644
--- a/xbmc/events/EventLog.cpp
+++ b/xbmc/events/EventLog.cpp
@@ -90,8 +90,8 @@ EventPtr CEventLog::Get(const std::string& eventPtrIdentifier) const
void CEventLog::Add(const EventPtr& eventPtr)
{
if (eventPtr == nullptr || eventPtr->GetIdentifier().empty() ||
- !CServiceBroker::GetSettings().GetBool(CSettings::SETTING_EVENTLOG_ENABLED) ||
- (eventPtr->GetLevel() == EventLevel::Information && !CServiceBroker::GetSettings().GetBool(CSettings::SETTING_EVENTLOG_ENABLED_NOTIFICATIONS)))
+ !CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_EVENTLOG_ENABLED) ||
+ (eventPtr->GetLevel() == EventLevel::Information && !CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_EVENTLOG_ENABLED_NOTIFICATIONS)))
return;
CSingleLock lock(m_critical);
diff --git a/xbmc/events/windows/GUIWindowEventLog.cpp b/xbmc/events/windows/GUIWindowEventLog.cpp
index 07ced5df0c..581fac31ac 100644
--- a/xbmc/events/windows/GUIWindowEventLog.cpp
+++ b/xbmc/events/windows/GUIWindowEventLog.cpp
@@ -55,7 +55,7 @@ bool CGUIWindowEventLog::OnMessage(CGUIMessage& message)
{
// update the event level
CViewStateSettings::GetInstance().CycleEventLevel();
- CServiceBroker::GetSettings().Save();
+ CServiceBroker::GetSettings()->Save();
// update the listing
Refresh();
@@ -67,7 +67,7 @@ bool CGUIWindowEventLog::OnMessage(CGUIMessage& message)
{
// update whether to show higher event levels
CViewStateSettings::GetInstance().ToggleShowHigherEventLevels();
- CServiceBroker::GetSettings().Save();
+ CServiceBroker::GetSettings()->Save();
// update the listing
Refresh();
diff --git a/xbmc/filesystem/AddonsDirectory.cpp b/xbmc/filesystem/AddonsDirectory.cpp
index a6c515683c..4d06daa234 100644
--- a/xbmc/filesystem/AddonsDirectory.cpp
+++ b/xbmc/filesystem/AddonsDirectory.cpp
@@ -629,7 +629,7 @@ static void RootDirectory(CFileItemList& items)
item->SetIconImage("DefaultNetwork.png");
items.Add(item);
}
- if (CServiceBroker::GetSettings().GetInt(CSettings::SETTING_ADDONS_AUTOUPDATES) == ADDON::AUTO_UPDATES_ON
+ if (CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_ADDONS_AUTOUPDATES) == ADDON::AUTO_UPDATES_ON
&& HasRecentlyUpdatedAddons())
{
CFileItemPtr item(new CFileItem("addons://recently_updated/", true));
diff --git a/xbmc/filesystem/CurlFile.cpp b/xbmc/filesystem/CurlFile.cpp
index 7a377f97d6..3f87c42c98 100644
--- a/xbmc/filesystem/CurlFile.cpp
+++ b/xbmc/filesystem/CurlFile.cpp
@@ -751,18 +751,21 @@ void CCurlFile::ParseAndCorrectUrl(CURL &url2)
else if(url2.IsProtocol("http") ||
url2.IsProtocol("https"))
{
- const CSettings &s = CServiceBroker::GetSettings();
+ std::shared_ptr<CSettings> s = CServiceBroker::GetSettings();
+ if (!s)
+ return;
+
if (!url2.IsLocalHost() &&
m_proxyhost.empty() &&
- s.GetBool(CSettings::SETTING_NETWORK_USEHTTPPROXY) &&
- !s.GetString(CSettings::SETTING_NETWORK_HTTPPROXYSERVER).empty() &&
- s.GetInt(CSettings::SETTING_NETWORK_HTTPPROXYPORT) > 0)
+ s->GetBool(CSettings::SETTING_NETWORK_USEHTTPPROXY) &&
+ !s->GetString(CSettings::SETTING_NETWORK_HTTPPROXYSERVER).empty() &&
+ s->GetInt(CSettings::SETTING_NETWORK_HTTPPROXYPORT) > 0)
{
- m_proxytype = (ProxyType)s.GetInt(CSettings::SETTING_NETWORK_HTTPPROXYTYPE);
- m_proxyhost = s.GetString(CSettings::SETTING_NETWORK_HTTPPROXYSERVER);
- m_proxyport = s.GetInt(CSettings::SETTING_NETWORK_HTTPPROXYPORT);
- m_proxyuser = s.GetString(CSettings::SETTING_NETWORK_HTTPPROXYUSERNAME);
- m_proxypassword = s.GetString(CSettings::SETTING_NETWORK_HTTPPROXYPASSWORD);
+ m_proxytype = (ProxyType)s->GetInt(CSettings::SETTING_NETWORK_HTTPPROXYTYPE);
+ m_proxyhost = s->GetString(CSettings::SETTING_NETWORK_HTTPPROXYSERVER);
+ m_proxyport = s->GetInt(CSettings::SETTING_NETWORK_HTTPPROXYPORT);
+ m_proxyuser = s->GetString(CSettings::SETTING_NETWORK_HTTPPROXYUSERNAME);
+ m_proxypassword = s->GetString(CSettings::SETTING_NETWORK_HTTPPROXYPASSWORD);
CLog::Log(LOGDEBUG, "Using proxy %s, type %d", m_proxyhost.c_str(),
proxyType2CUrlProxyType[m_proxytype]);
}
diff --git a/xbmc/filesystem/Directory.cpp b/xbmc/filesystem/Directory.cpp
index 31e3320d8c..294559809a 100644
--- a/xbmc/filesystem/Directory.cpp
+++ b/xbmc/filesystem/Directory.cpp
@@ -266,7 +266,7 @@ bool CDirectory::GetDirectory(const CURL& url, std::shared_ptr<IDirectory> pDire
}
// filter hidden files
//! @todo we shouldn't be checking the gui setting here, callers should use getHidden instead
- if (!CServiceBroker::GetSettings().GetBool(CSettings::SETTING_FILELISTS_SHOWHIDDEN) && !(hints.flags & DIR_FLAG_GET_HIDDEN))
+ if (!CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_FILELISTS_SHOWHIDDEN) && !(hints.flags & DIR_FLAG_GET_HIDDEN))
{
for (int i = 0; i < items.Size(); ++i)
{
diff --git a/xbmc/filesystem/MusicDatabaseDirectory/DirectoryNodeArtist.cpp b/xbmc/filesystem/MusicDatabaseDirectory/DirectoryNodeArtist.cpp
index d8012faa99..92aabec4ce 100644
--- a/xbmc/filesystem/MusicDatabaseDirectory/DirectoryNodeArtist.cpp
+++ b/xbmc/filesystem/MusicDatabaseDirectory/DirectoryNodeArtist.cpp
@@ -45,7 +45,7 @@ bool CDirectoryNodeArtist::GetContent(CFileItemList& items) const
CQueryParams params;
CollectQueryParams(params);
- bool bSuccess = musicdatabase.GetArtistsNav(BuildPath(), items, !CServiceBroker::GetSettings().GetBool(CSettings::SETTING_MUSICLIBRARY_SHOWCOMPILATIONARTISTS), params.GetGenreId());
+ bool bSuccess = musicdatabase.GetArtistsNav(BuildPath(), items, !CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_MUSICLIBRARY_SHOWCOMPILATIONARTISTS), params.GetGenreId());
musicdatabase.Close();
diff --git a/xbmc/filesystem/PluginDirectory.cpp b/xbmc/filesystem/PluginDirectory.cpp
index e53176c954..3846691131 100644
--- a/xbmc/filesystem/PluginDirectory.cpp
+++ b/xbmc/filesystem/PluginDirectory.cpp
@@ -263,25 +263,25 @@ void CPluginDirectory::AddSortMethod(int handle, SORT_METHOD sortMethod, const s
case SORT_METHOD_LABEL:
case SORT_METHOD_LABEL_IGNORE_THE:
{
- dir->m_listItems->AddSortMethod(SortByLabel, 551, LABEL_MASKS("%T", label2Mask), CServiceBroker::GetSettings().GetBool(CSettings::SETTING_FILELISTS_IGNORETHEWHENSORTING) ? SortAttributeIgnoreArticle : SortAttributeNone);
+ dir->m_listItems->AddSortMethod(SortByLabel, 551, LABEL_MASKS("%T", label2Mask), CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_FILELISTS_IGNORETHEWHENSORTING) ? SortAttributeIgnoreArticle : SortAttributeNone);
break;
}
case SORT_METHOD_TITLE:
case SORT_METHOD_TITLE_IGNORE_THE:
{
- dir->m_listItems->AddSortMethod(SortByTitle, 556, LABEL_MASKS("%T", label2Mask), CServiceBroker::GetSettings().GetBool(CSettings::SETTING_FILELISTS_IGNORETHEWHENSORTING) ? SortAttributeIgnoreArticle : SortAttributeNone);
+ dir->m_listItems->AddSortMethod(SortByTitle, 556, LABEL_MASKS("%T", label2Mask), CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_FILELISTS_IGNORETHEWHENSORTING) ? SortAttributeIgnoreArticle : SortAttributeNone);
break;
}
case SORT_METHOD_ARTIST:
case SORT_METHOD_ARTIST_IGNORE_THE:
{
- dir->m_listItems->AddSortMethod(SortByArtist, 557, LABEL_MASKS("%T", "%A"), CServiceBroker::GetSettings().GetBool(CSettings::SETTING_FILELISTS_IGNORETHEWHENSORTING) ? SortAttributeIgnoreArticle : SortAttributeNone);
+ dir->m_listItems->AddSortMethod(SortByArtist, 557, LABEL_MASKS("%T", "%A"), CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_FILELISTS_IGNORETHEWHENSORTING) ? SortAttributeIgnoreArticle : SortAttributeNone);
break;
}
case SORT_METHOD_ALBUM:
case SORT_METHOD_ALBUM_IGNORE_THE:
{
- dir->m_listItems->AddSortMethod(SortByAlbum, 558, LABEL_MASKS("%T", "%B"), CServiceBroker::GetSettings().GetBool(CSettings::SETTING_FILELISTS_IGNORETHEWHENSORTING) ? SortAttributeIgnoreArticle : SortAttributeNone);
+ dir->m_listItems->AddSortMethod(SortByAlbum, 558, LABEL_MASKS("%T", "%B"), CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_FILELISTS_IGNORETHEWHENSORTING) ? SortAttributeIgnoreArticle : SortAttributeNone);
break;
}
case SORT_METHOD_DATE:
@@ -344,7 +344,7 @@ void CPluginDirectory::AddSortMethod(int handle, SORT_METHOD sortMethod, const s
case SORT_METHOD_VIDEO_SORT_TITLE:
case SORT_METHOD_VIDEO_SORT_TITLE_IGNORE_THE:
{
- dir->m_listItems->AddSortMethod(SortBySortTitle, 556, LABEL_MASKS("%T", label2Mask), CServiceBroker::GetSettings().GetBool(CSettings::SETTING_FILELISTS_IGNORETHEWHENSORTING) ? SortAttributeIgnoreArticle : SortAttributeNone);
+ dir->m_listItems->AddSortMethod(SortBySortTitle, 556, LABEL_MASKS("%T", label2Mask), CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_FILELISTS_IGNORETHEWHENSORTING) ? SortAttributeIgnoreArticle : SortAttributeNone);
break;
}
case SORT_METHOD_MPAA_RATING:
@@ -355,7 +355,7 @@ void CPluginDirectory::AddSortMethod(int handle, SORT_METHOD sortMethod, const s
case SORT_METHOD_STUDIO:
case SORT_METHOD_STUDIO_IGNORE_THE:
{
- dir->m_listItems->AddSortMethod(SortByStudio, 572, LABEL_MASKS("%T", "%U"), CServiceBroker::GetSettings().GetBool(CSettings::SETTING_FILELISTS_IGNORETHEWHENSORTING) ? SortAttributeIgnoreArticle : SortAttributeNone);
+ dir->m_listItems->AddSortMethod(SortByStudio, 572, LABEL_MASKS("%T", "%U"), CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_FILELISTS_IGNORETHEWHENSORTING) ? SortAttributeIgnoreArticle : SortAttributeNone);
break;
}
case SORT_METHOD_PROGRAM_COUNT:
@@ -380,7 +380,7 @@ void CPluginDirectory::AddSortMethod(int handle, SORT_METHOD sortMethod, const s
}
case SORT_METHOD_PLAYLIST_ORDER:
{
- std::string strTrack=CServiceBroker::GetSettings().GetString(CSettings::SETTING_MUSICFILES_TRACKFORMAT);
+ std::string strTrack=CServiceBroker::GetSettings()->GetString(CSettings::SETTING_MUSICFILES_TRACKFORMAT);
dir->m_listItems->AddSortMethod(SortByPlaylistOrder, 559, LABEL_MASKS(strTrack, "%D"));
break;
}
diff --git a/xbmc/filesystem/RSSDirectory.cpp b/xbmc/filesystem/RSSDirectory.cpp
index 30ed47b92c..22ed381337 100644
--- a/xbmc/filesystem/RSSDirectory.cpp
+++ b/xbmc/filesystem/RSSDirectory.cpp
@@ -446,7 +446,7 @@ static void ParseItem(CFileItem* item, TiXmlElement* root, const std::string& pa
else if(FindMime(resources, "image/"))
mime = "image/";
- int maxrate = CServiceBroker::GetSettings().GetInt(CSettings::SETTING_NETWORK_BANDWIDTH);
+ int maxrate = CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_NETWORK_BANDWIDTH);
if(maxrate == 0)
maxrate = INT_MAX;
diff --git a/xbmc/filesystem/SmartPlaylistDirectory.cpp b/xbmc/filesystem/SmartPlaylistDirectory.cpp
index 2f260ca6c4..fb29e7bc53 100644
--- a/xbmc/filesystem/SmartPlaylistDirectory.cpp
+++ b/xbmc/filesystem/SmartPlaylistDirectory.cpp
@@ -57,7 +57,7 @@ namespace XFILE
sorting.sortBy = playlist.GetOrder();
sorting.sortOrder = playlist.GetOrderAscending() ? SortOrderAscending : SortOrderDescending;
sorting.sortAttributes = playlist.GetOrderAttributes();
- if (CServiceBroker::GetSettings().GetBool(CSettings::SETTING_FILELISTS_IGNORETHEWHENSORTING))
+ if (CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_FILELISTS_IGNORETHEWHENSORTING))
sorting.sortAttributes = (SortAttribute)(sorting.sortAttributes | SortAttributeIgnoreArticle);
items.SetSortIgnoreFolders((sorting.sortAttributes & SortAttributeIgnoreFolders) == SortAttributeIgnoreFolders);
@@ -277,7 +277,7 @@ namespace XFILE
// sort grouped list by label
if (items.Size() > 1 && !group.empty())
- items.Sort(SortByLabel, SortOrderAscending, CServiceBroker::GetSettings().GetBool(CSettings::SETTING_FILELISTS_IGNORETHEWHENSORTING) ? SortAttributeIgnoreArticle : SortAttributeNone);
+ items.Sort(SortByLabel, SortOrderAscending, CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_FILELISTS_IGNORETHEWHENSORTING) ? SortAttributeIgnoreArticle : SortAttributeNone);
// go through and set the playlist order
for (int i = 0; i < items.Size(); i++)
diff --git a/xbmc/filesystem/SpecialProtocol.cpp b/xbmc/filesystem/SpecialProtocol.cpp
index 4f0865046c..e69a5dc26a 100644
--- a/xbmc/filesystem/SpecialProtocol.cpp
+++ b/xbmc/filesystem/SpecialProtocol.cpp
@@ -148,7 +148,7 @@ std::string CSpecialProtocol::TranslatePath(const CURL &url)
RootDir = FullFileName;
if (RootDir == "subtitles")
- translatedPath = URIUtils::AddFileToFolder(CServiceBroker::GetSettings().GetString(CSettings::SETTING_SUBTITLES_CUSTOMPATH), FileName);
+ translatedPath = URIUtils::AddFileToFolder(CServiceBroker::GetSettings()->GetString(CSettings::SETTING_SUBTITLES_CUSTOMPATH), FileName);
else if (RootDir == "userdata" && m_profileManager)
translatedPath = URIUtils::AddFileToFolder(m_profileManager->GetUserDataFolder(), FileName);
else if (RootDir == "database" && m_profileManager)
@@ -156,9 +156,9 @@ std::string CSpecialProtocol::TranslatePath(const CURL &url)
else if (RootDir == "thumbnails" && m_profileManager)
translatedPath = URIUtils::AddFileToFolder(m_profileManager->GetThumbnailsFolder(), FileName);
else if (RootDir == "recordings" || RootDir == "cdrips")
- translatedPath = URIUtils::AddFileToFolder(CServiceBroker::GetSettings().GetString(CSettings::SETTING_AUDIOCDS_RECORDINGPATH), FileName);
+ translatedPath = URIUtils::AddFileToFolder(CServiceBroker::GetSettings()->GetString(CSettings::SETTING_AUDIOCDS_RECORDINGPATH), FileName);
else if (RootDir == "screenshots")
- translatedPath = URIUtils::AddFileToFolder(CServiceBroker::GetSettings().GetString(CSettings::SETTING_DEBUG_SCREENSHOTPATH), FileName);
+ translatedPath = URIUtils::AddFileToFolder(CServiceBroker::GetSettings()->GetString(CSettings::SETTING_DEBUG_SCREENSHOTPATH), FileName);
else if (RootDir == "musicplaylists")
translatedPath = URIUtils::AddFileToFolder(CUtil::MusicPlaylistsLocation(), FileName);
else if (RootDir == "videoplaylists")
diff --git a/xbmc/filesystem/UPnPDirectory.cpp b/xbmc/filesystem/UPnPDirectory.cpp
index c209258c30..e374a288a9 100644
--- a/xbmc/filesystem/UPnPDirectory.cpp
+++ b/xbmc/filesystem/UPnPDirectory.cpp
@@ -132,7 +132,7 @@ CUPnPDirectory::GetFriendlyName(const CURL& url)
+---------------------------------------------------------------------*/
bool CUPnPDirectory::GetResource(const CURL& path, CFileItem &item)
{
- if (!CServiceBroker::GetSettings().GetBool(CSettings::SETTING_SERVICES_UPNP))
+ if (!CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_SERVICES_UPNP))
return false;
if(!path.IsProtocol("upnp"))
@@ -178,7 +178,7 @@ bool CUPnPDirectory::GetResource(const CURL& path, CFileItem &item)
bool
CUPnPDirectory::GetDirectory(const CURL& url, CFileItemList &items)
{
- if (!CServiceBroker::GetSettings().GetBool(CSettings::SETTING_SERVICES_UPNP))
+ if (!CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_SERVICES_UPNP))
return false;
CUPnP* upnp = CUPnP::GetInstance();
diff --git a/xbmc/filesystem/VideoDatabaseDirectory.cpp b/xbmc/filesystem/VideoDatabaseDirectory.cpp
index 4e38d301eb..4fa88e5c46 100644
--- a/xbmc/filesystem/VideoDatabaseDirectory.cpp
+++ b/xbmc/filesystem/VideoDatabaseDirectory.cpp
@@ -225,7 +225,7 @@ std::string CVideoDatabaseDirectory::GetIcon(const std::string &strDirectory)
case NODE_TYPE_TITLE_MOVIES:
if (URIUtils::PathEquals(path, "videodb://movies/titles/"))
{
- if (CServiceBroker::GetSettings().GetBool(CSettings::SETTING_MYVIDEOS_FLATTEN))
+ if (CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_MYVIDEOS_FLATTEN))
return "DefaultMovies.png";
return "DefaultMovieTitle.png";
}
@@ -233,7 +233,7 @@ std::string CVideoDatabaseDirectory::GetIcon(const std::string &strDirectory)
case NODE_TYPE_TITLE_TVSHOWS:
if (URIUtils::PathEquals(path, "videodb://tvshows/titles/"))
{
- if (CServiceBroker::GetSettings().GetBool(CSettings::SETTING_MYVIDEOS_FLATTEN))
+ if (CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_MYVIDEOS_FLATTEN))
return "DefaultTVShows.png";
return "DefaultTVShowTitle.png";
}
@@ -241,7 +241,7 @@ std::string CVideoDatabaseDirectory::GetIcon(const std::string &strDirectory)
case NODE_TYPE_TITLE_MUSICVIDEOS:
if (URIUtils::PathEquals(path, "videodb://musicvideos/titles/"))
{
- if (CServiceBroker::GetSettings().GetBool(CSettings::SETTING_MYVIDEOS_FLATTEN))
+ if (CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_MYVIDEOS_FLATTEN))
return "DefaultMusicVideos.png";
return "DefaultMusicVideoTitle.png";
}
diff --git a/xbmc/filesystem/VideoDatabaseDirectory/DirectoryNodeOverview.cpp b/xbmc/filesystem/VideoDatabaseDirectory/DirectoryNodeOverview.cpp
index 5960368c23..3abac729c5 100644
--- a/xbmc/filesystem/VideoDatabaseDirectory/DirectoryNodeOverview.cpp
+++ b/xbmc/filesystem/VideoDatabaseDirectory/DirectoryNodeOverview.cpp
@@ -61,21 +61,21 @@ bool CDirectoryNodeOverview::GetContent(CFileItemList& items) const
std::vector<std::pair<const char*, int> > vec;
if (hasMovies)
{
- if (CServiceBroker::GetSettings().GetBool(CSettings::SETTING_MYVIDEOS_FLATTEN))
+ if (CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_MYVIDEOS_FLATTEN))
vec.push_back(std::make_pair("movies/titles", 342));
else
vec.push_back(std::make_pair("movies", 342)); // Movies
}
if (hasTvShows)
{
- if (CServiceBroker::GetSettings().GetBool(CSettings::SETTING_MYVIDEOS_FLATTEN))
+ if (CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_MYVIDEOS_FLATTEN))
vec.push_back(std::make_pair("tvshows/titles", 20343));
else
vec.push_back(std::make_pair("tvshows", 20343)); // TV Shows
}
if (hasMusicVideos)
{
- if (CServiceBroker::GetSettings().GetBool(CSettings::SETTING_MYVIDEOS_FLATTEN))
+ if (CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_MYVIDEOS_FLATTEN))
vec.push_back(std::make_pair("musicvideos/titles", 20389));
else
vec.push_back(std::make_pair("musicvideos", 20389)); // Music Videos
diff --git a/xbmc/filesystem/test/TestFileFactory.cpp b/xbmc/filesystem/test/TestFileFactory.cpp
index 2c4f06dbeb..5061b1479a 100644
--- a/xbmc/filesystem/test/TestFileFactory.cpp
+++ b/xbmc/filesystem/test/TestFileFactory.cpp
@@ -20,7 +20,7 @@ class TestFileFactory : public testing::Test
protected:
TestFileFactory()
{
- if (CServiceBroker::GetSettings().Initialize())
+ if (CServiceBroker::GetSettings()->Initialize())
{
std::vector<std::string> advancedsettings =
CXBMCTestUtils::Instance().getAdvancedSettingsFiles();
@@ -28,20 +28,20 @@ protected:
CXBMCTestUtils::Instance().getGUISettingsFiles();
for (const auto& it : guisettings)
- CServiceBroker::GetSettings().Load(it);
+ CServiceBroker::GetSettings()->Load(it);
for (const auto& it : advancedsettings)
g_advancedSettings.ParseSettingsFile(it);
- CServiceBroker::GetSettings().SetLoaded();
+ CServiceBroker::GetSettings()->SetLoaded();
}
}
~TestFileFactory() override
{
g_advancedSettings.Clear();
- CServiceBroker::GetSettings().Unload();
- CServiceBroker::GetSettings().Uninitialize();
+ CServiceBroker::GetSettings()->Unload();
+ CServiceBroker::GetSettings()->Uninitialize();
}
};
diff --git a/xbmc/filesystem/test/TestZipFile.cpp b/xbmc/filesystem/test/TestZipFile.cpp
index e3f3d610b7..61c98bcce3 100644
--- a/xbmc/filesystem/test/TestZipFile.cpp
+++ b/xbmc/filesystem/test/TestZipFile.cpp
@@ -30,12 +30,12 @@ protected:
*/
//! @todo implement
/*
- CSettingsCategory *loc = CServiceBroker::GetSettings().AddCategory(7, "locale", 14090);
- CServiceBroker::GetSettings().AddString(loc, CSettings::SETTING_LOCALE_LANGUAGE,248,"english",
+ CSettingsCategory *loc = CServiceBroker::GetSettings()->AddCategory(7, "locale", 14090);
+ CServiceBroker::GetSettings()->AddString(loc, CSettings::SETTING_LOCALE_LANGUAGE,248,"english",
SPIN_CONTROL_TEXT);
- CServiceBroker::GetSettings().AddString(loc, CSettings::SETTING_LOCALE_COUNTRY, 20026, "USA",
+ CServiceBroker::GetSettings()->AddString(loc, CSettings::SETTING_LOCALE_COUNTRY, 20026, "USA",
SPIN_CONTROL_TEXT);
- CServiceBroker::GetSettings().AddString(loc, CSettings::SETTING_LOCALE_CHARSET, 14091, "DEFAULT",
+ CServiceBroker::GetSettings()->AddString(loc, CSettings::SETTING_LOCALE_CHARSET, 14091, "DEFAULT",
SPIN_CONTROL_TEXT); // charset is set by the
// language file
*/
@@ -43,7 +43,7 @@ protected:
~TestZipFile() override
{
- CServiceBroker::GetSettings().Unload();
+ CServiceBroker::GetSettings()->Unload();
}
};
diff --git a/xbmc/games/GameServices.cpp b/xbmc/games/GameServices.cpp
index 756ca7bf63..447ef9aa53 100644
--- a/xbmc/games/GameServices.cpp
+++ b/xbmc/games/GameServices.cpp
@@ -17,13 +17,12 @@ using namespace GAME;
CGameServices::CGameServices(CControllerManager &controllerManager,
RETRO:: CGUIGameRenderManager &renderManager,
- CSettings &settings,
PERIPHERALS::CPeripherals &peripheralManager,
const CProfilesManager &profileManager) :
m_controllerManager(controllerManager),
m_gameRenderManager(renderManager),
m_profileManager(profileManager),
- m_gameSettings(new CGameSettings(settings))
+ m_gameSettings(new CGameSettings())
{
}
diff --git a/xbmc/games/GameServices.h b/xbmc/games/GameServices.h
index 9749c8a256..db9515b0af 100644
--- a/xbmc/games/GameServices.h
+++ b/xbmc/games/GameServices.h
@@ -14,7 +14,6 @@
#include <string>
class CProfilesManager;
-class CSettings;
namespace PERIPHERALS
{
@@ -38,7 +37,6 @@ namespace GAME
public:
CGameServices(CControllerManager &controllerManager,
RETRO::CGUIGameRenderManager &renderManager,
- CSettings &settings,
PERIPHERALS::CPeripherals &peripheralManager,
const CProfilesManager &profileManager);
~CGameServices();
diff --git a/xbmc/games/GameSettings.cpp b/xbmc/games/GameSettings.cpp
index 0b6f2bf74b..8fa53417d7 100644
--- a/xbmc/games/GameSettings.cpp
+++ b/xbmc/games/GameSettings.cpp
@@ -7,6 +7,7 @@
*/
#include "GameSettings.h"
+#include "ServiceBroker.h"
#include "settings/lib/Setting.h"
#include "settings/Settings.h"
@@ -23,10 +24,11 @@ namespace
const std::string SETTING_GAMES_REWINDTIME = "gamesgeneral.rewindtime";
}
-CGameSettings::CGameSettings(CSettings &settings) :
- m_settings(settings)
+CGameSettings::CGameSettings()
{
- m_settings.RegisterCallback(this, {
+ m_settings = CServiceBroker::GetSettings();
+
+ m_settings->RegisterCallback(this, {
SETTING_GAMES_ENABLEREWIND,
SETTING_GAMES_REWINDTIME,
});
@@ -34,32 +36,32 @@ CGameSettings::CGameSettings(CSettings &settings) :
CGameSettings::~CGameSettings()
{
- m_settings.UnregisterCallback(this);
+ m_settings->UnregisterCallback(this);
}
bool CGameSettings::GamesEnabled()
{
- return m_settings.GetBool(SETTING_GAMES_ENABLE);
+ return m_settings->GetBool(SETTING_GAMES_ENABLE);
}
void CGameSettings::ToggleGames()
{
- m_settings.ToggleBool(SETTING_GAMES_ENABLE);
+ m_settings->ToggleBool(SETTING_GAMES_ENABLE);
}
bool CGameSettings::AutosaveEnabled()
{
- return m_settings.GetBool(SETTING_GAMES_ENABLEAUTOSAVE);
+ return m_settings->GetBool(SETTING_GAMES_ENABLEAUTOSAVE);
}
bool CGameSettings::RewindEnabled()
{
- return m_settings.GetBool(SETTING_GAMES_ENABLEREWIND);
+ return m_settings->GetBool(SETTING_GAMES_ENABLEREWIND);
}
unsigned int CGameSettings::MaxRewindTimeSec()
{
- int rewindTimeSec = m_settings.GetInt(SETTING_GAMES_REWINDTIME);
+ int rewindTimeSec = m_settings->GetInt(SETTING_GAMES_REWINDTIME);
return static_cast<unsigned int>(std::max(rewindTimeSec, 0));
}
diff --git a/xbmc/games/GameSettings.h b/xbmc/games/GameSettings.h
index ce01cfb013..dd746eec47 100644
--- a/xbmc/games/GameSettings.h
+++ b/xbmc/games/GameSettings.h
@@ -23,7 +23,7 @@ class CGameSettings : public ISettingCallback,
public Observable
{
public:
- CGameSettings(CSettings &settings);
+ CGameSettings();
~CGameSettings() override;
// General settings
@@ -38,7 +38,7 @@ public:
private:
// Construction parameters
- CSettings &m_settings;
+ std::shared_ptr<CSettings> m_settings;
};
} // namespace GAME
diff --git a/xbmc/games/dialogs/osd/DialogGameVideoSelect.cpp b/xbmc/games/dialogs/osd/DialogGameVideoSelect.cpp
index cd99f0b6d6..a0e994607d 100644
--- a/xbmc/games/dialogs/osd/DialogGameVideoSelect.cpp
+++ b/xbmc/games/dialogs/osd/DialogGameVideoSelect.cpp
@@ -199,7 +199,7 @@ void CDialogGameVideoSelect::SaveSettings()
if (defaultSettings != currentSettings)
{
defaultSettings = currentSettings;
- CServiceBroker::GetSettings().Save();
+ CServiceBroker::GetSettings()->Save();
}
}
diff --git a/xbmc/games/windows/GUIWindowGames.cpp b/xbmc/games/windows/GUIWindowGames.cpp
index ea77aaca47..745a875135 100644
--- a/xbmc/games/windows/GUIWindowGames.cpp
+++ b/xbmc/games/windows/GUIWindowGames.cpp
@@ -88,7 +88,7 @@ bool CGUIWindowGames::OnClickMsg(int controlId, int actionId)
case ACTION_DELETE_ITEM:
{
// Is delete allowed?
- if (CServiceBroker::GetSettings().GetBool(CSettings::SETTING_FILELISTS_ALLOWFILEDELETION))
+ if (CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_FILELISTS_ALLOWFILEDELETION))
{
OnDeleteItem(iItem);
return true;
@@ -184,7 +184,7 @@ void CGUIWindowGames::GetContextButtons(int itemNumber, CContextButtons &buttons
buttons.Add(CONTEXT_BUTTON_PLAY_ITEM, 208); // Play
}
- if (CServiceBroker::GetSettings().GetBool(CSettings::SETTING_FILELISTS_ALLOWFILEDELETION) && !item->IsReadOnly())
+ if (CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_FILELISTS_ALLOWFILEDELETION) && !item->IsReadOnly())
{
buttons.Add(CONTEXT_BUTTON_DELETE, 117);
buttons.Add(CONTEXT_BUTTON_RENAME, 118);
diff --git a/xbmc/guilib/GUIAudioManager.cpp b/xbmc/guilib/GUIAudioManager.cpp
index cce9c19529..fbcbbcc310 100644
--- a/xbmc/guilib/GUIAudioManager.cpp
+++ b/xbmc/guilib/GUIAudioManager.cpp
@@ -23,19 +23,20 @@
#include "cores/AudioEngine/Interfaces/AE.h"
#include "utils/log.h"
-CGUIAudioManager::CGUIAudioManager(CSettings &settings) :
- m_settings(settings)
+CGUIAudioManager::CGUIAudioManager()
{
+ m_settings = CServiceBroker::GetSettings();
+
m_bEnabled = false;
- m_settings.RegisterCallback(this, {
+ m_settings->RegisterCallback(this, {
CSettings::SETTING_LOOKANDFEEL_SOUNDSKIN,
});
}
CGUIAudioManager::~CGUIAudioManager()
{
- m_settings.UnregisterCallback(this);
+ m_settings->UnregisterCallback(this);
}
void CGUIAudioManager::OnSettingChanged(std::shared_ptr<const CSetting> setting)
@@ -216,7 +217,7 @@ void CGUIAudioManager::UnLoad()
std::string GetSoundSkinPath()
{
- auto setting = std::static_pointer_cast<CSettingString>(CServiceBroker::GetSettings().GetSetting(CSettings::SETTING_LOOKANDFEEL_SOUNDSKIN));
+ auto setting = std::static_pointer_cast<CSettingString>(CServiceBroker::GetSettings()->GetSetting(CSettings::SETTING_LOOKANDFEEL_SOUNDSKIN));
auto value = setting->GetValue();
if (value.empty())
return "";
@@ -405,7 +406,7 @@ IAESound* CGUIAudioManager::LoadWindowSound(TiXmlNode* pWindowNode, const std::s
void CGUIAudioManager::Enable(bool bEnable)
{
// always deinit audio when we don't want gui sounds
- if (CServiceBroker::GetSettings().GetString(CSettings::SETTING_LOOKANDFEEL_SOUNDSKIN).empty())
+ if (CServiceBroker::GetSettings()->GetString(CSettings::SETTING_LOOKANDFEEL_SOUNDSKIN).empty())
bEnable = false;
CSingleLock lock(m_cs);
diff --git a/xbmc/guilib/GUIAudioManager.h b/xbmc/guilib/GUIAudioManager.h
index 6b767f411b..3e8891bbee 100644
--- a/xbmc/guilib/GUIAudioManager.h
+++ b/xbmc/guilib/GUIAudioManager.h
@@ -42,7 +42,7 @@ class CGUIAudioManager : public ISettingCallback
};
public:
- CGUIAudioManager(CSettings &settings);
+ CGUIAudioManager();
~CGUIAudioManager() override;
void OnSettingChanged(std::shared_ptr<const CSetting> setting) override;
@@ -65,7 +65,7 @@ public:
private:
// Construction parameters
- CSettings &m_settings;
+ std::shared_ptr<CSettings> m_settings;
typedef std::map<const std::string, CSoundInfo> soundCache;
typedef std::map<int, IAESound* > actionSoundMap;
diff --git a/xbmc/guilib/GUIBaseContainer.cpp b/xbmc/guilib/GUIBaseContainer.cpp
index d96036c2cc..c139f918d9 100644
--- a/xbmc/guilib/GUIBaseContainer.cpp
+++ b/xbmc/guilib/GUIBaseContainer.cpp
@@ -571,7 +571,7 @@ void CGUIBaseContainer::OnJumpLetter(char letter, bool skip /*=false*/)
{
CGUIListItemPtr item = m_items[i];
std::string label = item->GetLabel();
- if (CServiceBroker::GetSettings().GetBool(CSettings::SETTING_FILELISTS_IGNORETHEWHENSORTING))
+ if (CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_FILELISTS_IGNORETHEWHENSORTING))
label = SortUtils::RemoveArticles(label);
if (0 == strnicmp(label.c_str(), m_match.c_str(), m_match.size()))
{
diff --git a/xbmc/guilib/GUIComponent.cpp b/xbmc/guilib/GUIComponent.cpp
index 1c8968cd09..b8f026868b 100644
--- a/xbmc/guilib/GUIComponent.cpp
+++ b/xbmc/guilib/GUIComponent.cpp
@@ -23,10 +23,10 @@ CGUIComponent::CGUIComponent()
m_pWindowManager.reset(new CGUIWindowManager());
m_pTextureManager.reset(new CGUITextureManager());
m_pLargeTextureManager.reset(new CGUILargeTextureManager());
- m_stereoscopicsManager.reset(new CStereoscopicsManager(CServiceBroker::GetSettings()));
+ m_stereoscopicsManager.reset(new CStereoscopicsManager());
m_guiInfoManager.reset(new CGUIInfoManager());
m_guiColorManager.reset(new CGUIColorManager());
- m_guiAudioManager.reset(new CGUIAudioManager(CServiceBroker::GetSettings()));
+ m_guiAudioManager.reset(new CGUIAudioManager());
}
CGUIComponent::~CGUIComponent()
diff --git a/xbmc/guilib/GUIKeyboardFactory.cpp b/xbmc/guilib/GUIKeyboardFactory.cpp
index 3647ffef81..4121f89a9d 100644
--- a/xbmc/guilib/GUIKeyboardFactory.cpp
+++ b/xbmc/guilib/GUIKeyboardFactory.cpp
@@ -184,7 +184,7 @@ int CGUIKeyboardFactory::ShowAndVerifyPassword(std::string& strPassword, const s
else
strHeadingTemp = StringUtils::Format("%s - %i %s",
g_localizeStrings.Get(12326).c_str(),
- CServiceBroker::GetSettings().GetInt(CSettings::SETTING_MASTERLOCK_MAXRETRIES) - iRetries,
+ CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_MASTERLOCK_MAXRETRIES) - iRetries,
g_localizeStrings.Get(12343).c_str());
std::string strUserInput;
diff --git a/xbmc/guilib/GUIRSSControl.cpp b/xbmc/guilib/GUIRSSControl.cpp
index e5eeea722d..f8efd00323 100644
--- a/xbmc/guilib/GUIRSSControl.cpp
+++ b/xbmc/guilib/GUIRSSControl.cpp
@@ -89,7 +89,7 @@ bool CGUIRSSControl::UpdateColors()
void CGUIRSSControl::Process(unsigned int currentTime, CDirtyRegionList &dirtyregions)
{
bool dirty = false;
- if (CServiceBroker::GetSettings().GetBool(CSettings::SETTING_LOOKANDFEEL_ENABLERSSFEEDS) && CRssManager::GetInstance().IsActive())
+ if (CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_LOOKANDFEEL_ENABLERSSFEEDS) && CRssManager::GetInstance().IsActive())
{
CSingleLock lock(m_criticalSection);
// Create RSS background/worker thread if needed
@@ -150,7 +150,7 @@ void CGUIRSSControl::Process(unsigned int currentTime, CDirtyRegionList &dirtyre
void CGUIRSSControl::Render()
{
// only render the control if they are enabled
- if (CServiceBroker::GetSettings().GetBool(CSettings::SETTING_LOOKANDFEEL_ENABLERSSFEEDS) && CRssManager::GetInstance().IsActive())
+ if (CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_LOOKANDFEEL_ENABLERSSFEEDS) && CRssManager::GetInstance().IsActive())
{
if (m_label.font)
diff --git a/xbmc/guilib/GUIVisualisationControl.cpp b/xbmc/guilib/GUIVisualisationControl.cpp
index 1567e4978e..5d3e176094 100644
--- a/xbmc/guilib/GUIVisualisationControl.cpp
+++ b/xbmc/guilib/GUIVisualisationControl.cpp
@@ -369,7 +369,7 @@ bool CGUIVisualisationControl::GetPresetList(std::vector<std::string> &vecpreset
bool CGUIVisualisationControl::InitVisualization()
{
- const ADDON::BinaryAddonBasePtr addonBase = CServiceBroker::GetBinaryAddonManager().GetInstalledAddonInfo(CServiceBroker::GetSettings().GetString(CSettings::SETTING_MUSICPLAYER_VISUALISATION), ADDON::ADDON_VIZ);
+ const ADDON::BinaryAddonBasePtr addonBase = CServiceBroker::GetBinaryAddonManager().GetInstalledAddonInfo(CServiceBroker::GetSettings()->GetString(CSettings::SETTING_MUSICPLAYER_VISUALISATION), ADDON::ADDON_VIZ);
if (!addonBase)
return false;
diff --git a/xbmc/guilib/StereoscopicsManager.cpp b/xbmc/guilib/StereoscopicsManager.cpp
index dc2997855f..dade21e0d8 100644
--- a/xbmc/guilib/StereoscopicsManager.cpp
+++ b/xbmc/guilib/StereoscopicsManager.cpp
@@ -87,9 +87,10 @@ static const struct StereoModeMap StringToGuiModeMap[] =
};
-CStereoscopicsManager::CStereoscopicsManager(CSettings &settings) :
- m_settings(settings)
+CStereoscopicsManager::CStereoscopicsManager()
{
+ m_settings = CServiceBroker::GetSettings();
+
m_stereoModeSetByUser = RENDER_STEREO_MODE_UNDEFINED;
m_lastStereoModeSetByUser = RENDER_STEREO_MODE_UNDEFINED;
@@ -97,12 +98,12 @@ CStereoscopicsManager::CStereoscopicsManager(CSettings &settings) :
std::set<std::string> settingSet{
CSettings::SETTING_VIDEOSCREEN_STEREOSCOPICMODE
};
- m_settings.GetSettingsManager()->RegisterCallback(this, settingSet);
+ m_settings->GetSettingsManager()->RegisterCallback(this, settingSet);
}
CStereoscopicsManager::~CStereoscopicsManager(void)
{
- m_settings.GetSettingsManager()->UnregisterCallback(this);
+ m_settings->GetSettingsManager()->UnregisterCallback(this);
}
void CStereoscopicsManager::Initialize()
@@ -113,7 +114,7 @@ void CStereoscopicsManager::Initialize()
RENDER_STEREO_MODE CStereoscopicsManager::GetStereoMode(void) const
{
- return static_cast<RENDER_STEREO_MODE>(m_settings.GetInt(CSettings::SETTING_VIDEOSCREEN_STEREOSCOPICMODE));
+ return static_cast<RENDER_STEREO_MODE>(m_settings->GetInt(CSettings::SETTING_VIDEOSCREEN_STEREOSCOPICMODE));
}
void CStereoscopicsManager::SetStereoModeByUser(const RENDER_STEREO_MODE &mode)
@@ -138,7 +139,7 @@ void CStereoscopicsManager::SetStereoMode(const RENDER_STEREO_MODE &mode)
if (applyMode != currentMode && applyMode >= RENDER_STEREO_MODE_OFF)
{
if (CServiceBroker::GetRenderSystem()->SupportsStereo(applyMode))
- m_settings.SetInt(CSettings::SETTING_VIDEOSCREEN_STEREOSCOPICMODE, applyMode);
+ m_settings->SetInt(CSettings::SETTING_VIDEOSCREEN_STEREOSCOPICMODE, applyMode);
}
}
@@ -290,7 +291,7 @@ std::string CStereoscopicsManager::GetLabelForStereoMode(const RENDER_STEREO_MOD
RENDER_STEREO_MODE CStereoscopicsManager::GetPreferredPlaybackMode(void) const
{
- return static_cast<RENDER_STEREO_MODE>(m_settings.GetInt(CSettings::SETTING_VIDEOSCREEN_PREFEREDSTEREOSCOPICMODE));
+ return static_cast<RENDER_STEREO_MODE>(m_settings->GetInt(CSettings::SETTING_VIDEOSCREEN_PREFEREDSTEREOSCOPICMODE));
}
int CStereoscopicsManager::ConvertVideoToGuiStereoMode(const std::string &mode)
@@ -513,7 +514,7 @@ bool CStereoscopicsManager::IsVideoStereoscopic() const
void CStereoscopicsManager::OnStreamChange()
{
- STEREOSCOPIC_PLAYBACK_MODE playbackMode = static_cast<STEREOSCOPIC_PLAYBACK_MODE>(m_settings.GetInt(CSettings::SETTING_VIDEOPLAYER_STEREOSCOPICPLAYBACKMODE));
+ STEREOSCOPIC_PLAYBACK_MODE playbackMode = static_cast<STEREOSCOPIC_PLAYBACK_MODE>(m_settings->GetInt(CSettings::SETTING_VIDEOPLAYER_STEREOSCOPICPLAYBACKMODE));
RENDER_STEREO_MODE mode = GetStereoMode();
// early return if playback mode should be ignored and we're in no stereoscopic mode right now
@@ -524,7 +525,7 @@ void CStereoscopicsManager::OnStreamChange()
{
// exit stereo mode if started item is not stereoscopic
// and if user prefers to stop 3D playback when movie is finished
- if (mode != RENDER_STEREO_MODE_OFF && m_settings.GetBool(CSettings::SETTING_VIDEOPLAYER_QUITSTEREOMODEONSTOP))
+ if (mode != RENDER_STEREO_MODE_OFF && m_settings->GetBool(CSettings::SETTING_VIDEOPLAYER_QUITSTEREOMODEONSTOP))
SetStereoMode(RENDER_STEREO_MODE_OFF);
return;
}
@@ -545,7 +546,7 @@ void CStereoscopicsManager::OnStreamChange()
// users selecting this option usually have to manually switch their TV into 3D mode
// and would be annoyed by having to switch TV modes when next movies comes up
// @todo probably add a new setting for just this behavior
- if (m_settings.GetBool(CSettings::SETTING_VIDEOPLAYER_QUITSTEREOMODEONSTOP) == false)
+ if (m_settings->GetBool(CSettings::SETTING_VIDEOPLAYER_QUITSTEREOMODEONSTOP) == false)
return;
// only change to new stereo mode if not yet in preferred stereo mode
@@ -612,7 +613,7 @@ void CStereoscopicsManager::OnPlaybackStopped(void)
{
RENDER_STEREO_MODE mode = GetStereoMode();
- if (m_settings.GetBool(CSettings::SETTING_VIDEOPLAYER_QUITSTEREOMODEONSTOP) && mode != RENDER_STEREO_MODE_OFF)
+ if (m_settings->GetBool(CSettings::SETTING_VIDEOPLAYER_QUITSTEREOMODEONSTOP) && mode != RENDER_STEREO_MODE_OFF)
SetStereoMode(RENDER_STEREO_MODE_OFF);
// reset user modes on playback end to start over new on next playback and not end up in a probably unwanted mode
diff --git a/xbmc/guilib/StereoscopicsManager.h b/xbmc/guilib/StereoscopicsManager.h
index fd773ae4e9..1855534cc3 100644
--- a/xbmc/guilib/StereoscopicsManager.h
+++ b/xbmc/guilib/StereoscopicsManager.h
@@ -36,7 +36,7 @@ class CStereoscopicsManager : public ISettingCallback,
public IMsgTargetCallback
{
public:
- CStereoscopicsManager(CSettings &settings);
+ CStereoscopicsManager();
~CStereoscopicsManager(void) override;
@@ -90,7 +90,7 @@ private:
static int ConvertVideoToGuiStereoMode(const std::string &mode);
// Construction parameters
- CSettings &m_settings;
+ std::shared_ptr<CSettings> m_settings;
// Stereoscopic parameters
RENDER_STEREO_MODE m_stereoModeSetByUser;
diff --git a/xbmc/guilib/TextureBundleXBT.cpp b/xbmc/guilib/TextureBundleXBT.cpp
index c1fa6fa759..a17aaf9ccb 100644
--- a/xbmc/guilib/TextureBundleXBT.cpp
+++ b/xbmc/guilib/TextureBundleXBT.cpp
@@ -61,14 +61,14 @@ bool CTextureBundleXBT::OpenBundle()
{
mediaDir = CSpecialProtocol::TranslatePath(
URIUtils::AddFileToFolder("special://home/addons",
- CServiceBroker::GetSettings().GetString(CSettings::SETTING_LOOKANDFEEL_SKIN)));
+ CServiceBroker::GetSettings()->GetString(CSettings::SETTING_LOOKANDFEEL_SKIN)));
}
if (m_themeBundle)
{
// if we are the theme bundle, we only load if the user has chosen
// a valid theme (or the skin has a default one)
- std::string theme = CServiceBroker::GetSettings().GetString(CSettings::SETTING_LOOKANDFEEL_SKINTHEME);
+ std::string theme = CServiceBroker::GetSettings()->GetString(CSettings::SETTING_LOOKANDFEEL_SKINTHEME);
if (!theme.empty() && !StringUtils::EqualsNoCase(theme, "SKINDEFAULT"))
{
std::string themeXBT(URIUtils::ReplaceExtension(theme, ".xbt"));
diff --git a/xbmc/guilib/guiinfo/GUIControlsGUIInfo.cpp b/xbmc/guilib/guiinfo/GUIControlsGUIInfo.cpp
index 6143a9dd15..4832f64a29 100644
--- a/xbmc/guilib/guiinfo/GUIControlsGUIInfo.cpp
+++ b/xbmc/guilib/guiinfo/GUIControlsGUIInfo.cpp
@@ -315,7 +315,7 @@ bool CGUIControlsGUIInfo::GetLabel(std::string& value, const CFileItem *item, in
value = g_localizeStrings.Get(CServiceBroker::GetGUI()->GetWindowManager().GetActiveWindowOrDialog());
return true;
case SYSTEM_STARTUP_WINDOW:
- value = StringUtils::Format("%i", CServiceBroker::GetSettings().GetInt(CSettings::SETTING_LOOKANDFEEL_STARTUPWINDOW));
+ value = StringUtils::Format("%i", CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_LOOKANDFEEL_STARTUPWINDOW));
return true;
case SYSTEM_CURRENT_CONTROL:
case SYSTEM_CURRENT_CONTROL_ID:
diff --git a/xbmc/guilib/guiinfo/SkinGUIInfo.cpp b/xbmc/guilib/guiinfo/SkinGUIInfo.cpp
index feee3a3703..b58c1ea923 100644
--- a/xbmc/guilib/guiinfo/SkinGUIInfo.cpp
+++ b/xbmc/guilib/guiinfo/SkinGUIInfo.cpp
@@ -50,12 +50,12 @@ bool CSkinGUIInfo::GetLabel(std::string& value, const CFileItem *item, int conte
}
case SKIN_THEME:
{
- value = CServiceBroker::GetSettings().GetString(CSettings::SETTING_LOOKANDFEEL_SKINTHEME);
+ value = CServiceBroker::GetSettings()->GetString(CSettings::SETTING_LOOKANDFEEL_SKINTHEME);
return true;
}
case SKIN_COLOUR_THEME:
{
- value = CServiceBroker::GetSettings().GetString(CSettings::SETTING_LOOKANDFEEL_SKINCOLORS);
+ value = CServiceBroker::GetSettings()->GetString(CSettings::SETTING_LOOKANDFEEL_SKINCOLORS);
return true;
}
case SKIN_ASPECT_RATIO:
@@ -69,7 +69,7 @@ bool CSkinGUIInfo::GetLabel(std::string& value, const CFileItem *item, int conte
}
case SKIN_FONT:
{
- value = CServiceBroker::GetSettings().GetString(CSettings::SETTING_LOOKANDFEEL_FONT);
+ value = CServiceBroker::GetSettings()->GetString(CSettings::SETTING_LOOKANDFEEL_FONT);
return true;
}
}
@@ -106,7 +106,7 @@ bool CSkinGUIInfo::GetBool(bool& value, const CGUIListItem *gitem, int contextWi
}
case SKIN_HAS_THEME:
{
- std::string theme = CServiceBroker::GetSettings().GetString(CSettings::SETTING_LOOKANDFEEL_SKINTHEME);
+ std::string theme = CServiceBroker::GetSettings()->GetString(CSettings::SETTING_LOOKANDFEEL_SKINTHEME);
URIUtils::RemoveExtension(theme);
value = StringUtils::EqualsNoCase(theme, info.GetData3());
return true;
diff --git a/xbmc/guilib/guiinfo/SystemGUIInfo.cpp b/xbmc/guilib/guiinfo/SystemGUIInfo.cpp
index b888c3b06b..8c34687746 100644
--- a/xbmc/guilib/guiinfo/SystemGUIInfo.cpp
+++ b/xbmc/guilib/guiinfo/SystemGUIInfo.cpp
@@ -280,7 +280,7 @@ bool CSystemGUIInfo::GetLabel(std::string& value, const CFileItem *item, int con
return true;
case SYSTEM_STEREOSCOPIC_MODE:
{
- int iStereoMode = CServiceBroker::GetSettings().GetInt(CSettings::SETTING_VIDEOSCREEN_STEREOSCOPICMODE);
+ int iStereoMode = CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_VIDEOSCREEN_STEREOSCOPICMODE);
value = StringUtils::Format("%i", iStereoMode);
return true;
}
@@ -547,7 +547,7 @@ bool CSystemGUIInfo::GetBool(bool& value, const CGUIListItem *gitem, int context
value = g_application.IsIdleShutdownInhibited();
return true;
case SYSTEM_HAS_SHUTDOWN:
- value = (CServiceBroker::GetSettings().GetInt(CSettings::SETTING_POWERMANAGEMENT_SHUTDOWNTIME) > 0);
+ value = (CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_POWERMANAGEMENT_SHUTDOWNTIME) > 0);
return true;
case SYSTEM_LOGGEDON:
value = !(CServiceBroker::GetGUI()->GetWindowManager().GetActiveWindow() == WINDOW_LOGIN_SCREEN);
@@ -611,7 +611,7 @@ bool CSystemGUIInfo::GetBool(bool& value, const CGUIListItem *gitem, int context
value = g_alarmClock.HasAlarm(info.GetData3());
return true;
case SYSTEM_GET_BOOL:
- value = CServiceBroker::GetSettings().GetBool(info.GetData3());
+ value = CServiceBroker::GetSettings()->GetBool(info.GetData3());
return true;
case SYSTEM_SETTING:
{
diff --git a/xbmc/guilib/guiinfo/VideoGUIInfo.cpp b/xbmc/guilib/guiinfo/VideoGUIInfo.cpp
index 7f26d24201..14c7f56354 100644
--- a/xbmc/guilib/guiinfo/VideoGUIInfo.cpp
+++ b/xbmc/guilib/guiinfo/VideoGUIInfo.cpp
@@ -328,7 +328,7 @@ bool CVideoGUIInfo::GetLabel(std::string& value, const CFileItem *item, int cont
if (tag->m_type != MediaTypeTvShow &&
tag->m_type != MediaTypeVideoCollection &&
tag->GetPlayCount() == 0 &&
- !CServiceBroker::GetSettings().GetBool(CSettings::SETTING_VIDEOLIBRARY_SHOWUNWATCHEDPLOTS))
+ !CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_VIDEOLIBRARY_SHOWUNWATCHEDPLOTS))
{
value = g_localizeStrings.Get(20370);
}
@@ -630,7 +630,7 @@ bool CVideoGUIInfo::GetBool(bool& value, const CGUIListItem *gitem, int contextW
return value; // if no match for this provider, other providers shall be asked.
}
case VIDEOPLAYER_USING_OVERLAYS:
- value = (CServiceBroker::GetSettings().GetInt(CSettings::SETTING_VIDEOPLAYER_RENDERMETHOD) == RENDER_OVERLAYS);
+ value = (CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_VIDEOPLAYER_RENDERMETHOD) == RENDER_OVERLAYS);
return true;
case VIDEOPLAYER_ISFULLSCREEN:
value = CServiceBroker::GetGUI()->GetWindowManager().GetActiveWindow() == WINDOW_FULLSCREEN_VIDEO ||
diff --git a/xbmc/guilib/guiinfo/VisualisationGUIInfo.cpp b/xbmc/guilib/guiinfo/VisualisationGUIInfo.cpp
index b9da45f45e..bec0f6cdef 100644
--- a/xbmc/guilib/guiinfo/VisualisationGUIInfo.cpp
+++ b/xbmc/guilib/guiinfo/VisualisationGUIInfo.cpp
@@ -53,7 +53,7 @@ bool CVisualisationGUIInfo::GetLabel(std::string& value, const CFileItem *item,
case VISUALISATION_NAME:
{
ADDON::AddonPtr addon;
- value = CServiceBroker::GetSettings().GetString(CSettings::SETTING_MUSICPLAYER_VISUALISATION);
+ value = CServiceBroker::GetSettings()->GetString(CSettings::SETTING_MUSICPLAYER_VISUALISATION);
if (CServiceBroker::GetAddonMgr().GetAddon(value, addon) && addon)
{
value = addon->Name();
@@ -91,7 +91,7 @@ bool CVisualisationGUIInfo::GetBool(bool& value, const CGUIListItem *gitem, int
}
case VISUALISATION_ENABLED:
{
- value = !CServiceBroker::GetSettings().GetString(CSettings::SETTING_MUSICPLAYER_VISUALISATION).empty();
+ value = !CServiceBroker::GetSettings()->GetString(CSettings::SETTING_MUSICPLAYER_VISUALISATION).empty();
return true;
}
case VISUALISATION_HAS_PRESETS:
diff --git a/xbmc/guilib/guiinfo/WeatherGUIInfo.cpp b/xbmc/guilib/guiinfo/WeatherGUIInfo.cpp
index 0018d68e87..514e744ce6 100644
--- a/xbmc/guilib/guiinfo/WeatherGUIInfo.cpp
+++ b/xbmc/guilib/guiinfo/WeatherGUIInfo.cpp
@@ -53,7 +53,7 @@ bool CWeatherGUIInfo::GetLabel(std::string& value, const CFileItem *item, int co
URIUtils::RemoveExtension(value);
return true;
case WEATHER_PLUGIN:
- value = CServiceBroker::GetSettings().GetString(CSettings::SETTING_WEATHER_ADDON);
+ value = CServiceBroker::GetSettings()->GetString(CSettings::SETTING_WEATHER_ADDON);
return true;
}
diff --git a/xbmc/input/InputManager.cpp b/xbmc/input/InputManager.cpp
index ac43269b8a..7d9c0d208b 100644
--- a/xbmc/input/InputManager.cpp
+++ b/xbmc/input/InputManager.cpp
@@ -67,7 +67,7 @@ CInputManager::CInputManager(const CAppParamParser &params) :
// Register settings
std::set<std::string> settingSet;
settingSet.insert(CSettings::SETTING_INPUT_ENABLEMOUSE);
- CServiceBroker::GetSettings().RegisterCallback(this, settingSet);
+ CServiceBroker::GetSettings()->RegisterCallback(this, settingSet);
}
CInputManager::~CInputManager()
@@ -75,7 +75,7 @@ CInputManager::~CInputManager()
Deinitialize();
// Unregister settings
- CServiceBroker::GetSettings().UnregisterCallback(this);
+ CServiceBroker::GetSettings()->UnregisterCallback(this);
UnregisterKeyboardDriverHandler(m_keyboardEasterEgg.get());
@@ -89,7 +89,7 @@ void CInputManager::InitializeInputs()
m_Keyboard.Initialize();
m_Mouse.Initialize();
- m_Mouse.SetEnabled(CServiceBroker::GetSettings().GetBool(CSettings::SETTING_INPUT_ENABLEMOUSE));
+ m_Mouse.SetEnabled(CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_INPUT_ENABLEMOUSE));
}
void CInputManager::Deinitialize()
diff --git a/xbmc/input/joysticks/dialogs/GUIDialogNewJoystick.cpp b/xbmc/input/joysticks/dialogs/GUIDialogNewJoystick.cpp
index cc0c659b36..475cfd7866 100644
--- a/xbmc/input/joysticks/dialogs/GUIDialogNewJoystick.cpp
+++ b/xbmc/input/joysticks/dialogs/GUIDialogNewJoystick.cpp
@@ -28,7 +28,7 @@ void CGUIDialogNewJoystick::ShowAsync()
if (IsRunning())
bShow = false;
- else if (!CServiceBroker::GetSettings().GetBool(CSettings::SETTING_INPUT_ASKNEWCONTROLLERS))
+ else if (!CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_INPUT_ASKNEWCONTROLLERS))
bShow = false;
else if (CServiceBroker::GetGUI()->GetWindowManager().IsWindowActive(WINDOW_DIALOG_GAME_CONTROLLERS, false))
bShow = false;
@@ -49,6 +49,6 @@ void CGUIDialogNewJoystick::Process()
}
else
{
- CServiceBroker::GetSettings().SetBool(CSettings::SETTING_INPUT_ASKNEWCONTROLLERS, false);
+ CServiceBroker::GetSettings()->SetBool(CSettings::SETTING_INPUT_ASKNEWCONTROLLERS, false);
}
}
diff --git a/xbmc/interfaces/builtins/ApplicationBuiltins.cpp b/xbmc/interfaces/builtins/ApplicationBuiltins.cpp
index 1efb8c342b..259ee0fedf 100644
--- a/xbmc/interfaces/builtins/ApplicationBuiltins.cpp
+++ b/xbmc/interfaces/builtins/ApplicationBuiltins.cpp
@@ -112,8 +112,8 @@ static int SetVolume(const std::vector<std::string>& params)
*/
static int ToggleDebug(const std::vector<std::string>& params)
{
- bool debug = CServiceBroker::GetSettings().GetBool(CSettings::SETTING_DEBUG_SHOWLOGINFO);
- CServiceBroker::GetSettings().SetBool(CSettings::SETTING_DEBUG_SHOWLOGINFO, !debug);
+ bool debug = CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_DEBUG_SHOWLOGINFO);
+ CServiceBroker::GetSettings()->SetBool(CSettings::SETTING_DEBUG_SHOWLOGINFO, !debug);
g_advancedSettings.SetDebugMode(!debug);
return 0;
diff --git a/xbmc/interfaces/builtins/Builtins.cpp b/xbmc/interfaces/builtins/Builtins.cpp
index 50f5291bea..7d901d8fe6 100644
--- a/xbmc/interfaces/builtins/Builtins.cpp
+++ b/xbmc/interfaces/builtins/Builtins.cpp
@@ -112,7 +112,7 @@ bool CBuiltins::IsSystemPowerdownCommand(const std::string& execString)
}
else if (execute == "shutdown")
{
- switch (CServiceBroker::GetSettings().GetInt(CSettings::SETTING_POWERMANAGEMENT_SHUTDOWNSTATE))
+ switch (CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_POWERMANAGEMENT_SHUTDOWNSTATE))
{
case POWERSTATE_SHUTDOWN:
case POWERSTATE_SUSPEND:
diff --git a/xbmc/interfaces/builtins/PlayerBuiltins.cpp b/xbmc/interfaces/builtins/PlayerBuiltins.cpp
index 7a735e01b1..72c2e86307 100644
--- a/xbmc/interfaces/builtins/PlayerBuiltins.cpp
+++ b/xbmc/interfaces/builtins/PlayerBuiltins.cpp
@@ -271,11 +271,11 @@ static int PlayerControl(const std::vector<std::string>& params)
{
case PLAYLIST_MUSIC:
CMediaSettings::GetInstance().SetMusicPlaylistShuffled(CServiceBroker::GetPlaylistPlayer().IsShuffled(iPlaylist));
- CServiceBroker::GetSettings().Save();
+ CServiceBroker::GetSettings()->Save();
break;
case PLAYLIST_VIDEO:
CMediaSettings::GetInstance().SetVideoPlaylistShuffled(CServiceBroker::GetPlaylistPlayer().IsShuffled(iPlaylist));
- CServiceBroker::GetSettings().Save();
+ CServiceBroker::GetSettings()->Save();
default:
break;
}
@@ -319,11 +319,11 @@ static int PlayerControl(const std::vector<std::string>& params)
{
case PLAYLIST_MUSIC:
CMediaSettings::GetInstance().SetMusicPlaylistRepeat(state == PLAYLIST::REPEAT_ALL);
- CServiceBroker::GetSettings().Save();
+ CServiceBroker::GetSettings()->Save();
break;
case PLAYLIST_VIDEO:
CMediaSettings::GetInstance().SetVideoPlaylistRepeat(state == PLAYLIST::REPEAT_ALL);
- CServiceBroker::GetSettings().Save();
+ CServiceBroker::GetSettings()->Save();
}
// send messages so now playing window can get updated
diff --git a/xbmc/interfaces/builtins/SkinBuiltins.cpp b/xbmc/interfaces/builtins/SkinBuiltins.cpp
index bdf5fb150e..2c6a30cab8 100644
--- a/xbmc/interfaces/builtins/SkinBuiltins.cpp
+++ b/xbmc/interfaces/builtins/SkinBuiltins.cpp
@@ -62,7 +62,7 @@ static int ToggleSetting(const std::vector<std::string>& params)
{
int setting = CSkinSettings::GetInstance().TranslateBool(params[0]);
CSkinSettings::GetInstance().SetBool(setting, !CSkinSettings::GetInstance().GetBool(setting));
- CServiceBroker::GetSettings().Save();
+ CServiceBroker::GetSettings()->Save();
return 0;
}
@@ -86,7 +86,7 @@ static int SetAddon(const std::vector<std::string>& params)
if (!types.empty() && CGUIWindowAddonBrowser::SelectAddonID(types, result, true) == 1)
{
CSkinSettings::GetInstance().SetString(string, result);
- CServiceBroker::GetSettings().Save();
+ CServiceBroker::GetSettings()->Save();
}
return 0;
@@ -130,7 +130,7 @@ static int SelectBool(const std::vector<std::string>& params)
else
CSkinSettings::GetInstance().SetBool(setting, false);
}
- CServiceBroker::GetSettings().Save();
+ CServiceBroker::GetSettings()->Save();
}
return 0;
@@ -147,13 +147,13 @@ static int SetBool(const std::vector<std::string>& params)
{
int string = CSkinSettings::GetInstance().TranslateBool(params[0]);
CSkinSettings::GetInstance().SetBool(string, StringUtils::EqualsNoCase(params[1], "true"));
- CServiceBroker::GetSettings().Save();
+ CServiceBroker::GetSettings()->Save();
return 0;
}
// default is to set it to true
int setting = CSkinSettings::GetInstance().TranslateBool(params[0]);
CSkinSettings::GetInstance().SetBool(setting, true);
- CServiceBroker::GetSettings().Save();
+ CServiceBroker::GetSettings()->Save();
return 0;
}
@@ -201,7 +201,7 @@ static int SetPath(const std::vector<std::string>& params)
if (CGUIDialogFileBrowser::ShowAndGetDirectory(localShares, g_localizeStrings.Get(657), value))
CSkinSettings::GetInstance().SetString(string, value);
- CServiceBroker::GetSettings().Save();
+ CServiceBroker::GetSettings()->Save();
return 0;
}
@@ -313,7 +313,7 @@ static int SetString(const std::vector<std::string>& params)
{
string = CSkinSettings::GetInstance().TranslateString(params[0]);
CSkinSettings::GetInstance().SetString(string, params[1]);
- CServiceBroker::GetSettings().Save();
+ CServiceBroker::GetSettings()->Save();
return 0;
}
else
@@ -339,11 +339,11 @@ static int SetTheme(const std::vector<std::string>& params)
int iTheme = -1;
// find current theme
- if (!StringUtils::EqualsNoCase(CServiceBroker::GetSettings().GetString(CSettings::SETTING_LOOKANDFEEL_SKINTHEME), "SKINDEFAULT"))
+ if (!StringUtils::EqualsNoCase(CServiceBroker::GetSettings()->GetString(CSettings::SETTING_LOOKANDFEEL_SKINTHEME), "SKINDEFAULT"))
{
for (size_t i=0;i<vecTheme.size();++i)
{
- std::string strTmpTheme(CServiceBroker::GetSettings().GetString(CSettings::SETTING_LOOKANDFEEL_SKINTHEME));
+ std::string strTmpTheme(CServiceBroker::GetSettings()->GetString(CSettings::SETTING_LOOKANDFEEL_SKINTHEME));
URIUtils::RemoveExtension(strTmpTheme);
if (StringUtils::EqualsNoCase(vecTheme[i], strTmpTheme))
{
@@ -367,12 +367,12 @@ static int SetTheme(const std::vector<std::string>& params)
if (iTheme != -1 && iTheme < (int)vecTheme.size())
strSkinTheme = vecTheme[iTheme];
- CServiceBroker::GetSettings().SetString(CSettings::SETTING_LOOKANDFEEL_SKINTHEME, strSkinTheme);
+ CServiceBroker::GetSettings()->SetString(CSettings::SETTING_LOOKANDFEEL_SKINTHEME, strSkinTheme);
// also set the default color theme
std::string colorTheme(URIUtils::ReplaceExtension(strSkinTheme, ".xml"));
if (StringUtils::EqualsNoCase(colorTheme, "Textures.xml"))
colorTheme = "defaults.xml";
- CServiceBroker::GetSettings().SetString(CSettings::SETTING_LOOKANDFEEL_SKINCOLORS, colorTheme);
+ CServiceBroker::GetSettings()->SetString(CSettings::SETTING_LOOKANDFEEL_SKINCOLORS, colorTheme);
g_application.ReloadSkin();
return 0;
@@ -385,7 +385,7 @@ static int SetTheme(const std::vector<std::string>& params)
static int SkinReset(const std::vector<std::string>& params)
{
CSkinSettings::GetInstance().Reset(params[0]);
- CServiceBroker::GetSettings().Save();
+ CServiceBroker::GetSettings()->Save();
return 0;
}
@@ -396,7 +396,7 @@ static int SkinReset(const std::vector<std::string>& params)
static int SkinResetAll(const std::vector<std::string>& params)
{
CSkinSettings::GetInstance().Reset();
- CServiceBroker::GetSettings().Save();
+ CServiceBroker::GetSettings()->Save();
return 0;
}
diff --git a/xbmc/interfaces/json-rpc/AudioLibrary.cpp b/xbmc/interfaces/json-rpc/AudioLibrary.cpp
index 08e753cb3f..784e297187 100644
--- a/xbmc/interfaces/json-rpc/AudioLibrary.cpp
+++ b/xbmc/interfaces/json-rpc/AudioLibrary.cpp
@@ -103,7 +103,7 @@ JSONRPC_STATUS CAudioLibrary::GetArtists(const std::string &method, ITransportLa
musicUrl.AddOption("xsp", xsp);
}
- bool albumArtistsOnly = !CServiceBroker::GetSettings().GetBool(CSettings::SETTING_MUSICLIBRARY_SHOWCOMPILATIONARTISTS);
+ bool albumArtistsOnly = !CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_MUSICLIBRARY_SHOWCOMPILATIONARTISTS);
if (parameterObject["albumartistsonly"].isBoolean())
albumArtistsOnly = parameterObject["albumartistsonly"].asBoolean();
musicUrl.AddOption("albumartistsonly", albumArtistsOnly);
@@ -1027,11 +1027,11 @@ bool CAudioLibrary::FillFileItemList(const CVariant &parameterObject, CFileItemL
// If we retrieved the list of songs by "artistid"
// we sort by album (and implicitly by track number)
if (artistID != -1)
- list.Sort(SortByAlbum, SortOrderAscending, CServiceBroker::GetSettings().GetBool(CSettings::SETTING_FILELISTS_IGNORETHEWHENSORTING) ? SortAttributeIgnoreArticle : SortAttributeNone);
+ list.Sort(SortByAlbum, SortOrderAscending, CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_FILELISTS_IGNORETHEWHENSORTING) ? SortAttributeIgnoreArticle : SortAttributeNone);
// If we retrieve the list of songs by "genreid"
// we sort by artist (and implicitly by album and track number)
else if (genreID != -1)
- list.Sort(SortByArtist, SortOrderAscending, CServiceBroker::GetSettings().GetBool(CSettings::SETTING_FILELISTS_IGNORETHEWHENSORTING) ? SortAttributeIgnoreArticle : SortAttributeNone);
+ list.Sort(SortByArtist, SortOrderAscending, CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_FILELISTS_IGNORETHEWHENSORTING) ? SortAttributeIgnoreArticle : SortAttributeNone);
// otherwise we sort by track number
else
list.Sort(SortByTrackNumber, SortOrderAscending);
diff --git a/xbmc/interfaces/json-rpc/GUIOperations.cpp b/xbmc/interfaces/json-rpc/GUIOperations.cpp
index 8178a66bbe..666f56d025 100644
--- a/xbmc/interfaces/json-rpc/GUIOperations.cpp
+++ b/xbmc/interfaces/json-rpc/GUIOperations.cpp
@@ -133,7 +133,7 @@ JSONRPC_STATUS CGUIOperations::GetPropertyValue(const std::string &property, CVa
result["label"] = CServiceBroker::GetGUI()->GetInfoManager().GetLabel(CServiceBroker::GetGUI()->GetInfoManager().TranslateString("System.CurrentControl"));
else if (property == "skin")
{
- std::string skinId = CServiceBroker::GetSettings().GetString(CSettings::SETTING_LOOKANDFEEL_SKIN);
+ std::string skinId = CServiceBroker::GetSettings()->GetString(CSettings::SETTING_LOOKANDFEEL_SKIN);
AddonPtr addon;
if (!CServiceBroker::GetAddonMgr().GetAddon(skinId, addon, ADDON_SKIN))
return InternalError;
diff --git a/xbmc/interfaces/json-rpc/SettingsOperations.cpp b/xbmc/interfaces/json-rpc/SettingsOperations.cpp
index 9024058dd9..2b274b6da9 100644
--- a/xbmc/interfaces/json-rpc/SettingsOperations.cpp
+++ b/xbmc/interfaces/json-rpc/SettingsOperations.cpp
@@ -31,7 +31,7 @@ JSONRPC_STATUS CSettingsOperations::GetSections(const std::string &method, ITran
result["sections"] = CVariant(CVariant::VariantTypeArray);
// apply the level filter
- SettingSectionList allSections = CServiceBroker::GetSettings().GetSections();
+ SettingSectionList allSections = CServiceBroker::GetSettings()->GetSections();
for (SettingSectionList::const_iterator itSection = allSections.begin(); itSection != allSections.end(); ++itSection)
{
SettingCategoryList categories = (*itSection)->GetCategories(level);
@@ -70,14 +70,14 @@ JSONRPC_STATUS CSettingsOperations::GetCategories(const std::string &method, ITr
std::vector<SettingSectionPtr> sections;
if (!strSection.empty())
{
- SettingSectionPtr section = CServiceBroker::GetSettings().GetSection(strSection);
+ SettingSectionPtr section = CServiceBroker::GetSettings()->GetSection(strSection);
if (section == NULL)
return InvalidParams;
sections.push_back(section);
}
else
- sections = CServiceBroker::GetSettings().GetSections();
+ sections = CServiceBroker::GetSettings()->GetSections();
result["categories"] = CVariant(CVariant::VariantTypeArray);
@@ -142,14 +142,14 @@ JSONRPC_STATUS CSettingsOperations::GetSettings(const std::string &method, ITran
if (doFilter)
{
- SettingSectionPtr section = CServiceBroker::GetSettings().GetSection(strSection);
+ SettingSectionPtr section = CServiceBroker::GetSettings()->GetSection(strSection);
if (section == NULL)
return InvalidParams;
sections.push_back(section);
}
else
- sections = CServiceBroker::GetSettings().GetSections();
+ sections = CServiceBroker::GetSettings()->GetSections();
result["settings"] = CVariant(CVariant::VariantTypeArray);
@@ -195,7 +195,7 @@ JSONRPC_STATUS CSettingsOperations::GetSettingValue(const std::string &method, I
{
std::string settingId = parameterObject["setting"].asString();
- SettingPtr setting = CServiceBroker::GetSettings().GetSetting(settingId);
+ SettingPtr setting = CServiceBroker::GetSettings()->GetSetting(settingId);
if (setting == NULL ||
!setting->IsVisible())
return InvalidParams;
@@ -221,7 +221,7 @@ JSONRPC_STATUS CSettingsOperations::GetSettingValue(const std::string &method, I
case SettingType::List:
{
- SerializeSettingListValues(CServiceBroker::GetSettings().GetList(settingId), value);
+ SerializeSettingListValues(CServiceBroker::GetSettings()->GetList(settingId), value);
break;
}
@@ -241,7 +241,7 @@ JSONRPC_STATUS CSettingsOperations::SetSettingValue(const std::string &method, I
std::string settingId = parameterObject["setting"].asString();
CVariant value = parameterObject["value"];
- SettingPtr setting = CServiceBroker::GetSettings().GetSetting(settingId);
+ SettingPtr setting = CServiceBroker::GetSettings()->GetSetting(settingId);
if (setting == NULL ||
!setting->IsVisible())
return InvalidParams;
@@ -285,7 +285,7 @@ JSONRPC_STATUS CSettingsOperations::SetSettingValue(const std::string &method, I
for (CVariant::const_iterator_array itValue = value.begin_array(); itValue != value.end_array(); ++itValue)
values.push_back(*itValue);
- result = CServiceBroker::GetSettings().SetList(settingId, values);
+ result = CServiceBroker::GetSettings()->SetList(settingId, values);
break;
}
@@ -302,7 +302,7 @@ JSONRPC_STATUS CSettingsOperations::ResetSettingValue(const std::string &method,
{
std::string settingId = parameterObject["setting"].asString();
- SettingPtr setting = CServiceBroker::GetSettings().GetSetting(settingId);
+ SettingPtr setting = CServiceBroker::GetSettings()->GetSetting(settingId);
if (setting == NULL ||
!setting->IsVisible())
return InvalidParams;
diff --git a/xbmc/interfaces/legacy/ModuleXbmc.cpp b/xbmc/interfaces/legacy/ModuleXbmc.cpp
index 366b064928..cf1d2716a6 100644
--- a/xbmc/interfaces/legacy/ModuleXbmc.cpp
+++ b/xbmc/interfaces/legacy/ModuleXbmc.cpp
@@ -178,7 +178,7 @@ namespace XBMCAddon
String getSkinDir()
{
XBMC_TRACE;
- return CServiceBroker::GetSettings().GetString(CSettings::SETTING_LOOKANDFEEL_SKIN);
+ return CServiceBroker::GetSettings()->GetString(CSettings::SETTING_LOOKANDFEEL_SKIN);
}
String getLanguage(int format /* = CLangCodeExpander::ENGLISH_NAME */, bool region /*= false*/)
diff --git a/xbmc/listproviders/DirectoryProvider.cpp b/xbmc/listproviders/DirectoryProvider.cpp
index 70b7ddd4ca..3ed836daf3 100644
--- a/xbmc/listproviders/DirectoryProvider.cpp
+++ b/xbmc/listproviders/DirectoryProvider.cpp
@@ -351,7 +351,7 @@ bool CDirectoryProvider::OnClick(const CGUIListItemPtr &item)
CFileItem fileItem(*std::static_pointer_cast<CFileItem>(item));
if (fileItem.HasVideoInfoTag()
- && CServiceBroker::GetSettings().GetInt(CSettings::SETTING_MYVIDEOS_SELECTACTION) == SELECT_ACTION_INFO
+ && CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_MYVIDEOS_SELECTACTION) == SELECT_ACTION_INFO
&& OnInfo(item))
return true;
@@ -473,7 +473,7 @@ bool CDirectoryProvider::UpdateSort()
m_currentSort.sortOrder = sortOrder;
m_currentSort.sortAttributes = SortAttributeIgnoreFolders;
- if (CServiceBroker::GetSettings().GetBool(CSettings::SETTING_FILELISTS_IGNORETHEWHENSORTING))
+ if (CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_FILELISTS_IGNORETHEWHENSORTING))
m_currentSort.sortAttributes = static_cast<SortAttribute>(m_currentSort.sortAttributes | SortAttributeIgnoreArticle);
return true;
diff --git a/xbmc/music/GUIViewStateMusic.cpp b/xbmc/music/GUIViewStateMusic.cpp
index 184cd9ea0c..3f8d28a610 100644
--- a/xbmc/music/GUIViewStateMusic.cpp
+++ b/xbmc/music/GUIViewStateMusic.cpp
@@ -35,8 +35,8 @@ int CGUIViewStateWindowMusic::GetPlaylist() const
bool CGUIViewStateWindowMusic::AutoPlayNextItem()
{
- return CServiceBroker::GetSettings().GetBool(CSettings::SETTING_MUSICPLAYER_AUTOPLAYNEXTITEM) &&
- !CServiceBroker::GetSettings().GetBool(CSettings::SETTING_MUSICPLAYER_QUEUEBYDEFAULT);
+ return CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_MUSICPLAYER_AUTOPLAYNEXTITEM) &&
+ !CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_MUSICPLAYER_QUEUEBYDEFAULT);
}
std::string CGUIViewStateWindowMusic::GetLockType()
@@ -57,7 +57,7 @@ VECSOURCES& CGUIViewStateWindowMusic::GetSources()
CGUIViewStateMusicSearch::CGUIViewStateMusicSearch(const CFileItemList& items) : CGUIViewStateWindowMusic(items)
{
SortAttribute sortAttribute = SortAttributeNone;
- if (CServiceBroker::GetSettings().GetBool(CSettings::SETTING_FILELISTS_IGNORETHEWHENSORTING))
+ if (CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_FILELISTS_IGNORETHEWHENSORTING))
sortAttribute = SortAttributeIgnoreArticle;
AddSortMethod(SortByTitle, sortAttribute, 556, LABEL_MASKS("%T - %A", "%D", "%L", "%A")); // Title - Artist, Duration | Label, Artist
@@ -80,15 +80,15 @@ CGUIViewStateMusicDatabase::CGUIViewStateMusicDatabase(const CFileItemList& item
CMusicDatabaseDirectory dir;
NODE_TYPE NodeType=dir.GetDirectoryChildType(items.GetPath());
- std::string strTrack=CServiceBroker::GetSettings().GetString(CSettings::SETTING_MUSICFILES_LIBRARYTRACKFORMAT);
+ std::string strTrack=CServiceBroker::GetSettings()->GetString(CSettings::SETTING_MUSICFILES_LIBRARYTRACKFORMAT);
if (strTrack.empty())
- strTrack = CServiceBroker::GetSettings().GetString(CSettings::SETTING_MUSICFILES_TRACKFORMAT);
+ strTrack = CServiceBroker::GetSettings()->GetString(CSettings::SETTING_MUSICFILES_TRACKFORMAT);
std::string strAlbum = g_advancedSettings.m_strMusicLibraryAlbumFormat;
if (strAlbum.empty())
strAlbum = "%B"; // album
CLog::Log(LOGDEBUG,"Custom album format = [%s]", strAlbum.c_str());
SortAttribute sortAttribute = SortAttributeNone;
- if (CServiceBroker::GetSettings().GetBool(CSettings::SETTING_FILELISTS_IGNORETHEWHENSORTING))
+ if (CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_FILELISTS_IGNORETHEWHENSORTING))
sortAttribute = SortAttributeIgnoreArticle;
if (g_advancedSettings.m_musicUseArtistSortName)
sortAttribute = static_cast<SortAttribute>(sortAttribute | SortAttributeUseArtistSortName);
@@ -322,7 +322,7 @@ void CGUIViewStateMusicDatabase::SaveViewState()
CGUIViewStateMusicSmartPlaylist::CGUIViewStateMusicSmartPlaylist(const CFileItemList& items) : CGUIViewStateWindowMusic(items)
{
SortAttribute sortAttribute = SortAttributeNone;
- if (CServiceBroker::GetSettings().GetBool(CSettings::SETTING_FILELISTS_IGNORETHEWHENSORTING))
+ if (CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_FILELISTS_IGNORETHEWHENSORTING))
sortAttribute = SortAttributeIgnoreArticle;
if (g_advancedSettings.m_musicUseArtistSortName)
sortAttribute = static_cast<SortAttribute>(sortAttribute | SortAttributeUseArtistSortName);
@@ -330,7 +330,7 @@ CGUIViewStateMusicSmartPlaylist::CGUIViewStateMusicSmartPlaylist(const CFileItem
if (items.GetContent() == "songs" || items.GetContent() == "mixed")
{
- std::string strTrack=CServiceBroker::GetSettings().GetString(CSettings::SETTING_MUSICFILES_TRACKFORMAT);
+ std::string strTrack=CServiceBroker::GetSettings()->GetString(CSettings::SETTING_MUSICFILES_TRACKFORMAT);
AddSortMethod(SortByTrackNumber, 554, LABEL_MASKS(strTrack, "%D")); // Userdefined, Duration| empty, empty
AddSortMethod(SortByTitle, sortAttribute, 556, LABEL_MASKS("%T - %A", "%D")); // Title, Artist, Duration| empty, empty
AddSortMethod(SortByAlbum, sortAttribute, 558, LABEL_MASKS("%B - %T - %A", "%D")); // Album, Titel, Artist, Duration| empty, empty
@@ -404,12 +404,12 @@ void CGUIViewStateMusicSmartPlaylist::SaveViewState()
CGUIViewStateMusicPlaylist::CGUIViewStateMusicPlaylist(const CFileItemList& items) : CGUIViewStateWindowMusic(items)
{
SortAttribute sortAttribute = SortAttributeNone;
- if (CServiceBroker::GetSettings().GetBool(CSettings::SETTING_FILELISTS_IGNORETHEWHENSORTING))
+ if (CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_FILELISTS_IGNORETHEWHENSORTING))
sortAttribute = SortAttributeIgnoreArticle;
if (g_advancedSettings.m_musicUseArtistSortName)
sortAttribute = static_cast<SortAttribute>(sortAttribute | SortAttributeUseArtistSortName);
- std::string strTrack=CServiceBroker::GetSettings().GetString(CSettings::SETTING_MUSICFILES_TRACKFORMAT);
+ std::string strTrack=CServiceBroker::GetSettings()->GetString(CSettings::SETTING_MUSICFILES_TRACKFORMAT);
AddSortMethod(SortByPlaylistOrder, 559, LABEL_MASKS(strTrack, "%D"));
AddSortMethod(SortByTrackNumber, 554, LABEL_MASKS(strTrack, "%D")); // Userdefined, Duration| empty, empty
AddSortMethod(SortByTitle, sortAttribute, 556, LABEL_MASKS("%T - %A", "%D")); // Title, Artist, Duration| empty, empty
@@ -437,7 +437,7 @@ void CGUIViewStateMusicPlaylist::SaveViewState()
CGUIViewStateWindowMusicNav::CGUIViewStateWindowMusicNav(const CFileItemList& items) : CGUIViewStateWindowMusic(items)
{
SortAttribute sortAttribute = SortAttributeNone;
- if (CServiceBroker::GetSettings().GetBool(CSettings::SETTING_FILELISTS_IGNORETHEWHENSORTING))
+ if (CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_FILELISTS_IGNORETHEWHENSORTING))
sortAttribute = SortAttributeIgnoreArticle;
if (g_advancedSettings.m_musicUseArtistSortName)
sortAttribute = static_cast<SortAttribute>(sortAttribute | SortAttributeUseArtistSortName);
@@ -453,10 +453,10 @@ CGUIViewStateWindowMusicNav::CGUIViewStateWindowMusicNav(const CFileItemList& it
}
else
{
- if (items.IsVideoDb() && items.Size() > (CServiceBroker::GetSettings().GetBool(CSettings::SETTING_FILELISTS_SHOWPARENTDIRITEMS)?1:0))
+ if (items.IsVideoDb() && items.Size() > (CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_FILELISTS_SHOWPARENTDIRITEMS)?1:0))
{
XFILE::VIDEODATABASEDIRECTORY::CQueryParams params;
- XFILE::CVideoDatabaseDirectory::GetQueryParams(items[CServiceBroker::GetSettings().GetBool(CSettings::SETTING_FILELISTS_SHOWPARENTDIRITEMS)?1:0]->GetPath(),params);
+ XFILE::CVideoDatabaseDirectory::GetQueryParams(items[CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_FILELISTS_SHOWPARENTDIRITEMS)?1:0]->GetPath(),params);
if (params.GetMVideoId() != -1)
{
AddSortMethod(SortByLabel, sortAttribute, 551, LABEL_MASKS("%T", "%Y")); // Filename, Duration | Foldername, empty
@@ -465,7 +465,7 @@ CGUIViewStateWindowMusicNav::CGUIViewStateWindowMusicNav(const CFileItemList& it
AddSortMethod(SortByArtistThenYear, sortAttribute, 578, LABEL_MASKS("%A - %T", "%Y"));
AddSortMethod(SortByAlbum, sortAttribute, 558, LABEL_MASKS("%B - %T", "%Y"));
- std::string strTrack=CServiceBroker::GetSettings().GetString(CSettings::SETTING_MUSICFILES_TRACKFORMAT);
+ std::string strTrack=CServiceBroker::GetSettings()->GetString(CSettings::SETTING_MUSICFILES_TRACKFORMAT);
AddSortMethod(SortByTrackNumber, 554, LABEL_MASKS(strTrack, "%D")); // Userdefined, Duration| empty, empty
}
else
@@ -479,11 +479,11 @@ CGUIViewStateWindowMusicNav::CGUIViewStateWindowMusicNav(const CFileItemList& it
//In navigation of music files tag data is scanned whenever present and can be used as sort criteria
//hence sort methods available are similar to song node (not the same as only tag data)
//Unfortunately anything here appears at all levels of file navigation even if no song files there.
- std::string strTrack = CServiceBroker::GetSettings().GetString(CSettings::SETTING_MUSICFILES_LIBRARYTRACKFORMAT);
+ std::string strTrack = CServiceBroker::GetSettings()->GetString(CSettings::SETTING_MUSICFILES_LIBRARYTRACKFORMAT);
if (strTrack.empty())
- strTrack = CServiceBroker::GetSettings().GetString(CSettings::SETTING_MUSICFILES_TRACKFORMAT);
+ strTrack = CServiceBroker::GetSettings()->GetString(CSettings::SETTING_MUSICFILES_TRACKFORMAT);
AddSortMethod(SortByLabel, 551, LABEL_MASKS(strTrack, "%D", "%L", ""), // Userdefined, Duration | FolderName, empty
- CServiceBroker::GetSettings().GetBool(CSettings::SETTING_FILELISTS_IGNORETHEWHENSORTING) ? SortAttributeIgnoreArticle : SortAttributeNone);
+ CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_FILELISTS_IGNORETHEWHENSORTING) ? SortAttributeIgnoreArticle : SortAttributeNone);
AddSortMethod(SortBySize, 553, LABEL_MASKS("%F", "%I", "%L", "%I")); // Filename, Size | Foldername, Size
AddSortMethod(SortByDate, 552, LABEL_MASKS("%F", "%J", "%L", "%J")); // Filename, Date | Foldername, Date
AddSortMethod(SortByFile, 561, LABEL_MASKS("%F", "%I", "%L", "")); // Filename, Size | Label, empty
@@ -549,9 +549,9 @@ VECSOURCES& CGUIViewStateWindowMusicNav::GetSources()
CGUIViewStateWindowMusicPlaylist::CGUIViewStateWindowMusicPlaylist(const CFileItemList& items) : CGUIViewStateWindowMusic(items)
{
- std::string strTrack=CServiceBroker::GetSettings().GetString(CSettings::SETTING_MUSICFILES_NOWPLAYINGTRACKFORMAT);
+ std::string strTrack=CServiceBroker::GetSettings()->GetString(CSettings::SETTING_MUSICFILES_NOWPLAYINGTRACKFORMAT);
if (strTrack.empty())
- strTrack = CServiceBroker::GetSettings().GetString(CSettings::SETTING_MUSICFILES_TRACKFORMAT);
+ strTrack = CServiceBroker::GetSettings()->GetString(CSettings::SETTING_MUSICFILES_TRACKFORMAT);
AddSortMethod(SortByNone, 551, LABEL_MASKS(strTrack, "%D", "%L", "")); // Userdefined, Duration | FolderName, empty
SetSortMethod(SortByNone);
diff --git a/xbmc/music/MusicDatabase.cpp b/xbmc/music/MusicDatabase.cpp
index 071f75a0de..f30addf362 100644
--- a/xbmc/music/MusicDatabase.cpp
+++ b/xbmc/music/MusicDatabase.cpp
@@ -3481,7 +3481,7 @@ error:
bool CMusicDatabase::LookupCDDBInfo(bool bRequery/*=false*/)
{
#ifdef HAS_DVD_DRIVE
- if (!CServiceBroker::GetSettings().GetBool(CSettings::SETTING_AUDIOCDS_USECDDB))
+ if (!CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_AUDIOCDS_USECDDB))
return false;
// check network connectivity
@@ -7675,7 +7675,7 @@ bool CMusicDatabase::GetOldArtistPath(int idArtist, std::string &basePath)
bool CMusicDatabase::GetArtistPath(const CArtist& artist, std::string &path)
{
// Get path for artist in the artists folder
- path = CServiceBroker::GetSettings().GetString(CSettings::SETTING_MUSICLIBRARY_ARTISTSFOLDER);
+ path = CServiceBroker::GetSettings()->GetString(CSettings::SETTING_MUSICLIBRARY_ARTISTSFOLDER);
if (path.empty())
return false; // No Artists folder not set;
// Get unique artist folder name
@@ -9443,7 +9443,7 @@ bool CMusicDatabase::GetItems(const std::string &strBaseDir, const std::string &
else if (StringUtils::EqualsNoCase(itemType, "roles"))
return GetRolesNav(strBaseDir, items, filter);
else if (StringUtils::EqualsNoCase(itemType, "artists"))
- return GetArtistsNav(strBaseDir, items, !CServiceBroker::GetSettings().GetBool(CSettings::SETTING_MUSICLIBRARY_SHOWCOMPILATIONARTISTS), -1, -1, -1, filter, sortDescription);
+ return GetArtistsNav(strBaseDir, items, !CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_MUSICLIBRARY_SHOWCOMPILATIONARTISTS), -1, -1, -1, filter, sortDescription);
else if (StringUtils::EqualsNoCase(itemType, "albums"))
return GetAlbumsByWhere(strBaseDir, filter, items, sortDescription);
else if (StringUtils::EqualsNoCase(itemType, "songs"))
@@ -9499,7 +9499,7 @@ void CMusicDatabase::ExportToXML(const CLibExportSettings& settings, CGUIDialog
{
// Separate files with artists to library folder and albums to music folders.
// Without an artist information folder can not export artist NFO files or images
- strFolder = CServiceBroker::GetSettings().GetString(CSettings::SETTING_MUSICLIBRARY_ARTISTSFOLDER);
+ strFolder = CServiceBroker::GetSettings()->GetString(CSettings::SETTING_MUSICLIBRARY_ARTISTSFOLDER);
if (!settings.IsItemExported(ELIBEXPORT_ALBUMS) && strFolder.empty())
return;
}
@@ -10241,7 +10241,7 @@ bool CMusicDatabase::GetFilter(CDbUrl &musicUrl, Filter &filter, SortDescription
if (xsp.GetOrder() != SortByNone)
sorting.sortBy = xsp.GetOrder();
sorting.sortOrder = xsp.GetOrderAscending() ? SortOrderAscending : SortOrderDescending;
- if (CServiceBroker::GetSettings().GetBool(CSettings::SETTING_FILELISTS_IGNORETHEWHENSORTING))
+ if (CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_FILELISTS_IGNORETHEWHENSORTING))
sorting.sortAttributes = SortAttributeIgnoreArticle;
}
}
diff --git a/xbmc/music/MusicInfoLoader.cpp b/xbmc/music/MusicInfoLoader.cpp
index 673a69b7c6..ce7a778b91 100644
--- a/xbmc/music/MusicInfoLoader.cpp
+++ b/xbmc/music/MusicInfoLoader.cpp
@@ -213,7 +213,7 @@ bool CMusicInfoLoader::LoadItemLookup(CFileItem* pItem)
pItem->SetArt("thumb", song.strThumb);
}
}
- else if (CServiceBroker::GetSettings().GetBool(CSettings::SETTING_MUSICFILES_USETAGS) || pItem->IsCDDA())
+ else if (CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_MUSICFILES_USETAGS) || pItem->IsCDDA())
{ // Nothing found, load tag from file,
// always try to load cddb info
// get correct tag parser
diff --git a/xbmc/music/dialogs/GUIDialogInfoProviderSettings.cpp b/xbmc/music/dialogs/GUIDialogInfoProviderSettings.cpp
index 51eac0c4f0..7f48364c1d 100644
--- a/xbmc/music/dialogs/GUIDialogInfoProviderSettings.cpp
+++ b/xbmc/music/dialogs/GUIDialogInfoProviderSettings.cpp
@@ -59,7 +59,7 @@ bool CGUIDialogInfoProviderSettings::Show()
dialog->m_showSingleScraper = false;
// Get current default info provider settings from service broker
- dialog->m_fetchInfo = CServiceBroker::GetSettings().GetBool(CSettings::SETTING_MUSICLIBRARY_DOWNLOADINFO);
+ dialog->m_fetchInfo = CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_MUSICLIBRARY_DOWNLOADINFO);
ADDON::AddonPtr defaultScraper;
// Get default album scraper (when enabled - can default scraper be disabled??)
@@ -76,7 +76,7 @@ bool CGUIDialogInfoProviderSettings::Show()
dialog->SetArtistScraper(scraper);
}
- dialog->m_strArtistInfoPath = CServiceBroker::GetSettings().GetString(CSettings::SETTING_MUSICLIBRARY_ARTISTSFOLDER);
+ dialog->m_strArtistInfoPath = CServiceBroker::GetSettings()->GetString(CSettings::SETTING_MUSICLIBRARY_ARTISTSFOLDER);
dialog->Open();
@@ -116,7 +116,7 @@ int CGUIDialogInfoProviderSettings::Show(ADDON::ScraperPtr& scraper)
scraper = dialog->GetArtistScraper();
// Save artist information folder (here not in the caller) when applying setting as default for all artists
if (applyToItems == INFOPROVIDERAPPLYOPTIONS::INFOPROVIDER_DEFAULT)
- CServiceBroker::GetSettings().SetString(CSettings::SETTING_MUSICLIBRARY_ARTISTSFOLDER, dialog->m_strArtistInfoPath);
+ CServiceBroker::GetSettings()->SetString(CSettings::SETTING_MUSICLIBRARY_ARTISTSFOLDER, dialog->m_strArtistInfoPath);
}
if (scraper)
scraper->SetPathSettings(dialog->m_singleScraperType, "");
@@ -249,15 +249,15 @@ void CGUIDialogInfoProviderSettings::Save()
// Save default settings for fetching additional information and art
CLog::Log(LOGINFO, "%s called", __FUNCTION__);
// Save Fetch addiitional info during update
- CServiceBroker::GetSettings().SetBool(CSettings::SETTING_MUSICLIBRARY_DOWNLOADINFO, m_fetchInfo);
+ CServiceBroker::GetSettings()->SetBool(CSettings::SETTING_MUSICLIBRARY_DOWNLOADINFO, m_fetchInfo);
// Save default scrapers and addon setting values
- CServiceBroker::GetSettings().SetString(CSettings::SETTING_MUSICLIBRARY_ALBUMSSCRAPER, m_albumscraper->ID());
+ CServiceBroker::GetSettings()->SetString(CSettings::SETTING_MUSICLIBRARY_ALBUMSSCRAPER, m_albumscraper->ID());
m_albumscraper->SaveSettings();
- CServiceBroker::GetSettings().SetString(CSettings::SETTING_MUSICLIBRARY_ARTISTSSCRAPER, m_artistscraper->ID());
+ CServiceBroker::GetSettings()->SetString(CSettings::SETTING_MUSICLIBRARY_ARTISTSSCRAPER, m_artistscraper->ID());
m_artistscraper->SaveSettings();
// Save artist information folder
- CServiceBroker::GetSettings().SetString(CSettings::SETTING_MUSICLIBRARY_ARTISTSFOLDER, m_strArtistInfoPath);
- CServiceBroker::GetSettings().Save();
+ CServiceBroker::GetSettings()->SetString(CSettings::SETTING_MUSICLIBRARY_ARTISTSFOLDER, m_strArtistInfoPath);
+ CServiceBroker::GetSettings()->Save();
}
void CGUIDialogInfoProviderSettings::SetupView()
diff --git a/xbmc/music/dialogs/GUIDialogMusicInfo.cpp b/xbmc/music/dialogs/GUIDialogMusicInfo.cpp
index b3d47d6bed..f70793888a 100644
--- a/xbmc/music/dialogs/GUIDialogMusicInfo.cpp
+++ b/xbmc/music/dialogs/GUIDialogMusicInfo.cpp
@@ -106,7 +106,7 @@ public:
artistItemPath = oldartistpath;
else
// Fall back further to browse the Artist Info Folder itself
- artistItemPath = CServiceBroker::GetSettings().GetString(CSettings::SETTING_MUSICLIBRARY_ARTISTSFOLDER);
+ artistItemPath = CServiceBroker::GetSettings()->GetString(CSettings::SETTING_MUSICLIBRARY_ARTISTSFOLDER);
}
m_item->SetPath(artistItemPath);
@@ -684,7 +684,7 @@ void CGUIDialogMusicInfo::AddItemPathToFileBrowserSources(VECSOURCES &sources, c
// For artist add Artist Info Folder path to browser sources
if (item.GetMusicInfoTag()->GetType() == MediaTypeArtist)
{
- artistFolder = CServiceBroker::GetSettings().GetString(CSettings::SETTING_MUSICLIBRARY_ARTISTSFOLDER);
+ artistFolder = CServiceBroker::GetSettings()->GetString(CSettings::SETTING_MUSICLIBRARY_ARTISTSFOLDER);
if (!artistFolder.empty() && artistFolder.compare(itemDir) == 0)
itemDir.clear(); // skip *item when artist not have a unique path
}
diff --git a/xbmc/music/dialogs/GUIDialogMusicOSD.cpp b/xbmc/music/dialogs/GUIDialogMusicOSD.cpp
index 9fe42651c3..0d9a51012a 100644
--- a/xbmc/music/dialogs/GUIDialogMusicOSD.cpp
+++ b/xbmc/music/dialogs/GUIDialogMusicOSD.cpp
@@ -39,8 +39,8 @@ bool CGUIDialogMusicOSD::OnMessage(CGUIMessage &message)
std::string addonID;
if (CGUIWindowAddonBrowser::SelectAddonID(ADDON::ADDON_VIZ, addonID, true) == 1)
{
- CServiceBroker::GetSettings().SetString(CSettings::SETTING_MUSICPLAYER_VISUALISATION, addonID);
- CServiceBroker::GetSettings().Save();
+ CServiceBroker::GetSettings()->SetString(CSettings::SETTING_MUSICPLAYER_VISUALISATION, addonID);
+ CServiceBroker::GetSettings()->Save();
CServiceBroker::GetGUI()->GetWindowManager().SendMessage(GUI_MSG_VISUALISATION_RELOAD, 0, 0);
}
}
diff --git a/xbmc/music/infoscanner/MusicInfoScanner.cpp b/xbmc/music/infoscanner/MusicInfoScanner.cpp
index 00ec82af22..201397c131 100644
--- a/xbmc/music/infoscanner/MusicInfoScanner.cpp
+++ b/xbmc/music/infoscanner/MusicInfoScanner.cpp
@@ -76,7 +76,7 @@ void CMusicInfoScanner::Process()
CServiceBroker::GetAnnouncementManager()->Announce(ANNOUNCEMENT::AudioLibrary, "xbmc", "OnScanStarted");
try
{
- if (m_showDialog && !CServiceBroker::GetSettings().GetBool(CSettings::SETTING_MUSICLIBRARY_BACKGROUNDUPDATE))
+ if (m_showDialog && !CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_MUSICLIBRARY_BACKGROUNDUPDATE))
{
CGUIDialogExtendedProgressBar* dialog =
CServiceBroker::GetGUI()->GetWindowManager().GetWindow<CGUIDialogExtendedProgressBar>(WINDOW_DIALOG_EXT_PROGRESS);
@@ -379,7 +379,7 @@ void CMusicInfoScanner::FetchArtistInfo(const std::string& strDirectory,
if (strDirectory.empty())
{
m_musicDatabase.Open();
- m_musicDatabase.GetArtistsNav("musicdb://artists/", items, !CServiceBroker::GetSettings().GetBool(CSettings::SETTING_MUSICLIBRARY_SHOWCOMPILATIONARTISTS), -1);
+ m_musicDatabase.GetArtistsNav("musicdb://artists/", items, !CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_MUSICLIBRARY_SHOWCOMPILATIONARTISTS), -1);
m_musicDatabase.Close();
}
else
@@ -939,7 +939,7 @@ void MUSIC_INFO::CMusicInfoScanner::ScrapeInfoAddedAlbums()
if (ADDON::CAddonSystemSettings::GetInstance().GetActive(ADDON::ADDON_SCRAPER_ARTISTS, addon))
artistScraper = std::dynamic_pointer_cast<ADDON::CScraper>(addon);
- bool albumartistsonly = !CServiceBroker::GetSettings().GetBool(CSettings::SETTING_MUSICLIBRARY_SHOWCOMPILATIONARTISTS);
+ bool albumartistsonly = !CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_MUSICLIBRARY_SHOWCOMPILATIONARTISTS);
if (!albumScraper || !artistScraper)
return;
@@ -1297,7 +1297,7 @@ CMusicInfoScanner::UpdateDatabaseAlbumInfo(CAlbum& album,
if (albumDownloadStatus == INFO_ADDED)
{
- bool overridetags = CServiceBroker::GetSettings().GetBool(CSettings::SETTING_MUSICLIBRARY_OVERRIDETAGS);
+ bool overridetags = CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_MUSICLIBRARY_OVERRIDETAGS);
album.MergeScrapedAlbum(albumInfo.GetAlbum(), overridetags);
m_musicDatabase.UpdateAlbum(album);
albumInfo.SetLoaded(true);
@@ -1364,7 +1364,7 @@ CMusicInfoScanner::UpdateDatabaseArtistInfo(CArtist& artist,
if (artistDownloadStatus == INFO_ADDED)
{
- artist.MergeScrapedArtist(artistInfo.GetArtist(), CServiceBroker::GetSettings().GetBool(CSettings::SETTING_MUSICLIBRARY_OVERRIDETAGS));
+ artist.MergeScrapedArtist(artistInfo.GetArtist(), CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_MUSICLIBRARY_OVERRIDETAGS));
m_musicDatabase.UpdateArtist(artist);
artistInfo.SetLoaded();
}
@@ -1471,7 +1471,7 @@ CMusicInfoScanner::DownloadAlbumInfo(const CAlbum& album,
CLog::Log(LOGERROR,"Unable to find an url in nfo file: %s", strNfo.c_str());
}
- if (!scraper.CheckValidOrFallback(CServiceBroker::GetSettings().GetString(CSettings::SETTING_MUSICLIBRARY_ALBUMSSCRAPER)))
+ if (!scraper.CheckValidOrFallback(CServiceBroker::GetSettings()->GetString(CSettings::SETTING_MUSICLIBRARY_ALBUMSSCRAPER)))
{ // the current scraper is invalid, as is the default - bail
CLog::Log(LOGERROR, "%s - current and default scrapers are invalid. Pick another one", __FUNCTION__);
return INFO_ERROR;
@@ -1646,7 +1646,7 @@ void CMusicInfoScanner::GetAlbumArtwork(long id, const CAlbum &album)
// b) thumb is embedded in music file and "prefer online album art" enabled
if (artURL.empty() ||
(StringUtils::StartsWith(artURL, "image://") &&
- CServiceBroker::GetSettings().GetBool(CSettings::SETTING_MUSICLIBRARY_PREFERONLINEALBUMART)))
+ CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_MUSICLIBRARY_PREFERONLINEALBUMART)))
{
std::string thumb = CScraperUrl::GetThumbURL(album.thumbURL.GetFirstThumb());
if (!thumb.empty())
@@ -2032,7 +2032,7 @@ bool CMusicInfoScanner::SetAlbumArtwork(CAlbum& album, std::vector<std::string>&
if (artfolder.empty())
return false; // No local or scraped art to process
}
- else if (CServiceBroker::GetSettings().GetBool(CSettings::SETTING_MUSICLIBRARY_PREFERONLINEALBUMART))
+ else if (CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_MUSICLIBRARY_PREFERONLINEALBUMART))
{
// When "prefer online album art" enabled, and we have a scraped cover then
// if the thumb is embedded replace it by adding "thumb" to the missing types
diff --git a/xbmc/music/windows/GUIWindowMusicBase.cpp b/xbmc/music/windows/GUIWindowMusicBase.cpp
index 0e6e2482da..a2b865e208 100644
--- a/xbmc/music/windows/GUIWindowMusicBase.cpp
+++ b/xbmc/music/windows/GUIWindowMusicBase.cpp
@@ -842,7 +842,7 @@ bool CGUIWindowMusicBase::OnPlayMedia(int iItem, const std::string &player)
{ // single music file - if we get here then we have autoplaynextitem turned off or queuebydefault
// turned on, but we still want to use the playlist player in order to handle more queued items
// following etc.
- if ( (CServiceBroker::GetSettings().GetBool(CSettings::SETTING_MUSICPLAYER_QUEUEBYDEFAULT) && CServiceBroker::GetGUI()->GetWindowManager().GetActiveWindow() != WINDOW_MUSIC_PLAYLIST_EDITOR) )
+ if ( (CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_MUSICPLAYER_QUEUEBYDEFAULT) && CServiceBroker::GetGUI()->GetWindowManager().GetActiveWindow() != WINDOW_MUSIC_PLAYLIST_EDITOR) )
{
//! @todo Should the playlist be cleared if nothing is already playing?
OnQueueItem(iItem);
@@ -859,7 +859,7 @@ bool CGUIWindowMusicBase::OnPlayMedia(int iItem, const std::string &player)
void CGUIWindowMusicBase::OnRetrieveMusicInfo(CFileItemList& items)
{
if (items.GetFolderCount()==items.Size() || items.IsMusicDb() ||
- (!CServiceBroker::GetSettings().GetBool(CSettings::SETTING_MUSICFILES_USETAGS) && !items.IsCDDA()))
+ (!CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_MUSICFILES_USETAGS) && !items.IsCDDA()))
{
return;
}
@@ -1024,7 +1024,7 @@ void CGUIWindowMusicBase::OnInitWindow()
int flags = CMusicInfoScanner::SCAN_RESCAN;
// When set to fetch information on update enquire about scraping that as well
// It may take some time, so the user may want to do it later by "Query Info For All"
- if (CServiceBroker::GetSettings().GetBool(CSettings::SETTING_MUSICLIBRARY_DOWNLOADINFO))
+ if (CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_MUSICLIBRARY_DOWNLOADINFO))
if (CGUIDialogYesNo::ShowAndGetInput(CVariant{799}, CVariant{38061}))
flags |= CMusicInfoScanner::SCAN_ONLINE;
g_application.StartMusicScan("", true, flags);
@@ -1082,7 +1082,7 @@ void CGUIWindowMusicBase::DoScan(const std::string &strPath, bool bRescan /*= fa
int flags = 0;
if (bRescan)
flags = CMusicInfoScanner::SCAN_RESCAN;
- if (CServiceBroker::GetSettings().GetBool(CSettings::SETTING_MUSICLIBRARY_DOWNLOADINFO))
+ if (CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_MUSICLIBRARY_DOWNLOADINFO))
flags |= CMusicInfoScanner::SCAN_ONLINE;
g_application.StartMusicScan(strPath, true, flags);
SET_CONTROL_FOCUS(iControl, 0);
diff --git a/xbmc/music/windows/GUIWindowMusicNav.cpp b/xbmc/music/windows/GUIWindowMusicNav.cpp
index 60d6050f0b..98f3585dd8 100644
--- a/xbmc/music/windows/GUIWindowMusicNav.cpp
+++ b/xbmc/music/windows/GUIWindowMusicNav.cpp
@@ -90,7 +90,7 @@ bool CGUIWindowMusicNav::OnMessage(CGUIMessage& message)
// is this the first time the window is opened?
if (m_vecItems->GetPath() == "?" && message.GetStringParam().empty())
- message.SetStringParam(CServiceBroker::GetSettings().GetString(CSettings::SETTING_MYMUSIC_DEFAULTLIBVIEW));
+ message.SetStringParam(CServiceBroker::GetSettings()->GetString(CSettings::SETTING_MYMUSIC_DEFAULTLIBVIEW));
if (!CGUIWindowMusicBase::OnMessage(message))
return false;
@@ -325,10 +325,10 @@ bool CGUIWindowMusicNav::ManageInfoProvider(const CFileItemPtr item)
scraper->SaveSettings();
// Set default scraper
if (content == CONTENT_ARTISTS)
- CServiceBroker::GetSettings().SetString(CSettings::SETTING_MUSICLIBRARY_ARTISTSSCRAPER, scraper->ID());
+ CServiceBroker::GetSettings()->SetString(CSettings::SETTING_MUSICLIBRARY_ARTISTSSCRAPER, scraper->ID());
else
- CServiceBroker::GetSettings().SetString(CSettings::SETTING_MUSICLIBRARY_ALBUMSSCRAPER, scraper->ID());
- CServiceBroker::GetSettings().Save();
+ CServiceBroker::GetSettings()->SetString(CSettings::SETTING_MUSICLIBRARY_ALBUMSSCRAPER, scraper->ID());
+ CServiceBroker::GetSettings()->Save();
// Clear all item specifc settings
if (content == CONTENT_ARTISTS)
result = m_musicdatabase.SetScraperAll("musicdb://artists/", nullptr);
@@ -634,9 +634,9 @@ void CGUIWindowMusicNav::GetContextButtons(int itemNumber, CContextButtons &butt
nodetype == NODE_TYPE_OVERVIEW ||
nodetype == NODE_TYPE_TOP100))
{
- if (!item->IsPath(CServiceBroker::GetSettings().GetString(CSettings::SETTING_MYMUSIC_DEFAULTLIBVIEW)))
+ if (!item->IsPath(CServiceBroker::GetSettings()->GetString(CSettings::SETTING_MYMUSIC_DEFAULTLIBVIEW)))
buttons.Add(CONTEXT_BUTTON_SET_DEFAULT, 13335); // set default
- if (!CServiceBroker::GetSettings().GetString(CSettings::SETTING_MYMUSIC_DEFAULTLIBVIEW).empty())
+ if (!CServiceBroker::GetSettings()->GetString(CSettings::SETTING_MYMUSIC_DEFAULTLIBVIEW).empty())
buttons.Add(CONTEXT_BUTTON_CLEAR_DEFAULT, 13403); // clear default
}
@@ -676,7 +676,7 @@ void CGUIWindowMusicNav::GetContextButtons(int itemNumber, CContextButtons &butt
&& (item->IsPlayList() || item->IsSmartPlayList()))
buttons.Add(CONTEXT_BUTTON_DELETE, 117);
- if (!item->IsReadOnly() && CServiceBroker::GetSettings().GetBool("filelists.allowfiledeletion"))
+ if (!item->IsReadOnly() && CServiceBroker::GetSettings()->GetBool("filelists.allowfiledeletion"))
{
buttons.Add(CONTEXT_BUTTON_DELETE, 117);
buttons.Add(CONTEXT_BUTTON_RENAME, 118);
@@ -749,13 +749,13 @@ bool CGUIWindowMusicNav::OnContextButton(int itemNumber, CONTEXT_BUTTON button)
return true;
case CONTEXT_BUTTON_SET_DEFAULT:
- CServiceBroker::GetSettings().SetString(CSettings::SETTING_MYMUSIC_DEFAULTLIBVIEW, GetQuickpathName(item->GetPath()));
- CServiceBroker::GetSettings().Save();
+ CServiceBroker::GetSettings()->SetString(CSettings::SETTING_MYMUSIC_DEFAULTLIBVIEW, GetQuickpathName(item->GetPath()));
+ CServiceBroker::GetSettings()->Save();
return true;
case CONTEXT_BUTTON_CLEAR_DEFAULT:
- CServiceBroker::GetSettings().SetString(CSettings::SETTING_MYMUSIC_DEFAULTLIBVIEW, "");
- CServiceBroker::GetSettings().Save();
+ CServiceBroker::GetSettings()->SetString(CSettings::SETTING_MYMUSIC_DEFAULTLIBVIEW, "");
+ CServiceBroker::GetSettings()->Save();
return true;
case CONTEXT_BUTTON_GO_TO_ARTIST:
diff --git a/xbmc/music/windows/GUIWindowMusicPlaylist.cpp b/xbmc/music/windows/GUIWindowMusicPlaylist.cpp
index dc3a9b773b..47afcc6b62 100644
--- a/xbmc/music/windows/GUIWindowMusicPlaylist.cpp
+++ b/xbmc/music/windows/GUIWindowMusicPlaylist.cpp
@@ -138,7 +138,7 @@ bool CGUIWindowMusicPlayList::OnMessage(CGUIMessage& message)
{
CServiceBroker::GetPlaylistPlayer().SetShuffle(PLAYLIST_MUSIC, !(CServiceBroker::GetPlaylistPlayer().IsShuffled(PLAYLIST_MUSIC)));
CMediaSettings::GetInstance().SetMusicPlaylistShuffled(CServiceBroker::GetPlaylistPlayer().IsShuffled(PLAYLIST_MUSIC));
- CServiceBroker::GetSettings().Save();
+ CServiceBroker::GetSettings()->Save();
UpdateButtons();
Refresh();
}
@@ -188,7 +188,7 @@ bool CGUIWindowMusicPlayList::OnMessage(CGUIMessage& message)
// save settings
CMediaSettings::GetInstance().SetMusicPlaylistRepeat(CServiceBroker::GetPlaylistPlayer().GetRepeat(PLAYLIST_MUSIC) == PLAYLIST::REPEAT_ALL);
- CServiceBroker::GetSettings().Save();
+ CServiceBroker::GetSettings()->Save();
UpdateButtons();
}
@@ -288,7 +288,7 @@ void CGUIWindowMusicPlayList::SavePlayList()
strNewFileName = CUtil::MakeLegalFileName(strNewFileName);
strNewFileName += ".m3u";
std::string strPath = URIUtils::AddFileToFolder(
- CServiceBroker::GetSettings().GetString(CSettings::SETTING_SYSTEM_PLAYLISTSPATH),
+ CServiceBroker::GetSettings()->GetString(CSettings::SETTING_SYSTEM_PLAYLISTSPATH),
"music",
strNewFileName);
@@ -448,9 +448,9 @@ void CGUIWindowMusicPlayList::OnItemLoaded(CFileItem* pItem)
{
if (pItem->HasMusicInfoTag() && pItem->GetMusicInfoTag()->Loaded())
{ // set label 1+2 from tags
- std::string strTrack=CServiceBroker::GetSettings().GetString(CSettings::SETTING_MUSICFILES_NOWPLAYINGTRACKFORMAT);
+ std::string strTrack=CServiceBroker::GetSettings()->GetString(CSettings::SETTING_MUSICFILES_NOWPLAYINGTRACKFORMAT);
if (strTrack.empty())
- strTrack = CServiceBroker::GetSettings().GetString(CSettings::SETTING_MUSICFILES_TRACKFORMAT);
+ strTrack = CServiceBroker::GetSettings()->GetString(CSettings::SETTING_MUSICFILES_TRACKFORMAT);
CLabelFormatter formatter(strTrack, "%D");
formatter.FormatLabels(pItem);
} // if (pItem->m_musicInfoTag.Loaded())
diff --git a/xbmc/music/windows/GUIWindowMusicPlaylistEditor.cpp b/xbmc/music/windows/GUIWindowMusicPlaylistEditor.cpp
index 89914ef42a..4cdf606dab 100644
--- a/xbmc/music/windows/GUIWindowMusicPlaylistEditor.cpp
+++ b/xbmc/music/windows/GUIWindowMusicPlaylistEditor.cpp
@@ -374,7 +374,7 @@ void CGUIWindowMusicPlaylistEditor::OnSavePlaylist()
PLAYLIST::CPlayListM3U playlist;
playlist.Add(*m_playlist);
std::string path = URIUtils::AddFileToFolder(
- CServiceBroker::GetSettings().GetString(CSettings::SETTING_SYSTEM_PLAYLISTSPATH),
+ CServiceBroker::GetSettings()->GetString(CSettings::SETTING_SYSTEM_PLAYLISTSPATH),
"music",
name + ".m3u");
@@ -386,7 +386,7 @@ void CGUIWindowMusicPlaylistEditor::OnSavePlaylist()
void CGUIWindowMusicPlaylistEditor::AppendToPlaylist(CFileItemList &newItems)
{
OnRetrieveMusicInfo(newItems);
- FormatItemLabels(newItems, LABEL_MASKS(CServiceBroker::GetSettings().GetString(CSettings::SETTING_MUSICFILES_TRACKFORMAT), "%D", "%L", ""));
+ FormatItemLabels(newItems, LABEL_MASKS(CServiceBroker::GetSettings()->GetString(CSettings::SETTING_MUSICFILES_TRACKFORMAT), "%D", "%L", ""));
m_playlist->Append(newItems);
UpdatePlaylist();
}
diff --git a/xbmc/music/windows/GUIWindowVisualisation.cpp b/xbmc/music/windows/GUIWindowVisualisation.cpp
index a2f491bc81..14845c8b9b 100644
--- a/xbmc/music/windows/GUIWindowVisualisation.cpp
+++ b/xbmc/music/windows/GUIWindowVisualisation.cpp
@@ -50,7 +50,7 @@ bool CGUIWindowVisualisation::OnAction(const CAction &action)
case ACTION_SHOW_INFO:
{
m_initTimer.Stop();
- CServiceBroker::GetSettings().SetBool(CSettings::SETTING_MYMUSIC_SONGTHUMBINVIS,
+ CServiceBroker::GetSettings()->SetBool(CSettings::SETTING_MYMUSIC_SONGTHUMBINVIS,
CServiceBroker::GetGUI()->GetInfoManager().GetInfoProviders().GetPlayerInfoProvider().ToggleShowInfo());
return true;
}
@@ -62,7 +62,7 @@ bool CGUIWindowVisualisation::OnAction(const CAction &action)
case ACTION_SHOW_GUI:
// save the settings
- CServiceBroker::GetSettings().Save();
+ CServiceBroker::GetSettings()->Save();
CServiceBroker::GetGUI()->GetWindowManager().PreviousWindow();
return true;
break;
@@ -141,7 +141,7 @@ bool CGUIWindowVisualisation::OnMessage(CGUIMessage& message)
case GUI_MSG_WINDOW_DEINIT:
{
if (IsActive()) // save any changed settings from the OSD
- CServiceBroker::GetSettings().Save();
+ CServiceBroker::GetSettings()->Save();
// close all active modal dialogs
CServiceBroker::GetGUI()->GetWindowManager().CloseInternalModalDialogs(true);
@@ -164,7 +164,7 @@ bool CGUIWindowVisualisation::OnMessage(CGUIMessage& message)
if (infoMgr.GetCurrentSongTag())
m_tag = *infoMgr.GetCurrentSongTag();
- if (CServiceBroker::GetSettings().GetBool(CSettings::SETTING_MYMUSIC_SONGTHUMBINVIS))
+ if (CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_MYMUSIC_SONGTHUMBINVIS))
{ // always on
m_initTimer.Stop();
}
@@ -217,7 +217,7 @@ void CGUIWindowVisualisation::FrameMove()
if (m_initTimer.IsRunning() && m_initTimer.GetElapsedSeconds() > (float)g_advancedSettings.m_songInfoDuration)
{
m_initTimer.Stop();
- if (!CServiceBroker::GetSettings().GetBool(CSettings::SETTING_MYMUSIC_SONGTHUMBINVIS))
+ if (!CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_MYMUSIC_SONGTHUMBINVIS))
{ // reached end of fade in, fade out again
infoMgr.GetInfoProviders().GetPlayerInfoProvider().SetShowInfo(false);
}
diff --git a/xbmc/music/windows/MusicFileItemListModifier.cpp b/xbmc/music/windows/MusicFileItemListModifier.cpp
index cc013bc38e..3243e99327 100644
--- a/xbmc/music/windows/MusicFileItemListModifier.cpp
+++ b/xbmc/music/windows/MusicFileItemListModifier.cpp
@@ -47,7 +47,7 @@ void CMusicFileItemListModifier::AddQueuingFolder(CFileItemList& items)
return;
// always show "all" items by default
- if (!CServiceBroker::GetSettings().GetBool(CSettings::SETTING_MUSICLIBRARY_SHOWALLITEMS))
+ if (!CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_MUSICLIBRARY_SHOWALLITEMS))
return;
// no need for "all" item when only one item
diff --git a/xbmc/network/AirPlayServer.cpp b/xbmc/network/AirPlayServer.cpp
index fdc183dc0e..e337ac0142 100644
--- a/xbmc/network/AirPlayServer.cpp
+++ b/xbmc/network/AirPlayServer.cpp
@@ -729,7 +729,7 @@ void CAirPlayServer::restoreVolume()
{
CSingleLock lock(ServerInstanceLock);
- if (ServerInstance && ServerInstance->m_origVolume != -1 && CServiceBroker::GetSettings().GetBool(CSettings::SETTING_SERVICES_AIRPLAYVOLUMECONTROL))
+ if (ServerInstance && ServerInstance->m_origVolume != -1 && CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_SERVICES_AIRPLAYVOLUMECONTROL))
{
g_application.SetVolume((float)ServerInstance->m_origVolume);
ServerInstance->m_origVolume = -1;
@@ -843,7 +843,7 @@ int CAirPlayServer::CTCPClient::ProcessRequest( std::string& responseHeader,
{
float oldVolume = g_application.GetVolume();
volume *= 100;
- if(oldVolume != volume && CServiceBroker::GetSettings().GetBool(CSettings::SETTING_SERVICES_AIRPLAYVOLUMECONTROL))
+ if(oldVolume != volume && CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_SERVICES_AIRPLAYVOLUMECONTROL))
{
backupVolume();
g_application.SetVolume(volume);
diff --git a/xbmc/network/AirTunesServer.cpp b/xbmc/network/AirTunesServer.cpp
index 3add8b7037..56ec0029f5 100644
--- a/xbmc/network/AirTunesServer.cpp
+++ b/xbmc/network/AirTunesServer.cpp
@@ -453,7 +453,7 @@ void CAirTunesServer::AudioOutputFunctions::audio_set_volume(void *cls, void *s
#ifdef HAS_AIRPLAY
CAirPlayServer::backupVolume();
#endif
- if (CServiceBroker::GetSettings().GetBool(CSettings::SETTING_SERVICES_AIRPLAYVOLUMECONTROL))
+ if (CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_SERVICES_AIRPLAYVOLUMECONTROL))
g_application.SetVolume(volPercent, false);//non-percent volume 0.0-1.0
}
diff --git a/xbmc/network/EventClient.h b/xbmc/network/EventClient.h
index a8a4c43ccf..22c7a29cac 100644
--- a/xbmc/network/EventClient.h
+++ b/xbmc/network/EventClient.h
@@ -145,8 +145,8 @@ namespace EVENTCLIENT
void RefreshSettings()
{
- m_iRepeatDelay = CServiceBroker::GetSettings().GetInt(CSettings::SETTING_SERVICES_ESINITIALDELAY);
- m_iRepeatSpeed = CServiceBroker::GetSettings().GetInt(CSettings::SETTING_SERVICES_ESCONTINUOUSDELAY);
+ m_iRepeatDelay = CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_SERVICES_ESINITIALDELAY);
+ m_iRepeatSpeed = CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_SERVICES_ESCONTINUOUSDELAY);
}
SOCKETS::CAddress& Address()
diff --git a/xbmc/network/EventServer.cpp b/xbmc/network/EventServer.cpp
index 5df12b7c06..1ca0f59c70 100644
--- a/xbmc/network/EventServer.cpp
+++ b/xbmc/network/EventServer.cpp
@@ -72,11 +72,11 @@ void CEventServer::StartServer()
return;
// set default port
- m_iPort = CServiceBroker::GetSettings().GetInt(CSettings::SETTING_SERVICES_ESPORT);
+ m_iPort = CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_SERVICES_ESPORT);
assert(m_iPort <= 65535 && m_iPort >= 1);
// max clients
- m_iMaxClients = CServiceBroker::GetSettings().GetInt(CSettings::SETTING_SERVICES_ESMAXCLIENTS);
+ m_iMaxClients = CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_SERVICES_ESMAXCLIENTS);
if (m_iMaxClients < 0)
{
CLog::Log(LOGERROR, "ES: Invalid maximum number of clients specified %d", m_iMaxClients);
@@ -161,13 +161,13 @@ void CEventServer::Run()
}
// bind to IP and start listening on port
- int port_range = CServiceBroker::GetSettings().GetInt(CSettings::SETTING_SERVICES_ESPORTRANGE);
+ int port_range = CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_SERVICES_ESPORTRANGE);
if (port_range < 1 || port_range > 100)
{
CLog::Log(LOGERROR, "ES: Invalid port range specified %d, defaulting to 10", port_range);
port_range = 10;
}
- if (!m_pSocket->Bind(!CServiceBroker::GetSettings().GetBool(CSettings::SETTING_SERVICES_ESALLINTERFACES), m_iPort, port_range))
+ if (!m_pSocket->Bind(!CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_SERVICES_ESALLINTERFACES), m_iPort, port_range))
{
CLog::Log(LOGERROR, "ES: Could not listen on port %d", m_iPort);
return;
diff --git a/xbmc/network/Network.cpp b/xbmc/network/Network.cpp
index e783c87afb..927562f673 100644
--- a/xbmc/network/Network.cpp
+++ b/xbmc/network/Network.cpp
@@ -125,8 +125,8 @@ int NetworkAccessPoint::FreqToChannel(float frequency)
return 0; // unknown
}
-CNetworkBase::CNetworkBase(CSettings &settings) :
- m_services(new CNetworkServices(settings))
+CNetworkBase::CNetworkBase() :
+ m_services(new CNetworkServices())
{
CApplicationMessenger::GetInstance().PostMsg(TMSG_NETWORKMESSAGE, SERVICES_UP, 0);
}
@@ -513,7 +513,7 @@ std::vector<SOCKET> CreateTCPServerSocket(const int port, const bool bindLocal,
void CNetworkBase::WaitForNet()
{
- const int timeout = CServiceBroker::GetSettings().GetInt(CSettings::SETTING_POWERMANAGEMENT_WAITFORNETWORK);
+ const int timeout = CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_POWERMANAGEMENT_WAITFORNETWORK);
if (timeout <= 0)
return; // wait for network is disabled
diff --git a/xbmc/network/Network.h b/xbmc/network/Network.h
index 4b0b747fda..98bc7fe7dd 100644
--- a/xbmc/network/Network.h
+++ b/xbmc/network/Network.h
@@ -99,7 +99,7 @@ public:
SERVICES_DOWN
};
- CNetworkBase(CSettings &settings);
+ CNetworkBase();
virtual ~CNetworkBase();
// Get network services
diff --git a/xbmc/network/NetworkServices.cpp b/xbmc/network/NetworkServices.cpp
index fbff0eaa5d..a2b97446af 100644
--- a/xbmc/network/NetworkServices.cpp
+++ b/xbmc/network/NetworkServices.cpp
@@ -76,10 +76,9 @@ using namespace UPNP;
using KODI::MESSAGING::HELPERS::DialogResponse;
-CNetworkServices::CNetworkServices(CSettings &settings)
- : m_settings(settings)
+CNetworkServices::CNetworkServices()
#ifdef HAS_WEB_SERVER
- , m_webserver(*new CWebServer),
+ : m_webserver(*new CWebServer),
m_httpImageHandler(*new CHTTPImageHandler),
m_httpImageTransformationHandler(*new CHTTPImageTransformationHandler),
m_httpVfsHandler(*new CHTTPVfsHandler),
@@ -133,12 +132,13 @@ CNetworkServices::CNetworkServices(CSettings &settings)
CSettings::SETTING_SMB_MAXPROTOCOL,
CSettings::SETTING_SMB_LEGACYSECURITY
};
- m_settings.GetSettingsManager()->RegisterCallback(this, settingSet);
+ m_settings = CServiceBroker::GetSettings();
+ m_settings->GetSettingsManager()->RegisterCallback(this, settingSet);
}
CNetworkServices::~CNetworkServices()
{
- m_settings.GetSettingsManager()->UnregisterCallback(this);
+ m_settings->GetSettingsManager()->UnregisterCallback(this);
#ifdef HAS_WEB_SERVER
m_webserver.UnregisterRequestHandler(&m_httpImageHandler);
delete &m_httpImageHandler;
@@ -177,7 +177,7 @@ bool CNetworkServices::OnSettingChanging(std::shared_ptr<const CSetting> setting
if (IsWebserverRunning() && !StopWebserver())
return false;
- if (m_settings.GetBool(CSettings::SETTING_SERVICES_WEBSERVER))
+ if (m_settings->GetBool(CSettings::SETTING_SERVICES_WEBSERVER))
{
if (!StartWebserver())
{
@@ -221,7 +221,7 @@ bool CNetworkServices::OnSettingChanging(std::shared_ptr<const CSetting> setting
{
#ifdef HAS_ZEROCONF
// AirPlay needs zeroconf
- if (!m_settings.GetBool(CSettings::SETTING_SERVICES_ZEROCONF))
+ if (!m_settings->GetBool(CSettings::SETTING_SERVICES_ZEROCONF))
{
HELPERS::ShowOKDialogText(CVariant{1273}, CVariant{34302});
return false;
@@ -277,11 +277,11 @@ bool CNetworkServices::OnSettingChanging(std::shared_ptr<const CSetting> setting
else if (settingId == CSettings::SETTING_SERVICES_AIRPLAYPASSWORD ||
settingId == CSettings::SETTING_SERVICES_USEAIRPLAYPASSWORD)
{
- if (!m_settings.GetBool(CSettings::SETTING_SERVICES_AIRPLAY))
+ if (!m_settings->GetBool(CSettings::SETTING_SERVICES_AIRPLAY))
return false;
- if (!CAirPlayServer::SetCredentials(m_settings.GetBool(CSettings::SETTING_SERVICES_USEAIRPLAYPASSWORD),
- m_settings.GetString(CSettings::SETTING_SERVICES_AIRPLAYPASSWORD)))
+ if (!CAirPlayServer::SetCredentials(m_settings->GetBool(CSettings::SETTING_SERVICES_USEAIRPLAYPASSWORD),
+ m_settings->GetString(CSettings::SETTING_SERVICES_AIRPLAYPASSWORD)))
return false;
}
else
@@ -383,7 +383,7 @@ bool CNetworkServices::OnSettingChanging(std::shared_ptr<const CSetting> setting
}
else if (settingId == CSettings::SETTING_SERVICES_ESALLINTERFACES)
{
- if (m_settings.GetBool(CSettings::SETTING_SERVICES_ESENABLED))
+ if (m_settings->GetBool(CSettings::SETTING_SERVICES_ESENABLED))
{
if (!StopEventServer(true, true))
return false;
@@ -395,7 +395,7 @@ bool CNetworkServices::OnSettingChanging(std::shared_ptr<const CSetting> setting
}
}
- if (m_settings.GetBool(CSettings::SETTING_SERVICES_ESENABLED))
+ if (m_settings->GetBool(CSettings::SETTING_SERVICES_ESENABLED))
{
if (!StopJSONRPCServer(true))
return false;
@@ -411,7 +411,7 @@ bool CNetworkServices::OnSettingChanging(std::shared_ptr<const CSetting> setting
else if (settingId == CSettings::SETTING_SERVICES_ESINITIALDELAY ||
settingId == CSettings::SETTING_SERVICES_ESCONTINUOUSDELAY)
{
- if (m_settings.GetBool(CSettings::SETTING_SERVICES_ESENABLED))
+ if (m_settings->GetBool(CSettings::SETTING_SERVICES_ESENABLED))
return RefreshEventServer();
}
@@ -428,8 +428,8 @@ void CNetworkServices::OnSettingChanged(std::shared_ptr<const CSetting> setting)
if (settingId == CSettings::SETTING_SERVICES_WEBSERVERUSERNAME ||
settingId == CSettings::SETTING_SERVICES_WEBSERVERPASSWORD)
{
- m_webserver.SetCredentials(m_settings.GetString(CSettings::SETTING_SERVICES_WEBSERVERUSERNAME),
- m_settings.GetString(CSettings::SETTING_SERVICES_WEBSERVERPASSWORD));
+ m_webserver.SetCredentials(m_settings->GetString(CSettings::SETTING_SERVICES_WEBSERVERUSERNAME),
+ m_settings->GetString(CSettings::SETTING_SERVICES_WEBSERVERPASSWORD));
}
else
#endif // HAS_WEB_SERVER
@@ -443,7 +443,7 @@ void CNetworkServices::OnSettingChanged(std::shared_ptr<const CSetting> setting)
//! @todo - General way of handling setting changes that require restart
if (HELPERS::ShowYesNoDialogText(CVariant{14038}, CVariant{14039}) == DialogResponse::YES)
{
- m_settings.Save();
+ m_settings->Save();
CApplicationMessenger::GetInstance().PostMsg(TMSG_RESTARTAPP);
}
}
@@ -459,15 +459,15 @@ bool CNetworkServices::OnSettingUpdate(std::shared_ptr<CSetting> setting, const
{
// if webserverusername is xbmc and pw is not empty we treat it as altered
// and don't change the username to kodi - part of rebrand
- if (m_settings.GetString(CSettings::SETTING_SERVICES_WEBSERVERUSERNAME) == "xbmc" &&
- !m_settings.GetString(CSettings::SETTING_SERVICES_WEBSERVERPASSWORD).empty())
+ if (m_settings->GetString(CSettings::SETTING_SERVICES_WEBSERVERUSERNAME) == "xbmc" &&
+ !m_settings->GetString(CSettings::SETTING_SERVICES_WEBSERVERPASSWORD).empty())
return true;
}
if (settingId == CSettings::SETTING_SERVICES_WEBSERVERPORT)
{
// if webserverport is default but webserver is activated then treat it as altered
// and don't change the port to new value
- if (m_settings.GetBool(CSettings::SETTING_SERVICES_WEBSERVER))
+ if (m_settings->GetBool(CSettings::SETTING_SERVICES_WEBSERVER))
return true;
}
return false;
@@ -477,14 +477,14 @@ void CNetworkServices::Start()
{
StartZeroconf();
#ifdef HAS_WEB_SERVER
- if (m_settings.GetBool(CSettings::SETTING_SERVICES_WEBSERVER) && !StartWebserver())
+ if (m_settings->GetBool(CSettings::SETTING_SERVICES_WEBSERVER) && !StartWebserver())
CGUIDialogKaiToast::QueueNotification(CGUIDialogKaiToast::Warning, g_localizeStrings.Get(33101), g_localizeStrings.Get(33100));
#endif // HAS_WEB_SERVER
- if (m_settings.GetBool(CSettings::SETTING_SERVICES_UPNP))
+ if (m_settings->GetBool(CSettings::SETTING_SERVICES_UPNP))
StartUPnP();
- if (m_settings.GetBool(CSettings::SETTING_SERVICES_ESENABLED) && !StartEventServer())
+ if (m_settings->GetBool(CSettings::SETTING_SERVICES_ESENABLED) && !StartEventServer())
CGUIDialogKaiToast::QueueNotification(CGUIDialogKaiToast::Warning, g_localizeStrings.Get(33102), g_localizeStrings.Get(33100));
- if (m_settings.GetBool(CSettings::SETTING_SERVICES_ESENABLED) && !StartJSONRPCServer())
+ if (m_settings->GetBool(CSettings::SETTING_SERVICES_ESENABLED) && !StartJSONRPCServer())
CGUIDialogKaiToast::QueueNotification(CGUIDialogKaiToast::Warning, g_localizeStrings.Get(33103), g_localizeStrings.Get(33100));
// note - airtunesserver has to start before airplay server (ios7 client detection bug)
@@ -515,10 +515,10 @@ bool CNetworkServices::StartWebserver()
if (!CServiceBroker::GetNetwork().IsAvailable())
return false;
- if (!m_settings.GetBool(CSettings::SETTING_SERVICES_WEBSERVER))
+ if (!m_settings->GetBool(CSettings::SETTING_SERVICES_WEBSERVER))
return false;
- int webPort = m_settings.GetInt(CSettings::SETTING_SERVICES_WEBSERVERPORT);
+ int webPort = m_settings->GetInt(CSettings::SETTING_SERVICES_WEBSERVERPORT);
if (!ValidatePort(webPort))
{
CLog::Log(LOGERROR, "Cannot start Web Server on port %i", webPort);
@@ -528,13 +528,13 @@ bool CNetworkServices::StartWebserver()
if (IsWebserverRunning())
return true;
- if (!m_webserver.Start(webPort, m_settings.GetString(CSettings::SETTING_SERVICES_WEBSERVERUSERNAME), m_settings.GetString(CSettings::SETTING_SERVICES_WEBSERVERPASSWORD)))
+ if (!m_webserver.Start(webPort, m_settings->GetString(CSettings::SETTING_SERVICES_WEBSERVERUSERNAME), m_settings->GetString(CSettings::SETTING_SERVICES_WEBSERVERPASSWORD)))
return false;
#ifdef HAS_ZEROCONF
std::vector<std::pair<std::string, std::string> > txt;
txt.push_back(std::make_pair("txtvers", "1"));
- txt.push_back(std::make_pair("uuid", CServiceBroker::GetSettings().GetString(CSettings::SETTING_SERVICES_DEVICEUUID)));
+ txt.push_back(std::make_pair("uuid", CServiceBroker::GetSettings()->GetString(CSettings::SETTING_SERVICES_DEVICEUUID)));
// publish web frontend and API services
#ifdef HAS_WEB_INTERFACE
@@ -582,11 +582,11 @@ bool CNetworkServices::StopWebserver()
bool CNetworkServices::StartAirPlayServer()
{
- if (!m_settings.GetBool(CSettings::SETTING_SERVICES_AIRPLAYVIDEOSUPPORT))
+ if (!m_settings->GetBool(CSettings::SETTING_SERVICES_AIRPLAYVIDEOSUPPORT))
return true;
#ifdef HAS_AIRPLAY
- if (!CServiceBroker::GetNetwork().IsAvailable() || !m_settings.GetBool(CSettings::SETTING_SERVICES_AIRPLAY))
+ if (!CServiceBroker::GetNetwork().IsAvailable() || !m_settings->GetBool(CSettings::SETTING_SERVICES_AIRPLAY))
return false;
if (IsAirPlayServerRunning())
@@ -595,8 +595,8 @@ bool CNetworkServices::StartAirPlayServer()
if (!CAirPlayServer::StartServer(g_advancedSettings.m_airPlayPort, true))
return false;
- if (!CAirPlayServer::SetCredentials(m_settings.GetBool(CSettings::SETTING_SERVICES_USEAIRPLAYPASSWORD),
- m_settings.GetString(CSettings::SETTING_SERVICES_AIRPLAYPASSWORD)))
+ if (!CAirPlayServer::SetCredentials(m_settings->GetBool(CSettings::SETTING_SERVICES_USEAIRPLAYPASSWORD),
+ m_settings->GetString(CSettings::SETTING_SERVICES_AIRPLAYPASSWORD)))
return false;
#ifdef HAS_ZEROCONF
@@ -648,15 +648,15 @@ bool CNetworkServices::StopAirPlayServer(bool bWait)
bool CNetworkServices::StartAirTunesServer()
{
#ifdef HAS_AIRTUNES
- if (!CServiceBroker::GetNetwork().IsAvailable() || !m_settings.GetBool(CSettings::SETTING_SERVICES_AIRPLAY))
+ if (!CServiceBroker::GetNetwork().IsAvailable() || !m_settings->GetBool(CSettings::SETTING_SERVICES_AIRPLAY))
return false;
if (IsAirTunesServerRunning())
return true;
if (!CAirTunesServer::StartServer(g_advancedSettings.m_airTunesPort, true,
- m_settings.GetBool(CSettings::SETTING_SERVICES_USEAIRPLAYPASSWORD),
- m_settings.GetString(CSettings::SETTING_SERVICES_AIRPLAYPASSWORD)))
+ m_settings->GetBool(CSettings::SETTING_SERVICES_USEAIRPLAYPASSWORD),
+ m_settings->GetString(CSettings::SETTING_SERVICES_AIRPLAYPASSWORD)))
{
CLog::Log(LOGERROR, "Failed to start AirTunes Server");
return false;
@@ -689,19 +689,19 @@ bool CNetworkServices::StopAirTunesServer(bool bWait)
bool CNetworkServices::StartJSONRPCServer()
{
- if (!m_settings.GetBool(CSettings::SETTING_SERVICES_ESENABLED))
+ if (!m_settings->GetBool(CSettings::SETTING_SERVICES_ESENABLED))
return false;
if (IsJSONRPCServerRunning())
return true;
- if (!CTCPServer::StartServer(g_advancedSettings.m_jsonTcpPort, m_settings.GetBool(CSettings::SETTING_SERVICES_ESALLINTERFACES)))
+ if (!CTCPServer::StartServer(g_advancedSettings.m_jsonTcpPort, m_settings->GetBool(CSettings::SETTING_SERVICES_ESALLINTERFACES)))
return false;
#ifdef HAS_ZEROCONF
std::vector<std::pair<std::string, std::string> > txt;
txt.push_back(std::make_pair("txtvers", "1"));
- txt.push_back(std::make_pair("uuid", CServiceBroker::GetSettings().GetString(CSettings::SETTING_SERVICES_DEVICEUUID)));
+ txt.push_back(std::make_pair("uuid", CServiceBroker::GetSettings()->GetString(CSettings::SETTING_SERVICES_DEVICEUUID)));
CZeroconf::GetInstance()->PublishService("servers.jsonrpc-tpc", "_xbmc-jsonrpc._tcp", CSysInfo::GetDeviceName(), g_advancedSettings.m_jsonTcpPort, txt);
#endif // HAS_ZEROCONF
@@ -730,7 +730,7 @@ bool CNetworkServices::StopJSONRPCServer(bool bWait)
bool CNetworkServices::StartEventServer()
{
- if (!m_settings.GetBool(CSettings::SETTING_SERVICES_ESENABLED))
+ if (!m_settings->GetBool(CSettings::SETTING_SERVICES_ESENABLED))
return false;
if (IsEventServerRunning())
@@ -793,7 +793,7 @@ bool CNetworkServices::StopEventServer(bool bWait, bool promptuser)
bool CNetworkServices::RefreshEventServer()
{
- if (!m_settings.GetBool(CSettings::SETTING_SERVICES_ESENABLED))
+ if (!m_settings->GetBool(CSettings::SETTING_SERVICES_ESENABLED))
return false;
if (!IsEventServerRunning())
@@ -808,17 +808,17 @@ bool CNetworkServices::StartUPnP()
bool ret = false;
#ifdef HAS_UPNP
ret |= StartUPnPClient();
- if (m_settings.GetBool(CSettings::SETTING_SERVICES_UPNPSERVER))
+ if (m_settings->GetBool(CSettings::SETTING_SERVICES_UPNPSERVER))
{
ret |= StartUPnPServer();
}
- if (m_settings.GetBool(CSettings::SETTING_SERVICES_UPNPCONTROLLER))
+ if (m_settings->GetBool(CSettings::SETTING_SERVICES_UPNPCONTROLLER))
{
ret |= StartUPnPController();
}
- if (m_settings.GetBool(CSettings::SETTING_SERVICES_UPNPRENDERER))
+ if (m_settings->GetBool(CSettings::SETTING_SERVICES_UPNPRENDERER))
{
ret |= StartUPnPRenderer();
}
@@ -843,7 +843,7 @@ bool CNetworkServices::StopUPnP(bool bWait)
bool CNetworkServices::StartUPnPClient()
{
#ifdef HAS_UPNP
- if (!m_settings.GetBool(CSettings::SETTING_SERVICES_UPNP))
+ if (!m_settings->GetBool(CSettings::SETTING_SERVICES_UPNP))
return false;
CLog::Log(LOGNOTICE, "starting upnp client");
@@ -878,9 +878,9 @@ bool CNetworkServices::StopUPnPClient()
bool CNetworkServices::StartUPnPController()
{
#ifdef HAS_UPNP
- if (!m_settings.GetBool(CSettings::SETTING_SERVICES_UPNPCONTROLLER) ||
- !m_settings.GetBool(CSettings::SETTING_SERVICES_UPNPSERVER) ||
- !m_settings.GetBool(CSettings::SETTING_SERVICES_UPNP))
+ if (!m_settings->GetBool(CSettings::SETTING_SERVICES_UPNPCONTROLLER) ||
+ !m_settings->GetBool(CSettings::SETTING_SERVICES_UPNPSERVER) ||
+ !m_settings->GetBool(CSettings::SETTING_SERVICES_UPNP))
return false;
CLog::Log(LOGNOTICE, "starting upnp controller");
@@ -915,8 +915,8 @@ bool CNetworkServices::StopUPnPController()
bool CNetworkServices::StartUPnPRenderer()
{
#ifdef HAS_UPNP
- if (!m_settings.GetBool(CSettings::SETTING_SERVICES_UPNPRENDERER) ||
- !m_settings.GetBool(CSettings::SETTING_SERVICES_UPNP))
+ if (!m_settings->GetBool(CSettings::SETTING_SERVICES_UPNPRENDERER) ||
+ !m_settings->GetBool(CSettings::SETTING_SERVICES_UPNP))
return false;
CLog::Log(LOGNOTICE, "starting upnp renderer");
@@ -950,8 +950,8 @@ bool CNetworkServices::StopUPnPRenderer()
bool CNetworkServices::StartUPnPServer()
{
#ifdef HAS_UPNP
- if (!m_settings.GetBool(CSettings::SETTING_SERVICES_UPNPSERVER) ||
- !m_settings.GetBool(CSettings::SETTING_SERVICES_UPNP))
+ if (!m_settings->GetBool(CSettings::SETTING_SERVICES_UPNPSERVER) ||
+ !m_settings->GetBool(CSettings::SETTING_SERVICES_UPNP))
return false;
CLog::Log(LOGNOTICE, "starting upnp server");
@@ -1010,7 +1010,7 @@ bool CNetworkServices::StopRss()
bool CNetworkServices::StartZeroconf()
{
#ifdef HAS_ZEROCONF
- if (!m_settings.GetBool(CSettings::SETTING_SERVICES_ZEROCONF))
+ if (!m_settings->GetBool(CSettings::SETTING_SERVICES_ZEROCONF))
return false;
if (IsZeroconfRunning())
diff --git a/xbmc/network/NetworkServices.h b/xbmc/network/NetworkServices.h
index 5e8cdf44fc..860243107d 100644
--- a/xbmc/network/NetworkServices.h
+++ b/xbmc/network/NetworkServices.h
@@ -29,7 +29,7 @@ class CHTTPWebinterfaceAddonsHandler;
class CNetworkServices : public ISettingCallback
{
public:
- CNetworkServices(CSettings &settings);
+ CNetworkServices();
~CNetworkServices() override;
bool OnSettingChanging(std::shared_ptr<const CSetting> setting) override;
@@ -89,7 +89,7 @@ private:
bool ValidatePort(int port);
// Construction parameters
- CSettings &m_settings;
+ std::shared_ptr<CSettings> m_settings;
// Network services
#ifdef HAS_WEB_SERVER
diff --git a/xbmc/network/WakeOnAccess.cpp b/xbmc/network/WakeOnAccess.cpp
index 0350fb9c3d..f8aa005fd8 100644
--- a/xbmc/network/WakeOnAccess.cpp
+++ b/xbmc/network/WakeOnAccess.cpp
@@ -794,7 +794,7 @@ void CWakeOnAccess::SetEnabled(bool enabled)
void CWakeOnAccess::LoadFromXML()
{
- bool enabled = CServiceBroker::GetSettings().GetBool(CSettings::SETTING_POWERMANAGEMENT_WAKEONACCESS);
+ bool enabled = CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_POWERMANAGEMENT_WAKEONACCESS);
CXBMCTinyXML xmlDoc;
if (!xmlDoc.LoadFile(GetSettingFile()))
diff --git a/xbmc/network/WebServer.cpp b/xbmc/network/WebServer.cpp
index e78a62ef66..2c8cdd1fa4 100644
--- a/xbmc/network/WebServer.cpp
+++ b/xbmc/network/WebServer.cpp
@@ -1110,7 +1110,7 @@ struct MHD_Daemon* CWebServer::StartMHD(unsigned int flags, int port)
MHD_set_panic_func(&panicHandlerForMHD, nullptr);
- if (CServiceBroker::GetSettings().GetBool(CSettings::SETTING_SERVICES_WEBSERVERSSL) &&
+ if (CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_SERVICES_WEBSERVERSSL) &&
MHD_is_feature_supported(MHD_FEATURE_SSL) == MHD_YES &&
LoadCert(m_key, m_cert))
// SSL enabled
diff --git a/xbmc/network/Zeroconf.cpp b/xbmc/network/Zeroconf.cpp
index 34c922ffb1..61b066ee41 100644
--- a/xbmc/network/Zeroconf.cpp
+++ b/xbmc/network/Zeroconf.cpp
@@ -105,9 +105,9 @@ bool CZeroconf::Start()
CSingleLock lock(*mp_crit_sec);
if(!IsZCdaemonRunning())
{
- CServiceBroker::GetSettings().SetBool(CSettings::SETTING_SERVICES_ZEROCONF, false);
- if (CServiceBroker::GetSettings().GetBool(CSettings::SETTING_SERVICES_AIRPLAY))
- CServiceBroker::GetSettings().SetBool(CSettings::SETTING_SERVICES_AIRPLAY, false);
+ CServiceBroker::GetSettings()->SetBool(CSettings::SETTING_SERVICES_ZEROCONF, false);
+ if (CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_SERVICES_AIRPLAY))
+ CServiceBroker::GetSettings()->SetBool(CSettings::SETTING_SERVICES_AIRPLAY, false);
return false;
}
if(m_started)
diff --git a/xbmc/network/upnp/UPnP.cpp b/xbmc/network/upnp/UPnP.cpp
index a040e14811..bcaaf0d349 100644
--- a/xbmc/network/upnp/UPnP.cpp
+++ b/xbmc/network/upnp/UPnP.cpp
@@ -629,7 +629,7 @@ CUPnP::CreateServer(int port /* = 0 */)
// but it doesn't work anyways as it requires multicast for XP to detect us
device->m_PresentationURL =
NPT_HttpUrl(m_IP.c_str(),
- CServiceBroker::GetSettings().GetInt(CSettings::SETTING_SERVICES_WEBSERVERPORT),
+ CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_SERVICES_WEBSERVERPORT),
"/").ToString();
device->m_ModelName = "Kodi";
@@ -714,7 +714,7 @@ CUPnP::CreateRenderer(int port /* = 0 */)
device->m_PresentationURL =
NPT_HttpUrl(m_IP.c_str(),
- CServiceBroker::GetSettings().GetInt(CSettings::SETTING_SERVICES_WEBSERVERPORT),
+ CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_SERVICES_WEBSERVERPORT),
"/").ToString();
device->m_ModelName = "Kodi";
device->m_ModelNumber = CSysInfo::GetVersion().c_str();
diff --git a/xbmc/network/upnp/UPnPInternal.cpp b/xbmc/network/upnp/UPnPInternal.cpp
index 4cab0f0ff9..94fce41d65 100644
--- a/xbmc/network/upnp/UPnPInternal.cpp
+++ b/xbmc/network/upnp/UPnPInternal.cpp
@@ -608,7 +608,7 @@ BuildObject(CFileItem& item,
// to look for external subtitles
if (upnp_server != NULL && item.IsVideo() &&
(upnp_service == UPnPPlayer || upnp_service == UPnPRenderer ||
- CServiceBroker::GetSettings().GetBool(CSettings::SETTING_SERVICES_UPNPLOOKFOREXTERNALSUBTITLES)))
+ CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_SERVICES_UPNPLOOKFOREXTERNALSUBTITLES)))
{
// find any available external subtitles
std::vector<std::string> filenames;
@@ -638,7 +638,7 @@ BuildObject(CFileItem& item,
else if (!subtitles.empty())
{
/* trying to find subtitle with prefered language settings */
- std::string preferredLanguage = (CServiceBroker::GetSettings().GetSetting("locale.subtitlelanguage"))->ToString();
+ std::string preferredLanguage = (CServiceBroker::GetSettings()->GetSetting("locale.subtitlelanguage"))->ToString();
std::string preferredLanguageCode;
g_LangCodeExpander.ConvertToISO6392B(preferredLanguage, preferredLanguageCode);
diff --git a/xbmc/network/upnp/UPnPServer.cpp b/xbmc/network/upnp/UPnPServer.cpp
index efe2197081..219bc6be47 100644
--- a/xbmc/network/upnp/UPnPServer.cpp
+++ b/xbmc/network/upnp/UPnPServer.cpp
@@ -158,7 +158,7 @@ CUPnPServer::PropagateUpdates()
std::string buffer;
std::map<std::string, std::pair<bool, unsigned long> >::iterator itr;
- if (m_scanning || !CServiceBroker::GetSettings().GetBool(CSettings::SETTING_SERVICES_UPNPANNOUNCE))
+ if (m_scanning || !CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_SERVICES_UPNPANNOUNCE))
return;
NPT_CHECK_LABEL(FindServiceById("urn:upnp-org:serviceId:ContentDirectory", service), failed);
diff --git a/xbmc/peripherals/Peripherals.cpp b/xbmc/peripherals/Peripherals.cpp
index 6eecb17329..95c185b344 100644
--- a/xbmc/peripherals/Peripherals.cpp
+++ b/xbmc/peripherals/Peripherals.cpp
@@ -81,13 +81,13 @@ CPeripherals::CPeripherals(CInputManager &inputManager,
settingSet.insert(CSettings::SETTING_INPUT_CONTROLLERCONFIG);
settingSet.insert(CSettings::SETTING_INPUT_TESTRUMBLE);
settingSet.insert(CSettings::SETTING_LOCALE_LANGUAGE);
- CServiceBroker::GetSettings().RegisterCallback(this, settingSet);
+ CServiceBroker::GetSettings()->RegisterCallback(this, settingSet);
}
CPeripherals::~CPeripherals()
{
// Unregister settings
- CServiceBroker::GetSettings().UnregisterCallback(this);
+ CServiceBroker::GetSettings()->UnregisterCallback(this);
Clear();
}
@@ -776,7 +776,7 @@ EventLockHandlePtr CPeripherals::RegisterEventLock()
void CPeripherals::OnUserNotification()
{
- if (!CServiceBroker::GetSettings().GetBool(CSettings::SETTING_INPUT_RUMBLENOTIFY))
+ if (!CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_INPUT_RUMBLENOTIFY))
return;
PeripheralVector peripherals;
@@ -965,7 +965,7 @@ void CPeripherals::Announce(ANNOUNCEMENT::AnnouncementFlag flag, const char *sen
{
if (strcmp(message, "OnQuit") == 0)
{
- if (CServiceBroker::GetSettings().GetBool(CSettings::SETTING_INPUT_CONTROLLERPOWEROFF))
+ if (CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_INPUT_CONTROLLERPOWEROFF))
PowerOffDevices();
}
}
diff --git a/xbmc/peripherals/bus/virtual/PeripheralBusApplication.cpp b/xbmc/peripherals/bus/virtual/PeripheralBusApplication.cpp
index 4050f6b3a1..70be5eb2de 100644
--- a/xbmc/peripherals/bus/virtual/PeripheralBusApplication.cpp
+++ b/xbmc/peripherals/bus/virtual/PeripheralBusApplication.cpp
@@ -44,7 +44,7 @@ bool CPeripheralBusApplication::PerformDeviceScan(PeripheralScanResults& results
results.m_results.push_back(result);
}
- bool bHasMouse = CServiceBroker::GetSettings().GetBool(CSettings::SETTING_INPUT_ENABLEMOUSE);
+ bool bHasMouse = CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_INPUT_ENABLEMOUSE);
//! @todo Fix game clients to handle mouse disconnecting
//! For now mouse is always connected
diff --git a/xbmc/pictures/GUIViewStatePictures.cpp b/xbmc/pictures/GUIViewStatePictures.cpp
index c6a366790c..e36ec5e0fe 100644
--- a/xbmc/pictures/GUIViewStatePictures.cpp
+++ b/xbmc/pictures/GUIViewStatePictures.cpp
@@ -63,7 +63,7 @@ std::string CGUIViewStateWindowPictures::GetLockType()
std::string CGUIViewStateWindowPictures::GetExtensions()
{
std::string extensions = CServiceBroker::GetFileExtensionProvider().GetPictureExtensions();
- if (CServiceBroker::GetSettings().GetBool(CSettings::SETTING_PICTURES_SHOWVIDEOS))
+ if (CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_PICTURES_SHOWVIDEOS))
extensions += "|" + CServiceBroker::GetFileExtensionProvider().GetVideoExtensions();
return extensions;
diff --git a/xbmc/pictures/GUIWindowPictures.cpp b/xbmc/pictures/GUIWindowPictures.cpp
index c5acd1de91..062ff6df85 100644
--- a/xbmc/pictures/GUIWindowPictures.cpp
+++ b/xbmc/pictures/GUIWindowPictures.cpp
@@ -118,8 +118,8 @@ bool CGUIWindowPictures::OnMessage(CGUIMessage& message)
}
else if (iControl == CONTROL_SHUFFLE)
{
- CServiceBroker::GetSettings().ToggleBool(CSettings::SETTING_SLIDESHOW_SHUFFLE);
- CServiceBroker::GetSettings().Save();
+ CServiceBroker::GetSettings()->ToggleBool(CSettings::SETTING_SLIDESHOW_SHUFFLE);
+ CServiceBroker::GetSettings()->Save();
}
else if (m_viewControl.HasControl(iControl)) // list/thumb control
{
@@ -130,7 +130,7 @@ bool CGUIWindowPictures::OnMessage(CGUIMessage& message)
if (iAction == ACTION_DELETE_ITEM)
{
// is delete allowed?
- if (CServiceBroker::GetSettings().GetBool(CSettings::SETTING_FILELISTS_ALLOWFILEDELETION))
+ if (CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_FILELISTS_ALLOWFILEDELETION))
OnDeleteItem(iItem);
else
return false;
@@ -157,7 +157,7 @@ void CGUIWindowPictures::UpdateButtons()
CGUIMediaWindow::UpdateButtons();
// Update the shuffle button
- SET_CONTROL_SELECTED(GetID(), CONTROL_SHUFFLE, CServiceBroker::GetSettings().GetBool(CSettings::SETTING_SLIDESHOW_SHUFFLE));
+ SET_CONTROL_SELECTED(GetID(), CONTROL_SHUFFLE, CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_SLIDESHOW_SHUFFLE));
// check we can slideshow or recursive slideshow
int nFolders = m_vecItems->GetFolderCount();
@@ -191,7 +191,7 @@ void CGUIWindowPictures::OnPrepareFileItems(CFileItemList& items)
if (StringUtils::EqualsNoCase(items[i]->GetLabel(), "folder.jpg"))
items.Remove(i);
- if (items.GetFolderCount() == items.Size() || !CServiceBroker::GetSettings().GetBool(CSettings::SETTING_PICTURES_USETAGS))
+ if (items.GetFolderCount() == items.Size() || !CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_PICTURES_USETAGS))
return;
// Start the music info loader thread
@@ -244,7 +244,7 @@ bool CGUIWindowPictures::Update(const std::string &strDirectory, bool updateFilt
return false;
m_vecItems->SetArt("thumb", "");
- if (CServiceBroker::GetSettings().GetBool(CSettings::SETTING_PICTURES_GENERATETHUMBS))
+ if (CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_PICTURES_GENERATETHUMBS))
m_thumbLoader.Load(*m_vecItems);
CPictureThumbLoader thumbLoader;
@@ -324,7 +324,7 @@ bool CGUIWindowPictures::ShowPicture(int iItem, bool startSlideShow)
CFileItemPtr pItem = m_vecItems->Get(i);
if (!pItem->m_bIsFolder && !(URIUtils::IsRAR(pItem->GetPath()) ||
URIUtils::IsZIP(pItem->GetPath())) && (pItem->IsPicture() || (
- CServiceBroker::GetSettings().GetBool(CSettings::SETTING_PICTURES_SHOWVIDEOS) &&
+ CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_PICTURES_SHOWVIDEOS) &&
pItem->IsVideo())))
{
pSlideShow->Add(pItem.get());
@@ -389,7 +389,7 @@ void CGUIWindowPictures::OnSlideShowRecursive(const std::string &strPicture)
SortDescription sorting = m_guiState->GetSortMethod();
pSlideShow->RunSlideShow(strPicture, true,
- CServiceBroker::GetSettings().GetBool(CSettings::SETTING_SLIDESHOW_SHUFFLE),false,
+ CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_SLIDESHOW_SHUFFLE),false,
"", true,
sorting.sortBy, sorting.sortOrder, sorting.sortAttributes,
strExtensions);
@@ -464,7 +464,7 @@ void CGUIWindowPictures::GetContextButtons(int itemNumber, CContextButtons &butt
if (!m_thumbLoader.IsLoading())
buttons.Add(CONTEXT_BUTTON_REFRESH_THUMBS, 13315); // Create Thumbnails
- if (CServiceBroker::GetSettings().GetBool(CSettings::SETTING_FILELISTS_ALLOWFILEDELETION) && !item->IsReadOnly())
+ if (CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_FILELISTS_ALLOWFILEDELETION) && !item->IsReadOnly())
{
buttons.Add(CONTEXT_BUTTON_DELETE, 117);
buttons.Add(CONTEXT_BUTTON_RENAME, 118);
diff --git a/xbmc/pictures/GUIWindowSlideShow.cpp b/xbmc/pictures/GUIWindowSlideShow.cpp
index 0b09efa426..e14e458c9e 100644
--- a/xbmc/pictures/GUIWindowSlideShow.cpp
+++ b/xbmc/pictures/GUIWindowSlideShow.cpp
@@ -916,7 +916,7 @@ bool CGUIWindowSlideShow::OnMessage(CGUIMessage& message)
{
case GUI_MSG_WINDOW_INIT:
{
- m_Resolution = (RESOLUTION) CServiceBroker::GetSettings().GetInt(CSettings::SETTING_PICTURES_DISPLAYRESOLUTION);
+ m_Resolution = (RESOLUTION) CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_PICTURES_DISPLAYRESOLUTION);
//FIXME: Use GUI resolution for now
if (0 /*m_Resolution != CDisplaySettings::GetInstance().GetCurrentResolution() && m_Resolution != INVALID && m_Resolution!=AUTORES*/)
@@ -1105,7 +1105,7 @@ bool CGUIWindowSlideShow::PlayVideo()
CSlideShowPic::DISPLAY_EFFECT CGUIWindowSlideShow::GetDisplayEffect(int iSlideNumber) const
{
if (m_bSlideShow && !m_bPause && !m_slides.at(iSlideNumber)->IsVideo())
- return CServiceBroker::GetSettings().GetBool(CSettings::SETTING_SLIDESHOW_DISPLAYEFFECTS) ? CSlideShowPic::EFFECT_RANDOM : CSlideShowPic::EFFECT_NONE;
+ return CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_SLIDESHOW_DISPLAYEFFECTS) ? CSlideShowPic::EFFECT_RANDOM : CSlideShowPic::EFFECT_NONE;
else
return CSlideShowPic::EFFECT_NO_TIMEOUT;
}
@@ -1213,7 +1213,7 @@ void CGUIWindowSlideShow::RunSlideShow(const std::string &strPath,
bRandom = bNotRandom = false;
// NotRandom overrides the window setting
- if ((!bNotRandom && CServiceBroker::GetSettings().GetBool(CSettings::SETTING_SLIDESHOW_SHUFFLE)) || bRandom)
+ if ((!bNotRandom && CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_SLIDESHOW_SHUFFLE)) || bRandom)
Shuffle();
if (!beginSlidePath.empty())
diff --git a/xbmc/pictures/PictureInfoLoader.cpp b/xbmc/pictures/PictureInfoLoader.cpp
index 08cecf2ca9..62b715b222 100644
--- a/xbmc/pictures/PictureInfoLoader.cpp
+++ b/xbmc/pictures/PictureInfoLoader.cpp
@@ -32,7 +32,7 @@ void CPictureInfoLoader::OnLoaderStart()
m_mapFileItems->SetFastLookup(true);
m_tagReads = 0;
- m_loadTags = CServiceBroker::GetSettings().GetBool(CSettings::SETTING_PICTURES_USETAGS);
+ m_loadTags = CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_PICTURES_USETAGS);
if (m_pProgressCallback)
m_pProgressCallback->SetProgressMax(m_pVecItems->GetFileCount());
diff --git a/xbmc/pictures/PictureThumbLoader.cpp b/xbmc/pictures/PictureThumbLoader.cpp
index 32eb172346..e34869321a 100644
--- a/xbmc/pictures/PictureThumbLoader.cpp
+++ b/xbmc/pictures/PictureThumbLoader.cpp
@@ -82,7 +82,7 @@ bool CPictureThumbLoader::LoadItemCached(CFileItem* pItem)
{
thumb = thumbURL;
}
- else if (CServiceBroker::GetSettings().GetBool(CSettings::SETTING_MYVIDEOS_EXTRACTTHUMB) && CServiceBroker::GetSettings().GetBool(CSettings::SETTING_MYVIDEOS_EXTRACTFLAGS))
+ else if (CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_MYVIDEOS_EXTRACTTHUMB) && CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_MYVIDEOS_EXTRACTFLAGS))
{
CFileItem item(*pItem);
CThumbExtractor* extract = new CThumbExtractor(item, pItem->GetPath(), true, thumbURL);
diff --git a/xbmc/pictures/SlideShowPicture.cpp b/xbmc/pictures/SlideShowPicture.cpp
index ad0e08df20..9fbeeddc8a 100644
--- a/xbmc/pictures/SlideShowPicture.cpp
+++ b/xbmc/pictures/SlideShowPicture.cpp
@@ -117,7 +117,7 @@ void CSlideShowPic::SetTexture_Internal(int iSlideNumber, CBaseTexture* pTexture
m_pImage = pTexture;
m_fWidth = (float)pTexture->GetWidth();
m_fHeight = (float)pTexture->GetHeight();
- if (CServiceBroker::GetSettings().GetBool(CSettings::SETTING_SLIDESHOW_HIGHQUALITYDOWNSCALING))
+ if (CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_SLIDESHOW_HIGHQUALITYDOWNSCALING))
{ // activate mipmapping when high quality downscaling is 'on'
pTexture->SetMipmapping();
}
@@ -141,7 +141,7 @@ void CSlideShowPic::SetTexture_Internal(int iSlideNumber, CBaseTexture* pTexture
// the +1's make sure it actually occurs
float fadeTime = 0.2f;
if (m_displayEffect != EFFECT_NO_TIMEOUT)
- fadeTime = std::min(0.2f*CServiceBroker::GetSettings().GetInt(CSettings::SETTING_SLIDESHOW_STAYTIME), 3.0f);
+ fadeTime = std::min(0.2f*CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_SLIDESHOW_STAYTIME), 3.0f);
m_transitionStart.length = (int)(CServiceBroker::GetWinSystem()->GetGfxContext().GetFPS() * fadeTime); // transition time in frames
m_transitionEnd.type = transEffect;
m_transitionEnd.length = m_transitionStart.length;
@@ -167,7 +167,7 @@ void CSlideShowPic::SetTexture_Internal(int iSlideNumber, CBaseTexture* pTexture
m_fPosX = m_fPosY = 0.0f;
m_fPosZ = 1.0f;
m_fVelocityX = m_fVelocityY = m_fVelocityZ = 0.0f;
- int iFrames = std::max((int)(CServiceBroker::GetWinSystem()->GetGfxContext().GetFPS() * CServiceBroker::GetSettings().GetInt(CSettings::SETTING_SLIDESHOW_STAYTIME)), 1);
+ int iFrames = std::max((int)(CServiceBroker::GetWinSystem()->GetGfxContext().GetFPS() * CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_SLIDESHOW_STAYTIME)), 1);
if (m_displayEffect == EFFECT_PANORAMA)
{
RESOLUTION_INFO res = CServiceBroker::GetWinSystem()->GetGfxContext().GetResInfo();
@@ -377,9 +377,9 @@ void CSlideShowPic::Process(unsigned int currentTime, CDirtyRegionList &dirtyreg
else if (m_displayEffect == EFFECT_ZOOM)
{
m_fPosZ += m_fVelocityZ;
-/* if (m_fPosZ > 1.0f + 0.01f*CServiceBroker::GetSettings().GetInt("Slideshow.ZoomAmount"))
+/* if (m_fPosZ > 1.0f + 0.01f*CServiceBroker::GetSettings()->GetInt("Slideshow.ZoomAmount"))
{
- m_fPosZ = 1.0f + 0.01f * CServiceBroker::GetSettings().GetInt("Slideshow.ZoomAmount");
+ m_fPosZ = 1.0f + 0.01f * CServiceBroker::GetSettings()->GetInt("Slideshow.ZoomAmount");
m_fVelocityZ = -m_fVelocityZ;
}
if (m_fPosZ < 1.0f)
@@ -708,7 +708,7 @@ void CSlideShowPic::Rotate(float fRotateAngle, bool immediate /* = false */)
m_transitionTemp.length = IMMEDIATE_TRANSITION_TIME;
m_fTransitionAngle = fRotateAngle / (float)m_transitionTemp.length;
// reset the timer
- m_transitionEnd.start = m_iCounter + m_transitionStart.length + (int)(CServiceBroker::GetWinSystem()->GetGfxContext().GetFPS() * CServiceBroker::GetSettings().GetInt(CSettings::SETTING_SLIDESHOW_STAYTIME));
+ m_transitionEnd.start = m_iCounter + m_transitionStart.length + (int)(CServiceBroker::GetWinSystem()->GetGfxContext().GetFPS() * CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_SLIDESHOW_STAYTIME));
}
void CSlideShowPic::Zoom(float fZoom, bool immediate /* = false */)
@@ -725,7 +725,7 @@ void CSlideShowPic::Zoom(float fZoom, bool immediate /* = false */)
m_transitionTemp.length = IMMEDIATE_TRANSITION_TIME;
m_fTransitionZoom = (fZoom - m_fZoomAmount) / (float)m_transitionTemp.length;
// reset the timer
- m_transitionEnd.start = m_iCounter + m_transitionStart.length + (int)(CServiceBroker::GetWinSystem()->GetGfxContext().GetFPS() * CServiceBroker::GetSettings().GetInt(CSettings::SETTING_SLIDESHOW_STAYTIME));
+ m_transitionEnd.start = m_iCounter + m_transitionStart.length + (int)(CServiceBroker::GetWinSystem()->GetGfxContext().GetFPS() * CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_SLIDESHOW_STAYTIME));
// turn off the render effects until we're back down to normal zoom
m_bNoEffect = true;
}
@@ -735,7 +735,7 @@ void CSlideShowPic::Move(float fDeltaX, float fDeltaY)
m_fZoomLeft += fDeltaX;
m_fZoomTop += fDeltaY;
// reset the timer
- // m_transitionEnd.start = m_iCounter + m_transitionStart.length + (int)(CServiceBroker::GetWinSystem()->GetGfxContext().GetFPS() * CServiceBroker::GetSettings().GetInt(CSettings::SETTING_SLIDESHOW_STAYTIME));
+ // m_transitionEnd.start = m_iCounter + m_transitionStart.length + (int)(CServiceBroker::GetWinSystem()->GetGfxContext().GetFPS() * CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_SLIDESHOW_STAYTIME));
}
void CSlideShowPic::Render()
diff --git a/xbmc/platform/android/network/NetworkAndroid.cpp b/xbmc/platform/android/network/NetworkAndroid.cpp
index ff84014e05..7c7be13539 100644
--- a/xbmc/platform/android/network/NetworkAndroid.cpp
+++ b/xbmc/platform/android/network/NetworkAndroid.cpp
@@ -281,8 +281,8 @@ std::string CNetworkInterfaceAndroid::GetHostName()
/*************************/
-CNetworkAndroid::CNetworkAndroid(CSettings &settings)
- : CNetworkBase(settings)
+CNetworkAndroid::CNetworkAndroid()
+ : CNetworkBase()
{
RetrieveInterfaces();
}
diff --git a/xbmc/platform/android/network/NetworkAndroid.h b/xbmc/platform/android/network/NetworkAndroid.h
index bd9e41442b..580a3cd1b8 100644
--- a/xbmc/platform/android/network/NetworkAndroid.h
+++ b/xbmc/platform/android/network/NetworkAndroid.h
@@ -57,7 +57,7 @@ class CNetworkAndroid : public CNetworkBase
friend class CXBMCApp;
public:
- CNetworkAndroid(CSettings &settings);
+ CNetworkAndroid();
~CNetworkAndroid();
// CNetwork interface
diff --git a/xbmc/platform/darwin/osx/XBMCHelper.cpp b/xbmc/platform/darwin/osx/XBMCHelper.cpp
index 2c6f65998e..eba24cbb27 100644
--- a/xbmc/platform/darwin/osx/XBMCHelper.cpp
+++ b/xbmc/platform/darwin/osx/XBMCHelper.cpp
@@ -98,7 +98,7 @@ bool XBMCHelper::OnSettingChanging(std::shared_ptr<const CSetting> setting)
if (remoteMode != APPLE_REMOTE_DISABLED)
{
// if starting the event server fails, we have to revert the change
- if (!CServiceBroker::GetSettings().SetBool("services.esenabled", true))
+ if (!CServiceBroker::GetSettings()->SetBool("services.esenabled", true))
return false;
}
@@ -171,9 +171,9 @@ void XBMCHelper::Configure()
// Read the new configuration.
m_errorStarting = false;
- m_mode = CServiceBroker::GetSettings().GetInt(CSettings::SETTING_INPUT_APPLEREMOTEMODE);
- m_sequenceDelay = CServiceBroker::GetSettings().GetInt(CSettings::SETTING_INPUT_APPLEREMOTESEQUENCETIME);
- m_port = CServiceBroker::GetSettings().GetInt(CSettings::SETTING_SERVICES_ESPORT);
+ m_mode = CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_INPUT_APPLEREMOTEMODE);
+ m_sequenceDelay = CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_INPUT_APPLEREMOTESEQUENCETIME);
+ m_port = CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_SERVICES_ESPORT);
// Don't let it enable if sofa control or remote buddy is around.
@@ -184,7 +184,7 @@ void XBMCHelper::Configure()
m_errorStarting = true;
m_mode = APPLE_REMOTE_DISABLED;
- CServiceBroker::GetSettings().SetInt(CSettings::SETTING_INPUT_APPLEREMOTEMODE, APPLE_REMOTE_DISABLED);
+ CServiceBroker::GetSettings()->SetInt(CSettings::SETTING_INPUT_APPLEREMOTEMODE, APPLE_REMOTE_DISABLED);
}
// New configuration.
@@ -259,7 +259,7 @@ void XBMCHelper::Configure()
void XBMCHelper::HandleLaunchAgent()
{
bool oldAlwaysOn = m_alwaysOn;
- m_alwaysOn = CServiceBroker::GetSettings().GetBool(CSettings::SETTING_INPUT_APPLEREMOTEALWAYSON);
+ m_alwaysOn = CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_INPUT_APPLEREMOTEALWAYSON);
// Installation/uninstallation.
if (oldAlwaysOn == false && m_alwaysOn == true)
diff --git a/xbmc/platform/linux/LinuxTimezone.cpp b/xbmc/platform/linux/LinuxTimezone.cpp
index 3a418b4a67..da21619cf2 100644
--- a/xbmc/platform/linux/LinuxTimezone.cpp
+++ b/xbmc/platform/linux/LinuxTimezone.cpp
@@ -155,7 +155,7 @@ void CLinuxTimezone::OnSettingChanged(std::shared_ptr<const CSetting> setting)
void CLinuxTimezone::OnSettingsLoaded()
{
- SetTimezone(CServiceBroker::GetSettings().GetString(CSettings::SETTING_LOCALE_TIMEZONE));
+ SetTimezone(CServiceBroker::GetSettings()->GetString(CSettings::SETTING_LOCALE_TIMEZONE));
CDateTime::ResetTimezoneBias();
}
@@ -243,7 +243,7 @@ void CLinuxTimezone::SettingOptionsTimezonesFiller(std::shared_ptr<const CSettin
{
current = std::static_pointer_cast<const CSettingString>(setting)->GetValue();
bool found = false;
- std::vector<std::string> timezones = g_timezone.GetTimezonesByCountry(CServiceBroker::GetSettings().GetString(CSettings::SETTING_LOCALE_TIMEZONECOUNTRY));
+ std::vector<std::string> timezones = g_timezone.GetTimezonesByCountry(CServiceBroker::GetSettings()->GetString(CSettings::SETTING_LOCALE_TIMEZONECOUNTRY));
for (unsigned int i = 0; i < timezones.size(); i++)
{
if (!found && StringUtils::EqualsNoCase(timezones[i], current))
diff --git a/xbmc/platform/linux/OMXClock.cpp b/xbmc/platform/linux/OMXClock.cpp
index b1751d07ee..fce437f5ba 100644
--- a/xbmc/platform/linux/OMXClock.cpp
+++ b/xbmc/platform/linux/OMXClock.cpp
@@ -494,7 +494,7 @@ void OMXClock::OMXSetSpeedAdjust(double adjust, bool lock /* = true */)
if(lock)
Lock();
// we only support resampling (and hence clock adjustment) in this mode
- if (CServiceBroker::GetSettings().GetBool(CSettings::SETTING_VIDEOPLAYER_USEDISPLAYASCLOCK))
+ if (CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_VIDEOPLAYER_USEDISPLAYASCLOCK))
{
m_speedAdjust = adjust;
OMXSetSpeed(m_omx_speed, false, true);
diff --git a/xbmc/platform/linux/RBP.cpp b/xbmc/platform/linux/RBP.cpp
index 945dbd3679..a206d1450b 100644
--- a/xbmc/platform/linux/RBP.cpp
+++ b/xbmc/platform/linux/RBP.cpp
@@ -117,7 +117,7 @@ bool CRBP::Initialize()
if (m_gpu_mem < 128)
setenv("V3D_DOUBLE_BUFFER", "1", 1);
- m_gui_resolution_limit = CServiceBroker::GetSettings().GetInt("videoscreen.limitgui");
+ m_gui_resolution_limit = CServiceBroker::GetSettings()->GetInt("videoscreen.limitgui");
if (!m_gui_resolution_limit)
m_gui_resolution_limit = m_gpu_mem < 128 ? 720:1080;
diff --git a/xbmc/platform/linux/network/NetworkLinux.cpp b/xbmc/platform/linux/network/NetworkLinux.cpp
index 9a46769572..c5229a621e 100644
--- a/xbmc/platform/linux/network/NetworkLinux.cpp
+++ b/xbmc/platform/linux/network/NetworkLinux.cpp
@@ -293,8 +293,8 @@ std::string CNetworkInterfaceLinux::GetCurrentDefaultGateway(void) const
return result;
}
-CNetworkLinux::CNetworkLinux(CSettings &settings)
- : CNetworkBase(settings)
+CNetworkLinux::CNetworkLinux()
+ : CNetworkBase()
{
m_sock = socket(AF_INET, SOCK_DGRAM, 0);
queryInterfaceList();
diff --git a/xbmc/platform/linux/network/NetworkLinux.h b/xbmc/platform/linux/network/NetworkLinux.h
index 81809a7e80..ef9a060ade 100644
--- a/xbmc/platform/linux/network/NetworkLinux.h
+++ b/xbmc/platform/linux/network/NetworkLinux.h
@@ -54,7 +54,7 @@ private:
class CNetworkLinux : public CNetworkBase
{
public:
- CNetworkLinux(CSettings &settings);
+ CNetworkLinux();
~CNetworkLinux(void) override;
// Return the list of interfaces
diff --git a/xbmc/platform/posix/filesystem/SMBFile.cpp b/xbmc/platform/posix/filesystem/SMBFile.cpp
index d8ec2fda31..e93b0be392 100644
--- a/xbmc/platform/posix/filesystem/SMBFile.cpp
+++ b/xbmc/platform/posix/filesystem/SMBFile.cpp
@@ -106,25 +106,25 @@ void CSMB::Init()
fprintf(f, "\tlock directory = %s/.smb/\n", home.c_str());
// set minimum smbclient protocol version
- if (CServiceBroker::GetSettings().GetInt(CSettings::SETTING_SMB_MINPROTOCOL) > 0)
+ if (CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_SMB_MINPROTOCOL) > 0)
{
- if (CServiceBroker::GetSettings().GetInt(CSettings::SETTING_SMB_MINPROTOCOL) == 1)
+ if (CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_SMB_MINPROTOCOL) == 1)
fprintf(f, "\tclient min protocol = NT1\n");
else
- fprintf(f, "\tclient min protocol = SMB%d\n", CServiceBroker::GetSettings().GetInt(CSettings::SETTING_SMB_MINPROTOCOL));
+ fprintf(f, "\tclient min protocol = SMB%d\n", CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_SMB_MINPROTOCOL));
}
// set maximum smbclient protocol version
- if (CServiceBroker::GetSettings().GetInt(CSettings::SETTING_SMB_MAXPROTOCOL) > 0)
+ if (CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_SMB_MAXPROTOCOL) > 0)
{
- if (CServiceBroker::GetSettings().GetInt(CSettings::SETTING_SMB_MAXPROTOCOL) == 1)
+ if (CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_SMB_MAXPROTOCOL) == 1)
fprintf(f, "\tclient max protocol = NT1\n");
else
- fprintf(f, "\tclient max protocol = SMB%d\n", CServiceBroker::GetSettings().GetInt(CSettings::SETTING_SMB_MAXPROTOCOL));
+ fprintf(f, "\tclient max protocol = SMB%d\n", CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_SMB_MAXPROTOCOL));
}
// set legacy security options
- if (CServiceBroker::GetSettings().GetBool(CSettings::SETTING_SMB_LEGACYSECURITY) && (CServiceBroker::GetSettings().GetInt(CSettings::SETTING_SMB_MAXPROTOCOL) == 1))
+ if (CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_SMB_LEGACYSECURITY) && (CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_SMB_MAXPROTOCOL) == 1))
{
fprintf(f, "\tclient NTLMv2 auth = no\n");
fprintf(f, "\tclient use spnego = no\n");
@@ -132,9 +132,9 @@ void CSMB::Init()
// set wins server if there's one. name resolve order defaults to 'lmhosts host wins bcast'.
// if no WINS server has been specified the wins method will be ignored.
- if (CServiceBroker::GetSettings().GetString(CSettings::SETTING_SMB_WINSSERVER).length() > 0 && !StringUtils::EqualsNoCase(CServiceBroker::GetSettings().GetString(CSettings::SETTING_SMB_WINSSERVER), "0.0.0.0") )
+ if (CServiceBroker::GetSettings()->GetString(CSettings::SETTING_SMB_WINSSERVER).length() > 0 && !StringUtils::EqualsNoCase(CServiceBroker::GetSettings()->GetString(CSettings::SETTING_SMB_WINSSERVER), "0.0.0.0") )
{
- fprintf(f, "\twins server = %s\n", CServiceBroker::GetSettings().GetString(CSettings::SETTING_SMB_WINSSERVER).c_str());
+ fprintf(f, "\twins server = %s\n", CServiceBroker::GetSettings()->GetString(CSettings::SETTING_SMB_WINSSERVER).c_str());
fprintf(f, "\tname resolve order = bcast wins host\n");
}
else
@@ -177,9 +177,9 @@ void CSMB::Init()
smbc_setOptionBrowseMaxLmbCount(m_context, 0);
smbc_setTimeout(m_context, g_advancedSettings.m_sambaclienttimeout * 1000);
// we do not need to strdup these, smbc_setXXX below will make their own copies
- if (CServiceBroker::GetSettings().GetString(CSettings::SETTING_SMB_WORKGROUP).length() > 0)
+ if (CServiceBroker::GetSettings()->GetString(CSettings::SETTING_SMB_WORKGROUP).length() > 0)
//! @bug libsmbclient < 4.9 isn't const correct
- smbc_setWorkgroup(m_context, const_cast<char*>(CServiceBroker::GetSettings().GetString(CSettings::SETTING_SMB_WORKGROUP).c_str()));
+ smbc_setWorkgroup(m_context, const_cast<char*>(CServiceBroker::GetSettings()->GetString(CSettings::SETTING_SMB_WORKGROUP).c_str()));
std::string guest = "guest";
//! @bug libsmbclient < 4.8 isn't const correct
smbc_setUser(m_context, const_cast<char*>(guest.c_str()));
@@ -192,8 +192,8 @@ void CSMB::Init()
m_context->options.browse_max_lmb_count = 0;
m_context->timeout = g_advancedSettings.m_sambaclienttimeout * 1000;
// we need to strdup these, they will get free'd on smbc_free_context
- if (CServiceBroker::GetSettings().GetString(CSettings::SETTING_SMB_WORKGROUP).length() > 0)
- m_context->workgroup = strdup(CServiceBroker::GetSettings().GetString(CSettings::SETTING_SMB_WORKGROUP).c_str());
+ if (CServiceBroker::GetSettings()->GetString(CSettings::SETTING_SMB_WORKGROUP).length() > 0)
+ m_context->workgroup = strdup(CServiceBroker::GetSettings()->GetString(CSettings::SETTING_SMB_WORKGROUP).c_str());
m_context->user = strdup("guest");
#endif
diff --git a/xbmc/platform/win10/network/NetworkWin10.cpp b/xbmc/platform/win10/network/NetworkWin10.cpp
index 1f4c52dce9..f0752fbddc 100644
--- a/xbmc/platform/win10/network/NetworkWin10.cpp
+++ b/xbmc/platform/win10/network/NetworkWin10.cpp
@@ -267,8 +267,8 @@ std::string CNetworkInterfaceWin10::GetCurrentDefaultGateway(void) const
return result;
}
-CNetworkWin10::CNetworkWin10(CSettings &settings)
- : CNetworkBase(settings)
+CNetworkWin10::CNetworkWin10()
+ : CNetworkBase()
, m_adapterAddresses(nullptr)
{
queryInterfaceList();
diff --git a/xbmc/platform/win10/network/NetworkWin10.h b/xbmc/platform/win10/network/NetworkWin10.h
index 9914981736..19efd24abe 100644
--- a/xbmc/platform/win10/network/NetworkWin10.h
+++ b/xbmc/platform/win10/network/NetworkWin10.h
@@ -64,7 +64,7 @@ private:
class CNetworkWin10 : public CNetworkBase
{
public:
- CNetworkWin10(CSettings &settings);
+ CNetworkWin10();
virtual ~CNetworkWin10(void);
std::vector<CNetworkInterface*>& GetInterfaceList(void) override;
diff --git a/xbmc/platform/win32/network/NetworkWin32.cpp b/xbmc/platform/win32/network/NetworkWin32.cpp
index be944bb956..e7a8fa99e1 100644
--- a/xbmc/platform/win32/network/NetworkWin32.cpp
+++ b/xbmc/platform/win32/network/NetworkWin32.cpp
@@ -134,8 +134,8 @@ std::string CNetworkInterfaceWin32::GetCurrentDefaultGateway(void) const
return m_adapter.FirstGatewayAddress != nullptr ? CNetworkBase::GetIpStr(m_adapter.FirstGatewayAddress->Address.lpSockaddr) : "";
}
-CNetworkWin32::CNetworkWin32(CSettings &settings)
- : CNetworkBase(settings)
+CNetworkWin32::CNetworkWin32()
+ : CNetworkBase()
{
queryInterfaceList();
}
diff --git a/xbmc/platform/win32/network/NetworkWin32.h b/xbmc/platform/win32/network/NetworkWin32.h
index 95b78eecea..4aeb42b5e7 100644
--- a/xbmc/platform/win32/network/NetworkWin32.h
+++ b/xbmc/platform/win32/network/NetworkWin32.h
@@ -57,7 +57,7 @@ private:
class CNetworkWin32 : public CNetworkBase
{
public:
- CNetworkWin32(CSettings &settings);
+ CNetworkWin32();
~CNetworkWin32(void) override;
// Return the list of interfaces
diff --git a/xbmc/powermanagement/PowerManager.cpp b/xbmc/powermanagement/PowerManager.cpp
index d6aadff5a1..b2666359eb 100644
--- a/xbmc/powermanagement/PowerManager.cpp
+++ b/xbmc/powermanagement/PowerManager.cpp
@@ -36,10 +36,10 @@
extern HWND g_hWnd;
#endif
-CPowerManager::CPowerManager(CSettings &settings) :
- m_settings(settings)
+CPowerManager::CPowerManager()
{
- m_settings.GetSettingsManager()->RegisterSettingOptionsFiller("shutdownstates", SettingOptionsShutdownStatesFiller);
+ m_settings = CServiceBroker::GetSettings();
+ m_settings->GetSettingsManager()->RegisterSettingOptionsFiller("shutdownstates", SettingOptionsShutdownStatesFiller);
}
CPowerManager::~CPowerManager() = default;
@@ -51,7 +51,7 @@ void CPowerManager::Initialize()
void CPowerManager::SetDefaults()
{
- int defaultShutdown = m_settings.GetInt(CSettings::SETTING_POWERMANAGEMENT_SHUTDOWNSTATE);
+ int defaultShutdown = m_settings->GetInt(CSettings::SETTING_POWERMANAGEMENT_SHUTDOWNSTATE);
switch (defaultShutdown)
{
@@ -90,7 +90,7 @@ void CPowerManager::SetDefaults()
break;
}
- std::static_pointer_cast<CSettingInt>(m_settings.GetSetting(CSettings::SETTING_POWERMANAGEMENT_SHUTDOWNSTATE))->SetDefault(defaultShutdown);
+ std::static_pointer_cast<CSettingInt>(m_settings->GetSetting(CSettings::SETTING_POWERMANAGEMENT_SHUTDOWNSTATE))->SetDefault(defaultShutdown);
}
bool CPowerManager::Powerdown()
diff --git a/xbmc/powermanagement/PowerManager.h b/xbmc/powermanagement/PowerManager.h
index 7134a4cacb..dde9407efd 100644
--- a/xbmc/powermanagement/PowerManager.h
+++ b/xbmc/powermanagement/PowerManager.h
@@ -24,7 +24,7 @@ class CSettings;
class CPowerManager : public IPowerEventsCallback
{
public:
- CPowerManager(CSettings &settings);
+ CPowerManager();
~CPowerManager() override;
void Initialize();
@@ -54,7 +54,7 @@ private:
void StorePlayerState();
// Construction parameters
- CSettings &m_settings;
+ std::shared_ptr<CSettings> m_settings;
std::unique_ptr<IPowerSyscall> m_instance;
std::unique_ptr<CFileItem> m_lastPlayedFileItem;
diff --git a/xbmc/profiles/ProfilesManager.cpp b/xbmc/profiles/ProfilesManager.cpp
index 145c3a8750..ddaf2ce463 100644
--- a/xbmc/profiles/ProfilesManager.cpp
+++ b/xbmc/profiles/ProfilesManager.cpp
@@ -75,8 +75,7 @@ using namespace XFILE;
static CProfile EmptyProfile;
-CProfilesManager::CProfilesManager(CSettings &settings) :
- m_settings(settings),
+CProfilesManager::CProfilesManager() :
m_usingLoginScreen(false),
m_profileLoadedForLogin(false),
m_autoLoginProfile(-1),
@@ -85,32 +84,34 @@ CProfilesManager::CProfilesManager(CSettings &settings) :
m_nextProfileId(0),
m_eventLogs(new CEventLogManager)
{
- if (m_settings.IsLoaded())
+ m_settings = CServiceBroker::GetSettings();
+
+ if (m_settings->IsLoaded())
OnSettingsLoaded();
- m_settings.GetSettingsManager()->RegisterSettingsHandler(this);
+ m_settings->GetSettingsManager()->RegisterSettingsHandler(this);
std::set<std::string> settingSet = {
CSettings::SETTING_EVENTLOG_SHOW
};
- m_settings.GetSettingsManager()->RegisterCallback(this, settingSet);
+ m_settings->GetSettingsManager()->RegisterCallback(this, settingSet);
}
CProfilesManager::~CProfilesManager()
{
- m_settings.GetSettingsManager()->UnregisterCallback(this);
- m_settings.GetSettingsManager()->UnregisterSettingsHandler(this);
+ m_settings->GetSettingsManager()->UnregisterCallback(this);
+ m_settings->GetSettingsManager()->UnregisterSettingsHandler(this);
}
void CProfilesManager::OnSettingsLoaded()
{
// check them all
- std::string strDir = m_settings.GetString(CSettings::SETTING_SYSTEM_PLAYLISTSPATH);
+ std::string strDir = m_settings->GetString(CSettings::SETTING_SYSTEM_PLAYLISTSPATH);
if (strDir == "set default" || strDir.empty())
{
strDir = "special://profile/playlists/";
- m_settings.SetString(CSettings::SETTING_SYSTEM_PLAYLISTSPATH, strDir.c_str());
+ m_settings->SetString(CSettings::SETTING_SYSTEM_PLAYLISTSPATH, strDir.c_str());
}
CDirectory::Create(strDir);
@@ -297,25 +298,25 @@ bool CProfilesManager::LoadProfile(unsigned int index)
g_SkinInfo->SaveSettings();
// unload any old settings
- CServiceBroker::GetSettings().Unload();
+ CServiceBroker::GetSettings()->Unload();
SetCurrentProfileId(index);
m_profileLoadedForLogin = false;
// load the new settings
- if (!CServiceBroker::GetSettings().Load())
+ if (!CServiceBroker::GetSettings()->Load())
{
CLog::Log(LOGFATAL, "CProfilesManager: unable to load settings for profile \"%s\"", m_profiles.at(index).getName().c_str());
return false;
}
- CServiceBroker::GetSettings().SetLoaded();
+ CServiceBroker::GetSettings()->SetLoaded();
CreateProfileFolders();
CServiceBroker::GetDatabaseManager().Initialize();
CServiceBroker::GetInputManager().LoadKeymaps();
- CServiceBroker::GetInputManager().SetMouseEnabled(CServiceBroker::GetSettings().GetBool(CSettings::SETTING_INPUT_ENABLEMOUSE));
+ CServiceBroker::GetInputManager().SetMouseEnabled(CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_INPUT_ENABLEMOUSE));
CGUIComponent* gui = CServiceBroker::GetGUI();
if (gui)
@@ -331,8 +332,8 @@ bool CProfilesManager::LoadProfile(unsigned int index)
CXBMCTinyXML doc;
if (doc.LoadFile(URIUtils::AddFileToFolder(GetUserDataFolder(), "guisettings.xml")))
{
- CServiceBroker::GetSettings().LoadSetting(doc.RootElement(), CSettings::SETTING_MASTERLOCK_MAXRETRIES);
- CServiceBroker::GetSettings().LoadSetting(doc.RootElement(), CSettings::SETTING_MASTERLOCK_STARTUPLOCK);
+ CServiceBroker::GetSettings()->LoadSetting(doc.RootElement(), CSettings::SETTING_MASTERLOCK_MAXRETRIES);
+ CServiceBroker::GetSettings()->LoadSetting(doc.RootElement(), CSettings::SETTING_MASTERLOCK_STARTUPLOCK);
}
}
@@ -484,7 +485,7 @@ bool CProfilesManager::DeleteProfile(unsigned int index)
if (index == m_currentProfile)
{
LoadProfile(0);
- m_settings.Save();
+ m_settings->Save();
}
CFileItemPtr item = CFileItemPtr(new CFileItem(URIUtils::AddFileToFolder(GetUserDataFolder(), strDirectory)));
diff --git a/xbmc/profiles/ProfilesManager.h b/xbmc/profiles/ProfilesManager.h
index f285c0ff02..0d5a452202 100644
--- a/xbmc/profiles/ProfilesManager.h
+++ b/xbmc/profiles/ProfilesManager.h
@@ -26,7 +26,7 @@ class CProfilesManager : protected ISettingsHandler,
protected ISettingCallback
{
public:
- CProfilesManager(CSettings &settings);
+ CProfilesManager();
CProfilesManager(const CProfilesManager&) = delete;
CProfilesManager& operator=(CProfilesManager const&) = delete;
~CProfilesManager() override;
@@ -194,7 +194,7 @@ private:
void FinalizeLoadProfile();
// Construction parameters
- CSettings &m_settings;
+ std::shared_ptr<CSettings> m_settings;
std::vector<CProfile> m_profiles;
bool m_usingLoginScreen;
diff --git a/xbmc/programs/GUIViewStatePrograms.cpp b/xbmc/programs/GUIViewStatePrograms.cpp
index 263aa791a7..0bb402e691 100644
--- a/xbmc/programs/GUIViewStatePrograms.cpp
+++ b/xbmc/programs/GUIViewStatePrograms.cpp
@@ -23,7 +23,7 @@ using namespace XFILE;
CGUIViewStateWindowPrograms::CGUIViewStateWindowPrograms(const CFileItemList& items) : CGUIViewState(items)
{
AddSortMethod(SortByLabel, 551, LABEL_MASKS("%K", "%I", "%L", ""), // Titel, Size | Foldername, empty
- CServiceBroker::GetSettings().GetBool(CSettings::SETTING_FILELISTS_IGNORETHEWHENSORTING) ? SortAttributeIgnoreArticle : SortAttributeNone);
+ CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_FILELISTS_IGNORETHEWHENSORTING) ? SortAttributeIgnoreArticle : SortAttributeNone);
const CViewState *viewState = CViewStateSettings::GetInstance().Get("programs");
SetSortMethod(viewState->m_sortDescription);
diff --git a/xbmc/pvr/PVRActionListener.cpp b/xbmc/pvr/PVRActionListener.cpp
index 1d334ed1b5..b60ae8df59 100644
--- a/xbmc/pvr/PVRActionListener.cpp
+++ b/xbmc/pvr/PVRActionListener.cpp
@@ -28,7 +28,7 @@ namespace PVR
CPVRActionListener::CPVRActionListener()
{
g_application.RegisterActionListener(this);
- CServiceBroker::GetSettings().RegisterCallback(this, {
+ CServiceBroker::GetSettings()->RegisterCallback(this, {
CSettings::SETTING_PVRPARENTAL_ENABLED,
CSettings::SETTING_PVRMANAGER_RESETDB,
CSettings::SETTING_EPG_RESETEPG,
@@ -44,14 +44,14 @@ CPVRActionListener::CPVRActionListener()
CPVRActionListener::~CPVRActionListener()
{
- CServiceBroker::GetSettings().UnregisterCallback(this);
+ CServiceBroker::GetSettings()->UnregisterCallback(this);
g_application.UnregisterActionListener(this);
}
ChannelSwitchMode CPVRActionListener::GetChannelSwitchMode(int iAction)
{
if ((iAction == ACTION_MOVE_UP || iAction == ACTION_MOVE_DOWN) &&
- CServiceBroker::GetSettings().GetBool(CSettings::SETTING_PVRPLAYBACK_CONFIRMCHANNELSWITCH))
+ CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_PVRPLAYBACK_CONFIRMCHANNELSWITCH))
return ChannelSwitchMode::NO_SWITCH;
return ChannelSwitchMode::INSTANT_OR_DELAYED_SWITCH;
@@ -152,7 +152,7 @@ bool CPVRActionListener::OnAction(const CAction &action)
return false;
// If the button that caused this action matches action "Select" ...
- if (CServiceBroker::GetSettings().GetBool(CSettings::SETTING_PVRPLAYBACK_CONFIRMCHANNELSWITCH) &&
+ if (CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_PVRPLAYBACK_CONFIRMCHANNELSWITCH) &&
CServiceBroker::GetPVRManager().GUIActions()->GetChannelNavigator().IsPreview())
{
// ... and if "confirm channel switch" setting is active and a channel
@@ -242,12 +242,12 @@ void CPVRActionListener::OnSettingChanged(std::shared_ptr<const CSetting> settin
const std::string &settingId = setting->GetId();
if (settingId == CSettings::SETTING_PVRPARENTAL_ENABLED)
{
- if (std::static_pointer_cast<const CSettingBool>(setting)->GetValue() && CServiceBroker::GetSettings().GetString(CSettings::SETTING_PVRPARENTAL_PIN).empty())
+ if (std::static_pointer_cast<const CSettingBool>(setting)->GetValue() && CServiceBroker::GetSettings()->GetString(CSettings::SETTING_PVRPARENTAL_PIN).empty())
{
std::string newPassword = "";
// password set... save it
if (CGUIDialogNumeric::ShowAndVerifyNewPassword(newPassword))
- CServiceBroker::GetSettings().SetString(CSettings::SETTING_PVRPARENTAL_PIN, newPassword);
+ CServiceBroker::GetSettings()->SetString(CSettings::SETTING_PVRPARENTAL_PIN, newPassword);
// password not set... disable parental
else
std::static_pointer_cast<CSettingBool>(std::const_pointer_cast<CSetting>(setting))->SetValue(false);
diff --git a/xbmc/pvr/PVRDatabase.cpp b/xbmc/pvr/PVRDatabase.cpp
index c733998282..3db464e42a 100644
--- a/xbmc/pvr/PVRDatabase.cpp
+++ b/xbmc/pvr/PVRDatabase.cpp
@@ -237,7 +237,7 @@ bool CPVRDatabase::Delete(const CPVRChannel &channel)
int CPVRDatabase::Get(CPVRChannelGroup &results, bool bCompressDB)
{
int iReturn(0);
- bool bIgnoreEpgDB = CServiceBroker::GetSettings().GetBool(CSettings::SETTING_EPG_IGNOREDBFORCLIENT);
+ bool bIgnoreEpgDB = CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_EPG_IGNOREDBFORCLIENT);
std::string strQuery = PrepareSQL("SELECT channels.idChannel, channels.iUniqueId, channels.bIsRadio, channels.bIsHidden, channels.bIsUserSetIcon, channels.bIsUserSetName, "
"channels.sIconPath, channels.sChannelName, channels.bIsVirtual, channels.bEPGEnabled, channels.sEPGScraper, channels.iLastWatched, channels.iClientId, channels.bIsLocked, "
diff --git a/xbmc/pvr/PVRGUIChannelNavigator.cpp b/xbmc/pvr/PVRGUIChannelNavigator.cpp
index ebd2b5cc8b..098277d37f 100644
--- a/xbmc/pvr/PVRGUIChannelNavigator.cpp
+++ b/xbmc/pvr/PVRGUIChannelNavigator.cpp
@@ -80,7 +80,7 @@ namespace PVR
if (IsPreview() && eSwitchMode == ChannelSwitchMode::INSTANT_OR_DELAYED_SWITCH)
{
- int iTimeout = CServiceBroker::GetSettings().GetInt(CSettings::SETTING_PVRPLAYBACK_CHANNELENTRYTIMEOUT);
+ int iTimeout = CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_PVRPLAYBACK_CHANNELENTRYTIMEOUT);
if (iTimeout > 0)
{
// delayed switch
@@ -136,7 +136,7 @@ namespace PVR
void CPVRGUIChannelNavigator::ShowInfo(bool bForce)
{
- int iTimeout = CServiceBroker::GetSettings().GetInt(CSettings::SETTING_PVRMENU_DISPLAYCHANNELINFO);
+ int iTimeout = CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_PVRMENU_DISPLAYCHANNELINFO);
if (bForce || iTimeout > 0)
{
diff --git a/xbmc/pvr/PVRGUIInfo.cpp b/xbmc/pvr/PVRGUIInfo.cpp
index 686e8bf7b4..1be27cb5d8 100644
--- a/xbmc/pvr/PVRGUIInfo.cpp
+++ b/xbmc/pvr/PVRGUIInfo.cpp
@@ -189,7 +189,7 @@ void CPVRGUIInfo::UpdateQualityData(void)
PVR_SIGNAL_STATUS qualityInfo;
ClearQualityInfo(qualityInfo);
- if (CServiceBroker::GetSettings().GetBool(CSettings::SETTING_PVRPLAYBACK_SIGNALQUALITY))
+ if (CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_PVRPLAYBACK_SIGNALQUALITY))
{
bool bIsPlayingRecording = CServiceBroker::GetPVRManager().IsPlayingRecording();
if (!bIsPlayingRecording)
@@ -467,7 +467,7 @@ bool CPVRGUIInfo::GetListItemAndPlayerLabel(const CFileItem *item, const CGUIInf
// associated with the epg event of a timer, if any, and not the title of the timer.
if (epgTag)
strValue = epgTag->Title();
- if (strValue.empty() && !CServiceBroker::GetSettings().GetBool(CSettings::SETTING_EPG_HIDENOINFOAVAILABLE))
+ if (strValue.empty() && !CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_EPG_HIDENOINFOAVAILABLE))
strValue = g_localizeStrings.Get(19055); // no information available
return true;
}
@@ -843,7 +843,7 @@ namespace
{
if (epgTag)
return epgTag->Title();
- else if (CServiceBroker::GetSettings().GetBool(CSettings::SETTING_EPG_HIDENOINFOAVAILABLE))
+ else if (CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_EPG_HIDENOINFOAVAILABLE))
return std::string();
else
return g_localizeStrings.Get(19055); // no information available
diff --git a/xbmc/pvr/PVRGUITimesInfo.cpp b/xbmc/pvr/PVRGUITimesInfo.cpp
index 0a61caafdd..3e9fa1b84c 100644
--- a/xbmc/pvr/PVRGUITimesInfo.cpp
+++ b/xbmc/pvr/PVRGUITimesInfo.cpp
@@ -162,7 +162,7 @@ void CPVRGUITimesInfo::UpdateTimeshiftProgressData()
time_t start = 0;
m_playingEpgTag->StartAsUTC().GetAsTime(start);
if (start < m_iTimeshiftStartTime ||
- CServiceBroker::GetSettings().GetBool(CSettings::SETTING_PVRMENU_USESIMPLETIMESHIFTOSD))
+ CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_PVRMENU_USESIMPLETIMESHIFTOSD))
{
// playing event started before start of ts buffer or simple ts osd to be used
m_iTimeshiftProgressStartTime = start;
@@ -185,7 +185,7 @@ void CPVRGUITimesInfo::UpdateTimeshiftProgressData()
time_t end = 0;
m_playingEpgTag->EndAsUTC().GetAsTime(end);
if (end > m_iTimeshiftEndTime ||
- CServiceBroker::GetSettings().GetBool(CSettings::SETTING_PVRMENU_USESIMPLETIMESHIFTOSD))
+ CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_PVRMENU_USESIMPLETIMESHIFTOSD))
{
// playing event will end after end of ts buffer or simple ts osd to be used
m_iTimeshiftProgressEndTime = end;
diff --git a/xbmc/pvr/PVRSettings.cpp b/xbmc/pvr/PVRSettings.cpp
index c0f97b46f1..b5c8a83299 100644
--- a/xbmc/pvr/PVRSettings.cpp
+++ b/xbmc/pvr/PVRSettings.cpp
@@ -23,21 +23,21 @@ using namespace PVR;
CPVRSettings::CPVRSettings(const std::set<std::string> &settingNames)
{
Init(settingNames);
- CServiceBroker::GetSettings().GetSettingsManager()->RegisterSettingsHandler(this);
- CServiceBroker::GetSettings().RegisterCallback(this, settingNames);
+ CServiceBroker::GetSettings()->GetSettingsManager()->RegisterSettingsHandler(this);
+ CServiceBroker::GetSettings()->RegisterCallback(this, settingNames);
}
CPVRSettings::~CPVRSettings()
{
- CServiceBroker::GetSettings().UnregisterCallback(this);
- CServiceBroker::GetSettings().GetSettingsManager()->UnregisterSettingsHandler(this);
+ CServiceBroker::GetSettings()->UnregisterCallback(this);
+ CServiceBroker::GetSettings()->GetSettingsManager()->UnregisterSettingsHandler(this);
}
void CPVRSettings::Init(const std::set<std::string> &settingNames)
{
for (auto settingName : settingNames)
{
- SettingPtr setting = CServiceBroker::GetSettings().GetSetting(settingName);
+ SettingPtr setting = CServiceBroker::GetSettings()->GetSetting(settingName);
if (!setting)
{
CLog::LogF(LOGERROR, "Unknown PVR setting '%s'", settingName.c_str());
diff --git a/xbmc/pvr/channels/PVRChannelGroup.cpp b/xbmc/pvr/channels/PVRChannelGroup.cpp
index ab2cf8f1f5..74332fc04e 100644
--- a/xbmc/pvr/channels/PVRChannelGroup.cpp
+++ b/xbmc/pvr/channels/PVRChannelGroup.cpp
@@ -77,7 +77,7 @@ CPVRChannelGroup::CPVRChannelGroup(const CPVRChannelGroup &group) :
CPVRChannelGroup::~CPVRChannelGroup(void)
{
- CServiceBroker::GetSettings().UnregisterCallback(this);
+ CServiceBroker::GetSettings()->UnregisterCallback(this);
Unload();
}
@@ -99,7 +99,7 @@ PVRChannelGroupMember CPVRChannelGroup::EmptyMember;
void CPVRChannelGroup::OnInit(void)
{
- CServiceBroker::GetSettings().RegisterCallback(this, {
+ CServiceBroker::GetSettings()->RegisterCallback(this, {
CSettings::SETTING_PVRMANAGER_BACKENDCHANNELORDER,
CSettings::SETTING_PVRMANAGER_USEBACKENDCHANNELNUMBERS
});
@@ -110,8 +110,8 @@ bool CPVRChannelGroup::Load(void)
/* make sure this container is empty before loading */
Unload();
- m_bUsingBackendChannelOrder = CServiceBroker::GetSettings().GetBool(CSettings::SETTING_PVRMANAGER_BACKENDCHANNELORDER);
- m_bUsingBackendChannelNumbers = CServiceBroker::GetSettings().GetBool(CSettings::SETTING_PVRMANAGER_USEBACKENDCHANNELNUMBERS);
+ m_bUsingBackendChannelOrder = CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_PVRMANAGER_BACKENDCHANNELORDER);
+ m_bUsingBackendChannelNumbers = CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_PVRMANAGER_USEBACKENDCHANNELNUMBERS);
int iChannelCount = m_iGroupId > 0 ? LoadFromDb() : 0;
CLog::LogFC(LOGDEBUG, LOGPVR, "%d channels loaded from the database for group '%s'", iChannelCount, m_strGroupName.c_str());
@@ -147,7 +147,7 @@ void CPVRChannelGroup::Unload(void)
bool CPVRChannelGroup::Update(void)
{
if (GroupType() == PVR_GROUP_TYPE_USER_DEFINED ||
- !CServiceBroker::GetSettings().GetBool(CSettings::SETTING_PVRMANAGER_SYNCCHANNELGROUPS))
+ !CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_PVRMANAGER_SYNCCHANNELGROUPS))
return true;
CPVRChannelGroup PVRChannels_tmp(m_bRadio, m_iGroupId, m_strGroupName);
@@ -187,7 +187,7 @@ bool CPVRChannelGroup::SetChannelNumber(const CPVRChannelPtr &channel, const CPV
void CPVRChannelGroup::SearchAndSetChannelIcons(bool bUpdateDb /* = false */)
{
- std::string iconPath = CServiceBroker::GetSettings().GetString(CSettings::SETTING_PVRMENU_ICONPATH);
+ std::string iconPath = CServiceBroker::GetSettings()->GetString(CSettings::SETTING_PVRMENU_ICONPATH);
if (iconPath.empty())
return;
@@ -811,7 +811,7 @@ bool CPVRChannelGroup::Renumber(void)
bool bReturn(false);
unsigned int iChannelNumber(0);
- bool bUseBackendChannelNumbers(CServiceBroker::GetSettings().GetBool(CSettings::SETTING_PVRMANAGER_USEBACKENDCHANNELNUMBERS) &&
+ bool bUseBackendChannelNumbers(CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_PVRMANAGER_USEBACKENDCHANNELNUMBERS) &&
CServiceBroker::GetPVRManager().Clients()->EnabledClientAmount() == 1);
CPVRChannelGroupPtr groupAll;
if (!bUseBackendChannelNumbers && !IsInternalGroup())
@@ -895,8 +895,8 @@ void CPVRChannelGroup::OnSettingChanged(std::shared_ptr<const CSetting> setting)
const std::string &settingId = setting->GetId();
if (settingId == CSettings::SETTING_PVRMANAGER_BACKENDCHANNELORDER || settingId == CSettings::SETTING_PVRMANAGER_USEBACKENDCHANNELNUMBERS)
{
- bool bUsingBackendChannelOrder = CServiceBroker::GetSettings().GetBool(CSettings::SETTING_PVRMANAGER_BACKENDCHANNELORDER);
- bool bUsingBackendChannelNumbers = CServiceBroker::GetSettings().GetBool(CSettings::SETTING_PVRMANAGER_USEBACKENDCHANNELNUMBERS);
+ bool bUsingBackendChannelOrder = CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_PVRMANAGER_BACKENDCHANNELORDER);
+ bool bUsingBackendChannelNumbers = CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_PVRMANAGER_USEBACKENDCHANNELNUMBERS);
CSingleLock lock(m_critSection);
diff --git a/xbmc/pvr/channels/PVRChannelGroups.cpp b/xbmc/pvr/channels/PVRChannelGroups.cpp
index d53d6f665d..2637490a48 100644
--- a/xbmc/pvr/channels/PVRChannelGroups.cpp
+++ b/xbmc/pvr/channels/PVRChannelGroups.cpp
@@ -44,7 +44,7 @@ void CPVRChannelGroups::Clear(void)
bool CPVRChannelGroups::GetGroupsFromClients(void)
{
- if (! CServiceBroker::GetSettings().GetBool(CSettings::SETTING_PVRMANAGER_SYNCCHANNELGROUPS))
+ if (! CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_PVRMANAGER_SYNCCHANNELGROUPS))
return true;
return CServiceBroker::GetPVRManager().Clients()->GetChannelGroups(this, m_failedClientsForChannelGroups) == PVR_ERROR_NO_ERROR;
@@ -203,7 +203,7 @@ void CPVRChannelGroups::RemoveFromAllGroups(const CPVRChannelPtr &channel)
bool CPVRChannelGroups::Update(bool bChannelsOnly /* = false */)
{
- bool bUpdateAllGroups = !bChannelsOnly && CServiceBroker::GetSettings().GetBool(CSettings::SETTING_PVRMANAGER_SYNCCHANNELGROUPS);
+ bool bUpdateAllGroups = !bChannelsOnly && CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_PVRMANAGER_SYNCCHANNELGROUPS);
bool bReturn(true);
// sync groups
@@ -229,7 +229,7 @@ bool CPVRChannelGroups::Update(bool bChannelsOnly /* = false */)
bool CPVRChannelGroups::LoadUserDefinedChannelGroups(void)
{
- bool bSyncWithBackends = CServiceBroker::GetSettings().GetBool(CSettings::SETTING_PVRMANAGER_SYNCCHANNELGROUPS);
+ bool bSyncWithBackends = CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_PVRMANAGER_SYNCCHANNELGROUPS);
CSingleLock lock(m_critSection);
diff --git a/xbmc/pvr/dialogs/GUIDialogPVRChannelManager.cpp b/xbmc/pvr/dialogs/GUIDialogPVRChannelManager.cpp
index 803ac836c2..f29b571ae6 100644
--- a/xbmc/pvr/dialogs/GUIDialogPVRChannelManager.cpp
+++ b/xbmc/pvr/dialogs/GUIDialogPVRChannelManager.cpp
@@ -356,10 +356,10 @@ bool CGUIDialogPVRChannelManager::OnClickButtonChannelLogo(CGUIMessage &message)
std::string strThumb;
VECSOURCES shares;
- if (CServiceBroker::GetSettings().GetString(CSettings::SETTING_PVRMENU_ICONPATH) != "")
+ if (CServiceBroker::GetSettings()->GetString(CSettings::SETTING_PVRMENU_ICONPATH) != "")
{
CMediaSource share1;
- share1.strPath = CServiceBroker::GetSettings().GetString(CSettings::SETTING_PVRMENU_ICONPATH);
+ share1.strPath = CServiceBroker::GetSettings()->GetString(CSettings::SETTING_PVRMENU_ICONPATH);
share1.strName = g_localizeStrings.Get(19066);
shares.push_back(share1);
}
diff --git a/xbmc/pvr/epg/Epg.cpp b/xbmc/pvr/epg/Epg.cpp
index 413444865c..6582134bad 100644
--- a/xbmc/pvr/epg/Epg.cpp
+++ b/xbmc/pvr/epg/Epg.cpp
@@ -368,7 +368,7 @@ bool CPVREpg::UpdateEntries(const CPVREpg &epg, bool bStoreInDb /* = true */)
CDateTime CPVREpg::GetLastScanTime(void)
{
- bool bIgnore = CServiceBroker::GetSettings().GetBool(CSettings::SETTING_EPG_IGNOREDBFORCLIENT);
+ bool bIgnore = CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_EPG_IGNOREDBFORCLIENT);
CPVREpgDatabasePtr database = CServiceBroker::GetPVRManager().EpgContainer().GetEpgDatabase();
CDateTime lastScanTime;
@@ -569,7 +569,7 @@ int CPVREpg::Get(CFileItemList &results, const CPVREpgSearchFilter &filter) cons
bool CPVREpg::Persist(void)
{
- if (CServiceBroker::GetSettings().GetBool(CSettings::SETTING_EPG_IGNOREDBFORCLIENT) || !NeedsSave())
+ if (CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_EPG_IGNOREDBFORCLIENT) || !NeedsSave())
return true;
CPVREpgDatabasePtr database = CServiceBroker::GetPVRManager().EpgContainer().GetEpgDatabase();
@@ -792,13 +792,13 @@ bool CPVREpg::LoadFromClients(time_t start, time_t end)
{
CPVREpg tmpEpg(channel);
if (tmpEpg.UpdateFromScraper(start, end))
- bReturn = UpdateEntries(tmpEpg, !CServiceBroker::GetSettings().GetBool(CSettings::SETTING_EPG_IGNOREDBFORCLIENT));
+ bReturn = UpdateEntries(tmpEpg, !CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_EPG_IGNOREDBFORCLIENT));
}
else
{
CPVREpg tmpEpg(m_iEpgID, m_strName, m_strScraperName);
if (tmpEpg.UpdateFromScraper(start, end))
- bReturn = UpdateEntries(tmpEpg, !CServiceBroker::GetSettings().GetBool(CSettings::SETTING_EPG_IGNOREDBFORCLIENT));
+ bReturn = UpdateEntries(tmpEpg, !CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_EPG_IGNOREDBFORCLIENT));
}
return bReturn;
diff --git a/xbmc/pvr/epg/EpgInfoTag.cpp b/xbmc/pvr/epg/EpgInfoTag.cpp
index 890ef7e38b..510278eea9 100644
--- a/xbmc/pvr/epg/EpgInfoTag.cpp
+++ b/xbmc/pvr/epg/EpgInfoTag.cpp
@@ -351,7 +351,7 @@ std::string CPVREpgInfoTag::Title(bool bOverrideParental /* = false */) const
if (!bOverrideParental && IsParentalLocked())
strTitle = g_localizeStrings.Get(19266); // parental locked
- else if (m_strTitle.empty() && !CServiceBroker::GetSettings().GetBool(CSettings::SETTING_EPG_HIDENOINFOAVAILABLE))
+ else if (m_strTitle.empty() && !CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_EPG_HIDENOINFOAVAILABLE))
strTitle = g_localizeStrings.Get(19055); // no information available
else
strTitle = m_strTitle;
diff --git a/xbmc/pvr/recordings/PVRRecordings.cpp b/xbmc/pvr/recordings/PVRRecordings.cpp
index aa258e8934..477d9f9086 100644
--- a/xbmc/pvr/recordings/PVRRecordings.cpp
+++ b/xbmc/pvr/recordings/PVRRecordings.cpp
@@ -276,7 +276,7 @@ bool CPVRRecordings::GetDirectory(const std::string& strPath, CFileItemList &ite
}
else
{
- bGrouped = CServiceBroker::GetSettings().GetBool(CSettings::SETTING_PVRRECORD_GROUPRECORDINGS);
+ bGrouped = CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_PVRRECORD_GROUPRECORDINGS);
}
CPVRRecordingsPath recPath(url.GetWithoutOptions());
diff --git a/xbmc/pvr/timers/PVRTimerInfoTag.cpp b/xbmc/pvr/timers/PVRTimerInfoTag.cpp
index f6245f0d63..a8e11a2d90 100644
--- a/xbmc/pvr/timers/PVRTimerInfoTag.cpp
+++ b/xbmc/pvr/timers/PVRTimerInfoTag.cpp
@@ -37,8 +37,8 @@ CPVRTimerInfoTag::CPVRTimerInfoTag(bool bRadio /* = false */) :
m_iLifetime(DEFAULT_RECORDING_LIFETIME),
m_iPreventDupEpisodes(DEFAULT_RECORDING_DUPLICATEHANDLING),
m_bIsRadio(bRadio),
- m_iMarginStart(CServiceBroker::GetSettings().GetInt(CSettings::SETTING_PVRRECORD_MARGINSTART)),
- m_iMarginEnd(CServiceBroker::GetSettings().GetInt(CSettings::SETTING_PVRRECORD_MARGINEND)),
+ m_iMarginStart(CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_PVRRECORD_MARGINSTART)),
+ m_iMarginEnd(CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_PVRRECORD_MARGINEND)),
m_StartTime(CDateTime::GetUTCDateTime()),
m_StopTime(m_StartTime),
m_iEpgUid(EPG_TAG_INVALID_UID)
@@ -697,7 +697,7 @@ CPVRTimerInfoTagPtr CPVRTimerInfoTag::CreateInstantTimerTag(const CPVRChannelPtr
newTimer->SetStartFromUTC(now);
if (iDuration == DEFAULT_PVRRECORD_INSTANTRECORDTIME)
- iDuration = CServiceBroker::GetSettings().GetInt(CSettings::SETTING_PVRRECORD_INSTANTRECORDTIME);
+ iDuration = CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_PVRRECORD_INSTANTRECORDTIME);
CDateTime endTime = now + CDateTimeSpan(0, 0, iDuration ? iDuration : 120, 0);
newTimer->SetEndFromUTC(endTime);
diff --git a/xbmc/pvr/windows/GUIViewStatePVR.cpp b/xbmc/pvr/windows/GUIViewStatePVR.cpp
index 5d00014682..198fe4c82a 100644
--- a/xbmc/pvr/windows/GUIViewStatePVR.cpp
+++ b/xbmc/pvr/windows/GUIViewStatePVR.cpp
@@ -38,7 +38,7 @@ void CGUIViewStateWindowPVRChannels::SaveViewState(void)
CGUIViewStateWindowPVRRecordings::CGUIViewStateWindowPVRRecordings(const int windowId, const CFileItemList& items) : CGUIViewStatePVR(windowId, items)
{
AddSortMethod(SortByLabel, 551, LABEL_MASKS("%L", "%d", "%L", ""), // "Name" : Filename, DateTime | Foldername, empty
- CServiceBroker::GetSettings().GetBool(CSettings::SETTING_FILELISTS_IGNORETHEWHENSORTING)
+ CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_FILELISTS_IGNORETHEWHENSORTING)
? SortAttributeIgnoreArticle
: SortAttributeNone);
AddSortMethod(SortByDate, 552, LABEL_MASKS("%L", "%d", "%L", "%d")); // "Date" : Filename, DateTime | Foldername, DateTime
@@ -80,7 +80,7 @@ void CGUIViewStateWindowPVRGuide::SaveViewState(void)
CGUIViewStateWindowPVRTimers::CGUIViewStateWindowPVRTimers(const int windowId, const CFileItemList& items) : CGUIViewStatePVR(windowId, items)
{
- int sortAttributes(CServiceBroker::GetSettings().GetBool(CSettings::SETTING_FILELISTS_IGNORETHEWHENSORTING) ? SortAttributeIgnoreArticle : SortAttributeNone);
+ int sortAttributes(CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_FILELISTS_IGNORETHEWHENSORTING) ? SortAttributeIgnoreArticle : SortAttributeNone);
sortAttributes |= SortAttributeIgnoreFolders;
AddSortMethod(SortByLabel, static_cast<SortAttribute>(sortAttributes), 551, LABEL_MASKS("%L", "", "%L", "")); // "Name" : Filename, empty | Foldername, empty
AddSortMethod(SortByDate, static_cast<SortAttribute>(sortAttributes), 552, LABEL_MASKS("%L", "%d", "%L", "%d")); // "Date" : Filename, DateTime | Foldername, DateTime
diff --git a/xbmc/pvr/windows/GUIWindowPVRGuide.cpp b/xbmc/pvr/windows/GUIWindowPVRGuide.cpp
index b6fec9f811..383ba9ba94 100644
--- a/xbmc/pvr/windows/GUIWindowPVRGuide.cpp
+++ b/xbmc/pvr/windows/GUIWindowPVRGuide.cpp
@@ -381,7 +381,7 @@ bool CGUIWindowPVRGuideBase::OnMessage(CGUIMessage& message)
{
case ACTION_SELECT_ITEM:
case ACTION_MOUSE_LEFT_CLICK:
- switch(CServiceBroker::GetSettings().GetInt(CSettings::SETTING_EPG_SELECTACTION))
+ switch(CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_EPG_SELECTACTION))
{
case EPG_SELECT_ACTION_CONTEXT_MENU:
OnPopupMenu(iItem);
diff --git a/xbmc/pvr/windows/GUIWindowPVRRecordings.cpp b/xbmc/pvr/windows/GUIWindowPVRRecordings.cpp
index 2b861b6cdd..e17db851f0 100644
--- a/xbmc/pvr/windows/GUIWindowPVRRecordings.cpp
+++ b/xbmc/pvr/windows/GUIWindowPVRRecordings.cpp
@@ -266,8 +266,8 @@ bool CGUIWindowPVRRecordingsBase::OnMessage(CGUIMessage &message)
}
else if (message.GetSenderId() == CONTROL_BTNGROUPITEMS)
{
- CServiceBroker::GetSettings().ToggleBool(CSettings::SETTING_PVRRECORD_GROUPRECORDINGS);
- CServiceBroker::GetSettings().Save();
+ CServiceBroker::GetSettings()->ToggleBool(CSettings::SETTING_PVRRECORD_GROUPRECORDINGS);
+ CServiceBroker::GetSettings()->Save();
Refresh(true);
}
else if (message.GetSenderId() == CONTROL_BTNSHOWDELETED)
@@ -283,7 +283,7 @@ bool CGUIWindowPVRRecordingsBase::OnMessage(CGUIMessage &message)
else if (message.GetSenderId() == CONTROL_BTNSHOWMODE)
{
CMediaSettings::GetInstance().CycleWatchedMode("recordings");
- CServiceBroker::GetSettings().Save();
+ CServiceBroker::GetSettings()->Save();
OnFilterItems(GetProperty("filter").asString());
UpdateButtons();
return true;
diff --git a/xbmc/pvr/windows/GUIWindowPVRTimersBase.cpp b/xbmc/pvr/windows/GUIWindowPVRTimersBase.cpp
index abfe448851..8111fc2d20 100644
--- a/xbmc/pvr/windows/GUIWindowPVRTimersBase.cpp
+++ b/xbmc/pvr/windows/GUIWindowPVRTimersBase.cpp
@@ -77,7 +77,7 @@ bool CGUIWindowPVRTimersBase::Update(const std::string &strDirectory, bool updat
void CGUIWindowPVRTimersBase::UpdateButtons(void)
{
- SET_CONTROL_SELECTED(GetID(), CONTROL_BTNHIDEDISABLEDTIMERS, CServiceBroker::GetSettings().GetBool(CSettings::SETTING_PVRTIMERS_HIDEDISABLEDTIMERS));
+ SET_CONTROL_SELECTED(GetID(), CONTROL_BTNHIDEDISABLEDTIMERS, CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_PVRTIMERS_HIDEDISABLEDTIMERS));
CGUIWindowPVRBase::UpdateButtons();
@@ -137,8 +137,8 @@ bool CGUIWindowPVRTimersBase::OnMessage(CGUIMessage &message)
}
else if (message.GetSenderId() == CONTROL_BTNHIDEDISABLEDTIMERS)
{
- CServiceBroker::GetSettings().ToggleBool(CSettings::SETTING_PVRTIMERS_HIDEDISABLEDTIMERS);
- CServiceBroker::GetSettings().Save();
+ CServiceBroker::GetSettings()->ToggleBool(CSettings::SETTING_PVRTIMERS_HIDEDISABLEDTIMERS);
+ CServiceBroker::GetSettings()->Save();
Update(GetDirectoryPath());
bReturn = true;
}
diff --git a/xbmc/settings/AdvancedSettings.cpp b/xbmc/settings/AdvancedSettings.cpp
index 5c39cd1ffb..ae920d792a 100644
--- a/xbmc/settings/AdvancedSettings.cpp
+++ b/xbmc/settings/AdvancedSettings.cpp
@@ -57,7 +57,7 @@ void CAdvancedSettings::OnSettingsLoaded()
CLog::Log(LOGNOTICE, "Default Audio Player: %s", m_audioDefaultPlayer.c_str());
// setup any logging...
- if (CServiceBroker::GetSettings().GetBool(CSettings::SETTING_DEBUG_SHOWLOGINFO))
+ if (CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_DEBUG_SHOWLOGINFO))
{
m_logLevel = std::max(m_logLevelHint, LOG_LEVEL_DEBUG_FREEMEM);
CLog::Log(LOGNOTICE, "Enabled debug logging due to GUI setting (%d)", m_logLevel);
@@ -69,8 +69,8 @@ void CAdvancedSettings::OnSettingsLoaded()
}
CLog::SetLogLevel(m_logLevel);
- m_extraLogEnabled = CServiceBroker::GetSettings().GetBool(CSettings::SETTING_DEBUG_EXTRALOGGING);
- setExtraLogLevel(CServiceBroker::GetSettings().GetList(CSettings::SETTING_DEBUG_SETEXTRALOGLEVEL));
+ m_extraLogEnabled = CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_DEBUG_EXTRALOGGING);
+ setExtraLogLevel(CServiceBroker::GetSettings()->GetList(CSettings::SETTING_DEBUG_SETEXTRALOGLEVEL));
}
void CAdvancedSettings::OnSettingsUnloaded()
@@ -856,7 +856,7 @@ void CAdvancedSettings::ParseSettingsFile(const std::string &file)
const char* hide = pElement->Attribute("hide");
if (hide == NULL || strnicmp("false", hide, 4) != 0)
{
- SettingPtr setting = CServiceBroker::GetSettings().GetSetting(CSettings::SETTING_DEBUG_SHOWLOGINFO);
+ SettingPtr setting = CServiceBroker::GetSettings()->GetSetting(CSettings::SETTING_DEBUG_SHOWLOGINFO);
if (setting != NULL)
setting->SetVisible(false);
}
@@ -1211,7 +1211,7 @@ void CAdvancedSettings::ParseSettingsFile(const std::string &file)
}
// load in the settings overrides
- CServiceBroker::GetSettings().LoadHidden(pRootElement);
+ CServiceBroker::GetSettings()->LoadHidden(pRootElement);
}
void CAdvancedSettings::Clear()
diff --git a/xbmc/settings/DisplaySettings.cpp b/xbmc/settings/DisplaySettings.cpp
index 48ea9ce229..e43d75231f 100644
--- a/xbmc/settings/DisplaySettings.cpp
+++ b/xbmc/settings/DisplaySettings.cpp
@@ -278,7 +278,7 @@ bool CDisplaySettings::OnSettingChanging(std::shared_ptr<const CSetting> setting
}
std::string screenmode = GetStringFromResolution(newRes);
- CServiceBroker::GetSettings().SetString(CSettings::SETTING_VIDEOSCREEN_SCREENMODE, screenmode);
+ CServiceBroker::GetSettings()->SetString(CSettings::SETTING_VIDEOSCREEN_SCREENMODE, screenmode);
}
if (settingId == CSettings::SETTING_VIDEOSCREEN_SCREENMODE)
{
@@ -358,19 +358,19 @@ bool CDisplaySettings::OnSettingUpdate(std::shared_ptr<CSetting> setting, const
else if (settingId == CSettings::SETTING_VIDEOSCREEN_PREFEREDSTEREOSCOPICMODE)
{
std::shared_ptr<CSettingInt> stereomodeSetting = std::static_pointer_cast<CSettingInt>(setting);
- STEREOSCOPIC_PLAYBACK_MODE playbackMode = (STEREOSCOPIC_PLAYBACK_MODE) CServiceBroker::GetSettings().GetInt(CSettings::SETTING_VIDEOPLAYER_STEREOSCOPICPLAYBACKMODE);
+ STEREOSCOPIC_PLAYBACK_MODE playbackMode = (STEREOSCOPIC_PLAYBACK_MODE) CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_VIDEOPLAYER_STEREOSCOPICPLAYBACKMODE);
if (stereomodeSetting->GetValue() == RENDER_STEREO_MODE_OFF)
{
// if preferred playback mode was OFF, update playback mode to ignore
if (playbackMode == STEREOSCOPIC_PLAYBACK_MODE_PREFERRED)
- CServiceBroker::GetSettings().SetInt(CSettings::SETTING_VIDEOPLAYER_STEREOSCOPICPLAYBACKMODE, STEREOSCOPIC_PLAYBACK_MODE_IGNORE);
+ CServiceBroker::GetSettings()->SetInt(CSettings::SETTING_VIDEOPLAYER_STEREOSCOPICPLAYBACKMODE, STEREOSCOPIC_PLAYBACK_MODE_IGNORE);
return stereomodeSetting->SetValue(RENDER_STEREO_MODE_AUTO);
}
else if (stereomodeSetting->GetValue() == RENDER_STEREO_MODE_MONO)
{
// if preferred playback mode was MONO, update playback mode
if (playbackMode == STEREOSCOPIC_PLAYBACK_MODE_PREFERRED)
- CServiceBroker::GetSettings().SetInt(CSettings::SETTING_VIDEOPLAYER_STEREOSCOPICPLAYBACKMODE, STEREOSCOPIC_PLAYBACK_MODE_MONO);
+ CServiceBroker::GetSettings()->SetInt(CSettings::SETTING_VIDEOPLAYER_STEREOSCOPICPLAYBACKMODE, STEREOSCOPIC_PLAYBACK_MODE_MONO);
return stereomodeSetting->SetValue(RENDER_STEREO_MODE_AUTO);
}
}
@@ -380,11 +380,11 @@ bool CDisplaySettings::OnSettingUpdate(std::shared_ptr<CSetting> setting, const
void CDisplaySettings::SetMonitor(std::string monitor)
{
- std::string curMonitor = CServiceBroker::GetSettings().GetString(CSettings::SETTING_VIDEOSCREEN_MONITOR);
+ std::string curMonitor = CServiceBroker::GetSettings()->GetString(CSettings::SETTING_VIDEOSCREEN_MONITOR);
if (curMonitor != monitor)
{
m_resolutionChangeAborted = true;
- CServiceBroker::GetSettings().SetString(CSettings::SETTING_VIDEOSCREEN_MONITOR, monitor);
+ CServiceBroker::GetSettings()->SetString(CSettings::SETTING_VIDEOSCREEN_MONITOR, monitor);
}
}
@@ -396,7 +396,7 @@ void CDisplaySettings::SetCurrentResolution(RESOLUTION resolution, bool save /*
if (save)
{
std::string mode = GetStringFromResolution(resolution);
- CServiceBroker::GetSettings().SetString(CSettings::SETTING_VIDEOSCREEN_SCREENMODE, mode.c_str());
+ CServiceBroker::GetSettings()->SetString(CSettings::SETTING_VIDEOSCREEN_SCREENMODE, mode.c_str());
}
if (resolution != m_currentResolution)
@@ -408,7 +408,7 @@ void CDisplaySettings::SetCurrentResolution(RESOLUTION resolution, bool save /*
RESOLUTION CDisplaySettings::GetDisplayResolution() const
{
- return GetResolutionFromString(CServiceBroker::GetSettings().GetString(CSettings::SETTING_VIDEOSCREEN_SCREENMODE));
+ return GetResolutionFromString(CServiceBroker::GetSettings()->GetString(CSettings::SETTING_VIDEOSCREEN_SCREENMODE));
}
const RESOLUTION_INFO& CDisplaySettings::GetResolutionInfo(size_t index) const
@@ -646,7 +646,7 @@ std::string CDisplaySettings::GetStringFromResolution(RESOLUTION resolution, flo
RESOLUTION CDisplaySettings::GetResolutionForScreen()
{
- DisplayMode mode = CServiceBroker::GetSettings().GetInt(CSettings::SETTING_VIDEOSCREEN_SCREEN);
+ DisplayMode mode = CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_VIDEOSCREEN_SCREEN);
if (mode == DM_WINDOWED)
return RES_WINDOW;
@@ -807,7 +807,7 @@ void CDisplaySettings::SettingOptionsMonitorsFiller(SettingConstPtr setting, std
CWinSystemIOS *winSystem = dynamic_cast<CWinSystemIOS*>(CServiceBroker::GetWinSystem());
#endif
winSystem->GetConnectedOutputs(&monitors);
- std::string currentMonitor = CServiceBroker::GetSettings().GetString(CSettings::SETTING_VIDEOSCREEN_MONITOR);
+ std::string currentMonitor = CServiceBroker::GetSettings()->GetString(CSettings::SETTING_VIDEOSCREEN_MONITOR);
for (unsigned int i=0; i<monitors.size(); ++i)
{
if(currentMonitor.compare("Default") != 0 &&
@@ -826,7 +826,7 @@ void CDisplaySettings::SettingOptionsMonitorsFiller(SettingConstPtr setting, std
#endif
winSystem->GetConnectedOutputs(&monitors);
bool foundMonitor = false;
- std::string currentMonitor = CServiceBroker::GetSettings().GetString(CSettings::SETTING_VIDEOSCREEN_MONITOR);
+ std::string currentMonitor = CServiceBroker::GetSettings()->GetString(CSettings::SETTING_VIDEOSCREEN_MONITOR);
for (auto const& monitor : monitors)
{
if(monitor == currentMonitor)
diff --git a/xbmc/settings/SkinSettings.cpp b/xbmc/settings/SkinSettings.cpp
index fb477b89f7..a364bf882d 100644
--- a/xbmc/settings/SkinSettings.cpp
+++ b/xbmc/settings/SkinSettings.cpp
@@ -157,7 +157,7 @@ void CSkinSettings::MigrateSettings(const ADDON::SkinPtr& skin)
skin->SaveSettings();
// save the guisettings.xml
- CServiceBroker::GetSettings().Save();
+ CServiceBroker::GetSettings()->Save();
}
}
diff --git a/xbmc/settings/dialogs/GUIDialogLibExportSettings.cpp b/xbmc/settings/dialogs/GUIDialogLibExportSettings.cpp
index 74b95762ae..f0c05ec962 100644
--- a/xbmc/settings/dialogs/GUIDialogLibExportSettings.cpp
+++ b/xbmc/settings/dialogs/GUIDialogLibExportSettings.cpp
@@ -48,13 +48,13 @@ bool CGUIDialogLibExportSettings::Show(CLibExportSettings& settings)
return false;
// Get current export settings from service broker
- dialog->m_settings.SetExportType(CServiceBroker::GetSettings().GetInt(CSettings::SETTING_MUSICLIBRARY_EXPORT_FILETYPE));
- dialog->m_settings.m_strPath = CServiceBroker::GetSettings().GetString(CSettings::SETTING_MUSICLIBRARY_EXPORT_FOLDER);
- dialog->m_settings.SetItemsToExport(CServiceBroker::GetSettings().GetInt(CSettings::SETTING_MUSICLIBRARY_EXPORT_ITEMS));
- dialog->m_settings.m_unscraped = CServiceBroker::GetSettings().GetBool(CSettings::SETTING_MUSICLIBRARY_EXPORT_UNSCRAPED);
- dialog->m_settings.m_artwork = CServiceBroker::GetSettings().GetBool(CSettings::SETTING_MUSICLIBRARY_EXPORT_ARTWORK);
- dialog->m_settings.m_skipnfo = CServiceBroker::GetSettings().GetBool(CSettings::SETTING_MUSICLIBRARY_EXPORT_SKIPNFO);
- dialog->m_settings.m_overwrite = CServiceBroker::GetSettings().GetBool(CSettings::SETTING_MUSICLIBRARY_EXPORT_OVERWRITE);
+ dialog->m_settings.SetExportType(CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_MUSICLIBRARY_EXPORT_FILETYPE));
+ dialog->m_settings.m_strPath = CServiceBroker::GetSettings()->GetString(CSettings::SETTING_MUSICLIBRARY_EXPORT_FOLDER);
+ dialog->m_settings.SetItemsToExport(CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_MUSICLIBRARY_EXPORT_ITEMS));
+ dialog->m_settings.m_unscraped = CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_MUSICLIBRARY_EXPORT_UNSCRAPED);
+ dialog->m_settings.m_artwork = CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_MUSICLIBRARY_EXPORT_ARTWORK);
+ dialog->m_settings.m_skipnfo = CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_MUSICLIBRARY_EXPORT_SKIPNFO);
+ dialog->m_settings.m_overwrite = CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_MUSICLIBRARY_EXPORT_OVERWRITE);
dialog->m_destinationChecked = false;
dialog->Open();
@@ -177,7 +177,7 @@ void CGUIDialogLibExportSettings::OnOK()
if (m_settings.IsToLibFolders())
{
// Check artist info folder setting
- std::string path = CServiceBroker::GetSettings().GetString(CSettings::SETTING_MUSICLIBRARY_ARTISTSFOLDER);
+ std::string path = CServiceBroker::GetSettings()->GetString(CSettings::SETTING_MUSICLIBRARY_ARTISTSFOLDER);
if (path.empty())
{
//"Unable to export to library folders as the system artist information folder setting is empty"
@@ -209,14 +209,14 @@ void CGUIDialogLibExportSettings::OnOK()
void CGUIDialogLibExportSettings::Save()
{
CLog::Log(LOGINFO, "CGUIDialogMusicExportSettings: Save() called");
- CServiceBroker::GetSettings().SetInt(CSettings::SETTING_MUSICLIBRARY_EXPORT_FILETYPE, m_settings.GetExportType());
- CServiceBroker::GetSettings().SetString(CSettings::SETTING_MUSICLIBRARY_EXPORT_FOLDER, m_settings.m_strPath);
- CServiceBroker::GetSettings().SetInt(CSettings::SETTING_MUSICLIBRARY_EXPORT_ITEMS, m_settings.GetItemsToExport());
- CServiceBroker::GetSettings().SetBool(CSettings::SETTING_MUSICLIBRARY_EXPORT_UNSCRAPED, m_settings.m_unscraped);
- CServiceBroker::GetSettings().SetBool(CSettings::SETTING_MUSICLIBRARY_EXPORT_OVERWRITE, m_settings.m_overwrite);
- CServiceBroker::GetSettings().SetBool(CSettings::SETTING_MUSICLIBRARY_EXPORT_ARTWORK, m_settings.m_artwork);
- CServiceBroker::GetSettings().SetBool(CSettings::SETTING_MUSICLIBRARY_EXPORT_SKIPNFO, m_settings.m_skipnfo);
- CServiceBroker::GetSettings().Save();
+ CServiceBroker::GetSettings()->SetInt(CSettings::SETTING_MUSICLIBRARY_EXPORT_FILETYPE, m_settings.GetExportType());
+ CServiceBroker::GetSettings()->SetString(CSettings::SETTING_MUSICLIBRARY_EXPORT_FOLDER, m_settings.m_strPath);
+ CServiceBroker::GetSettings()->SetInt(CSettings::SETTING_MUSICLIBRARY_EXPORT_ITEMS, m_settings.GetItemsToExport());
+ CServiceBroker::GetSettings()->SetBool(CSettings::SETTING_MUSICLIBRARY_EXPORT_UNSCRAPED, m_settings.m_unscraped);
+ CServiceBroker::GetSettings()->SetBool(CSettings::SETTING_MUSICLIBRARY_EXPORT_OVERWRITE, m_settings.m_overwrite);
+ CServiceBroker::GetSettings()->SetBool(CSettings::SETTING_MUSICLIBRARY_EXPORT_ARTWORK, m_settings.m_artwork);
+ CServiceBroker::GetSettings()->SetBool(CSettings::SETTING_MUSICLIBRARY_EXPORT_SKIPNFO, m_settings.m_skipnfo);
+ CServiceBroker::GetSettings()->Save();
}
void CGUIDialogLibExportSettings::SetupView()
diff --git a/xbmc/settings/windows/GUIWindowSettingsCategory.cpp b/xbmc/settings/windows/GUIWindowSettingsCategory.cpp
index 7d7ab3c605..a925f16686 100644
--- a/xbmc/settings/windows/GUIWindowSettingsCategory.cpp
+++ b/xbmc/settings/windows/GUIWindowSettingsCategory.cpp
@@ -120,7 +120,7 @@ bool CGUIWindowSettingsCategory::OnAction(const CAction &action)
return false;
CViewStateSettings::GetInstance().CycleSettingLevel();
- CServiceBroker::GetSettings().Save();
+ CServiceBroker::GetSettings()->Save();
// try to keep the current position
std::string oldCategory;
@@ -178,7 +178,7 @@ SettingSectionPtr CGUIWindowSettingsCategory::GetSection()
for (size_t index = 0; index < SettingGroupSize; index++)
{
if (s_settingGroupMap[index].id == m_iSection)
- return m_settings.GetSection(s_settingGroupMap[index].name);
+ return m_settings->GetSection(s_settingGroupMap[index].name);
}
return NULL;
@@ -186,12 +186,12 @@ SettingSectionPtr CGUIWindowSettingsCategory::GetSection()
void CGUIWindowSettingsCategory::Save()
{
- m_settings.Save();
+ m_settings->Save();
}
CSettingsManager* CGUIWindowSettingsCategory::GetSettingsManager() const
{
- return m_settings.GetSettingsManager();
+ return m_settings->GetSettingsManager();
}
void CGUIWindowSettingsCategory::FocusElement(const std::string& elementId)
diff --git a/xbmc/settings/windows/GUIWindowSettingsCategory.h b/xbmc/settings/windows/GUIWindowSettingsCategory.h
index efc1f06112..dc5a5112c9 100644
--- a/xbmc/settings/windows/GUIWindowSettingsCategory.h
+++ b/xbmc/settings/windows/GUIWindowSettingsCategory.h
@@ -45,7 +45,7 @@ protected:
*/
void FocusElement(const std::string& elementId);
- CSettings& m_settings;
+ std::shared_ptr<CSettings> m_settings;
int m_iSection = 0;
bool m_returningFromSkinLoad = false; // true if we are returning from loading the skin
};
diff --git a/xbmc/settings/windows/GUIWindowSettingsScreenCalibration.cpp b/xbmc/settings/windows/GUIWindowSettingsScreenCalibration.cpp
index 961162aeb6..116c5c9f3a 100644
--- a/xbmc/settings/windows/GUIWindowSettingsScreenCalibration.cpp
+++ b/xbmc/settings/windows/GUIWindowSettingsScreenCalibration.cpp
@@ -126,7 +126,7 @@ bool CGUIWindowSettingsScreenCalibration::OnMessage(CGUIMessage& message)
case GUI_MSG_WINDOW_DEINIT:
{
CDisplaySettings::GetInstance().UpdateCalibrations();
- CServiceBroker::GetSettings().Save();
+ CServiceBroker::GetSettings()->Save();
CServiceBroker::GetWinSystem()->GetGfxContext().SetCalibrating(false);
// reset our screen resolution to what it was initially
CServiceBroker::GetWinSystem()->GetGfxContext().SetVideoResolution(CDisplaySettings::GetInstance().GetCurrentResolution(), false);
diff --git a/xbmc/storage/MediaManager.cpp b/xbmc/storage/MediaManager.cpp
index 1f5dcedf36..d433d80a1d 100644
--- a/xbmc/storage/MediaManager.cpp
+++ b/xbmc/storage/MediaManager.cpp
@@ -192,7 +192,7 @@ void CMediaManager::GetNetworkLocations(VECSOURCES &locations, bool autolocation
#endif// HAS_FILESYSTEM_NFS
#ifdef HAS_UPNP
- if (CServiceBroker::GetSettings().GetBool(CSettings::SETTING_SERVICES_UPNP))
+ if (CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_SERVICES_UPNP))
{
std::string strDevices = g_localizeStrings.Get(33040); //"% Devices"
share.strPath = "upnp://";
@@ -687,8 +687,8 @@ std::vector<std::string> CMediaManager::GetDiskUsage()
void CMediaManager::OnStorageAdded(const std::string &label, const std::string &path)
{
#ifdef HAS_DVD_DRIVE
- if (CServiceBroker::GetSettings().GetInt(CSettings::SETTING_AUDIOCDS_AUTOACTION) != AUTOCD_NONE || CServiceBroker::GetSettings().GetBool(CSettings::SETTING_DVDS_AUTORUN))
- if (CServiceBroker::GetSettings().GetInt(CSettings::SETTING_AUDIOCDS_AUTOACTION) == AUTOCD_RIP)
+ if (CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_AUDIOCDS_AUTOACTION) != AUTOCD_NONE || CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_DVDS_AUTORUN))
+ if (CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_AUDIOCDS_AUTOACTION) == AUTOCD_RIP)
CJobManager::GetInstance().AddJob(new CAutorunMediaJob(label, path), this, CJob::PRIORITY_LOW);
else
CJobManager::GetInstance().AddJob(new CAutorunMediaJob(label, path), this, CJob::PRIORITY_HIGH);
diff --git a/xbmc/test/TestBasicEnvironment.cpp b/xbmc/test/TestBasicEnvironment.cpp
index e526e61487..75cb78e2a1 100644
--- a/xbmc/test/TestBasicEnvironment.cpp
+++ b/xbmc/test/TestBasicEnvironment.cpp
@@ -32,6 +32,9 @@ namespace fs = KODI::PLATFORM::FILESYSTEM;
void TestBasicEnvironment::SetUp()
{
+ m_pSettings.reset(new CSettings());
+ CServiceBroker::RegisterSettings(m_pSettings);
+
XFILE::CFile *f;
/* NOTE: The below is done to fix memleak warning about uninitialized variable
@@ -92,15 +95,18 @@ void TestBasicEnvironment::SetUp()
if (!g_application.m_ServiceManager->InitForTesting())
exit(1);
- CServiceBroker::GetSettings().Initialize();
+ CServiceBroker::GetSettings()->Initialize();
}
void TestBasicEnvironment::TearDown()
{
XFILE::CDirectory::RemoveRecursive(m_tempPath);
- CServiceBroker::GetSettings().Uninitialize();
+ CServiceBroker::GetSettings()->Uninitialize();
g_application.m_ServiceManager->DeinitTesting();
+
+ CServiceBroker::UnregisterSettings();
+ m_pSettings.reset();
}
void TestBasicEnvironment::SetUpError()
diff --git a/xbmc/test/TestBasicEnvironment.h b/xbmc/test/TestBasicEnvironment.h
index ce6bad754a..ddee96f099 100644
--- a/xbmc/test/TestBasicEnvironment.h
+++ b/xbmc/test/TestBasicEnvironment.h
@@ -10,8 +10,11 @@
#include "gtest/gtest.h"
+#include <memory>
#include <string>
+class CSettings;
+
class TestBasicEnvironment : public testing::Environment
{
public:
@@ -20,4 +23,5 @@ public:
private:
void SetUpError();
std::string m_tempPath;
+ std::shared_ptr <CSettings> m_pSettings;
};
diff --git a/xbmc/utils/FileUtils.cpp b/xbmc/utils/FileUtils.cpp
index acc28129fc..6724733498 100644
--- a/xbmc/utils/FileUtils.cpp
+++ b/xbmc/utils/FileUtils.cpp
@@ -124,7 +124,7 @@ bool CFileUtils::RemoteAccessAllowed(const std::string &strPath)
return true;
else
{
- std::string strPlaylistsPath = CServiceBroker::GetSettings().GetString(CSettings::SETTING_SYSTEM_PLAYLISTSPATH);
+ std::string strPlaylistsPath = CServiceBroker::GetSettings()->GetString(CSettings::SETTING_SYSTEM_PLAYLISTSPATH);
URIUtils::RemoveSlashAtEnd(strPlaylistsPath);
if (StringUtils::StartsWithNoCase(realPath, strPlaylistsPath))
return true;
diff --git a/xbmc/utils/LabelFormatter.cpp b/xbmc/utils/LabelFormatter.cpp
index e66ceb2f1f..54dc7ad676 100644
--- a/xbmc/utils/LabelFormatter.cpp
+++ b/xbmc/utils/LabelFormatter.cpp
@@ -105,7 +105,7 @@ CLabelFormatter::CLabelFormatter(const std::string &mask, const std::string &mas
AssembleMask(0, mask);
AssembleMask(1, mask2);
// save a bool for faster lookups
- m_hideFileExtensions = !CServiceBroker::GetSettings().GetBool(CSettings::SETTING_FILELISTS_SHOWEXTENSIONS);
+ m_hideFileExtensions = !CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_FILELISTS_SHOWEXTENSIONS);
}
std::string CLabelFormatter::GetContent(unsigned int label, const CFileItem *item) const
diff --git a/xbmc/utils/RecentlyAddedJob.cpp b/xbmc/utils/RecentlyAddedJob.cpp
index aae763c8db..fb21afbcf6 100644
--- a/xbmc/utils/RecentlyAddedJob.cpp
+++ b/xbmc/utils/RecentlyAddedJob.cpp
@@ -319,7 +319,7 @@ bool CRecentlyAddedJob::UpdateTotal()
CMusicDbUrl musicUrl;
musicUrl.FromString("musicdb://artists/");
- musicUrl.AddOption("albumartistsonly", !CServiceBroker::GetSettings().GetBool(CSettings::SETTING_MUSICLIBRARY_SHOWCOMPILATIONARTISTS));
+ musicUrl.AddOption("albumartistsonly", !CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_MUSICLIBRARY_SHOWCOMPILATIONARTISTS));
CFileItemList items;
CDatabase::Filter filter;
diff --git a/xbmc/utils/Screenshot.cpp b/xbmc/utils/Screenshot.cpp
index 310595a4c1..82b305439c 100644
--- a/xbmc/utils/Screenshot.cpp
+++ b/xbmc/utils/Screenshot.cpp
@@ -239,7 +239,7 @@ void CScreenShot::TakeScreenshot()
std::string strDir;
// check to see if we have a screenshot folder yet
- std::shared_ptr<CSettingPath> screenshotSetting = std::static_pointer_cast<CSettingPath>(CServiceBroker::GetSettings().GetSetting(CSettings::SETTING_DEBUG_SCREENSHOTPATH));
+ std::shared_ptr<CSettingPath> screenshotSetting = std::static_pointer_cast<CSettingPath>(CServiceBroker::GetSettings()->GetSetting(CSettings::SETTING_DEBUG_SCREENSHOTPATH));
if (screenshotSetting != NULL)
{
strDir = screenshotSetting->GetValue();
diff --git a/xbmc/utils/SystemInfo.cpp b/xbmc/utils/SystemInfo.cpp
index 54814132ee..c8bd4e2dff 100644
--- a/xbmc/utils/SystemInfo.cpp
+++ b/xbmc/utils/SystemInfo.cpp
@@ -1189,7 +1189,7 @@ std::string CSysInfo::GetUserAgent()
std::string CSysInfo::GetDeviceName()
{
- std::string friendlyName = CServiceBroker::GetSettings().GetString(CSettings::SETTING_SERVICES_DEVICENAME);
+ std::string friendlyName = CServiceBroker::GetSettings()->GetString(CSettings::SETTING_SERVICES_DEVICENAME);
if (StringUtils::EqualsNoCase(friendlyName, CCompileInfo::GetAppName()))
{
std::string hostname("[unknown]");
diff --git a/xbmc/utils/test/TestCharsetConverter.cpp b/xbmc/utils/test/TestCharsetConverter.cpp
index 184a550116..605973b969 100644
--- a/xbmc/utils/test/TestCharsetConverter.cpp
+++ b/xbmc/utils/test/TestCharsetConverter.cpp
@@ -83,28 +83,28 @@ protected:
*/
/*
//! @todo implement
- CSettingsCategory *loc = CServiceBroker::GetSettings().AddCategory(7, "locale", 14090);
- CServiceBroker::GetSettings().AddString(loc, CSettings::SETTING_LOCALE_LANGUAGE,248,"english",
+ CSettingsCategory *loc = CServiceBroker::GetSettings()->AddCategory(7, "locale", 14090);
+ CServiceBroker::GetSettings()->AddString(loc, CSettings::SETTING_LOCALE_LANGUAGE,248,"english",
SPIN_CONTROL_TEXT);
- CServiceBroker::GetSettings().AddString(loc, CSettings::SETTING_LOCALE_COUNTRY, 20026, "USA",
+ CServiceBroker::GetSettings()->AddString(loc, CSettings::SETTING_LOCALE_COUNTRY, 20026, "USA",
SPIN_CONTROL_TEXT);
- CServiceBroker::GetSettings().AddString(loc, CSettings::SETTING_LOCALE_CHARSET, 14091, "DEFAULT",
+ CServiceBroker::GetSettings()->AddString(loc, CSettings::SETTING_LOCALE_CHARSET, 14091, "DEFAULT",
SPIN_CONTROL_TEXT); // charset is set by the
// language file
// Add default settings for subtitles
- CSettingsCategory *sub = CServiceBroker::GetSettings().AddCategory(5, "subtitles", 287);
- CServiceBroker::GetSettings().AddString(sub, CSettings::SETTING_SUBTITLES_CHARSET, 735, "DEFAULT",
+ CSettingsCategory *sub = CServiceBroker::GetSettings()->AddCategory(5, "subtitles", 287);
+ CServiceBroker::GetSettings()->AddString(sub, CSettings::SETTING_SUBTITLES_CHARSET, 735, "DEFAULT",
SPIN_CONTROL_TEXT);
*/
- CServiceBroker::GetSettings().Initialize();
+ CServiceBroker::GetSettings()->Initialize();
g_charsetConverter.reset();
g_charsetConverter.clear();
}
~TestCharsetConverter() override
{
- CServiceBroker::GetSettings().Unload();
+ CServiceBroker::GetSettings()->Unload();
}
std::string refstra1, refstra2, varstra1;
diff --git a/xbmc/utils/test/TestLabelFormatter.cpp b/xbmc/utils/test/TestLabelFormatter.cpp
index 338e88824b..eb8381f678 100644
--- a/xbmc/utils/test/TestLabelFormatter.cpp
+++ b/xbmc/utils/test/TestLabelFormatter.cpp
@@ -24,19 +24,19 @@ protected:
{
//! @todo implement
/* TODO
- CSettingsCategory* fl = CServiceBroker::GetSettings().AddCategory(7, "filelists", 14081);
- CServiceBroker::GetSettings().AddBool(fl, CSettings::SETTING_FILELISTS_SHOWPARENTDIRITEMS, 13306, true);
- CServiceBroker::GetSettings().AddBool(fl, CSettings::SETTING_FILELISTS_SHOWEXTENSIONS, 497, true);
- CServiceBroker::GetSettings().AddBool(fl, CSettings::SETTING_FILELISTS_IGNORETHEWHENSORTING, 13399, true);
- CServiceBroker::GetSettings().AddBool(fl, CSettings::SETTING_FILELISTS_ALLOWFILEDELETION, 14071, false);
- CServiceBroker::GetSettings().AddBool(fl, CSettings::SETTING_FILELISTS_SHOWADDSOURCEBUTTONS, 21382, true);
- CServiceBroker::GetSettings().AddBool(fl, CSettings::SETTING_FILELISTS_SHOWHIDDEN, 21330, false);
+ CSettingsCategory* fl = CServiceBroker::GetSettings()->AddCategory(7, "filelists", 14081);
+ CServiceBroker::GetSettings()->AddBool(fl, CSettings::SETTING_FILELISTS_SHOWPARENTDIRITEMS, 13306, true);
+ CServiceBroker::GetSettings()->AddBool(fl, CSettings::SETTING_FILELISTS_SHOWEXTENSIONS, 497, true);
+ CServiceBroker::GetSettings()->AddBool(fl, CSettings::SETTING_FILELISTS_IGNORETHEWHENSORTING, 13399, true);
+ CServiceBroker::GetSettings()->AddBool(fl, CSettings::SETTING_FILELISTS_ALLOWFILEDELETION, 14071, false);
+ CServiceBroker::GetSettings()->AddBool(fl, CSettings::SETTING_FILELISTS_SHOWADDSOURCEBUTTONS, 21382, true);
+ CServiceBroker::GetSettings()->AddBool(fl, CSettings::SETTING_FILELISTS_SHOWHIDDEN, 21330, false);
*/
}
~TestLabelFormatter() override
{
- CServiceBroker::GetSettings().Unload();
+ CServiceBroker::GetSettings()->Unload();
}
};
diff --git a/xbmc/video/GUIViewStateVideo.cpp b/xbmc/video/GUIViewStateVideo.cpp
index 5b66849473..8f4791a312 100644
--- a/xbmc/video/GUIViewStateVideo.cpp
+++ b/xbmc/video/GUIViewStateVideo.cpp
@@ -56,7 +56,7 @@ bool CGUIViewStateWindowVideo::AutoPlayNextItem()
CGUIViewStateWindowVideoNav::CGUIViewStateWindowVideoNav(const CFileItemList& items) : CGUIViewStateWindowVideo(items)
{
SortAttribute sortAttributes = SortAttributeNone;
- if (CServiceBroker::GetSettings().GetBool(CSettings::SETTING_FILELISTS_IGNORETHEWHENSORTING))
+ if (CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_FILELISTS_IGNORETHEWHENSORTING))
sortAttributes = SortAttributeIgnoreArticle;
if (items.IsVirtualDirectoryRoot())
@@ -272,7 +272,7 @@ CGUIViewStateWindowVideoNav::CGUIViewStateWindowVideoNav(const CFileItemList& it
if (CMediaSettings::GetInstance().GetWatchedMode(items.GetContent()) == WatchedModeAll)
AddSortMethod(SortByPlaycount, 567, LABEL_MASKS("%T", "%V")); // Title, Playcount | empty, empty
- std::string strTrack=CServiceBroker::GetSettings().GetString(CSettings::SETTING_MUSICFILES_TRACKFORMAT);
+ std::string strTrack=CServiceBroker::GetSettings()->GetString(CSettings::SETTING_MUSICFILES_TRACKFORMAT);
AddSortMethod(SortByTrackNumber, 554, LABEL_MASKS(strTrack, "%N")); // Userdefined, Track Number | empty, empty
const CViewState *viewState = CViewStateSettings::GetInstance().Get("videonavmusicvideos");
@@ -369,7 +369,7 @@ VECSOURCES& CGUIViewStateWindowVideoNav::GetSources()
// Setup shares we want to have
m_sources.clear();
CFileItemList items;
- if (CServiceBroker::GetSettings().GetBool(CSettings::SETTING_MYVIDEOS_FLATTEN))
+ if (CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_MYVIDEOS_FLATTEN))
CDirectory::GetDirectory("library://video_flat/", items, "", DIR_FLAG_DEFAULTS);
else
CDirectory::GetDirectory("library://video/", items, "", DIR_FLAG_DEFAULTS);
@@ -391,7 +391,7 @@ bool CGUIViewStateWindowVideoNav::AutoPlayNextItem()
CQueryParams params;
CVideoDatabaseDirectory::GetQueryParams(m_items.GetPath(),params);
if (params.GetContentType() == VIDEODB_CONTENT_MUSICVIDEOS || params.GetContentType() == 6) // recently added musicvideos
- return CServiceBroker::GetSettings().GetBool(CSettings::SETTING_MUSICPLAYER_AUTOPLAYNEXTITEM);
+ return CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_MUSICPLAYER_AUTOPLAYNEXTITEM);
return CGUIViewStateWindowVideo::AutoPlayNextItem();
}
@@ -439,7 +439,7 @@ VECSOURCES& CGUIViewStateWindowVideoPlaylist::GetSources()
CGUIViewStateVideoMovies::CGUIViewStateVideoMovies(const CFileItemList& items) : CGUIViewStateWindowVideo(items)
{
AddSortMethod(SortBySortTitle, 556, LABEL_MASKS("%T", "%R", "%T", "%R"), // Title, Rating | Title, Rating
- CServiceBroker::GetSettings().GetBool(CSettings::SETTING_FILELISTS_IGNORETHEWHENSORTING) ? SortAttributeIgnoreArticle : SortAttributeNone);
+ CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_FILELISTS_IGNORETHEWHENSORTING) ? SortAttributeIgnoreArticle : SortAttributeNone);
AddSortMethod(SortByYear, 562, LABEL_MASKS("%T", "%Y", "%T", "%Y")); // Title, Year | Title, Year
AddSortMethod(SortByRating, 563, LABEL_MASKS("%T", "%R", "%T", "%R")); // Title, Rating | Title, Rating
AddSortMethod(SortByUserRating, 38018, LABEL_MASKS("%T", "%r", "%T", "%r")); // Title, Userrating | Title, Userrating
@@ -472,7 +472,7 @@ void CGUIViewStateVideoMovies::SaveViewState()
CGUIViewStateVideoMusicVideos::CGUIViewStateVideoMusicVideos(const CFileItemList& items) : CGUIViewStateWindowVideo(items)
{
SortAttribute sortAttributes = SortAttributeNone;
- if (CServiceBroker::GetSettings().GetBool(CSettings::SETTING_FILELISTS_IGNORETHEWHENSORTING))
+ if (CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_FILELISTS_IGNORETHEWHENSORTING))
sortAttributes = SortAttributeIgnoreArticle;
AddSortMethod(SortByLabel, sortAttributes, 551, LABEL_MASKS("%T", "%Y")); // Title, Year | empty, empty
@@ -484,7 +484,7 @@ CGUIViewStateVideoMusicVideos::CGUIViewStateVideoMusicVideos(const CFileItemList
if (CMediaSettings::GetInstance().GetWatchedMode(items.GetContent()) == WatchedModeAll)
AddSortMethod(SortByPlaycount, 567, LABEL_MASKS("%T", "%V")); // Title, Playcount | empty, empty
- std::string strTrack=CServiceBroker::GetSettings().GetString(CSettings::SETTING_MUSICFILES_TRACKFORMAT);
+ std::string strTrack=CServiceBroker::GetSettings()->GetString(CSettings::SETTING_MUSICFILES_TRACKFORMAT);
AddSortMethod(SortByTrackNumber, 554, LABEL_MASKS(strTrack, "%N")); // Userdefined, Track Number | empty, empty
const CViewState *viewState = CViewStateSettings::GetInstance().Get("videonavmusicvideos");
@@ -509,7 +509,7 @@ void CGUIViewStateVideoMusicVideos::SaveViewState()
CGUIViewStateVideoTVShows::CGUIViewStateVideoTVShows(const CFileItemList& items) : CGUIViewStateWindowVideo(items)
{
AddSortMethod(SortBySortTitle, 556, LABEL_MASKS("%T", "%M", "%T", "%M"), // Title, #Episodes | Title, #Episodes
- CServiceBroker::GetSettings().GetBool(CSettings::SETTING_FILELISTS_IGNORETHEWHENSORTING) ? SortAttributeIgnoreArticle : SortAttributeNone);
+ CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_FILELISTS_IGNORETHEWHENSORTING) ? SortAttributeIgnoreArticle : SortAttributeNone);
AddSortMethod(SortByNumberOfEpisodes, 20360, LABEL_MASKS("%L", "%M", "%L", "%M")); // Label, #Episodes | Label, #Episodes
AddSortMethod(SortByLastPlayed, 568, LABEL_MASKS("%T", "%p", "%T", "%p")); // Title, #Last played | Title, #Last played
@@ -564,7 +564,7 @@ CGUIViewStateVideoEpisodes::CGUIViewStateVideoEpisodes(const CFileItemList& item
}
AddSortMethod(SortByLabel, 551, LABEL_MASKS("%Z - %H. %T","%R"), // TvShow - Order. Title, Rating | empty, empty
- CServiceBroker::GetSettings().GetBool(CSettings::SETTING_FILELISTS_IGNORETHEWHENSORTING) ? SortAttributeIgnoreArticle : SortAttributeNone);
+ CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_FILELISTS_IGNORETHEWHENSORTING) ? SortAttributeIgnoreArticle : SortAttributeNone);
const CViewState *viewState = CViewStateSettings::GetInstance().Get("videonavepisodes");
if (items.IsSmartPlayList() || items.IsLibraryFolder())
diff --git a/xbmc/video/PlayerController.cpp b/xbmc/video/PlayerController.cpp
index e22dfe27b6..06f4ee1b3f 100644
--- a/xbmc/video/PlayerController.cpp
+++ b/xbmc/video/PlayerController.cpp
@@ -324,7 +324,7 @@ bool CPlayerController::OnAction(const CAction &action)
case ACTION_SUBTITLE_VSHIFT_UP:
{
RESOLUTION_INFO res_info = CServiceBroker::GetWinSystem()->GetGfxContext().GetResInfo();
- int subalign = CServiceBroker::GetSettings().GetInt(CSettings::SETTING_SUBTITLES_ALIGN);
+ int subalign = CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_SUBTITLES_ALIGN);
if ((subalign == SUBTITLE_ALIGN_BOTTOM_OUTSIDE) || (subalign == SUBTITLE_ALIGN_TOP_INSIDE))
{
res_info.iSubtitles ++;
@@ -351,7 +351,7 @@ bool CPlayerController::OnAction(const CAction &action)
case ACTION_SUBTITLE_VSHIFT_DOWN:
{
RESOLUTION_INFO res_info = CServiceBroker::GetWinSystem()->GetGfxContext().GetResInfo();
- int subalign = CServiceBroker::GetSettings().GetInt(CSettings::SETTING_SUBTITLES_ALIGN);
+ int subalign = CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_SUBTITLES_ALIGN);
if ((subalign == SUBTITLE_ALIGN_BOTTOM_OUTSIDE) || (subalign == SUBTITLE_ALIGN_TOP_INSIDE))
{
res_info.iSubtitles--;
@@ -378,7 +378,7 @@ bool CPlayerController::OnAction(const CAction &action)
case ACTION_SUBTITLE_ALIGN:
{
RESOLUTION_INFO res_info = CServiceBroker::GetWinSystem()->GetGfxContext().GetResInfo();
- int subalign = CServiceBroker::GetSettings().GetInt(CSettings::SETTING_SUBTITLES_ALIGN);
+ int subalign = CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_SUBTITLES_ALIGN);
subalign++;
if (subalign > SUBTITLE_ALIGN_TOP_OUTSIDE)
@@ -386,7 +386,7 @@ bool CPlayerController::OnAction(const CAction &action)
res_info.iSubtitles = res_info.iHeight - 1;
- CServiceBroker::GetSettings().SetInt(CSettings::SETTING_SUBTITLES_ALIGN, subalign);
+ CServiceBroker::GetSettings()->SetInt(CSettings::SETTING_SUBTITLES_ALIGN, subalign);
CGUIDialogKaiToast::QueueNotification(CGUIDialogKaiToast::Info,
g_localizeStrings.Get(21460),
g_localizeStrings.Get(21461 + subalign),
@@ -464,7 +464,7 @@ bool CPlayerController::OnAction(const CAction &action)
case ACTION_PLAYER_RESOLUTION_SELECT:
{
- std::vector<CVariant> indexList = CServiceBroker::GetSettings().GetList(CSettings::SETTING_VIDEOSCREEN_WHITELIST);
+ std::vector<CVariant> indexList = CServiceBroker::GetSettings()->GetList(CSettings::SETTING_VIDEOSCREEN_WHITELIST);
CGUIDialogSelect *dialog = CServiceBroker::GetGUI()->GetWindowManager().GetWindow<CGUIDialogSelect>(WINDOW_DIALOG_SELECT);
if (dialog)
diff --git a/xbmc/video/VideoDatabase.cpp b/xbmc/video/VideoDatabase.cpp
index ae0086dbae..23fe19339f 100644
--- a/xbmc/video/VideoDatabase.cpp
+++ b/xbmc/video/VideoDatabase.cpp
@@ -6776,7 +6776,7 @@ bool CVideoDatabase::GetItems(const std::string &strBaseDir, VIDEODB_CONTENT_TYP
else if (StringUtils::EqualsNoCase(itemType, "studios"))
return GetStudiosNav(strBaseDir, items, mediaType, filter);
else if (StringUtils::EqualsNoCase(itemType, "sets"))
- return GetSetsNav(strBaseDir, items, mediaType, filter, !CServiceBroker::GetSettings().GetBool(CSettings::SETTING_VIDEOLIBRARY_GROUPSINGLEITEMSETS));
+ return GetSetsNav(strBaseDir, items, mediaType, filter, !CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_VIDEOLIBRARY_GROUPSINGLEITEMSETS));
else if (StringUtils::EqualsNoCase(itemType, "countries"))
return GetCountriesNav(strBaseDir, items, mediaType, filter);
else if (StringUtils::EqualsNoCase(itemType, "tags"))
@@ -6951,7 +6951,7 @@ bool CVideoDatabase::GetTvShowsNav(const std::string& strBaseDir, CFileItemList&
videoUrl.AddOption("tagid", idTag);
Filter filter;
- if (!CServiceBroker::GetSettings().GetBool(CSettings::SETTING_VIDEOLIBRARY_SHOWEMPTYTVSHOWS))
+ if (!CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_VIDEOLIBRARY_SHOWEMPTYTVSHOWS))
filter.AppendWhere("totalCount IS NOT NULL AND totalCount > 0");
return GetTvShowsByWhere(videoUrl.ToString(), filter, items, sortDescription, getDetails);
}
@@ -8148,7 +8148,7 @@ void CVideoDatabase::GetMoviesByName(const std::string& strSearch, CFileItemList
int setId = m_pDS->fv("movie.idSet").get_asInt();
CFileItemPtr pItem(new CFileItem(m_pDS->fv(1).get_asString()));
std::string path;
- if (setId <= 0 || !CServiceBroker::GetSettings().GetBool(CSettings::SETTING_VIDEOLIBRARY_GROUPMOVIESETS))
+ if (setId <= 0 || !CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_VIDEOLIBRARY_GROUPMOVIESETS))
path = StringUtils::Format("videodb://movies/titles/%i", movieId);
else
path = StringUtils::Format("videodb://movies/sets/%i/%i", setId, movieId);
@@ -10171,7 +10171,7 @@ bool CVideoDatabase::GetFilter(CDbUrl &videoUrl, Filter &filter, SortDescription
sorting.sortBy = xsp.GetOrder();
if (xsp.GetOrderDirection() != SortOrderNone)
sorting.sortOrder = xsp.GetOrderDirection();
- if (CServiceBroker::GetSettings().GetBool(CSettings::SETTING_FILELISTS_IGNORETHEWHENSORTING))
+ if (CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_FILELISTS_IGNORETHEWHENSORTING))
sorting.sortAttributes = SortAttributeIgnoreArticle;
}
}
diff --git a/xbmc/video/VideoInfoScanner.cpp b/xbmc/video/VideoInfoScanner.cpp
index ed1ae2a5ca..706b737c23 100644
--- a/xbmc/video/VideoInfoScanner.cpp
+++ b/xbmc/video/VideoInfoScanner.cpp
@@ -74,7 +74,7 @@ namespace VIDEO
try
{
- if (m_showDialog && !CServiceBroker::GetSettings().GetBool(CSettings::SETTING_VIDEOLIBRARY_BACKGROUNDUPDATE))
+ if (m_showDialog && !CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_VIDEOLIBRARY_BACKGROUNDUPDATE))
{
CGUIDialogExtendedProgressBar* dialog =
CServiceBroker::GetGUI()->GetWindowManager().GetWindow<CGUIDialogExtendedProgressBar>(WINDOW_DIALOG_EXT_PROGRESS);
@@ -1520,7 +1520,7 @@ namespace VIDEO
// parent folder to apply the thumb to and to search for local actor thumbs
std::string parentDir = URIUtils::GetBasePath(pItem->GetPath());
- if (CServiceBroker::GetSettings().GetBool(CSettings::SETTING_VIDEOLIBRARY_ACTORTHUMBS))
+ if (CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_VIDEOLIBRARY_ACTORTHUMBS))
FetchActorThumbs(movieDetails.m_cast, actorArtPath.empty() ? parentDir : actorArtPath);
if (bApplyToDir)
ApplyThumbToFolder(parentDir, art["thumb"]);
diff --git a/xbmc/video/VideoThumbLoader.cpp b/xbmc/video/VideoThumbLoader.cpp
index 884ca32310..c232185b19 100644
--- a/xbmc/video/VideoThumbLoader.cpp
+++ b/xbmc/video/VideoThumbLoader.cpp
@@ -395,8 +395,8 @@ bool CVideoThumbLoader::LoadItemLookup(CFileItem* pItem)
m_videoDatabase->SetArtForItem(info->m_iDbId, info->m_type, "thumb", thumbURL);
}
}
- else if (CServiceBroker::GetSettings().GetBool(CSettings::SETTING_MYVIDEOS_EXTRACTTHUMB) &&
- CServiceBroker::GetSettings().GetBool(CSettings::SETTING_MYVIDEOS_EXTRACTFLAGS))
+ else if (CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_MYVIDEOS_EXTRACTTHUMB) &&
+ CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_MYVIDEOS_EXTRACTFLAGS))
{
CFileItem item(*pItem);
std::string path(item.GetPath());
@@ -412,7 +412,7 @@ bool CVideoThumbLoader::LoadItemLookup(CFileItem* pItem)
}
// flag extraction
- if (CServiceBroker::GetSettings().GetBool(CSettings::SETTING_MYVIDEOS_EXTRACTFLAGS) &&
+ if (CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_MYVIDEOS_EXTRACTFLAGS) &&
(!pItem->HasVideoInfoTag() ||
!pItem->GetVideoInfoTag()->HasStreamDetails() ) )
{
diff --git a/xbmc/video/dialogs/GUIDialogAudioSettings.cpp b/xbmc/video/dialogs/GUIDialogAudioSettings.cpp
index ead92bc2cb..af844bc8d3 100644
--- a/xbmc/video/dialogs/GUIDialogAudioSettings.cpp
+++ b/xbmc/video/dialogs/GUIDialogAudioSettings.cpp
@@ -67,7 +67,7 @@ void CGUIDialogAudioSettings::FrameMove()
// these settings can change on the fly
//! @todo (needs special handling): m_settingsManager->SetInt(SETTING_AUDIO_STREAM, g_application.GetAppPlayer().GetAudioStream());
GetSettingsManager()->SetNumber(SETTING_AUDIO_DELAY, videoSettings.m_AudioDelay);
- GetSettingsManager()->SetBool(SETTING_AUDIO_PASSTHROUGH, CServiceBroker::GetSettings().GetBool(CSettings::SETTING_AUDIOOUTPUT_PASSTHROUGH));
+ GetSettingsManager()->SetBool(SETTING_AUDIO_PASSTHROUGH, CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_AUDIOOUTPUT_PASSTHROUGH));
}
CGUIDialogSettingsManualBase::FrameMove();
@@ -134,7 +134,7 @@ void CGUIDialogAudioSettings::OnSettingChanged(std::shared_ptr<const CSetting> s
else if (settingId == SETTING_AUDIO_PASSTHROUGH)
{
m_passthrough = std::static_pointer_cast<const CSettingBool>(setting)->GetValue();
- CServiceBroker::GetSettings().SetBool(CSettings::SETTING_AUDIOOUTPUT_PASSTHROUGH, m_passthrough);
+ CServiceBroker::GetSettings()->SetBool(CSettings::SETTING_AUDIOOUTPUT_PASSTHROUGH, m_passthrough);
}
}
@@ -172,7 +172,7 @@ void CGUIDialogAudioSettings::Save()
CMediaSettings::GetInstance().GetDefaultVideoSettings() = g_application.GetAppPlayer().GetVideoSettings();
CMediaSettings::GetInstance().GetDefaultVideoSettings().m_AudioStream = -1;
- CServiceBroker::GetSettings().Save();
+ CServiceBroker::GetSettings()->Save();
}
void CGUIDialogAudioSettings::SetupView()
@@ -270,7 +270,7 @@ void CGUIDialogAudioSettings::InitializeSettings()
// audio digital/analog setting
if (SupportsAudioFeature(IPC_AUD_SELECT_OUTPUT))
{
- m_passthrough = CServiceBroker::GetSettings().GetBool(CSettings::SETTING_AUDIOOUTPUT_PASSTHROUGH);
+ m_passthrough = CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_AUDIOOUTPUT_PASSTHROUGH);
AddToggle(groupAudio, SETTING_AUDIO_PASSTHROUGH, 348, SettingLevel::Basic, m_passthrough);
}
diff --git a/xbmc/video/dialogs/GUIDialogCMSSettings.cpp b/xbmc/video/dialogs/GUIDialogCMSSettings.cpp
index 402f8df41a..32bdb96487 100644
--- a/xbmc/video/dialogs/GUIDialogCMSSettings.cpp
+++ b/xbmc/video/dialogs/GUIDialogCMSSettings.cpp
@@ -109,9 +109,9 @@ void CGUIDialogCMSSettings::InitializeSettings()
depsCmsGamma.push_back(dependencyCmsGamma);
// color management settings
- AddToggle(groupColorManagement, SETTING_VIDEO_CMSENABLE, 36560, SettingLevel::Basic, CServiceBroker::GetSettings().GetBool(SETTING_VIDEO_CMSENABLE));
+ AddToggle(groupColorManagement, SETTING_VIDEO_CMSENABLE, 36560, SettingLevel::Basic, CServiceBroker::GetSettings()->GetBool(SETTING_VIDEO_CMSENABLE));
- int currentMode = CServiceBroker::GetSettings().GetInt(SETTING_VIDEO_CMSMODE);
+ int currentMode = CServiceBroker::GetSettings()->GetInt(SETTING_VIDEO_CMSMODE);
entries.clear();
// entries.push_back(std::make_pair(16039, CMS_MODE_OFF)); // FIXME: get from CMS class
entries.push_back(std::make_pair(36580, CMS_MODE_3DLUT));
@@ -121,19 +121,19 @@ void CGUIDialogCMSSettings::InitializeSettings()
std::shared_ptr<CSettingInt> settingCmsMode = AddSpinner(groupColorManagement, SETTING_VIDEO_CMSMODE, 36562, SettingLevel::Basic, currentMode, entries);
settingCmsMode->SetDependencies(depsCmsEnabled);
- std::string current3dLUT = CServiceBroker::GetSettings().GetString(SETTING_VIDEO_CMS3DLUT);
+ std::string current3dLUT = CServiceBroker::GetSettings()->GetString(SETTING_VIDEO_CMS3DLUT);
std::shared_ptr<CSettingString> settingCms3dlut = AddList(groupColorManagement, SETTING_VIDEO_CMS3DLUT, 36564, SettingLevel::Basic, current3dLUT, Cms3dLutsFiller, 36564);
settingCms3dlut->SetDependencies(depsCms3dlut);
// display settings
- int currentWhitepoint = CServiceBroker::GetSettings().GetInt(SETTING_VIDEO_CMSWHITEPOINT);
+ int currentWhitepoint = CServiceBroker::GetSettings()->GetInt(SETTING_VIDEO_CMSWHITEPOINT);
entries.clear();
entries.push_back(std::make_pair(36586, CMS_WHITEPOINT_D65));
entries.push_back(std::make_pair(36587, CMS_WHITEPOINT_D93));
std::shared_ptr<CSettingInt> settingCmsWhitepoint = AddSpinner(groupColorManagement, SETTING_VIDEO_CMSWHITEPOINT, 36568, SettingLevel::Basic, currentWhitepoint, entries);
settingCmsWhitepoint->SetDependencies(depsCmsIcc);
- int currentPrimaries = CServiceBroker::GetSettings().GetInt(SETTING_VIDEO_CMSPRIMARIES);
+ int currentPrimaries = CServiceBroker::GetSettings()->GetInt(SETTING_VIDEO_CMSPRIMARIES);
entries.clear();
entries.push_back(std::make_pair(36588, CMS_PRIMARIES_AUTO));
entries.push_back(std::make_pair(36589, CMS_PRIMARIES_BT709));
@@ -145,7 +145,7 @@ void CGUIDialogCMSSettings::InitializeSettings()
std::shared_ptr<CSettingInt> settingCmsPrimaries = AddSpinner(groupColorManagement, SETTING_VIDEO_CMSPRIMARIES, 36570, SettingLevel::Basic, currentPrimaries, entries);
settingCmsPrimaries->SetDependencies(depsCmsIcc);
- int currentGammaMode = CServiceBroker::GetSettings().GetInt(SETTING_VIDEO_CMSGAMMAMODE);
+ int currentGammaMode = CServiceBroker::GetSettings()->GetInt(SETTING_VIDEO_CMSGAMMAMODE);
entries.clear();
entries.push_back(std::make_pair(36582, CMS_TRC_BT1886));
entries.push_back(std::make_pair(36583, CMS_TRC_INPUT_OFFSET));
@@ -154,12 +154,12 @@ void CGUIDialogCMSSettings::InitializeSettings()
std::shared_ptr<CSettingInt> settingCmsGammaMode = AddSpinner(groupColorManagement, SETTING_VIDEO_CMSGAMMAMODE, 36572, SettingLevel::Basic, currentGammaMode, entries);
settingCmsGammaMode->SetDependencies(depsCmsIcc);
- float currentGamma = CServiceBroker::GetSettings().GetInt(SETTING_VIDEO_CMSGAMMA)/100.0f;
+ float currentGamma = CServiceBroker::GetSettings()->GetInt(SETTING_VIDEO_CMSGAMMA)/100.0f;
if (currentGamma == 0.0) currentGamma = 2.20;
std::shared_ptr<CSettingNumber> settingCmsGamma = AddSlider(groupColorManagement, SETTING_VIDEO_CMSGAMMA, 36574, SettingLevel::Basic, currentGamma, 36597, 1.6, 0.05, 2.8, 36574, usePopup);
settingCmsGamma->SetDependencies(depsCmsGamma);
- int currentLutSize = CServiceBroker::GetSettings().GetInt(SETTING_VIDEO_CMSLUTSIZE);
+ int currentLutSize = CServiceBroker::GetSettings()->GetInt(SETTING_VIDEO_CMSLUTSIZE);
entries.clear();
entries.push_back(std::make_pair(36594, 4));
entries.push_back(std::make_pair(36595, 6));
@@ -177,21 +177,21 @@ void CGUIDialogCMSSettings::OnSettingChanged(std::shared_ptr<const CSetting> set
const std::string &settingId = setting->GetId();
if (settingId == SETTING_VIDEO_CMSENABLE)
- CServiceBroker::GetSettings().SetBool(SETTING_VIDEO_CMSENABLE, (std::static_pointer_cast<const CSettingBool>(setting)->GetValue()));
+ CServiceBroker::GetSettings()->SetBool(SETTING_VIDEO_CMSENABLE, (std::static_pointer_cast<const CSettingBool>(setting)->GetValue()));
else if (settingId == SETTING_VIDEO_CMSMODE)
- CServiceBroker::GetSettings().SetInt(SETTING_VIDEO_CMSMODE, std::static_pointer_cast<const CSettingInt>(setting)->GetValue());
+ CServiceBroker::GetSettings()->SetInt(SETTING_VIDEO_CMSMODE, std::static_pointer_cast<const CSettingInt>(setting)->GetValue());
else if (settingId == SETTING_VIDEO_CMS3DLUT)
- CServiceBroker::GetSettings().SetString(SETTING_VIDEO_CMS3DLUT, std::static_pointer_cast<const CSettingString>(setting)->GetValue());
+ CServiceBroker::GetSettings()->SetString(SETTING_VIDEO_CMS3DLUT, std::static_pointer_cast<const CSettingString>(setting)->GetValue());
else if (settingId == SETTING_VIDEO_CMSWHITEPOINT)
- CServiceBroker::GetSettings().SetInt(SETTING_VIDEO_CMSWHITEPOINT, std::static_pointer_cast<const CSettingInt>(setting)->GetValue());
+ CServiceBroker::GetSettings()->SetInt(SETTING_VIDEO_CMSWHITEPOINT, std::static_pointer_cast<const CSettingInt>(setting)->GetValue());
else if (settingId == SETTING_VIDEO_CMSPRIMARIES)
- CServiceBroker::GetSettings().SetInt(SETTING_VIDEO_CMSPRIMARIES, std::static_pointer_cast<const CSettingInt>(setting)->GetValue());
+ CServiceBroker::GetSettings()->SetInt(SETTING_VIDEO_CMSPRIMARIES, std::static_pointer_cast<const CSettingInt>(setting)->GetValue());
else if (settingId == SETTING_VIDEO_CMSGAMMAMODE)
- CServiceBroker::GetSettings().SetInt(SETTING_VIDEO_CMSGAMMAMODE, std::static_pointer_cast<const CSettingInt>(setting)->GetValue());
+ CServiceBroker::GetSettings()->SetInt(SETTING_VIDEO_CMSGAMMAMODE, std::static_pointer_cast<const CSettingInt>(setting)->GetValue());
else if (settingId == SETTING_VIDEO_CMSGAMMA)
- CServiceBroker::GetSettings().SetInt(SETTING_VIDEO_CMSGAMMA, static_cast<float>(std::static_pointer_cast<const CSettingNumber>(setting)->GetValue())*100);
+ CServiceBroker::GetSettings()->SetInt(SETTING_VIDEO_CMSGAMMA, static_cast<float>(std::static_pointer_cast<const CSettingNumber>(setting)->GetValue())*100);
else if (settingId == SETTING_VIDEO_CMSLUTSIZE)
- CServiceBroker::GetSettings().SetInt(SETTING_VIDEO_CMSLUTSIZE, std::static_pointer_cast<const CSettingInt>(setting)->GetValue());
+ CServiceBroker::GetSettings()->SetInt(SETTING_VIDEO_CMSLUTSIZE, std::static_pointer_cast<const CSettingInt>(setting)->GetValue());
}
bool CGUIDialogCMSSettings::OnBack(int actionID)
@@ -203,7 +203,7 @@ bool CGUIDialogCMSSettings::OnBack(int actionID)
void CGUIDialogCMSSettings::Save()
{
CLog::Log(LOGINFO, "CGUIDialogCMSSettings: Save() called");
- CServiceBroker::GetSettings().Save();
+ CServiceBroker::GetSettings()->Save();
}
void CGUIDialogCMSSettings::Cms3dLutsFiller(
@@ -216,7 +216,7 @@ void CGUIDialogCMSSettings::Cms3dLutsFiller(
CFileItemList items;
// list .3dlut files
- std::string current3dlut = CServiceBroker::GetSettings().GetString(SETTING_VIDEO_CMS3DLUT);
+ std::string current3dlut = CServiceBroker::GetSettings()->GetString(SETTING_VIDEO_CMS3DLUT);
if (!current3dlut.empty())
current3dlut = URIUtils::GetDirectory(current3dlut);
XFILE::CDirectory::GetDirectory(current3dlut, items, ".3dlut", XFILE::DIR_FLAG_DEFAULTS);
diff --git a/xbmc/video/dialogs/GUIDialogSubtitleSettings.cpp b/xbmc/video/dialogs/GUIDialogSubtitleSettings.cpp
index 6da6fb5013..0056a60d15 100644
--- a/xbmc/video/dialogs/GUIDialogSubtitleSettings.cpp
+++ b/xbmc/video/dialogs/GUIDialogSubtitleSettings.cpp
@@ -114,12 +114,12 @@ std::string CGUIDialogSubtitleSettings::BrowseForSubtitle()
if (g_application.GetCurrentPlayer() == "VideoPlayer")
strMask = ".srt|.rar|.zip|.ifo|.smi|.sub|.idx|.ass|.ssa|.txt";
VECSOURCES shares(*CMediaSourceSettings::GetInstance().GetSources("video"));
- if (CMediaSettings::GetInstance().GetAdditionalSubtitleDirectoryChecked() != -1 && !CServiceBroker::GetSettings().GetString(CSettings::SETTING_SUBTITLES_CUSTOMPATH).empty())
+ if (CMediaSettings::GetInstance().GetAdditionalSubtitleDirectoryChecked() != -1 && !CServiceBroker::GetSettings()->GetString(CSettings::SETTING_SUBTITLES_CUSTOMPATH).empty())
{
CMediaSource share;
std::vector<std::string> paths;
paths.push_back(URIUtils::GetDirectory(strPath));
- paths.push_back(CServiceBroker::GetSettings().GetString(CSettings::SETTING_SUBTITLES_CUSTOMPATH));
+ paths.push_back(CServiceBroker::GetSettings()->GetString(CSettings::SETTING_SUBTITLES_CUSTOMPATH));
share.FromNameAndPaths("video",g_localizeStrings.Get(21367),paths);
shares.push_back(share);
strPath = share.strPath;
@@ -192,7 +192,7 @@ void CGUIDialogSubtitleSettings::Save()
CMediaSettings::GetInstance().GetDefaultVideoSettings() = g_application.GetAppPlayer().GetVideoSettings();
CMediaSettings::GetInstance().GetDefaultVideoSettings().m_SubtitleStream = -1;
- CServiceBroker::GetSettings().Save();
+ CServiceBroker::GetSettings()->Save();
}
void CGUIDialogSubtitleSettings::SetupView()
diff --git a/xbmc/video/dialogs/GUIDialogSubtitles.cpp b/xbmc/video/dialogs/GUIDialogSubtitles.cpp
index b39092f47b..80decca823 100644
--- a/xbmc/video/dialogs/GUIDialogSubtitles.cpp
+++ b/xbmc/video/dialogs/GUIDialogSubtitles.cpp
@@ -162,7 +162,7 @@ void CGUIDialogSubtitles::OnInitWindow()
{
// Pause the video if the user has requested it
m_pausedOnRun = false;
- if (CServiceBroker::GetSettings().GetBool(CSettings::SETTING_SUBTITLES_PAUSEONSEARCH) && !g_application.GetAppPlayer().IsPaused())
+ if (CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_SUBTITLES_PAUSEONSEARCH) && !g_application.GetAppPlayer().IsPaused())
{
g_application.GetAppPlayer().Pause();
m_pausedOnRun = true;
@@ -236,10 +236,10 @@ void CGUIDialogSubtitles::FillServices()
if (item.GetVideoContentType() == VIDEODB_CONTENT_TVSHOWS ||
item.GetVideoContentType() == VIDEODB_CONTENT_EPISODES)
// Set default service for tv shows
- defaultService = CServiceBroker::GetSettings().GetString(CSettings::SETTING_SUBTITLES_TV);
+ defaultService = CServiceBroker::GetSettings()->GetString(CSettings::SETTING_SUBTITLES_TV);
else
// Set default service for filemode and movies
- defaultService = CServiceBroker::GetSettings().GetString(CSettings::SETTING_SUBTITLES_MOVIE);
+ defaultService = CServiceBroker::GetSettings()->GetString(CSettings::SETTING_SUBTITLES_MOVIE);
std::string service = addons.front()->ID();
for (VECADDONS::const_iterator addonIt = addons.begin(); addonIt != addons.end(); ++addonIt)
@@ -317,7 +317,7 @@ void CGUIDialogSubtitles::Search(const std::string &search/*=""*/)
else
url.SetOption("action", "search");
- SettingConstPtr setting = CServiceBroker::GetSettings().GetSetting(CSettings::SETTING_SUBTITLES_LANGUAGES);
+ SettingConstPtr setting = CServiceBroker::GetSettings()->GetSetting(CSettings::SETTING_SUBTITLES_LANGUAGES);
if (setting)
url.SetOption("languages", setting->ToString());
@@ -325,7 +325,7 @@ void CGUIDialogSubtitles::Search(const std::string &search/*=""*/)
if (g_application.CurrentFileItem().IsStack())
url.SetOption("stack", "1");
- std::string preferredLanguage = CServiceBroker::GetSettings().GetString(CSettings::SETTING_LOCALE_SUBTITLELANGUAGE);
+ std::string preferredLanguage = CServiceBroker::GetSettings()->GetString(CSettings::SETTING_LOCALE_SUBTITLELANGUAGE);
if(StringUtils::EqualsNoCase(preferredLanguage, "original"))
{
@@ -367,7 +367,7 @@ void CGUIDialogSubtitles::OnSearchComplete(const CFileItemList *items)
m_updateSubsList = true;
if (!items->IsEmpty() && g_application.GetAppPlayer().GetSubtitleCount() == 0 &&
- m_LastAutoDownloaded != g_application.CurrentFile() && CServiceBroker::GetSettings().GetBool(CSettings::SETTING_SUBTITLES_DOWNLOADFIRST))
+ m_LastAutoDownloaded != g_application.CurrentFile() && CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_SUBTITLES_DOWNLOADFIRST))
{
CFileItemPtr item = items->Get(0);
CLog::Log(LOGDEBUG, "%s - Automatically download first subtitle: %s", __FUNCTION__, item->GetLabel2().c_str());
@@ -433,7 +433,7 @@ void CGUIDialogSubtitles::OnDownloadComplete(const CFileItemList *items, const s
return;
}
- SUBTITLE_STORAGEMODE storageMode = (SUBTITLE_STORAGEMODE) CServiceBroker::GetSettings().GetInt(CSettings::SETTING_SUBTITLES_STORAGEMODE);
+ SUBTITLE_STORAGEMODE storageMode = (SUBTITLE_STORAGEMODE) CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_SUBTITLES_STORAGEMODE);
// Get (unstacked) path
std::string strCurrentFile = g_application.CurrentUnstackedItem().GetPath();
diff --git a/xbmc/video/dialogs/GUIDialogTeletext.cpp b/xbmc/video/dialogs/GUIDialogTeletext.cpp
index 8f450007f4..405db916e1 100644
--- a/xbmc/video/dialogs/GUIDialogTeletext.cpp
+++ b/xbmc/video/dialogs/GUIDialogTeletext.cpp
@@ -165,7 +165,7 @@ void CGUIDialogTeletext::SetCoordinates()
top = CServiceBroker::GetWinSystem()->GetGfxContext().ScaleFinalYCoord(0, 0);
bottom = CServiceBroker::GetWinSystem()->GetGfxContext().ScaleFinalYCoord(0, (float)m_coordsRes.iHeight);
- if (CServiceBroker::GetSettings().GetBool(CSettings::SETTING_VIDEOPLAYER_TELETEXTSCALE))
+ if (CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_VIDEOPLAYER_TELETEXTSCALE))
{
/* Fixed aspect ratio to 4:3 for teletext */
float width = right - left;
diff --git a/xbmc/video/dialogs/GUIDialogVideoBookmarks.cpp b/xbmc/video/dialogs/GUIDialogVideoBookmarks.cpp
index 6ac8c0f6ac..5a30daef74 100644
--- a/xbmc/video/dialogs/GUIDialogVideoBookmarks.cpp
+++ b/xbmc/video/dialogs/GUIDialogVideoBookmarks.cpp
@@ -278,7 +278,7 @@ void CGUIDialogVideoBookmarks::OnRefreshList()
std::string cachefile = CTextureCache::GetInstance().GetCachedPath(CTextureCache::GetInstance().GetCacheFile(chapterPath)+".jpg");
if (XFILE::CFile::Exists(cachefile))
item->SetArt("thumb", cachefile);
- else if (i > m_jobsStarted && CServiceBroker::GetSettings().GetBool(CSettings::SETTING_MYVIDEOS_EXTRACTCHAPTERTHUMBS))
+ else if (i > m_jobsStarted && CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_MYVIDEOS_EXTRACTCHAPTERTHUMBS))
{
CFileItem item(m_filePath, false);
CJob* job = new CThumbExtractor(item, m_filePath, true, chapterPath, pos * 1000, false);
diff --git a/xbmc/video/dialogs/GUIDialogVideoInfo.cpp b/xbmc/video/dialogs/GUIDialogVideoInfo.cpp
index 9439f74515..df167fb654 100644
--- a/xbmc/video/dialogs/GUIDialogVideoInfo.cpp
+++ b/xbmc/video/dialogs/GUIDialogVideoInfo.cpp
@@ -325,7 +325,7 @@ void CGUIDialogVideoInfo::SetMovie(const CFileItem *item)
CFileItemPtr item(new CFileItem(it->strName));
if (!it->thumb.empty())
item->SetArt("thumb", it->thumb);
- else if (CServiceBroker::GetSettings().GetBool(CSettings::SETTING_VIDEOLIBRARY_ACTORTHUMBS))
+ else if (CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_VIDEOLIBRARY_ACTORTHUMBS))
{ // backward compatibility
std::string thumb = CScraperUrl::GetThumbURL(it->thumbUrl.GetFirstThumb());
if (!thumb.empty())
@@ -376,7 +376,7 @@ void CGUIDialogVideoInfo::Update()
// setup plot text area
std::string strTmp = m_movieItem->GetVideoInfoTag()->m_strPlot;
if (m_movieItem->GetVideoInfoTag()->m_type != MediaTypeTvShow)
- if (m_movieItem->GetVideoInfoTag()->GetPlayCount() == 0 && !CServiceBroker::GetSettings().GetBool(CSettings::SETTING_VIDEOLIBRARY_SHOWUNWATCHEDPLOTS))
+ if (m_movieItem->GetVideoInfoTag()->GetPlayCount() == 0 && !CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_VIDEOLIBRARY_SHOWUNWATCHEDPLOTS))
strTmp = g_localizeStrings.Get(20370);
StringUtils::Trim(strTmp);
@@ -1386,7 +1386,7 @@ bool CGUIDialogVideoInfo::DeleteVideoItem(const CFileItemPtr &item, bool unavail
const CProfilesManager &profileManager = CServiceBroker::GetProfileManager();
// check if the user is allowed to delete the actual file as well
- if (CServiceBroker::GetSettings().GetBool(CSettings::SETTING_FILELISTS_ALLOWFILEDELETION) &&
+ if (CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_FILELISTS_ALLOWFILEDELETION) &&
(profileManager.GetCurrentProfile().getLockMode() == LOCK_MODE_EVERYONE ||
!profileManager.GetCurrentProfile().filesLocked() ||
g_passwordManager.IsMasterLockUnlocked(true)))
@@ -1489,7 +1489,7 @@ bool CGUIDialogVideoInfo::GetMoviesForSet(const CFileItem *setItem, CFileItemLis
if (dialog == nullptr)
return false;
- listItems.Sort(SortByLabel, SortOrderAscending, CServiceBroker::GetSettings().GetBool(CSettings::SETTING_FILELISTS_IGNORETHEWHENSORTING) ? SortAttributeIgnoreArticle : SortAttributeNone);
+ listItems.Sort(SortByLabel, SortOrderAscending, CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_FILELISTS_IGNORETHEWHENSORTING) ? SortAttributeIgnoreArticle : SortAttributeNone);
dialog->Reset();
dialog->SetMultiSelection(true);
@@ -1534,7 +1534,7 @@ bool CGUIDialogVideoInfo::GetSetForMovie(const CFileItem *movieItem, CFileItemPt
std::string baseDir = "videodb://movies/sets/";
if (!CDirectory::GetDirectory(baseDir, listItems, "", DIR_FLAG_DEFAULTS))
return false;
- listItems.Sort(SortByLabel, SortOrderAscending, CServiceBroker::GetSettings().GetBool(CSettings::SETTING_FILELISTS_IGNORETHEWHENSORTING) ? SortAttributeIgnoreArticle : SortAttributeNone);
+ listItems.Sort(SortByLabel, SortOrderAscending, CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_FILELISTS_IGNORETHEWHENSORTING) ? SortAttributeIgnoreArticle : SortAttributeNone);
int currentSetId = 0;
std::string currentSetLabel;
@@ -1670,7 +1670,7 @@ bool CGUIDialogVideoInfo::GetItemsForTag(const std::string &strHeading, const st
if (dialog == nullptr)
return false;
- listItems.Sort(SortByLabel, SortOrderAscending, CServiceBroker::GetSettings().GetBool(CSettings::SETTING_FILELISTS_IGNORETHEWHENSORTING) ? SortAttributeIgnoreArticle : SortAttributeNone);
+ listItems.Sort(SortByLabel, SortOrderAscending, CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_FILELISTS_IGNORETHEWHENSORTING) ? SortAttributeIgnoreArticle : SortAttributeNone);
dialog->Reset();
dialog->SetMultiSelection(true);
@@ -2042,7 +2042,7 @@ bool CGUIDialogVideoInfo::LinkMovieToTvShow(const CFileItemPtr &item, bool bRemo
int iSelectedLabel = 0;
if (list.Size() > 1 || (!bRemove && !list.IsEmpty()))
{
- list.Sort(SortByLabel, SortOrderAscending, CServiceBroker::GetSettings().GetBool(CSettings::SETTING_FILELISTS_IGNORETHEWHENSORTING) ? SortAttributeIgnoreArticle : SortAttributeNone);
+ list.Sort(SortByLabel, SortOrderAscending, CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_FILELISTS_IGNORETHEWHENSORTING) ? SortAttributeIgnoreArticle : SortAttributeNone);
CGUIDialogSelect* pDialog = CServiceBroker::GetGUI()->GetWindowManager().GetWindow<CGUIDialogSelect>(WINDOW_DIALOG_SELECT);
if (pDialog)
{
diff --git a/xbmc/video/dialogs/GUIDialogVideoSettings.cpp b/xbmc/video/dialogs/GUIDialogVideoSettings.cpp
index b8c928fb33..d1e5bf4481 100644
--- a/xbmc/video/dialogs/GUIDialogVideoSettings.cpp
+++ b/xbmc/video/dialogs/GUIDialogVideoSettings.cpp
@@ -213,7 +213,7 @@ void CGUIDialogVideoSettings::OnSettingAction(std::shared_ptr<const CSetting> se
// launch calibration window
if (profileManager.GetMasterProfile().getLockMode() != LOCK_MODE_EVERYONE &&
- g_passwordManager.CheckSettingLevelLock(CServiceBroker::GetSettings().GetSetting(CSettings::SETTING_VIDEOSCREEN_GUICALIBRATION)->GetLevel()))
+ g_passwordManager.CheckSettingLevelLock(CServiceBroker::GetSettings()->GetSetting(CSettings::SETTING_VIDEOSCREEN_GUICALIBRATION)->GetLevel()))
return;
CServiceBroker::GetGUI()->GetWindowManager().ForceActivateWindow(WINDOW_SCREEN_CALIBRATION);
}
@@ -242,7 +242,7 @@ void CGUIDialogVideoSettings::Save()
CMediaSettings::GetInstance().GetDefaultVideoSettings() = g_application.GetAppPlayer().GetVideoSettings();
CMediaSettings::GetInstance().GetDefaultVideoSettings().m_SubtitleStream = -1;
CMediaSettings::GetInstance().GetDefaultVideoSettings().m_AudioStream = -1;
- CServiceBroker::GetSettings().Save();
+ CServiceBroker::GetSettings()->Save();
}
}
diff --git a/xbmc/video/tags/VideoInfoTagLoaderFactory.cpp b/xbmc/video/tags/VideoInfoTagLoaderFactory.cpp
index 5e18128ae7..d9134d3038 100644
--- a/xbmc/video/tags/VideoInfoTagLoaderFactory.cpp
+++ b/xbmc/video/tags/VideoInfoTagLoaderFactory.cpp
@@ -39,7 +39,7 @@ IVideoInfoTagLoader* CVideoInfoTagLoaderFactory::CreateLoader(const CFileItem& i
return nfo;
delete nfo;
- if (CServiceBroker::GetSettings().GetBool(CSettings::SETTING_MYVIDEOS_USETAGS) &&
+ if (CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_MYVIDEOS_USETAGS) &&
(item.IsType(".mkv") || item.IsType(".mp4") || item.IsType(".avi")))
{
CVideoTagLoaderFFmpeg* ff = new CVideoTagLoaderFFmpeg(item, info, lookInFolder);
diff --git a/xbmc/video/windows/GUIWindowFullScreen.cpp b/xbmc/video/windows/GUIWindowFullScreen.cpp
index b31d70c33d..34ed632b46 100644
--- a/xbmc/video/windows/GUIWindowFullScreen.cpp
+++ b/xbmc/video/windows/GUIWindowFullScreen.cpp
@@ -256,7 +256,7 @@ bool CGUIWindowFullScreen::OnMessage(CGUIMessage& message)
CGUIWindow::OnMessage(message);
- CServiceBroker::GetSettings().Save();
+ CServiceBroker::GetSettings()->Save();
CServiceBroker::GetWinSystem()->GetGfxContext().SetFullScreenVideo(false);
diff --git a/xbmc/video/windows/GUIWindowVideoBase.cpp b/xbmc/video/windows/GUIWindowVideoBase.cpp
index 1e9806e39f..78d4809219 100644
--- a/xbmc/video/windows/GUIWindowVideoBase.cpp
+++ b/xbmc/video/windows/GUIWindowVideoBase.cpp
@@ -610,7 +610,7 @@ bool CGUIWindowVideoBase::OnSelect(int iItem)
!StringUtils::StartsWith(path, "newplaylist://") &&
!StringUtils::StartsWith(path, "newtag://") &&
!StringUtils::StartsWith(path, "script://"))
- return OnFileAction(iItem, CServiceBroker::GetSettings().GetInt(CSettings::SETTING_MYVIDEOS_SELECTACTION), "");
+ return OnFileAction(iItem, CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_MYVIDEOS_SELECTACTION), "");
return CGUIMediaWindow::OnSelect(iItem);
}
@@ -867,7 +867,7 @@ void CGUIWindowVideoBase::GetContextButtons(int itemNumber, CContextButtons &but
//then add add either 'play from here' or 'play only this' depending on default behaviour
if (!(item->m_bIsFolder || item->IsScript()) && m_vecItems->Size() > 1 && itemNumber < m_vecItems->Size()-1)
{
- if (!CServiceBroker::GetSettings().GetBool(CSettings::SETTING_VIDEOPLAYER_AUTOPLAYNEXTITEM))
+ if (!CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_VIDEOPLAYER_AUTOPLAYNEXTITEM))
buttons.Add(CONTEXT_BUTTON_PLAY_AND_QUEUE, 13412);
else
buttons.Add(CONTEXT_BUTTON_PLAY_ONLY_THIS, 13434);
@@ -998,7 +998,7 @@ bool CGUIWindowVideoBase::OnContextButton(int itemNumber, CONTEXT_BUTTON button)
// any other select actions but play or resume, resume, play or playpart
// don't make any sense here since the user already decided that he'd
// like to play the item (just with a specific player)
- VideoSelectAction selectAction = (VideoSelectAction)CServiceBroker::GetSettings().GetInt(CSettings::SETTING_MYVIDEOS_SELECTACTION);
+ VideoSelectAction selectAction = (VideoSelectAction)CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_MYVIDEOS_SELECTACTION);
if (selectAction != SELECT_ACTION_PLAY_OR_RESUME &&
selectAction != SELECT_ACTION_RESUME &&
selectAction != SELECT_ACTION_PLAY &&
@@ -1147,7 +1147,7 @@ void CGUIWindowVideoBase::OnDeleteItem(CFileItemPtr item)
return;
}
- if ((CServiceBroker::GetSettings().GetBool(CSettings::SETTING_FILELISTS_ALLOWFILEDELETION) ||
+ if ((CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_FILELISTS_ALLOWFILEDELETION) ||
m_vecItems->IsPath("special://videoplaylists/")) &&
CUtil::SupportsWriteFileOperations(item->GetPath()))
{
@@ -1278,7 +1278,7 @@ bool CGUIWindowVideoBase::GetDirectory(const std::string &strDirectory, CFileIte
if (info && info->Content() == CONTENT_TVSHOWS)
m_stackingAvailable = false;
- if (m_stackingAvailable && !items.IsStack() && CServiceBroker::GetSettings().GetBool(CSettings::SETTING_MYVIDEOS_STACKVIDEOS))
+ if (m_stackingAvailable && !items.IsStack() && CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_MYVIDEOS_STACKVIDEOS))
items.Stack();
return bResult;
@@ -1312,10 +1312,10 @@ void CGUIWindowVideoBase::GetGroupedItems(CFileItemList &items)
VIDEODATABASEDIRECTORY::NODE_TYPE nodeType = CVideoDatabaseDirectory::GetDirectoryChildType(m_strFilterPath);
if (items.GetContent() == "movies" && params.GetSetId() <= 0 &&
nodeType == NODE_TYPE_TITLE_MOVIES &&
- (CServiceBroker::GetSettings().GetBool(CSettings::SETTING_VIDEOLIBRARY_GROUPMOVIESETS) || (StringUtils::EqualsNoCase(group, "sets") && mixed)))
+ (CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_VIDEOLIBRARY_GROUPMOVIESETS) || (StringUtils::EqualsNoCase(group, "sets") && mixed)))
{
CFileItemList groupedItems;
- GroupAttribute groupAttributes = CServiceBroker::GetSettings().GetBool(CSettings::SETTING_VIDEOLIBRARY_GROUPSINGLEITEMSETS) ? GroupAttributeNone : GroupAttributeIgnoreSingleItems;
+ GroupAttribute groupAttributes = CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_VIDEOLIBRARY_GROUPSINGLEITEMSETS) ? GroupAttributeNone : GroupAttributeIgnoreSingleItems;
if (GroupUtils::GroupAndMix(GroupBySet, m_strFilterPath, items, groupedItems, groupAttributes))
{
items.ClearItems();
@@ -1478,7 +1478,7 @@ void CGUIWindowVideoBase::OnSearchItemFound(const CFileItem* pSelItem)
Update(strParentPath);
- if (pSelItem->IsVideoDb() && CServiceBroker::GetSettings().GetBool(CSettings::SETTING_MYVIDEOS_FLATTEN))
+ if (pSelItem->IsVideoDb() && CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_MYVIDEOS_FLATTEN))
SetHistoryForPath("");
else
SetHistoryForPath(strParentPath);
@@ -1504,7 +1504,7 @@ void CGUIWindowVideoBase::OnSearchItemFound(const CFileItem* pSelItem)
Update(strPath);
- if (pSelItem->IsVideoDb() && CServiceBroker::GetSettings().GetBool(CSettings::SETTING_MYVIDEOS_FLATTEN))
+ if (pSelItem->IsVideoDb() && CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_MYVIDEOS_FLATTEN))
SetHistoryForPath("");
else
SetHistoryForPath(strPath);
@@ -1566,7 +1566,7 @@ void CGUIWindowVideoBase::AppendAndClearSearchItems(CFileItemList &searchItems,
if (!searchItems.Size())
return;
- searchItems.Sort(SortByLabel, SortOrderAscending, CServiceBroker::GetSettings().GetBool(CSettings::SETTING_FILELISTS_IGNORETHEWHENSORTING) ? SortAttributeIgnoreArticle : SortAttributeNone);
+ searchItems.Sort(SortByLabel, SortOrderAscending, CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_FILELISTS_IGNORETHEWHENSORTING) ? SortAttributeIgnoreArticle : SortAttributeNone);
for (int i = 0; i < searchItems.Size(); i++)
searchItems[i]->SetLabel(prependLabel + searchItems[i]->GetLabel());
results.Append(searchItems);
diff --git a/xbmc/video/windows/GUIWindowVideoNav.cpp b/xbmc/video/windows/GUIWindowVideoNav.cpp
index b04cfa35a4..65c4f3ad23 100644
--- a/xbmc/video/windows/GUIWindowVideoNav.cpp
+++ b/xbmc/video/windows/GUIWindowVideoNav.cpp
@@ -109,7 +109,7 @@ bool CGUIWindowVideoNav::OnMessage(CGUIMessage& message)
/* We don't want to show Autosourced items (ie removable pendrives, memorycards) in Library mode */
m_rootDir.AllowNonLocalSources(false);
- SetProperty("flattened", CServiceBroker::GetSettings().GetBool(CSettings::SETTING_MYVIDEOS_FLATTEN));
+ SetProperty("flattened", CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_MYVIDEOS_FLATTEN));
if (message.GetNumStringParams() && StringUtils::EqualsNoCase(message.GetStringParam(0), "Files") &&
CMediaSourceSettings::GetInstance().GetSources("video")->empty())
{
@@ -208,7 +208,7 @@ bool CGUIWindowVideoNav::OnMessage(CGUIMessage& message)
else if (iControl == CONTROL_BTNSHOWMODE)
{
CMediaSettings::GetInstance().CycleWatchedMode(m_vecItems->GetContent());
- CServiceBroker::GetSettings().Save();
+ CServiceBroker::GetSettings()->Save();
OnFilterItems(GetProperty("filter").asString());
UpdateButtons();
return true;
@@ -219,7 +219,7 @@ bool CGUIWindowVideoNav::OnMessage(CGUIMessage& message)
CMediaSettings::GetInstance().SetWatchedMode(m_vecItems->GetContent(), WatchedModeUnwatched);
else
CMediaSettings::GetInstance().SetWatchedMode(m_vecItems->GetContent(), WatchedModeAll);
- CServiceBroker::GetSettings().Save();
+ CServiceBroker::GetSettings()->Save();
OnFilterItems(GetProperty("filter").asString());
UpdateButtons();
return true;
@@ -250,7 +250,7 @@ SelectFirstUnwatchedItem CGUIWindowVideoNav::GetSettingSelectFirstUnwatchedItem(
if (nodeType == NODE_TYPE_SEASONS || nodeType == NODE_TYPE_EPISODES)
{
- int iValue = CServiceBroker::GetSettings().GetInt(CSettings::SETTING_VIDEOLIBRARY_TVSHOWSSELECTFIRSTUNWATCHEDITEM);
+ int iValue = CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_VIDEOLIBRARY_TVSHOWSSELECTFIRSTUNWATCHEDITEM);
if (iValue >= SelectFirstUnwatchedItem::NEVER && iValue <= SelectFirstUnwatchedItem::ALWAYS)
return (SelectFirstUnwatchedItem)iValue;
}
@@ -261,7 +261,7 @@ SelectFirstUnwatchedItem CGUIWindowVideoNav::GetSettingSelectFirstUnwatchedItem(
IncludeAllSeasonsAndSpecials CGUIWindowVideoNav::GetSettingIncludeAllSeasonsAndSpecials()
{
- int iValue = CServiceBroker::GetSettings().GetInt(CSettings::SETTING_VIDEOLIBRARY_TVSHOWSINCLUDEALLSEASONSANDSPECIALS);
+ int iValue = CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_VIDEOLIBRARY_TVSHOWSINCLUDEALLSEASONSANDSPECIALS);
if (iValue >= IncludeAllSeasonsAndSpecials::NEITHER && iValue <= IncludeAllSeasonsAndSpecials::SPECIALS)
return (IncludeAllSeasonsAndSpecials)iValue;
@@ -372,7 +372,7 @@ bool CGUIWindowVideoNav::GetDirectory(const std::string &strDirectory, CFileItem
dir.GetQueryParams(items.GetPath(),params);
VIDEODATABASEDIRECTORY::NODE_TYPE node = dir.GetDirectoryChildType(items.GetPath());
- int iFlatten = CServiceBroker::GetSettings().GetInt(CSettings::SETTING_VIDEOLIBRARY_FLATTENTVSHOWS);
+ int iFlatten = CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_VIDEOLIBRARY_FLATTENTVSHOWS);
int itemsSize = items.GetObjectCount();
int firstIndex = items.Size() - itemsSize;
@@ -578,8 +578,8 @@ void CGUIWindowVideoNav::LoadVideoInfo(CFileItemList &items, CVideoDatabase &dat
Similarly, we assign the "clean" library labels to the item only if the "Replace filenames with library titles"
setting is enabled.
*/
- const bool stackItems = items.GetProperty("isstacked").asBoolean() || (StackingAvailable(items) && CServiceBroker::GetSettings().GetBool(CSettings::SETTING_MYVIDEOS_STACKVIDEOS));
- const bool replaceLabels = allowReplaceLabels && CServiceBroker::GetSettings().GetBool(CSettings::SETTING_MYVIDEOS_REPLACELABELS);
+ const bool stackItems = items.GetProperty("isstacked").asBoolean() || (StackingAvailable(items) && CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_MYVIDEOS_STACKVIDEOS));
+ const bool replaceLabels = allowReplaceLabels && CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_MYVIDEOS_REPLACELABELS);
CFileItemList dbItems;
/* NOTE: In the future when GetItemsForPath returns all items regardless of whether they're "in the library"
@@ -989,7 +989,7 @@ void CGUIWindowVideoNav::GetContextButtons(int itemNumber, CContextButtons &butt
if (!m_vecItems->IsVideoDb() && !m_vecItems->IsVirtualDirectoryRoot())
{ // non-video db items, file operations are allowed
- if ((CServiceBroker::GetSettings().GetBool(CSettings::SETTING_FILELISTS_ALLOWFILEDELETION) &&
+ if ((CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_FILELISTS_ALLOWFILEDELETION) &&
CUtil::SupportsWriteFileOperations(item->GetPath())) ||
(inPlaylists && URIUtils::GetFileName(item->GetPath()) != "PartyMode-Video.xsp"
&& (item->IsPlayList() || item->IsSmartPlayList())))
diff --git a/xbmc/video/windows/GUIWindowVideoPlaylist.cpp b/xbmc/video/windows/GUIWindowVideoPlaylist.cpp
index ca7aece124..8102899dd4 100644
--- a/xbmc/video/windows/GUIWindowVideoPlaylist.cpp
+++ b/xbmc/video/windows/GUIWindowVideoPlaylist.cpp
@@ -117,7 +117,7 @@ bool CGUIWindowVideoPlaylist::OnMessage(CGUIMessage& message)
{
CServiceBroker::GetPlaylistPlayer().SetShuffle(PLAYLIST_VIDEO, !(CServiceBroker::GetPlaylistPlayer().IsShuffled(PLAYLIST_VIDEO)));
CMediaSettings::GetInstance().SetVideoPlaylistShuffled(CServiceBroker::GetPlaylistPlayer().IsShuffled(PLAYLIST_VIDEO));
- CServiceBroker::GetSettings().Save();
+ CServiceBroker::GetSettings()->Save();
UpdateButtons();
Refresh();
}
@@ -160,7 +160,7 @@ bool CGUIWindowVideoPlaylist::OnMessage(CGUIMessage& message)
// save settings
CMediaSettings::GetInstance().SetVideoPlaylistRepeat(CServiceBroker::GetPlaylistPlayer().GetRepeat(PLAYLIST_VIDEO) == PLAYLIST::REPEAT_ALL);
- CServiceBroker::GetSettings().Save();
+ CServiceBroker::GetSettings()->Save();
UpdateButtons();
}
@@ -367,7 +367,7 @@ void CGUIWindowVideoPlaylist::SavePlayList()
strNewFileName = CUtil::MakeLegalFileName(strNewFileName);
strNewFileName += ".m3u";
std::string strPath = URIUtils::AddFileToFolder(
- CServiceBroker::GetSettings().GetString(CSettings::SETTING_SYSTEM_PLAYLISTSPATH),
+ CServiceBroker::GetSettings()->GetString(CSettings::SETTING_SYSTEM_PLAYLISTSPATH),
"video",
strNewFileName);
diff --git a/xbmc/video/windows/VideoFileItemListModifier.cpp b/xbmc/video/windows/VideoFileItemListModifier.cpp
index 85f9e4154f..cbc30780c7 100644
--- a/xbmc/video/windows/VideoFileItemListModifier.cpp
+++ b/xbmc/video/windows/VideoFileItemListModifier.cpp
@@ -44,7 +44,7 @@ void CVideoFileItemListModifier::AddQueuingFolder(CFileItemList& items)
CFileItemPtr pItem;
// always show "all" items by default
- if (!CServiceBroker::GetSettings().GetBool(CSettings::SETTING_VIDEOLIBRARY_SHOWALLITEMS))
+ if (!CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_VIDEOLIBRARY_SHOWALLITEMS))
return;
// no need for "all" item when only one item
diff --git a/xbmc/view/GUIViewState.cpp b/xbmc/view/GUIViewState.cpp
index 68bb7f5952..68ad8dc0a5 100644
--- a/xbmc/view/GUIViewState.cpp
+++ b/xbmc/view/GUIViewState.cpp
@@ -378,12 +378,12 @@ SortDescription CGUIViewState::SetNextSortMethod(int direction /* = 1 */)
bool CGUIViewState::HideExtensions()
{
- return !CServiceBroker::GetSettings().GetBool(CSettings::SETTING_FILELISTS_SHOWEXTENSIONS);
+ return !CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_FILELISTS_SHOWEXTENSIONS);
}
bool CGUIViewState::HideParentDirItems()
{
- return !CServiceBroker::GetSettings().GetBool(CSettings::SETTING_FILELISTS_SHOWPARENTDIRITEMS);
+ return !CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_FILELISTS_SHOWPARENTDIRITEMS);
}
bool CGUIViewState::DisableAddSourceButtons()
@@ -391,7 +391,7 @@ bool CGUIViewState::DisableAddSourceButtons()
const CProfilesManager &profileManager = CServiceBroker::GetProfileManager();
if (profileManager.GetCurrentProfile().canWriteSources() || g_passwordManager.bMasterUser)
- return !CServiceBroker::GetSettings().GetBool(CSettings::SETTING_FILELISTS_SHOWADDSOURCEBUTTONS);
+ return !CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_FILELISTS_SHOWADDSOURCEBUTTONS);
return true;
}
@@ -508,7 +508,7 @@ bool CGUIViewState::AutoPlayNextVideoItem() const
else
settingValue = SETTING_AUTOPLAYNEXT_UNCATEGORIZED;
- return settingValue >= 0 && CServiceBroker::GetSettings().FindIntInList(CSettings::SETTING_VIDEOPLAYER_AUTOPLAYNEXTITEM, settingValue);
+ return settingValue >= 0 && CServiceBroker::GetSettings()->FindIntInList(CSettings::SETTING_VIDEOPLAYER_AUTOPLAYNEXTITEM, settingValue);
}
void CGUIViewState::LoadViewState(const std::string &path, int windowID)
@@ -518,7 +518,7 @@ void CGUIViewState::LoadViewState(const std::string &path, int windowID)
return;
CViewState state;
- if (db.GetViewState(path, windowID, state, CServiceBroker::GetSettings().GetString(CSettings::SETTING_LOOKANDFEEL_SKIN)) ||
+ if (db.GetViewState(path, windowID, state, CServiceBroker::GetSettings()->GetString(CSettings::SETTING_LOOKANDFEEL_SKIN)) ||
db.GetViewState(path, windowID, state, ""))
{
SetViewAsControl(state.m_viewMode);
@@ -537,11 +537,11 @@ void CGUIViewState::SaveViewToDb(const std::string &path, int windowID, CViewSta
if (viewState != NULL)
*viewState = state;
- db.SetViewState(path, windowID, state, CServiceBroker::GetSettings().GetString(CSettings::SETTING_LOOKANDFEEL_SKIN));
+ db.SetViewState(path, windowID, state, CServiceBroker::GetSettings()->GetString(CSettings::SETTING_LOOKANDFEEL_SKIN));
db.Close();
if (viewState != NULL)
- CServiceBroker::GetSettings().Save();
+ CServiceBroker::GetSettings()->Save();
}
void CGUIViewState::AddPlaylistOrder(const CFileItemList &items, LABEL_MASKS label_masks)
diff --git a/xbmc/weather/WeatherJob.cpp b/xbmc/weather/WeatherJob.cpp
index e5ebb61a72..7969e0d13c 100644
--- a/xbmc/weather/WeatherJob.cpp
+++ b/xbmc/weather/WeatherJob.cpp
@@ -51,7 +51,7 @@ bool CWeatherJob::DoWork()
return false;
AddonPtr addon;
- if (!CServiceBroker::GetAddonMgr().GetAddon(CServiceBroker::GetSettings().GetString(CSettings::SETTING_WEATHER_ADDON), addon, ADDON_SCRIPT_WEATHER))
+ if (!CServiceBroker::GetAddonMgr().GetAddon(CServiceBroker::GetSettings()->GetString(CSettings::SETTING_WEATHER_ADDON), addon, ADDON_SCRIPT_WEATHER))
return false;
// initialize our sys.argv variables
@@ -127,7 +127,7 @@ void CWeatherJob::LoadLocalizedToken()
{
// We load the english strings in to get our tokens
std::string language = LANGUAGE_DEFAULT;
- std::shared_ptr<CSettingString> languageSetting = std::static_pointer_cast<CSettingString>(CServiceBroker::GetSettings().GetSetting(CSettings::SETTING_LOCALE_LANGUAGE));
+ std::shared_ptr<CSettingString> languageSetting = std::static_pointer_cast<CSettingString>(CServiceBroker::GetSettings()->GetSetting(CSettings::SETTING_LOCALE_LANGUAGE));
if (languageSetting != NULL)
language = languageSetting->GetDefault();
diff --git a/xbmc/weather/WeatherManager.cpp b/xbmc/weather/WeatherManager.cpp
index c2d953560f..403514f8d4 100644
--- a/xbmc/weather/WeatherManager.cpp
+++ b/xbmc/weather/WeatherManager.cpp
@@ -28,7 +28,7 @@ using namespace ADDON;
CWeatherManager::CWeatherManager(void) : CInfoLoader(30 * 60 * 1000) // 30 minutes
{
- CServiceBroker::GetSettings().GetSettingsManager()->RegisterCallback(this, {
+ CServiceBroker::GetSettings()->GetSettingsManager()->RegisterCallback(this, {
CSettings::SETTING_WEATHER_ADDON,
CSettings::SETTING_WEATHER_ADDONSETTINGS
});
@@ -38,7 +38,7 @@ CWeatherManager::CWeatherManager(void) : CInfoLoader(30 * 60 * 1000) // 30 minut
CWeatherManager::~CWeatherManager(void)
{
- CServiceBroker::GetSettings().GetSettingsManager()->UnregisterCallback(this);
+ CServiceBroker::GetSettings()->GetSettingsManager()->UnregisterCallback(this);
}
std::string CWeatherManager::BusyInfo(int info) const
@@ -115,8 +115,8 @@ const ForecastDay &CWeatherManager::GetForecast(int day) const
*/
void CWeatherManager::SetArea(int iLocation)
{
- CServiceBroker::GetSettings().SetInt(CSettings::SETTING_WEATHER_CURRENTLOCATION, iLocation);
- CServiceBroker::GetSettings().Save();
+ CServiceBroker::GetSettings()->SetInt(CSettings::SETTING_WEATHER_CURRENTLOCATION, iLocation);
+ CServiceBroker::GetSettings()->Save();
}
/*!
@@ -125,7 +125,7 @@ void CWeatherManager::SetArea(int iLocation)
*/
int CWeatherManager::GetArea() const
{
- return CServiceBroker::GetSettings().GetInt(CSettings::SETTING_WEATHER_CURRENTLOCATION);
+ return CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_WEATHER_CURRENTLOCATION);
}
CJob *CWeatherManager::GetJob() const
@@ -164,7 +164,7 @@ void CWeatherManager::OnSettingAction(std::shared_ptr<const CSetting> setting)
if (settingId == CSettings::SETTING_WEATHER_ADDONSETTINGS)
{
AddonPtr addon;
- if (CServiceBroker::GetAddonMgr().GetAddon(CServiceBroker::GetSettings().GetString(CSettings::SETTING_WEATHER_ADDON), addon, ADDON_SCRIPT_WEATHER) && addon != NULL)
+ if (CServiceBroker::GetAddonMgr().GetAddon(CServiceBroker::GetSettings()->GetString(CSettings::SETTING_WEATHER_ADDON), addon, ADDON_SCRIPT_WEATHER) && addon != NULL)
{ //! @todo maybe have ShowAndGetInput return a bool if settings changed, then only reset weather if true.
CGUIDialogAddonSettings::ShowForAddon(addon);
Refresh();
diff --git a/xbmc/windowing/GraphicContext.cpp b/xbmc/windowing/GraphicContext.cpp
index 46c3efe736..0bbcb3936e 100644
--- a/xbmc/windowing/GraphicContext.cpp
+++ b/xbmc/windowing/GraphicContext.cpp
@@ -325,7 +325,7 @@ void CGraphicContext::SetFullScreenVideo(bool bOnOff)
bTriggerUpdateRes = true;
else
{
- bool allowDesktopRes = CServiceBroker::GetSettings().GetInt(CSettings::SETTING_VIDEOPLAYER_ADJUSTREFRESHRATE) == ADJUST_REFRESHRATE_ALWAYS;
+ bool allowDesktopRes = CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_VIDEOPLAYER_ADJUSTREFRESHRATE) == ADJUST_REFRESHRATE_ALWAYS;
if (!allowDesktopRes)
{
if (g_application.GetAppPlayer().IsPlayingVideo())
@@ -428,7 +428,7 @@ void CGraphicContext::SetVideoResolutionInternal(RESOLUTION res, bool forceUpdat
if (g_advancedSettings.m_fullScreen)
{
#if defined (TARGET_DARWIN) || defined (TARGET_WINDOWS)
- bool blankOtherDisplays = CServiceBroker::GetSettings().GetBool(CSettings::SETTING_VIDEOSCREEN_BLANKDISPLAYS);
+ bool blankOtherDisplays = CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_VIDEOSCREEN_BLANKDISPLAYS);
switched = CServiceBroker::GetWinSystem()->SetFullScreen(true, info_org, blankOtherDisplays);
#else
switched = CServiceBroker::GetWinSystem()->SetFullScreen(true, info_org, false);
@@ -669,7 +669,7 @@ void CGraphicContext::GetGUIScaling(const RESOLUTION_INFO &res, float &scaleX, f
float fToWidth = (float)info.Overscan.right - fToPosX;
float fToHeight = (float)info.Overscan.bottom - fToPosY;
- float fZoom = (100 + CServiceBroker::GetSettings().GetInt(CSettings::SETTING_LOOKANDFEEL_SKINZOOM)) * 0.01f;
+ float fZoom = (100 + CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_LOOKANDFEEL_SKINZOOM)) * 0.01f;
fZoom -= 1.0f;
fToPosX -= fToWidth * fZoom * 0.5f;
@@ -867,7 +867,7 @@ void CGraphicContext::UpdateCameraPosition(const CPoint &camera, const float &fa
RESOLUTION_INFO res = GetResInfo();
RESOLUTION_INFO desktop = GetResInfo(RES_DESKTOP);
float scaleRes = (static_cast<float>(res.iWidth) / static_cast<float>(desktop.iWidth));
- float scaleX = static_cast<float>(CServiceBroker::GetSettings().GetInt(CSettings::SETTING_LOOKANDFEEL_STEREOSTRENGTH)) * scaleRes;
+ float scaleX = static_cast<float>(CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_LOOKANDFEEL_STEREOSTRENGTH)) * scaleRes;
stereoFactor = factor * (m_stereoView == RENDER_STEREO_VIEW_LEFT ? scaleX : -scaleX);
}
CServiceBroker::GetRenderSystem()->SetCameraPosition(camera, m_iScreenWidth, m_iScreenHeight, stereoFactor);
diff --git a/xbmc/windowing/Resolution.cpp b/xbmc/windowing/Resolution.cpp
index dd2b5ce6ba..fa2f6b0d78 100644
--- a/xbmc/windowing/Resolution.cpp
+++ b/xbmc/windowing/Resolution.cpp
@@ -74,7 +74,7 @@ void CResolutionUtils::FindResolutionFromWhitelist(float fps, int width, int hei
{
RESOLUTION_INFO curr = CServiceBroker::GetWinSystem()->GetGfxContext().GetResInfo(resolution);
- std::vector<CVariant> indexList = CServiceBroker::GetSettings().GetList(CSettings::SETTING_VIDEOSCREEN_WHITELIST);
+ std::vector<CVariant> indexList = CServiceBroker::GetSettings()->GetList(CSettings::SETTING_VIDEOSCREEN_WHITELIST);
CLog::Log(LOGDEBUG, "Trying to find exact refresh rate");
@@ -237,6 +237,6 @@ float CResolutionUtils::RefreshWeight(float refresh, float fps)
bool CResolutionUtils::HasWhitelist()
{
- std::vector<CVariant> indexList = CServiceBroker::GetSettings().GetList(CSettings::SETTING_VIDEOSCREEN_WHITELIST);
+ std::vector<CVariant> indexList = CServiceBroker::GetSettings()->GetList(CSettings::SETTING_VIDEOSCREEN_WHITELIST);
return !indexList.empty();
}
diff --git a/xbmc/windowing/WinSystem.cpp b/xbmc/windowing/WinSystem.cpp
index e588c76996..9c512aad97 100644
--- a/xbmc/windowing/WinSystem.cpp
+++ b/xbmc/windowing/WinSystem.cpp
@@ -217,7 +217,7 @@ std::string CWinSystemBase::GetClipboardText(void)
int CWinSystemBase::NoOfBuffers(void)
{
- int buffers = CServiceBroker::GetSettings().GetInt(CSettings::SETTING_VIDEOSCREEN_NOOFBUFFERS);
+ int buffers = CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_VIDEOSCREEN_NOOFBUFFERS);
return buffers;
}
diff --git a/xbmc/windowing/X11/WinSystemX11.cpp b/xbmc/windowing/X11/WinSystemX11.cpp
index 4415dfc1ff..6488f97770 100644
--- a/xbmc/windowing/X11/WinSystemX11.cpp
+++ b/xbmc/windowing/X11/WinSystemX11.cpp
@@ -125,7 +125,7 @@ bool CWinSystemX11::DestroyWindow()
bool CWinSystemX11::ResizeWindow(int newWidth, int newHeight, int newLeft, int newTop)
{
- m_userOutput = CServiceBroker::GetSettings().GetString(CSettings::SETTING_VIDEOSCREEN_MONITOR);
+ m_userOutput = CServiceBroker::GetSettings()->GetString(CSettings::SETTING_VIDEOSCREEN_MONITOR);
XOutput *out = NULL;
if (m_userOutput.compare("Default") != 0)
{
@@ -163,7 +163,7 @@ bool CWinSystemX11::ResizeWindow(int newWidth, int newHeight, int newLeft, int n
void CWinSystemX11::FinishWindowResize(int newWidth, int newHeight)
{
- m_userOutput = CServiceBroker::GetSettings().GetString(CSettings::SETTING_VIDEOSCREEN_MONITOR);
+ m_userOutput = CServiceBroker::GetSettings()->GetString(CSettings::SETTING_VIDEOSCREEN_MONITOR);
XOutput *out = NULL;
if (m_userOutput.compare("Default") != 0)
{
@@ -263,7 +263,7 @@ bool CWinSystemX11::SetFullScreen(bool fullScreen, RESOLUTION_INFO& res, bool bl
OnLostDevice();
m_bIsInternalXrr = true;
g_xrandr.SetMode(out, mode);
- int delay = CServiceBroker::GetSettings().GetInt("videoscreen.delayrefreshchange");
+ int delay = CServiceBroker::GetSettings()->GetInt("videoscreen.delayrefreshchange");
if (delay > 0)
{
m_delayDispReset = true;
@@ -292,8 +292,8 @@ void CWinSystemX11::UpdateResolutions()
int numScreens = XScreenCount(m_dpy);
g_xrandr.SetNumScreens(numScreens);
- bool switchOnOff = CServiceBroker::GetSettings().GetBool(CSettings::SETTING_VIDEOSCREEN_BLANKDISPLAYS);
- m_userOutput = CServiceBroker::GetSettings().GetString(CSettings::SETTING_VIDEOSCREEN_MONITOR);
+ bool switchOnOff = CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_VIDEOSCREEN_BLANKDISPLAYS);
+ m_userOutput = CServiceBroker::GetSettings()->GetString(CSettings::SETTING_VIDEOSCREEN_MONITOR);
if (m_userOutput.compare("Default") == 0)
switchOnOff = false;
@@ -445,7 +445,7 @@ bool CWinSystemX11::HasCalibration(const RESOLUTION_INFO &resInfo)
bool CWinSystemX11::UseLimitedColor()
{
- return CServiceBroker::GetSettings().GetBool(CSettings::SETTING_VIDEOSCREEN_LIMITEDRANGE);
+ return CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_VIDEOSCREEN_LIMITEDRANGE);
}
void CWinSystemX11::GetConnectedOutputs(std::vector<std::string> *outputs)
diff --git a/xbmc/windowing/amlogic/WinSystemAmlogic.cpp b/xbmc/windowing/amlogic/WinSystemAmlogic.cpp
index 960a969867..9df83a6f6d 100644
--- a/xbmc/windowing/amlogic/WinSystemAmlogic.cpp
+++ b/xbmc/windowing/amlogic/WinSystemAmlogic.cpp
@@ -124,7 +124,7 @@ bool CWinSystemAmlogic::CreateNewWindow(const std::string& name,
return true;
}
- int delay = CServiceBroker::GetSettings().GetInt("videoscreen.delayrefreshchange");
+ int delay = CServiceBroker::GetSettings()->GetInt("videoscreen.delayrefreshchange");
if (delay > 0)
{
m_delayDispReset = true;
diff --git a/xbmc/windowing/android/AndroidUtils.cpp b/xbmc/windowing/android/AndroidUtils.cpp
index 389ae0a1fe..0d7f5c5d9c 100644
--- a/xbmc/windowing/android/AndroidUtils.cpp
+++ b/xbmc/windowing/android/AndroidUtils.cpp
@@ -152,7 +152,7 @@ CAndroidUtils::CAndroidUtils()
}
CLog::Log(LOGDEBUG, "CAndroidUtils: maximum/current resolution: %dx%d", m_width, m_height);
- int limit = CServiceBroker::GetSettings().GetInt("videoscreen.limitgui");
+ int limit = CServiceBroker::GetSettings()->GetInt("videoscreen.limitgui");
switch (limit)
{
case 0: // auto
diff --git a/xbmc/windowing/android/WinSystemAndroid.cpp b/xbmc/windowing/android/WinSystemAndroid.cpp
index cf3dcf6cb6..eb2bbdb1e6 100644
--- a/xbmc/windowing/android/WinSystemAndroid.cpp
+++ b/xbmc/windowing/android/WinSystemAndroid.cpp
@@ -116,7 +116,7 @@ bool CWinSystemAndroid::CreateNewWindow(const std::string& name,
return true;
}
- int delay = CServiceBroker::GetSettings().GetInt("videoscreen.delayrefreshchange");
+ int delay = CServiceBroker::GetSettings()->GetInt("videoscreen.delayrefreshchange");
if (delay > 0)
{
m_delayDispReset = true;
diff --git a/xbmc/windowing/gbm/WinSystemGbm.cpp b/xbmc/windowing/gbm/WinSystemGbm.cpp
index 9484f5aef4..12f2da635d 100644
--- a/xbmc/windowing/gbm/WinSystemGbm.cpp
+++ b/xbmc/windowing/gbm/WinSystemGbm.cpp
@@ -223,7 +223,7 @@ bool CWinSystemGbm::SetFullScreen(bool fullScreen, RESOLUTION_INFO& res, bool bl
m_GBM->ReleaseBuffer();
}
- int delay = CServiceBroker::GetSettings().GetInt("videoscreen.delayrefreshchange");
+ int delay = CServiceBroker::GetSettings()->GetInt("videoscreen.delayrefreshchange");
if (delay > 0)
{
m_delayDispReset = true;
@@ -256,7 +256,7 @@ void CWinSystemGbm::FlipPage(bool rendered, bool videoLayer)
bool CWinSystemGbm::UseLimitedColor()
{
- return CServiceBroker::GetSettings().GetBool(CSettings::SETTING_VIDEOSCREEN_LIMITEDRANGE);
+ return CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_VIDEOSCREEN_LIMITEDRANGE);
}
bool CWinSystemGbm::Hide()
diff --git a/xbmc/windowing/osx/WinSystemIOS.mm b/xbmc/windowing/osx/WinSystemIOS.mm
index e34c69a1f3..dadb64e788 100644
--- a/xbmc/windowing/osx/WinSystemIOS.mm
+++ b/xbmc/windowing/osx/WinSystemIOS.mm
@@ -70,7 +70,7 @@ std::unique_ptr<CWinSystemBase> CWinSystemBase::CreateWinSystem()
int CWinSystemIOS::GetDisplayIndexFromSettings()
{
- std::string currentScreen = CServiceBroker::GetSettings().GetString(CSettings::SETTING_VIDEOSCREEN_MONITOR);
+ std::string currentScreen = CServiceBroker::GetSettings()->GetString(CSettings::SETTING_VIDEOSCREEN_MONITOR);
int screenIdx = 0;
if (currentScreen == CONST_EXTERNAL)
diff --git a/xbmc/windowing/osx/WinSystemOSX.mm b/xbmc/windowing/osx/WinSystemOSX.mm
index 258652041e..061add38ff 100644
--- a/xbmc/windowing/osx/WinSystemOSX.mm
+++ b/xbmc/windowing/osx/WinSystemOSX.mm
@@ -888,7 +888,7 @@ bool CWinSystemOSX::SetFullScreen(bool fullScreen, RESOLUTION_INFO& res, bool bl
needtoshowme = true;
}
- m_lastDisplayNr = GetDisplayIndex(CServiceBroker::GetSettings().GetString(CSettings::SETTING_VIDEOSCREEN_MONITOR));
+ m_lastDisplayNr = GetDisplayIndex(CServiceBroker::GetSettings()->GetString(CSettings::SETTING_VIDEOSCREEN_MONITOR));
m_nWidth = res.iWidth;
m_nHeight = res.iHeight;
m_bFullScreen = fullScreen;
@@ -930,7 +930,7 @@ bool CWinSystemOSX::SetFullScreen(bool fullScreen, RESOLUTION_INFO& res, bool bl
last_window_origin = [[last_view window] frame].origin;
last_window_level = [[last_view window] level];
- if (CServiceBroker::GetSettings().GetBool(CSettings::SETTING_VIDEOSCREEN_FAKEFULLSCREEN))
+ if (CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_VIDEOSCREEN_FAKEFULLSCREEN))
{
// This is Cocoa Windowed FullScreen Mode
// Get the screen rect of our current display
@@ -1035,7 +1035,7 @@ bool CWinSystemOSX::SetFullScreen(bool fullScreen, RESOLUTION_INFO& res, bool bl
// Show menubar.
SetMenuBarVisible(true);
- if (CServiceBroker::GetSettings().GetBool(CSettings::SETTING_VIDEOSCREEN_FAKEFULLSCREEN))
+ if (CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_VIDEOSCREEN_FAKEFULLSCREEN))
{
// restore the windowed window level
[[last_view window] setLevel:last_window_level];
@@ -1110,7 +1110,7 @@ void CWinSystemOSX::UpdateResolutions()
int w, h;
double fps;
- int dispIdx = GetDisplayIndex(CServiceBroker::GetSettings().GetString(CSettings::SETTING_VIDEOSCREEN_MONITOR));
+ int dispIdx = GetDisplayIndex(CServiceBroker::GetSettings()->GetString(CSettings::SETTING_VIDEOSCREEN_MONITOR));
GetScreenResolution(&w, &h, &fps, dispIdx);
UpdateDesktopResolution(CDisplaySettings::GetInstance().GetResolutionInfo(RES_DESKTOP), w, h, fps, 0);
NSString *dispName = screenNameForDisplay(GetDisplayID(dispIdx));
@@ -1286,7 +1286,7 @@ bool CWinSystemOSX::SwitchToVideoMode(int width, int height, double refreshrate)
boolean_t match = false;
CGDisplayModeRef dispMode = NULL;
- int screenIdx = GetDisplayIndex(CServiceBroker::GetSettings().GetString(CSettings::SETTING_VIDEOSCREEN_MONITOR));
+ int screenIdx = GetDisplayIndex(CServiceBroker::GetSettings()->GetString(CSettings::SETTING_VIDEOSCREEN_MONITOR));
// Figure out the screen size. (default to main screen)
CGDirectDisplayID display_id = GetDisplayID(screenIdx);
@@ -1339,7 +1339,7 @@ bool CWinSystemOSX::SwitchToVideoMode(int width, int height, double refreshrate)
void CWinSystemOSX::FillInVideoModes()
{
- int dispIdx = GetDisplayIndex(CServiceBroker::GetSettings().GetString(CSettings::SETTING_VIDEOSCREEN_MONITOR));
+ int dispIdx = GetDisplayIndex(CServiceBroker::GetSettings()->GetString(CSettings::SETTING_VIDEOSCREEN_MONITOR));
// Add full screen settings for additional monitors
int numDisplays = [[NSScreen screens] count];
@@ -1427,7 +1427,7 @@ bool CWinSystemOSX::FlushBuffer(void)
bool CWinSystemOSX::IsObscured(void)
{
- if (m_bFullScreen && !CServiceBroker::GetSettings().GetBool(CSettings::SETTING_VIDEOSCREEN_FAKEFULLSCREEN))
+ if (m_bFullScreen && !CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_VIDEOSCREEN_FAKEFULLSCREEN))
return false;// in true fullscreen mode - we can't be obscured by anyone...
// check once a second if we are obscured.
@@ -1775,7 +1775,7 @@ void CWinSystemOSX::AnnounceOnLostDevice()
void CWinSystemOSX::HandleOnResetDevice()
{
- int delay = CServiceBroker::GetSettings().GetInt("videoscreen.delayrefreshchange");
+ int delay = CServiceBroker::GetSettings()->GetInt("videoscreen.delayrefreshchange");
if (delay > 0)
{
m_delayDispReset = true;
diff --git a/xbmc/windowing/rpi/RPIUtils.cpp b/xbmc/windowing/rpi/RPIUtils.cpp
index c294d1c232..d2837d52f4 100644
--- a/xbmc/windowing/rpi/RPIUtils.cpp
+++ b/xbmc/windowing/rpi/RPIUtils.cpp
@@ -128,7 +128,7 @@ bool CRPIUtils::SetNativeResolution(const RESOLUTION_INFO res, EGLSurface m_nati
/* inform TV of any 3D settings. Note this property just applies to next hdmi mode change, so no need to call for 2D modes */
HDMI_PROPERTY_PARAM_T property;
property.property = HDMI_PROPERTY_3D_STRUCTURE;
- if (CServiceBroker::GetSettings().GetBool(CSettings::SETTING_VIDEOSCREEN_FRAMEPACKING) && CServiceBroker::GetSettings().GetBool(CSettings::SETTING_VIDEOPLAYER_SUPPORTMVC) && res.fRefreshRate <= 30.0f)
+ if (CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_VIDEOSCREEN_FRAMEPACKING) && CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_VIDEOPLAYER_SUPPORTMVC) && res.fRefreshRate <= 30.0f)
property.param1 = HDMI_3D_FORMAT_FRAME_PACKING;
else if (stereo_mode == RENDER_STEREO_MODE_SPLIT_VERTICAL)
property.param1 = HDMI_3D_FORMAT_SBS_HALF;
diff --git a/xbmc/windowing/rpi/WinSystemRpi.cpp b/xbmc/windowing/rpi/WinSystemRpi.cpp
index 930d529167..f98abadaf8 100644
--- a/xbmc/windowing/rpi/WinSystemRpi.cpp
+++ b/xbmc/windowing/rpi/WinSystemRpi.cpp
@@ -96,7 +96,7 @@ bool CWinSystemRpi::CreateNewWindow(const std::string& name,
return true;
}
- int delay = CServiceBroker::GetSettings().GetInt("videoscreen.delayrefreshchange");
+ int delay = CServiceBroker::GetSettings()->GetInt("videoscreen.delayrefreshchange");
if (delay > 0)
{
m_delayDispReset = true;
diff --git a/xbmc/windowing/wayland/WinSystemWayland.cpp b/xbmc/windowing/wayland/WinSystemWayland.cpp
index 9c9e064620..8a3e485379 100644
--- a/xbmc/windowing/wayland/WinSystemWayland.cpp
+++ b/xbmc/windowing/wayland/WinSystemWayland.cpp
@@ -318,7 +318,7 @@ bool CWinSystemWayland::CreateNewWindow(const std::string& name,
if (fullScreen)
{
// Try to start on correct monitor and with correct buffer scale
- auto output = FindOutputByUserFriendlyName(CServiceBroker::GetSettings().GetString(CSettings::SETTING_VIDEOSCREEN_MONITOR));
+ auto output = FindOutputByUserFriendlyName(CServiceBroker::GetSettings()->GetString(CSettings::SETTING_VIDEOSCREEN_MONITOR));
auto wlOutput = output ? output->GetWaylandOutput() : wayland::output_t{};
m_lastSetOutput = wlOutput;
m_shellSurface->SetFullScreen(wlOutput, res.fRefreshRate);
@@ -423,7 +423,7 @@ void CWinSystemWayland::GetConnectedOutputs(std::vector<std::string>* outputs)
bool CWinSystemWayland::UseLimitedColor()
{
- return CServiceBroker::GetSettings().GetBool(CSettings::SETTING_VIDEOSCREEN_LIMITEDRANGE);
+ return CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_VIDEOSCREEN_LIMITEDRANGE);
}
void CWinSystemWayland::UpdateResolutions()
@@ -434,7 +434,7 @@ void CWinSystemWayland::UpdateResolutions()
// Mimic X11:
// Only show resolutions for the currently selected output
- std::string userOutput = CServiceBroker::GetSettings().GetString(CSettings::SETTING_VIDEOSCREEN_MONITOR);
+ std::string userOutput = CServiceBroker::GetSettings()->GetString(CSettings::SETTING_VIDEOSCREEN_MONITOR);
CSingleLock lock(m_outputsMutex);
diff --git a/xbmc/windowing/win10/WinSystemWin10.cpp b/xbmc/windowing/win10/WinSystemWin10.cpp
index c9698c5f01..96194e0f2c 100644
--- a/xbmc/windowing/win10/WinSystemWin10.cpp
+++ b/xbmc/windowing/win10/WinSystemWin10.cpp
@@ -580,7 +580,7 @@ void CWinSystemWin10::OnDisplayReset()
void CWinSystemWin10::OnDisplayBack()
{
- int delay = CServiceBroker::GetSettings().GetInt("videoscreen.delayrefreshchange");
+ int delay = CServiceBroker::GetSettings()->GetInt("videoscreen.delayrefreshchange");
if (delay > 0)
{
m_delayDispReset = true;
@@ -617,7 +617,7 @@ std::string CWinSystemWin10::GetClipboardText()
bool CWinSystemWin10::UseLimitedColor()
{
- return CServiceBroker::GetSettings().GetBool(CSettings::SETTING_VIDEOSCREEN_LIMITEDRANGE);
+ return CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_VIDEOSCREEN_LIMITEDRANGE);
}
void CWinSystemWin10::NotifyAppFocusChange(bool bGaining)
diff --git a/xbmc/windowing/windows/WinEventsWin32.cpp b/xbmc/windowing/windows/WinEventsWin32.cpp
index e6033e327a..02cdb39544 100644
--- a/xbmc/windowing/windows/WinEventsWin32.cpp
+++ b/xbmc/windowing/windows/WinEventsWin32.cpp
@@ -345,7 +345,7 @@ LRESULT CALLBACK CWinEventsWin32::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, L
case SC_MONITORPOWER:
if (g_application.GetAppPlayer().IsPlaying() || g_application.GetAppPlayer().IsPausedPlayback())
return 0;
- else if(CServiceBroker::GetSettings().GetInt(CSettings::SETTING_POWERMANAGEMENT_DISPLAYSOFF) == 0)
+ else if(CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_POWERMANAGEMENT_DISPLAYSOFF) == 0)
return 0;
break;
case SC_SCREENSAVE:
diff --git a/xbmc/windowing/windows/WinSystemWin32.cpp b/xbmc/windowing/windows/WinSystemWin32.cpp
index a0a20a346e..fdf7ff1484 100644
--- a/xbmc/windowing/windows/WinSystemWin32.cpp
+++ b/xbmc/windowing/windows/WinSystemWin32.cpp
@@ -860,7 +860,7 @@ void CWinSystemWin32::UpdateResolutions()
CWinSystemBase::UpdateResolutions();
GetConnectedDisplays(m_displays);
- MONITOR_DETAILS* details = GetDisplayDetails(CServiceBroker::GetSettings().GetString(CSettings::SETTING_VIDEOSCREEN_MONITOR));
+ MONITOR_DETAILS* details = GetDisplayDetails(CServiceBroker::GetSettings()->GetString(CSettings::SETTING_VIDEOSCREEN_MONITOR));
if (!details)
return;
@@ -1023,7 +1023,7 @@ void CWinSystemWin32::OnDisplayReset()
void CWinSystemWin32::OnDisplayBack()
{
- int delay = CServiceBroker::GetSettings().GetInt("videoscreen.delayrefreshchange");
+ int delay = CServiceBroker::GetSettings()->GetInt("videoscreen.delayrefreshchange");
if (delay > 0)
{
m_delayDispReset = true;
@@ -1111,7 +1111,7 @@ std::string CWinSystemWin32::GetClipboardText()
bool CWinSystemWin32::UseLimitedColor()
{
- return CServiceBroker::GetSettings().GetBool(CSettings::SETTING_VIDEOSCREEN_LIMITEDRANGE);
+ return CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_VIDEOSCREEN_LIMITEDRANGE);
}
void CWinSystemWin32::NotifyAppFocusChange(bool bGaining)
@@ -1142,7 +1142,7 @@ void CWinSystemWin32::NotifyAppFocusChange(bool bGaining)
void CWinSystemWin32::UpdateStates(bool fullScreen)
{
- m_fullscreenState = CServiceBroker::GetSettings().GetBool(CSettings::SETTING_VIDEOSCREEN_FAKEFULLSCREEN)
+ m_fullscreenState = CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_VIDEOSCREEN_FAKEFULLSCREEN)
? WINDOW_FULLSCREEN_STATE_FULLSCREEN_WINDOW
: WINDOW_FULLSCREEN_STATE_FULLSCREEN;
m_windowState = WINDOW_WINDOW_STATE_WINDOWED; // currently only this allowed
diff --git a/xbmc/windowing/windows/WinSystemWin32DX.cpp b/xbmc/windowing/windows/WinSystemWin32DX.cpp
index 5dd34e1622..fdbe58549f 100644
--- a/xbmc/windowing/windows/WinSystemWin32DX.cpp
+++ b/xbmc/windowing/windows/WinSystemWin32DX.cpp
@@ -71,7 +71,7 @@ void CWinSystemWin32DX::PresentRenderImpl(bool rendered)
bool CWinSystemWin32DX::CreateNewWindow(const std::string& name, bool fullScreen, RESOLUTION_INFO& res)
{
- const MONITOR_DETAILS* monitor = GetDisplayDetails(CServiceBroker::GetSettings().GetString(CSettings::SETTING_VIDEOSCREEN_MONITOR));
+ const MONITOR_DETAILS* monitor = GetDisplayDetails(CServiceBroker::GetSettings()->GetString(CSettings::SETTING_VIDEOSCREEN_MONITOR));
if (!monitor)
return false;
diff --git a/xbmc/windows/GUIMediaWindow.cpp b/xbmc/windows/GUIMediaWindow.cpp
index 52ff94dde2..9766ce145d 100644
--- a/xbmc/windows/GUIMediaWindow.cpp
+++ b/xbmc/windows/GUIMediaWindow.cpp
@@ -632,7 +632,7 @@ void CGUIMediaWindow::SortItems(CFileItemList &items)
{
sorting.sortBy = sortBy;
sorting.sortOrder = items.GetProperty(PROPERTY_SORT_ASCENDING).asBoolean() ? SortOrderAscending : SortOrderDescending;
- sorting.sortAttributes = CServiceBroker::GetSettings().GetBool(CSettings::SETTING_FILELISTS_IGNORETHEWHENSORTING) ? SortAttributeIgnoreArticle : SortAttributeNone;
+ sorting.sortAttributes = CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_FILELISTS_IGNORETHEWHENSORTING) ? SortAttributeIgnoreArticle : SortAttributeNone;
// if the sort order is descending, we need to switch the original sort order, as we assume
// in CGUIViewState::AddPlaylistOrder that SortByPlaylistOrder is ascending.
diff --git a/xbmc/windows/GUIWindowFileManager.cpp b/xbmc/windows/GUIWindowFileManager.cpp
index b22812235b..37a8691590 100644
--- a/xbmc/windows/GUIWindowFileManager.cpp
+++ b/xbmc/windows/GUIWindowFileManager.cpp
@@ -481,7 +481,7 @@ bool CGUIWindowFileManager::Update(int iList, const std::string &strDirectory)
std::string strParentPath;
URIUtils::GetParentPath(strDirectory, strParentPath);
- if (strDirectory.empty() && (m_vecItems[iList]->Size() == 0 || CServiceBroker::GetSettings().GetBool(CSettings::SETTING_FILELISTS_SHOWADDSOURCEBUTTONS)))
+ if (strDirectory.empty() && (m_vecItems[iList]->Size() == 0 || CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_FILELISTS_SHOWADDSOURCEBUTTONS)))
{ // add 'add source button'
std::string strLabel = g_localizeStrings.Get(1026);
CFileItemPtr pItem(new CFileItem(strLabel));
@@ -493,7 +493,7 @@ bool CGUIWindowFileManager::Update(int iList, const std::string &strDirectory)
pItem->SetSpecialSort(SortSpecialOnBottom);
m_vecItems[iList]->Add(pItem);
}
- else if (items.IsEmpty() || CServiceBroker::GetSettings().GetBool(CSettings::SETTING_FILELISTS_SHOWPARENTDIRITEMS))
+ else if (items.IsEmpty() || CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_FILELISTS_SHOWPARENTDIRITEMS))
{
CFileItemPtr pItem(new CFileItem(".."));
pItem->SetPath(m_rootDir.IsSource(strDirectory) ? "" : strParentPath);
@@ -1040,7 +1040,7 @@ void CGUIWindowFileManager::OnPopupMenu(int list, int item, bool bContextDriven
if (item >= 0)
{
//The ".." item is not selectable. Take that into account when figuring out if all items are selected
- int notSelectable = CServiceBroker::GetSettings().GetBool(CSettings::SETTING_FILELISTS_SHOWPARENTDIRITEMS) ? 1 : 0;
+ int notSelectable = CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_FILELISTS_SHOWPARENTDIRITEMS) ? 1 : 0;
if (NumSelected(list) < m_vecItems[list]->Size() - notSelectable)
choices.Add(CONTROL_BTNSELECTALL, 188); // SelectAll
if (!pItem->IsParentFolder())
diff --git a/xbmc/windows/GUIWindowLoginScreen.cpp b/xbmc/windows/GUIWindowLoginScreen.cpp
index 367967aef0..5977a26fe8 100644
--- a/xbmc/windows/GUIWindowLoginScreen.cpp
+++ b/xbmc/windows/GUIWindowLoginScreen.cpp
@@ -238,7 +238,7 @@ bool CGUIWindowLoginScreen::OnPopupMenu(int iItem)
if (choice == 2)
{
if (g_passwordManager.CheckLock(profileManager.GetMasterProfile().getLockMode(), profileManager.GetMasterProfile().getLockCode(), 20075))
- g_passwordManager.iMasterLockRetriesLeft = CServiceBroker::GetSettings().GetInt(CSettings::SETTING_MASTERLOCK_MAXRETRIES);
+ g_passwordManager.iMasterLockRetriesLeft = CServiceBroker::GetSettings()->GetInt(CSettings::SETTING_MASTERLOCK_MAXRETRIES);
else // be inconvenient
CApplicationMessenger::GetInstance().PostMsg(TMSG_SHUTDOWN);
diff --git a/xbmc/windows/GUIWindowScreensaver.cpp b/xbmc/windows/GUIWindowScreensaver.cpp
index d4e4129e26..915b95b82b 100644
--- a/xbmc/windows/GUIWindowScreensaver.cpp
+++ b/xbmc/windows/GUIWindowScreensaver.cpp
@@ -71,7 +71,7 @@ bool CGUIWindowScreensaver::OnMessage(CGUIMessage& message)
CServiceBroker::GetWinSystem()->GetGfxContext().CaptureStateBlock();
- const ADDON::BinaryAddonBasePtr addonBase = CServiceBroker::GetBinaryAddonManager().GetInstalledAddonInfo(CServiceBroker::GetSettings().GetString(CSettings::SETTING_SCREENSAVER_MODE), ADDON::ADDON_SCREENSAVER);
+ const ADDON::BinaryAddonBasePtr addonBase = CServiceBroker::GetBinaryAddonManager().GetInstalledAddonInfo(CServiceBroker::GetSettings()->GetString(CSettings::SETTING_SCREENSAVER_MODE), ADDON::ADDON_SCREENSAVER);
if (!addonBase)
return false;
m_addon = new ADDON::CScreenSaver(addonBase);