Skip to content

Commit

Permalink
Set direction to forward when starting a slideshow by action.
Browse files Browse the repository at this point in the history
  • Loading branch information
ulion committed May 2, 2013
1 parent 010b3d5 commit cc769b0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
14 changes: 14 additions & 0 deletions xbmc/pictures/GUIWindowSlideShow.cpp
Expand Up @@ -388,6 +388,16 @@ void CGUIWindowSlideShow::StartSlideShow()
AnnouncePlayerPlay(m_slides->Get(m_iCurrentSlide)); AnnouncePlayerPlay(m_slides->Get(m_iCurrentSlide));
} }


void CGUIWindowSlideShow::SetDirection(int direction)
{
direction = direction >= 0 ? 1 : -1;
if (m_iDirection != direction)
{
m_iDirection = direction;
m_iNextSlide = GetNextSlide();
}
}

void CGUIWindowSlideShow::Process(unsigned int currentTime, CDirtyRegionList &regions) void CGUIWindowSlideShow::Process(unsigned int currentTime, CDirtyRegionList &regions)
{ {
// reset the screensaver if we're in a slideshow // reset the screensaver if we're in a slideshow
Expand Down Expand Up @@ -830,14 +840,18 @@ bool CGUIWindowSlideShow::OnAction(const CAction &action)
if (!m_bPlayingVideo) if (!m_bPlayingVideo)
{ {
if (m_bSlideShow) if (m_bSlideShow)
{
SetDirection(1);
m_bPause = false; m_bPause = false;
}
PlayVideo(); PlayVideo();
} }
} }
else if (!m_bSlideShow || m_bPause) else if (!m_bSlideShow || m_bPause)
{ {
m_bSlideShow = true; m_bSlideShow = true;
m_bPause = false; m_bPause = false;
SetDirection(1);
if (m_Image[m_iCurrentPic].IsLoaded()) if (m_Image[m_iCurrentPic].IsLoaded())
{ {
CSlideShowPic::DISPLAY_EFFECT effect = GetDisplayEffect(m_iCurrentSlide); CSlideShowPic::DISPLAY_EFFECT effect = GetDisplayEffect(m_iCurrentSlide);
Expand Down
1 change: 1 addition & 0 deletions xbmc/pictures/GUIWindowSlideShow.h
Expand Up @@ -98,6 +98,7 @@ class CGUIWindowSlideShow : public CGUIWindow
bool IsPaused() const { return m_bPause; } bool IsPaused() const { return m_bPause; }
bool IsShuffled() const { return m_bShuffled; } bool IsShuffled() const { return m_bShuffled; }
int GetDirection() const { return m_iDirection; } int GetDirection() const { return m_iDirection; }
void SetDirection(int direction); // -1: rewind, 1: forward
private: private:
typedef std::set<CStdString> path_set; // set to track which paths we're adding typedef std::set<CStdString> path_set; // set to track which paths we're adding
void AddItems(const CStdString &strPath, path_set *recursivePaths, void AddItems(const CStdString &strPath, path_set *recursivePaths,
Expand Down

0 comments on commit cc769b0

Please sign in to comment.