Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Set direction to forward when starting a slideshow by action.

  • Loading branch information...
commit cc769b0ff16eab55091a4a1156f64a88b9d53c31 1 parent 010b3d5
@ulion authored
View
14 xbmc/pictures/GUIWindowSlideShow.cpp
@@ -388,6 +388,16 @@ void CGUIWindowSlideShow::StartSlideShow()
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)
{
// reset the screensaver if we're in a slideshow
@@ -830,7 +840,10 @@ bool CGUIWindowSlideShow::OnAction(const CAction &action)
if (!m_bPlayingVideo)
{
if (m_bSlideShow)
+ {
+ SetDirection(1);
m_bPause = false;
+ }
PlayVideo();
}
}
@@ -838,6 +851,7 @@ bool CGUIWindowSlideShow::OnAction(const CAction &action)
{
m_bSlideShow = true;
m_bPause = false;
+ SetDirection(1);
if (m_Image[m_iCurrentPic].IsLoaded())
{
CSlideShowPic::DISPLAY_EFFECT effect = GetDisplayEffect(m_iCurrentSlide);
View
1  xbmc/pictures/GUIWindowSlideShow.h
@@ -98,6 +98,7 @@ class CGUIWindowSlideShow : public CGUIWindow
bool IsPaused() const { return m_bPause; }
bool IsShuffled() const { return m_bShuffled; }
int GetDirection() const { return m_iDirection; }
+ void SetDirection(int direction); // -1: rewind, 1: forward
private:
typedef std::set<CStdString> path_set; // set to track which paths we're adding
void AddItems(const CStdString &strPath, path_set *recursivePaths,
Please sign in to comment.
Something went wrong with that request. Please try again.