From 558fea4ec466b976cb7feba9ea76ba126ec53ffb Mon Sep 17 00:00:00 2001 From: "M. Liebmann" Date: Tue, 8 Dec 2015 06:15:53 +0100 Subject: [PATCH] CMoviePlayerGui: Creating an possibility to block restoreNeutrino()... ...from an external plugin - This better play playlists with plugins --- src/gui/movieplayer.cpp | 6 +++++- src/gui/movieplayer.h | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index d1ab6dc9f..62e43d07e 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -189,6 +189,7 @@ void CMoviePlayerGui::Init(void) filelist_it = filelist.end(); keyPressed = CMoviePlayerGui::PLUGIN_PLAYSTATE_NORMAL; isLuaPlay = false; + blockedFromPlugin = false; } void CMoviePlayerGui::cutNeutrino() @@ -766,7 +767,10 @@ void CMoviePlayerGui::PlayFile(void) PlayFileStart(); mutex.unlock(); PlayFileLoop(); - PlayFileEnd(repeat_mode == REPEAT_OFF); + bool repeat = (repeat_mode == REPEAT_OFF); + if (isLuaPlay) + repeat = (!blockedFromPlugin); + PlayFileEnd(repeat); } bool CMoviePlayerGui::PlayFileStart(void) diff --git a/src/gui/movieplayer.h b/src/gui/movieplayer.h index 93e58e8b0..2adda1ae0 100644 --- a/src/gui/movieplayer.h +++ b/src/gui/movieplayer.h @@ -90,6 +90,7 @@ class CMoviePlayerGui : public CMenuTarget CMoviePlayerGui::state playstate; int keyPressed; bool isLuaPlay; + bool blockedFromPlugin; int speed; int startposition; int position; @@ -161,7 +162,6 @@ class CMoviePlayerGui : public CMenuTarget void PlayFileLoop(); void PlayFileEnd(bool restore = true); void cutNeutrino(); - void restoreNeutrino(); void showHelpTS(void); void callInfoViewer(); @@ -221,6 +221,9 @@ class CMoviePlayerGui : public CMenuTarget int getKeyPressed() { return keyPressed; }; size_t GetReadCount(); std::string GetFile() { return pretty_name; } + void restoreNeutrino(); + void setBlockedFromPlugin(bool b) { blockedFromPlugin = b; }; + bool getBlockedFromPlugin() { return blockedFromPlugin; }; }; #endif