Skip to content

Commit

Permalink
added: slideshow.ispaused and slideshow.israndom boolean infolabels
Browse files Browse the repository at this point in the history
  • Loading branch information
mkortstiege committed Aug 18, 2011
1 parent a3c804b commit ebbad80
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 0 deletions.
20 changes: 20 additions & 0 deletions xbmc/GUIInfoManager.cpp
Expand Up @@ -506,6 +506,9 @@ const infomap playlist[] = {{ "length", PLAYLIST_LENGTH },
{ "isrepeat", PLAYLIST_ISREPEAT },
{ "isrepeatone", PLAYLIST_ISREPEATONE }};

const infomap slideshow[] = {{ "ispaused", SLIDESHOW_ISPAUSED },
{ "israndom", SLIDESHOW_ISRANDOM }};

CGUIInfoManager::Property::Property(const CStdString &property, const CStdString &parameters)
: name(property)
{
Expand Down Expand Up @@ -794,7 +797,14 @@ int CGUIInfoManager::TranslateSingleString(const CStdString &strCondition)
}
}
else if (cat.name == "slideshow")
{
for (size_t i = 0; i < sizeof(slideshow) / sizeof(infomap); i++)
{
if (prop.name == slideshow[i].str)
return slideshow[i].val;
}
return CPictureInfoTag::TranslateString(prop.name);
}
else if (cat.name == "container")
{
for (size_t i = 0; i < sizeof(mediacontainer) / sizeof(infomap); i++) // these ones don't have or need an id
Expand Down Expand Up @@ -1933,6 +1943,16 @@ bool CGUIInfoManager::GetBool(int condition1, int contextWindow, const CGUIListI
}
}
}
else if (condition == SLIDESHOW_ISPAUSED)
{
CGUIWindowSlideShow *slideShow = (CGUIWindowSlideShow *)g_windowManager.GetWindow(WINDOW_SLIDESHOW);
bReturn = (slideShow && slideShow->IsPaused());
}
else if (condition == SLIDESHOW_ISRANDOM)
{
CGUIWindowSlideShow *slideShow = (CGUIWindowSlideShow *)g_windowManager.GetWindow(WINDOW_SLIDESHOW);
bReturn = (slideShow && slideShow->IsShuffled());
}
else if (g_application.IsPlaying())
{
switch (condition)
Expand Down
3 changes: 3 additions & 0 deletions xbmc/GUIInfoManager.h
Expand Up @@ -390,6 +390,9 @@ namespace INFO
#define SYSTEM_CAN_HIBERNATE 752
#define SYSTEM_CAN_REBOOT 753

#define SLIDESHOW_ISPAUSED 800
#define SLIDESHOW_ISRANDOM 801

#define SLIDE_INFO_START 900
#define SLIDE_INFO_END 980

Expand Down
2 changes: 2 additions & 0 deletions xbmc/pictures/GUIWindowSlideShow.cpp
Expand Up @@ -159,6 +159,7 @@ void CGUIWindowSlideShow::Reset()
{
g_infoManager.SetShowCodec(false);
m_bSlideShow = false;
m_bShuffled = false;
m_bPause = false;
m_bPlayingVideo = false;
m_bErrorMessage = false;
Expand Down Expand Up @@ -829,6 +830,7 @@ void CGUIWindowSlideShow::Shuffle()
m_slides->Randomize();
m_iCurrentSlide = 0;
m_iNextSlide = 1;
m_bShuffled = true;
}

int CGUIWindowSlideShow::NumSlides() const
Expand Down
3 changes: 3 additions & 0 deletions xbmc/pictures/GUIWindowSlideShow.h
Expand Up @@ -90,6 +90,8 @@ class CGUIWindowSlideShow : public CGUIWindow
int NumSlides() const;
int CurrentSlide() const;
void Shuffle();
bool IsPaused() const { return m_bPause; }
bool IsShuffled() const { return m_bShuffled; }
private:
typedef std::set<CStdString> path_set; // set to track which paths we're adding
void AddItems(const CStdString &strPath, path_set *recursivePaths,
Expand All @@ -109,6 +111,7 @@ class CGUIWindowSlideShow : public CGUIWindow
int m_iRotate;
int m_iZoomFactor;

bool m_bShuffled;
bool m_bSlideShow;
bool m_bScreensaver;
bool m_bPause;
Expand Down

0 comments on commit ebbad80

Please sign in to comment.