gui/movieplayer.cpp: add GetReadCount, (C) martii,

user RED button to call streaminfo
This commit is contained in:
[CST] Focus
2015-10-29 17:41:45 +03:00
parent a4d0179beb
commit 3feba2b40d
2 changed files with 27 additions and 0 deletions

View File

@@ -43,6 +43,7 @@
#include <gui/infoclock.h>
#include <gui/plugins.h>
#include <gui/videosettings.h>
#include <gui/streaminfo2.h>
#include <driver/screenshot.h>
#include <driver/volume.h>
#include <driver/display.h>
@@ -769,6 +770,7 @@ bool CMoviePlayerGui::PlayFileStart(void)
position = 0, duration = 0;
speed = 1;
last_read = 0;
printf("%s: starting...\n", __func__);
stopPlayBack();
@@ -1127,6 +1129,14 @@ void CMoviePlayerGui::PlayFileLoop(void)
}
if (restore)
FileTime.show(position);
} else if (msg == CRCInput::RC_red) {
bool restore = FileTime.IsVisible();
FileTime.kill();
CStreamInfo2 streaminfo;
streaminfo.exec(NULL, "");
if (restore)
FileTime.show(position);
update_lcd = true;
} else if (msg == NeutrinoMessages::SHOW_EPG) {
handleMovieBrowser(NeutrinoMessages::SHOW_EPG, position);
} else if (msg == (neutrino_msg_t) g_settings.key_screenshot) {
@@ -2180,3 +2190,17 @@ void CMoviePlayerGui::makeScreenShot(bool autoshot, bool forcover)
if (autoshot)
autoshot_done = true;
}
size_t CMoviePlayerGui::GetReadCount()
{
uint64_t this_read = 0;
this_read = playback->GetReadCount();
uint64_t res;
if (this_read < last_read)
res = 0;
else
res = this_read - last_read;
last_read = this_read;
//printf("GetReadCount: %lld\n", res);
return (size_t) res;
}