From b6f1963f2c5299f20235e43f83d96e6d881917df Mon Sep 17 00:00:00 2001 From: "M. Liebmann" Date: Wed, 10 Sep 2014 21:13:29 +0200 Subject: [PATCH] CLuaInstance: Add parameter info1/info2 to PlayFile() - This parameter display in info viewer instead of epg data --- src/gui/luainstance.cpp | 10 +++++++++- src/gui/movieplayer.cpp | 4 +++- src/gui/movieplayer.h | 3 ++- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/gui/luainstance.cpp b/src/gui/luainstance.cpp index 97a8afd01..94f98ebb9 100644 --- a/src/gui/luainstance.cpp +++ b/src/gui/luainstance.cpp @@ -612,14 +612,22 @@ int CLuaInstance::PlayFile(lua_State *L) return 0; } const char *title; + const char *info1 = ""; + const char *info2 = ""; const char *fname; title = luaL_checkstring(L, 2); fname = luaL_checkstring(L, 3); + if (numargs > 3) + info1 = luaL_checkstring(L, 4); + if (numargs > 4) + info2 = luaL_checkstring(L, 5); printf("CLuaInstance::%s: title %s file %s\n", __func__, title, fname); std::string st(title); + std::string si1(info1); + std::string si2(info2); std::string sf(fname); - CMoviePlayerGui::getInstance().SetFile(st, sf); + CMoviePlayerGui::getInstance().SetFile(st, sf, si1, si2); CMoviePlayerGui::getInstance().exec(NULL, "http"); return 0; } diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 4cceb7a69..98d92409a 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -158,6 +158,8 @@ void CMoviePlayerGui::Init(void) ext_subs = false; iso_file = false; bgThread = 0; + info_1 = ""; + info_2 = ""; } void CMoviePlayerGui::cutNeutrino() @@ -1034,7 +1036,7 @@ void CMoviePlayerGui::callInfoViewer(/*const int duration, const int curr_pos*/) } /* not moviebrowser => use the filename as title */ - g_InfoViewer->showMovieTitle(playstate, 0, pretty_name, "", "", duration, position); + g_InfoViewer->showMovieTitle(playstate, 0, pretty_name, info_1, info_2, duration, position); } bool CMoviePlayerGui::getAudioName(int apid, std::string &apidtitle) diff --git a/src/gui/movieplayer.h b/src/gui/movieplayer.h index 08fd77884..4fd8be092 100644 --- a/src/gui/movieplayer.h +++ b/src/gui/movieplayer.h @@ -73,6 +73,7 @@ class CMoviePlayerGui : public CMenuTarget std::string file_name; std::string pretty_name; + std::string info_1, info_2; std::string currentaudioname; bool playing; bool time_forced; @@ -186,7 +187,7 @@ class CMoviePlayerGui : public CMenuTarget void UpdatePosition(); int timeshift; int file_prozent; - void SetFile(std::string &name, std::string &file) { pretty_name = name; file_name = file; } + void SetFile(std::string &name, std::string &file, std::string info1="", std::string info2="") { pretty_name = name; file_name = file; info_1 = info1; info_2 = info2; } bool PlayBackgroundStart(const std::string &file, const std::string &name, t_channel_id chan); void stopPlayBack(void); void setLastMode(int m) { m_LastMode = m; }