Skip to content

Commit

Permalink
[setting] hunt missing setting id constants
Browse files Browse the repository at this point in the history
  • Loading branch information
xhaggi committed Aug 12, 2015
1 parent 184261c commit ecd263b
Show file tree
Hide file tree
Showing 18 changed files with 66 additions and 48 deletions.
4 changes: 2 additions & 2 deletions xbmc/Application.cpp
Expand Up @@ -1495,7 +1495,7 @@ bool CApplication::OnSettingUpdate(CSetting* &setting, const char *oldSettingId,
}
#endif
#if defined(TARGET_ANDROID)
if (settingId == "videoplayer.usestagefright")
if (settingId == CSettings::SETTING_VIDEOPLAYER_USESTAGEFRIGHT)
{
CSettingBool *usestagefright = (CSettingBool*)setting;
return usestagefright->SetValue(false);
Expand Down Expand Up @@ -2805,7 +2805,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 (g_graphicsContext.IsFullScreenVideo() && !m_pPlayer->IsPausedPlayback() && g_renderManager.IsVideoLayer())
fps = CSettings::Get().GetInt("videoplayer.limitguiupdate");
fps = CSettings::Get().GetInt(CSettings::SETTING_VIDEOPLAYER_LIMITGUIUPDATE);
#endif

unsigned int now = XbmcThreads::SystemClockMillis();
Expand Down
6 changes: 3 additions & 3 deletions xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp
Expand Up @@ -263,7 +263,7 @@ CDVDVideoCodec* CDVDFactoryCodec::CreateVideoCodec(CDVDStreamInfo &hint, const C
#endif

#if defined(TARGET_ANDROID)
if (!hint.software && CSettings::Get().GetBool("videoplayer.usemediacodec"))
if (!hint.software && CSettings::Get().GetBool(CSettings::SETTING_VIDEOPLAYER_USEMEDIACODEC))
{
switch(hint.codec)
{
Expand Down Expand Up @@ -292,7 +292,7 @@ CDVDVideoCodec* CDVDFactoryCodec::CreateVideoCodec(CDVDStreamInfo &hint, const C
#endif

#if defined(HAS_MMAL)
if (CSettings::Get().GetBool("videoplayer.usemmal") && !hint.software )
if (CSettings::Get().GetBool(CSettings::SETTING_VIDEOPLAYER_USEMMAL) && !hint.software )
{
if (hint.codec == AV_CODEC_ID_H264 || hint.codec == AV_CODEC_ID_H263 || hint.codec == AV_CODEC_ID_MPEG4 ||
hint.codec == AV_CODEC_ID_MPEG1VIDEO || hint.codec == AV_CODEC_ID_MPEG2VIDEO ||
Expand All @@ -305,7 +305,7 @@ CDVDVideoCodec* CDVDFactoryCodec::CreateVideoCodec(CDVDStreamInfo &hint, const C
#endif

#if defined(HAS_LIBSTAGEFRIGHT)
if (!hint.software && CSettings::Get().GetBool("videoplayer.usestagefright"))
if (!hint.software && CSettings::Get().GetBool(CSettings::SETTING_VIDEOPLAYER_USESTAGEFRIGHT))
{
switch(hint.codec)
{
Expand Down
2 changes: 1 addition & 1 deletion xbmc/epg/EpgContainer.cpp
Expand Up @@ -262,7 +262,7 @@ bool CEpgContainer::MarkTablesForPersist(void)
/* Set m_bMarkForPersist to persist tables on the next Process() run but only
if epg.ignoredbforclient is set, otherwise persistAll does already persisting. */
CSingleLock lock(m_critSection);
return m_bMarkForPersist = CSettings::Get().GetBool("epg.ignoredbforclient");
return m_bMarkForPersist = CSettings::Get().GetBool(CSettings::SETTING_EPG_IGNOREDBFORCLIENT);
}

bool CEpgContainer::PersistTables(void)
Expand Down
4 changes: 2 additions & 2 deletions xbmc/network/EventClient.h
Expand Up @@ -155,8 +155,8 @@ namespace EVENTCLIENT

void RefreshSettings()
{
m_iRepeatDelay = CSettings::Get().GetInt("services.esinitialdelay");
m_iRepeatSpeed = CSettings::Get().GetInt("services.escontinuousdelay");
m_iRepeatDelay = CSettings::Get().GetInt(CSettings::SETTING_SERVICES_ESINITIALDELAY);
m_iRepeatSpeed = CSettings::Get().GetInt(CSettings::SETTING_SERVICES_ESCONTINUOUSDELAY);
}

SOCKETS::CAddress& Address()
Expand Down
4 changes: 2 additions & 2 deletions xbmc/network/upnp/UPnP.cpp
Expand Up @@ -636,7 +636,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(),
CSettings::Get().GetInt("services.webserverport"),
CSettings::Get().GetInt(CSettings::SETTING_SERVICES_WEBSERVERPORT),
"/").ToString();

device->m_ModelName = "Kodi";
Expand Down Expand Up @@ -719,7 +719,7 @@ CUPnP::CreateRenderer(int port /* = 0 */)

device->m_PresentationURL =
NPT_HttpUrl(m_IP.c_str(),
CSettings::Get().GetInt("services.webserverport"),
CSettings::Get().GetInt(CSettings::SETTING_SERVICES_WEBSERVERPORT),
"/").ToString();
device->m_ModelName = "Kodi";
device->m_ModelNumber = CSysInfo::GetVersion().c_str();
Expand Down
2 changes: 1 addition & 1 deletion xbmc/network/upnp/UPnPInternal.cpp
Expand Up @@ -620,7 +620,7 @@ BuildObject(CFileItem& item,
// to look for external subtitles
if (upnp_server != NULL && item.IsVideo() &&
(upnp_service == UPnPPlayer || upnp_service == UPnPRenderer ||
CSettings::Get().GetBool("services.upnplookforexternalsubtitles")))
CSettings::Get().GetBool(CSettings::SETTING_SERVICES_UPNPLOOKFOREXTERNALSUBTITLES)))
{
// find any available external subtitles
std::vector<std::string> filenames;
Expand Down
2 changes: 1 addition & 1 deletion xbmc/network/upnp/UPnPServer.cpp
Expand Up @@ -165,7 +165,7 @@ CUPnPServer::PropagateUpdates()
string buffer;
map<string,pair<bool, unsigned long> >::iterator itr;

if (m_scanning || !CSettings::Get().GetBool("services.upnpannounce"))
if (m_scanning || !CSettings::Get().GetBool(CSettings::SETTING_SERVICES_UPNPANNOUNCE))
return;

NPT_CHECK_LABEL(FindServiceById("urn:upnp-org:serviceId:ContentDirectory", service), failed);
Expand Down
14 changes: 7 additions & 7 deletions xbmc/osx/XBMCHelper.cpp
Expand Up @@ -98,7 +98,7 @@ bool XBMCHelper::OnSettingChanging(const CSetting *setting)
return false;

const std::string &settingId = setting->GetId();
if (settingId == "input.appleremotemode")
if (settingId == CSettings::SETTING_INPUT_APPLEREMOTEMODE)
{
int remoteMode = ((CSettingInt*)setting)->GetValue();

Expand Down Expand Up @@ -132,7 +132,7 @@ bool XBMCHelper::OnSettingChanging(const CSetting *setting)
}
}

if (settingId == "input.appleremotealwayson")
if (settingId == CSettings::SETTING_INPUT_APPLEREMOTEALWAYSON)
{
HandleLaunchAgent();
}
Expand Down Expand Up @@ -175,9 +175,9 @@ void XBMCHelper::Configure()

// Read the new configuration.
m_errorStarting = false;
m_mode = CSettings::Get().GetInt("input.appleremotemode");
m_sequenceDelay = CSettings::Get().GetInt("input.appleremotesequencetime");
m_port = CSettings::Get().GetInt("services.esport");
m_mode = CSettings::Get().GetInt(CSettings::SETTING_INPUT_APPLEREMOTEMODE);
m_sequenceDelay = CSettings::Get().GetInt(CSettings::SETTING_INPUT_APPLEREMOTESEQUENCETIME);
m_port = CSettings::Get().GetInt(CSettings::SETTING_SERVICES_ESPORT);


// Don't let it enable if sofa control or remote buddy is around.
Expand All @@ -188,7 +188,7 @@ void XBMCHelper::Configure()
m_errorStarting = true;

m_mode = APPLE_REMOTE_DISABLED;
CSettings::Get().SetInt("input.appleremotemode", APPLE_REMOTE_DISABLED);
CSettings::Get().SetInt(CSettings::SETTING_INPUT_APPLEREMOTEMODE, APPLE_REMOTE_DISABLED);
}

// New configuration.
Expand Down Expand Up @@ -263,7 +263,7 @@ void XBMCHelper::Configure()
void XBMCHelper::HandleLaunchAgent()
{
int oldAlwaysOn = m_alwaysOn;
m_alwaysOn = CSettings::Get().GetBool("input.appleremotealwayson");
m_alwaysOn = CSettings::Get().GetBool(CSettings::SETTING_INPUT_APPLEREMOTEALWAYSON);

// Installation/uninstallation.
if (oldAlwaysOn == false && m_alwaysOn == true)
Expand Down
2 changes: 1 addition & 1 deletion xbmc/pictures/GUIViewStatePictures.cpp
Expand Up @@ -73,7 +73,7 @@ std::string CGUIViewStateWindowPictures::GetLockType()
std::string CGUIViewStateWindowPictures::GetExtensions()
{
std::string extensions = g_advancedSettings.m_pictureExtensions;
if (CSettings::Get().GetBool("pictures.showvideos"))
if (CSettings::Get().GetBool(CSettings::SETTING_PICTURES_SHOWVIDEOS))
extensions += "|" + g_advancedSettings.m_videoExtensions;

return extensions;
Expand Down
16 changes: 8 additions & 8 deletions xbmc/pictures/GUIWindowPictures.cpp
Expand Up @@ -139,7 +139,7 @@ bool CGUIWindowPictures::OnMessage(CGUIMessage& message)
}
else if (iControl == CONTROL_SHUFFLE)
{
CSettings::Get().ToggleBool("slideshow.shuffle");
CSettings::Get().ToggleBool(CSettings::SETTING_SLIDESHOW_SHUFFLE);
CSettings::Get().Save();
}
else if (m_viewControl.HasControl(iControl)) // list/thumb control
Expand All @@ -151,7 +151,7 @@ bool CGUIWindowPictures::OnMessage(CGUIMessage& message)
if (iAction == ACTION_DELETE_ITEM)
{
// is delete allowed?
if (CSettings::Get().GetBool("filelists.allowfiledeletion"))
if (CSettings::Get().GetBool(CSettings::SETTING_FILELISTS_ALLOWFILEDELETION))
OnDeleteItem(iItem);
else
return false;
Expand All @@ -178,7 +178,7 @@ void CGUIWindowPictures::UpdateButtons()
CGUIMediaWindow::UpdateButtons();

// Update the shuffle button
SET_CONTROL_SELECTED(GetID(), CONTROL_SHUFFLE, CSettings::Get().GetBool("slideshow.shuffle"));
SET_CONTROL_SELECTED(GetID(), CONTROL_SHUFFLE, CSettings::Get().GetBool(CSettings::SETTING_SLIDESHOW_SHUFFLE));

// check we can slideshow or recursive slideshow
int nFolders = m_vecItems->GetFolderCount();
Expand Down Expand Up @@ -212,7 +212,7 @@ void CGUIWindowPictures::OnPrepareFileItems(CFileItemList& items)
if (StringUtils::EqualsNoCase(items[i]->GetLabel(), "folder.jpg"))
items.Remove(i);

if (items.GetFolderCount()==items.Size() || !CSettings::Get().GetBool("pictures.usetags"))
if (items.GetFolderCount()==items.Size() || !CSettings::Get().GetBool(CSettings::SETTING_PICTURES_USETAGS))
return;

// Start the music info loader thread
Expand Down Expand Up @@ -265,7 +265,7 @@ bool CGUIWindowPictures::Update(const std::string &strDirectory, bool updateFilt
return false;

m_vecItems->SetArt("thumb", "");
if (CSettings::Get().GetBool("pictures.generatethumbs"))
if (CSettings::Get().GetBool(CSettings::SETTING_PICTURES_GENERATETHUMBS))
m_thumbLoader.Load(*m_vecItems);

CPictureThumbLoader thumbLoader;
Expand Down Expand Up @@ -343,7 +343,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() || (
CSettings::Get().GetBool("pictures.showvideos") &&
CSettings::Get().GetBool(CSettings::SETTING_PICTURES_SHOWVIDEOS) &&
pItem->IsVideo())))
{
pSlideShow->Add(pItem.get());
Expand Down Expand Up @@ -408,7 +408,7 @@ void CGUIWindowPictures::OnSlideShowRecursive(const std::string &strPicture)

SortDescription sorting = m_guiState->GetSortMethod();
pSlideShow->RunSlideShow(strPicture, true,
CSettings::Get().GetBool("slideshow.shuffle"),false,
CSettings::Get().GetBool(CSettings::SETTING_SLIDESHOW_SHUFFLE),false,
"", true,
sorting.sortBy, sorting.sortOrder, sorting.sortAttributes,
strExtensions);
Expand Down Expand Up @@ -484,7 +484,7 @@ void CGUIWindowPictures::GetContextButtons(int itemNumber, CContextButtons &butt

if (!m_thumbLoader.IsLoading())
buttons.Add(CONTEXT_BUTTON_REFRESH_THUMBS, 13315); // Create Thumbnails
if (CSettings::Get().GetBool("filelists.allowfiledeletion") && !item->IsReadOnly())
if (CSettings::Get().GetBool(CSettings::SETTING_FILELISTS_ALLOWFILEDELETION) && !item->IsReadOnly())
{
buttons.Add(CONTEXT_BUTTON_DELETE, 117);
buttons.Add(CONTEXT_BUTTON_RENAME, 118);
Expand Down
8 changes: 4 additions & 4 deletions xbmc/pictures/GUIWindowSlideShow.cpp
Expand Up @@ -101,7 +101,7 @@ void CBackgroundPicLoader::Process()
if (m_pCallback)
{
unsigned int start = XbmcThreads::SystemClockMillis();
CBaseTexture* texture = CTexture::LoadFromFile(m_strFileName, m_maxWidth, m_maxHeight, CSettings::Get().GetBool("pictures.useexifrotation"));
CBaseTexture* texture = CTexture::LoadFromFile(m_strFileName, m_maxWidth, m_maxHeight, CSettings::Get().GetBool(CSettings::SETTING_PICTURES_USEEXIFROTATION));
totalTime += XbmcThreads::SystemClockMillis() - start;
count++;
// tell our parent
Expand Down Expand Up @@ -923,7 +923,7 @@ bool CGUIWindowSlideShow::OnMessage(CGUIMessage& message)
{
case GUI_MSG_WINDOW_INIT:
{
m_Resolution = (RESOLUTION) CSettings::Get().GetInt("pictures.displayresolution");
m_Resolution = (RESOLUTION) CSettings::Get().GetInt(CSettings::SETTING_PICTURES_DISPLAYRESOLUTION);

//FIXME: Use GUI resolution for now
if (0 /*m_Resolution != CDisplaySettings::Get().GetCurrentResolution() && m_Resolution != INVALID && m_Resolution!=AUTORES*/)
Expand Down Expand Up @@ -1131,7 +1131,7 @@ bool CGUIWindowSlideShow::PlayVideo()
CSlideShowPic::DISPLAY_EFFECT CGUIWindowSlideShow::GetDisplayEffect(int iSlideNumber) const
{
if (m_bSlideShow && !m_bPause && !m_slides->Get(iSlideNumber)->IsVideo())
return CSettings::Get().GetBool("slideshow.displayeffects") ? CSlideShowPic::EFFECT_RANDOM : CSlideShowPic::EFFECT_NONE;
return CSettings::Get().GetBool(CSettings::SETTING_SLIDESHOW_DISPLAYEFFECTS) ? CSlideShowPic::EFFECT_RANDOM : CSlideShowPic::EFFECT_NONE;
else
return CSlideShowPic::EFFECT_NO_TIMEOUT;
}
Expand Down Expand Up @@ -1237,7 +1237,7 @@ void CGUIWindowSlideShow::RunSlideShow(const std::string &strPath,
bRandom = bNotRandom = false;

// NotRandom overrides the window setting
if ((!bNotRandom && CSettings::Get().GetBool("slideshow.shuffle")) || bRandom)
if ((!bNotRandom && CSettings::Get().GetBool(CSettings::SETTING_SLIDESHOW_SHUFFLE)) || bRandom)
Shuffle();

if (!beginSlidePath.empty())
Expand Down
2 changes: 1 addition & 1 deletion xbmc/pictures/Picture.cpp
Expand Up @@ -290,7 +290,7 @@ bool CPicture::CreateTiledThumb(const std::vector<std::string> &files, const std
int y = i / num_across;
// load in the image
unsigned int width = tile_width - 2*tile_gap, height = tile_height - 2*tile_gap;
CBaseTexture *texture = CTexture::LoadFromFile(files[i], width, height, CSettings::Get().GetBool("pictures.useexifrotation"), true);
CBaseTexture *texture = CTexture::LoadFromFile(files[i], width, height, CSettings::Get().GetBool(CSettings::SETTING_PICTURES_USEEXIFROTATION), true);
if (texture && texture->GetWidth() && texture->GetHeight())
{
GetScale(texture->GetWidth(), texture->GetHeight(), width, height);
Expand Down
2 changes: 1 addition & 1 deletion xbmc/pictures/PictureInfoLoader.cpp
Expand Up @@ -42,7 +42,7 @@ void CPictureInfoLoader::OnLoaderStart()
m_mapFileItems->SetFastLookup(true);

m_tagReads = 0;
m_loadTags = CSettings::Get().GetBool("pictures.usetags");
m_loadTags = CSettings::Get().GetBool(CSettings::SETTING_PICTURES_USETAGS);

if (m_pProgressCallback)
m_pProgressCallback->SetProgressMax(m_pVecItems->GetFileCount());
Expand Down
2 changes: 1 addition & 1 deletion xbmc/pictures/PictureThumbLoader.cpp
Expand Up @@ -92,7 +92,7 @@ bool CPictureThumbLoader::LoadItemCached(CFileItem* pItem)
{
thumb = thumbURL;
}
else if (CSettings::Get().GetBool("myvideos.extractthumb") && CSettings::Get().GetBool("myvideos.extractflags"))
else if (CSettings::Get().GetBool(CSettings::SETTING_MYVIDEOS_EXTRACTTHUMB) && CSettings::Get().GetBool(CSettings::SETTING_MYVIDEOS_EXTRACTFLAGS))
{
CFileItem item(*pItem);
CThumbExtractor* extract = new CThumbExtractor(item, pItem->GetPath(), true, thumbURL);
Expand Down
10 changes: 5 additions & 5 deletions xbmc/pictures/SlideShowPicture.cpp
Expand Up @@ -127,7 +127,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*CSettings::Get().GetInt("slideshow.staytime"), 3.0f);
fadeTime = std::min(0.2f*CSettings::Get().GetInt(CSettings::SETTING_SLIDESHOW_STAYTIME), 3.0f);
m_transistionStart.length = (int)(g_graphicsContext.GetFPS() * fadeTime); // transition time in frames
m_transistionEnd.type = transEffect;
m_transistionEnd.length = m_transistionStart.length;
Expand Down Expand Up @@ -163,7 +163,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 = max((int)(g_graphicsContext.GetFPS() * CSettings::Get().GetInt("slideshow.staytime")), 1);
int iFrames = max((int)(g_graphicsContext.GetFPS() * CSettings::Get().GetInt(CSettings::SETTING_SLIDESHOW_STAYTIME)), 1);
if (m_displayEffect == EFFECT_PANORAMA)
{
RESOLUTION_INFO res = g_graphicsContext.GetResInfo();
Expand Down Expand Up @@ -704,7 +704,7 @@ void CSlideShowPic::Rotate(float fRotateAngle, bool immediate /* = false */)
m_transistionTemp.length = IMMEDIATE_TRANSISTION_TIME;
m_fTransistionAngle = (float)fRotateAngle / (float)m_transistionTemp.length;
// reset the timer
m_transistionEnd.start = m_iCounter + m_transistionStart.length + (int)(g_graphicsContext.GetFPS() * CSettings::Get().GetInt("slideshow.staytime"));
m_transistionEnd.start = m_iCounter + m_transistionStart.length + (int)(g_graphicsContext.GetFPS() * CSettings::Get().GetInt(CSettings::SETTING_SLIDESHOW_STAYTIME));
}

void CSlideShowPic::Zoom(float fZoom, bool immediate /* = false */)
Expand All @@ -721,7 +721,7 @@ void CSlideShowPic::Zoom(float fZoom, bool immediate /* = false */)
m_transistionTemp.length = IMMEDIATE_TRANSISTION_TIME;
m_fTransistionZoom = (fZoom - m_fZoomAmount) / (float)m_transistionTemp.length;
// reset the timer
m_transistionEnd.start = m_iCounter + m_transistionStart.length + (int)(g_graphicsContext.GetFPS() * CSettings::Get().GetInt("slideshow.staytime"));
m_transistionEnd.start = m_iCounter + m_transistionStart.length + (int)(g_graphicsContext.GetFPS() * CSettings::Get().GetInt(CSettings::SETTING_SLIDESHOW_STAYTIME));
// turn off the render effects until we're back down to normal zoom
m_bNoEffect = true;
}
Expand All @@ -731,7 +731,7 @@ void CSlideShowPic::Move(float fDeltaX, float fDeltaY)
m_fZoomLeft += fDeltaX;
m_fZoomTop += fDeltaY;
// reset the timer
// m_transistionEnd.start = m_iCounter + m_transistionStart.length + (int)(g_graphicsContext.GetFPS() * CSettings::Get().GetInt("slideshow.staytime"));
// m_transistionEnd.start = m_iCounter + m_transistionStart.length + (int)(g_graphicsContext.GetFPS() * CSettings::Get().GetInt(CSettings::SETTING_SLIDESHOW_STAYTIME));
}

void CSlideShowPic::Render()
Expand Down

0 comments on commit ecd263b

Please sign in to comment.