Skip to content

Commit

Permalink
added: allow passing screensaver to activate as parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
notspiff committed May 12, 2015
1 parent c29f373 commit b8d0fb5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions xbmc/Application.cpp
Expand Up @@ -3771,7 +3771,8 @@ void CApplication::CheckScreenSaverAndDPMS()
// activate the screensaver.
// if forceType is true, we ignore the various conditions that can alter
// the type of screensaver displayed
void CApplication::ActivateScreenSaver(bool forceType /*= false */)
void CApplication::ActivateScreenSaver(bool forceType /*= false */,
std::string addonID /* = "" */)
{
if (m_pPlayer->IsPlayingAudio() && CSettings::Get().GetBool("screensaver.usemusicvisinstead") && !CSettings::Get().GetString("musicplayer.visualisation").empty())
{ // just activate the visualisation if user toggled the usemusicvisinstead option
Expand All @@ -3781,9 +3782,12 @@ void CApplication::ActivateScreenSaver(bool forceType /*= false */)

m_bScreenSave = true;

if (addonID.empty())
addonID = CSettings::Get().GetString("screensaver.mode");

// Get Screensaver Mode
m_screenSaver.reset();
if (!CAddonMgr::Get().GetAddon(CSettings::Get().GetString("screensaver.mode"), m_screenSaver))
if (!CAddonMgr::Get().GetAddon(addonID, m_screenSaver))
m_screenSaver.reset(new CScreenSaver(""));

CAnnouncementManager::Get().Announce(GUI, "xbmc", "OnScreensaverActivated");
Expand Down Expand Up @@ -3811,7 +3815,7 @@ void CApplication::ActivateScreenSaver(bool forceType /*= false */)
else if (m_screenSaver->ID().empty())
return;
else
g_windowManager.ActivateWindow(WINDOW_SCREENSAVER);
g_windowManager.ActivateWindow(WINDOW_SCREENSAVER, addonID);
}

void CApplication::CheckShutdown()
Expand Down
2 changes: 1 addition & 1 deletion xbmc/Application.h
Expand Up @@ -195,7 +195,7 @@ class CApplication : public CXBApplicationEx, public IPlayerCallback, public IMs
// Checks whether the screensaver and / or DPMS should become active.
void CheckScreenSaverAndDPMS();
void CheckPlayingProgress();
void ActivateScreenSaver(bool forceType = false);
void ActivateScreenSaver(bool forceType = false, std::string addonID="");
bool SetupNetwork();
void CloseNetworkShares();

Expand Down

0 comments on commit b8d0fb5

Please sign in to comment.