CLuaInstance: Add parameter info1/info2 to PlayFile()

- This parameter display in info viewer instead of epg data


Origin commit data
------------------
Branch: ni/coolstream
Commit: b6f1963f2c
Author: Michael Liebmann <tuxcode.bbg@gmail.com>
Date: 2014-09-10 (Wed, 10 Sep 2014)



------------------
This commit was generated by Migit
This commit is contained in:
Michael Liebmann
2014-09-10 21:13:29 +02:00
parent 6b81b487f7
commit dfb3be64db
3 changed files with 14 additions and 3 deletions

View File

@@ -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;
}

View File

@@ -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)

View File

@@ -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; }