CLuaInstVideo: Add script function 'setInfoFunc()'...

...for displaying information in the movieplayer

 - Set Lua api version to 1.36
This commit is contained in:
M. Liebmann
2016-01-17 06:12:37 +01:00
parent c7b6026ac2
commit 644ab18844
5 changed files with 75 additions and 4 deletions

View File

@@ -44,6 +44,7 @@
#include <gui/plugins.h>
#include <gui/videosettings.h>
#include <gui/streaminfo2.h>
#include <gui/lua/lua_video.h>
#include <gui/screensaver.h>
#include <driver/screenshot.h>
#include <driver/volume.h>
@@ -190,6 +191,7 @@ void CMoviePlayerGui::Init(void)
filelist_it = filelist.end();
keyPressed = CMoviePlayerGui::PLUGIN_PLAYSTATE_NORMAL;
isLuaPlay = false;
haveLuaInfoFunc = false;
blockedFromPlugin = false;
m_screensaver = false;
m_idletime = time(NULL);
@@ -309,6 +311,7 @@ int CMoviePlayerGui::exec(CMenuTarget * parent, const std::string & actionKey)
isLuaPlay = true;
is_file_player = true;
PlayFile();
haveLuaInfoFunc = false;
}
else {
return menu_return::RETURN_REPAINT;
@@ -1725,14 +1728,25 @@ void CMoviePlayerGui::handleMovieBrowser(neutrino_msg_t msg, int /*position*/)
cMovieInfo.saveMovieInfo(*p_movie_info); /* save immediately in xml file */
}
}
} else if (msg == NeutrinoMessages::SHOW_EPG && p_movie_info) {
} else if (msg == NeutrinoMessages::SHOW_EPG && (p_movie_info || (isLuaPlay && haveLuaInfoFunc))) {
CTimeOSD::mode m_mode = FileTime.getMode();
bool restore = FileTime.IsVisible();
if (restore)
FileTime.kill();
InfoClock->enableInfoClock(false);
cMovieInfo.showMovieInfo(*p_movie_info);
if (isLuaPlay && haveLuaInfoFunc) {
int xres = 0, yres = 0, aspectRatio = 0, framerate = -1;
if (!videoDecoder->getBlank()) {
videoDecoder->getPictureInfo(xres, yres, framerate);
if (yres == 1088)
yres = 1080;
aspectRatio = videoDecoder->getAspectRatio();
}
CLuaInstVideo::getInstance()->execLuaInfoFunc(luaState, xres, yres, aspectRatio, framerate);
}
else if (p_movie_info)
cMovieInfo.showMovieInfo(*p_movie_info);
InfoClock->enableInfoClock(true);
if (restore) {