From c4197fb5f3ffa0046f53ba36796c798fb0822f3f Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Fri, 16 Oct 2015 14:53:35 +0300 Subject: [PATCH] gui/movieplayer.cpp: allow getInstance() to return background instance --- src/gui/movieplayer.cpp | 4 ++-- src/gui/movieplayer.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 559a35afc..f45bda4ec 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -85,7 +85,7 @@ cPlayback *CMoviePlayerGui::playback; CMovieBrowser* CMoviePlayerGui::moviebrowser; CBookmarkManager * CMoviePlayerGui::bookmarkmanager; -CMoviePlayerGui& CMoviePlayerGui::getInstance() +CMoviePlayerGui& CMoviePlayerGui::getInstance(bool background) { OpenThreads::ScopedLock m_lock(bgmutex); if (!instance_mp ) @@ -94,7 +94,7 @@ CMoviePlayerGui& CMoviePlayerGui::getInstance() instance_bg = new CMoviePlayerGui(); printf("[neutrino CMoviePlayerGui] Instance created...\n"); } - return *instance_mp; + return background ? *instance_bg : *instance_mp; } CMoviePlayerGui::CMoviePlayerGui() diff --git a/src/gui/movieplayer.h b/src/gui/movieplayer.h index 56d4169b2..ec11ad8ba 100644 --- a/src/gui/movieplayer.h +++ b/src/gui/movieplayer.h @@ -195,7 +195,7 @@ class CMoviePlayerGui : public CMenuTarget public: ~CMoviePlayerGui(); - static CMoviePlayerGui& getInstance(); + static CMoviePlayerGui& getInstance(bool background = false); int exec(CMenuTarget* parent, const std::string & actionKey); bool Playing() { return playing; };