From e4de37f1bba3bbdf5d0050d683c24226839f1a62 Mon Sep 17 00:00:00 2001 From: "M. Liebmann" Date: Tue, 15 Dec 2015 09:57:53 +0100 Subject: [PATCH] CMoviePlayerGui: Send PLUGIN_PLAYSTATE_LEAVE_ALL to plugin... ...when tv/radio button are pressed on remote control - Set Lua api version to 1.32 --- src/gui/lua/luainstance.cpp | 9 +++++---- src/gui/lua/luainstance.h | 2 +- src/gui/movieplayer.cpp | 4 ++-- src/gui/movieplayer.h | 9 +++++---- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/gui/lua/luainstance.cpp b/src/gui/lua/luainstance.cpp index d3de36800..a0fe82396 100644 --- a/src/gui/lua/luainstance.cpp +++ b/src/gui/lua/luainstance.cpp @@ -277,10 +277,11 @@ static void set_lua_variables(lua_State *L) table_key playstate[] = { - { "NORMAL", CMoviePlayerGui::PLUGIN_PLAYSTATE_NORMAL }, - { "STOP", CMoviePlayerGui::PLUGIN_PLAYSTATE_STOP }, - { "NEXT", CMoviePlayerGui::PLUGIN_PLAYSTATE_NEXT }, - { "PREV", CMoviePlayerGui::PLUGIN_PLAYSTATE_PREV }, + { "NORMAL", CMoviePlayerGui::PLUGIN_PLAYSTATE_NORMAL }, + { "STOP", CMoviePlayerGui::PLUGIN_PLAYSTATE_STOP }, + { "NEXT", CMoviePlayerGui::PLUGIN_PLAYSTATE_NEXT }, + { "PREV", CMoviePlayerGui::PLUGIN_PLAYSTATE_PREV }, + { "LEAVE_ALL", CMoviePlayerGui::PLUGIN_PLAYSTATE_LEAVE_ALL }, { NULL, 0 } }; diff --git a/src/gui/lua/luainstance.h b/src/gui/lua/luainstance.h index 5a96eed88..96e52714e 100644 --- a/src/gui/lua/luainstance.h +++ b/src/gui/lua/luainstance.h @@ -31,7 +31,7 @@ extern "C" { #include "luainstance_helpers.h" #define LUA_API_VERSION_MAJOR 1 -#define LUA_API_VERSION_MINOR 31 +#define LUA_API_VERSION_MINOR 32 /* inspired by Steve Kemp http://www.steve.org.uk/ */ class CLuaInstance diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 0fea9a14b..b028a27f8 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -1171,7 +1171,7 @@ void CMoviePlayerGui::PlayFileLoop(void) menu_ret = menu_return::RETURN_EXIT_ALL; playstate = CMoviePlayerGui::STOPPED; - keyPressed = CMoviePlayerGui::PLUGIN_PLAYSTATE_STOP; + keyPressed = CMoviePlayerGui::PLUGIN_PLAYSTATE_LEAVE_ALL; ClearQueue(); g_RCInput->postMsg(msg, data); } else if (msg == CRCInput::RC_timeout || msg == NeutrinoMessages::EVT_TIMER) { @@ -1194,7 +1194,7 @@ void CMoviePlayerGui::PlayFileLoop(void) printf("CMoviePlayerGui::PlayFile: neutrino handleMsg messages_return::cancel_all\n"); menu_ret = menu_return::RETURN_EXIT_ALL; playstate = CMoviePlayerGui::STOPPED; - keyPressed = CMoviePlayerGui::PLUGIN_PLAYSTATE_STOP; + keyPressed = CMoviePlayerGui::PLUGIN_PLAYSTATE_LEAVE_ALL; ClearQueue(); } else if (msg <= CRCInput::RC_MaxRC ) { diff --git a/src/gui/movieplayer.h b/src/gui/movieplayer.h index 2adda1ae0..ba1f2fadf 100644 --- a/src/gui/movieplayer.h +++ b/src/gui/movieplayer.h @@ -69,10 +69,11 @@ class CMoviePlayerGui : public CMenuTarget enum { - PLUGIN_PLAYSTATE_NORMAL = 0, - PLUGIN_PLAYSTATE_STOP = 1, - PLUGIN_PLAYSTATE_NEXT = 2, - PLUGIN_PLAYSTATE_PREV = 3 + PLUGIN_PLAYSTATE_NORMAL = 0, + PLUGIN_PLAYSTATE_STOP = 1, + PLUGIN_PLAYSTATE_NEXT = 2, + PLUGIN_PLAYSTATE_PREV = 3, + PLUGIN_PLAYSTATE_LEAVE_ALL = 4 }; enum repeat_mode_enum { REPEAT_OFF = 0, REPEAT_TRACK = 1, REPEAT_ALL = 2 };