diff --git a/xbmc/pictures/GUIWindowPictures.cpp b/xbmc/pictures/GUIWindowPictures.cpp index b2ad62d1b6292..fa7ec34adee1a 100644 --- a/xbmc/pictures/GUIWindowPictures.cpp +++ b/xbmc/pictures/GUIWindowPictures.cpp @@ -26,7 +26,6 @@ #include "guilib/GUIComponent.h" #include "guilib/GUIWindowManager.h" #include "input/actions/ActionIDs.h" -#include "interfaces/AnnouncementManager.h" #include "media/MediaLockState.h" #include "messaging/helpers/DialogOKHelper.h" #include "pictures/SlideShowDelegator.h" @@ -343,11 +342,7 @@ bool CGUIWindowPictures::ShowPicture(int iItem, bool startSlideShow) slideShow.StartSlideShow(); else { - CVariant param; - param["player"]["speed"] = 1; - param["player"]["playerid"] = PLAYLIST::TYPE_PICTURE; - CServiceBroker::GetAnnouncementManager()->Announce(ANNOUNCEMENT::Player, "OnPlay", - slideShow.GetCurrentSlide(), param); + slideShow.PlayPicture(); } //! @todo this should trigger some event that should led the window manager to activate another window diff --git a/xbmc/pictures/GUIWindowSlideShow.cpp b/xbmc/pictures/GUIWindowSlideShow.cpp index 02a37130f6a9e..c82f0065ca127 100644 --- a/xbmc/pictures/GUIWindowSlideShow.cpp +++ b/xbmc/pictures/GUIWindowSlideShow.cpp @@ -1317,16 +1317,18 @@ void CGUIWindowSlideShow::RunSlideShow(const std::string &strPath, StartSlideShow(); else { - CVariant param; - param["player"]["speed"] = 0; - param["player"]["playerid"] = PLAYLIST::TYPE_PICTURE; - CServiceBroker::GetAnnouncementManager()->Announce(ANNOUNCEMENT::Player, "OnPlay", - GetCurrentSlide(), param); + PlayPicture(); } CServiceBroker::GetGUI()->GetWindowManager().ActivateWindow(WINDOW_SLIDESHOW); } +void CGUIWindowSlideShow::PlayPicture() +{ + if (m_iCurrentSlide >= 0 && m_iCurrentSlide < static_cast(m_slides.size())) + AnnouncePlayerPlay(m_slides.at(m_iCurrentSlide)); +} + void CGUIWindowSlideShow::AddItems(const std::string &strPath, path_set *recursivePaths, SortBy method, SortOrder order, SortAttribute sortAttributes) { // check whether we've already added this path diff --git a/xbmc/pictures/GUIWindowSlideShow.h b/xbmc/pictures/GUIWindowSlideShow.h index 504c7624d3772..f23cf0b81bc9d 100644 --- a/xbmc/pictures/GUIWindowSlideShow.h +++ b/xbmc/pictures/GUIWindowSlideShow.h @@ -61,6 +61,7 @@ class CGUIWindowSlideShow : public CGUIDialog, public ISlideShowDelegate void GetSlideShowContents(CFileItemList& list) override; std::shared_ptr GetCurrentSlide() override; void StartSlideShow() override; + void PlayPicture() override; bool InSlideShow() const override; int NumSlides() const override; int CurrentSlide() const override; diff --git a/xbmc/pictures/SlideShowDelegator.cpp b/xbmc/pictures/SlideShowDelegator.cpp index 6a453031ebb16..4335dc46137b4 100644 --- a/xbmc/pictures/SlideShowDelegator.cpp +++ b/xbmc/pictures/SlideShowDelegator.cpp @@ -68,6 +68,14 @@ void CSlideShowDelegator::StartSlideShow() } } +void CSlideShowDelegator::PlayPicture() +{ + if (m_delegate) + { + m_delegate->PlayPicture(); + } +} + bool CSlideShowDelegator::InSlideShow() const { if (m_delegate) diff --git a/xbmc/pictures/SlideShowDelegator.h b/xbmc/pictures/SlideShowDelegator.h index 3c8d950b32007..50ff51d885802 100644 --- a/xbmc/pictures/SlideShowDelegator.h +++ b/xbmc/pictures/SlideShowDelegator.h @@ -30,6 +30,7 @@ class CSlideShowDelegator : public ISlideShowDelegate void GetSlideShowContents(CFileItemList& list) override; std::shared_ptr GetCurrentSlide() override; void StartSlideShow() override; + void PlayPicture() override; bool InSlideShow() const override; int NumSlides() const override; int CurrentSlide() const override; diff --git a/xbmc/pictures/interfaces/ISlideShowDelegate.h b/xbmc/pictures/interfaces/ISlideShowDelegate.h index 1e18fa327fde9..e554f4b48dff1 100644 --- a/xbmc/pictures/interfaces/ISlideShowDelegate.h +++ b/xbmc/pictures/interfaces/ISlideShowDelegate.h @@ -27,6 +27,7 @@ class ISlideShowDelegate virtual void GetSlideShowContents(CFileItemList& list) = 0; virtual std::shared_ptr GetCurrentSlide() = 0; virtual void StartSlideShow() = 0; + virtual void PlayPicture() = 0; virtual bool InSlideShow() const = 0; virtual int NumSlides() const = 0; virtual int CurrentSlide() const = 0;