- movieplayer: add virtual zap mode for moviebrowser playlists

This commit fixes virtual zap for timeshift mode too.
TODO: virtual zap for fileplayer playlists
This commit is contained in:
svenhoefer
2016-02-03 16:27:07 +01:00
parent 32d3c2e467
commit fb2967ca8b
5 changed files with 153 additions and 36 deletions

View File

@@ -809,7 +809,7 @@ keybindingmenu.head Tasten-Belegungen bearbeiten
keybindingmenu.lastchannel Letzter Kanal keybindingmenu.lastchannel Letzter Kanal
keybindingmenu.longkeypress_duration Langer Tastendruck keybindingmenu.longkeypress_duration Langer Tastendruck
keybindingmenu.misc Sonstige keybindingmenu.misc Sonstige
keybindingmenu.mode_left_right_key_tv Funktion li/re Tasten im TV-Modus keybindingmenu.mode_left_right_key_tv Funktion der li/re-Tasten
keybindingmenu.mode_left_right_key_tv_infobar Infobar einblenden keybindingmenu.mode_left_right_key_tv_infobar Infobar einblenden
keybindingmenu.mode_left_right_key_tv_volume Lautstärkeregelung keybindingmenu.mode_left_right_key_tv_volume Lautstärkeregelung
keybindingmenu.mode_left_right_key_tv_vzap Virtual Zap keybindingmenu.mode_left_right_key_tv_vzap Virtual Zap
@@ -1107,7 +1107,7 @@ menu.hint_key_quickzap Konfigurieren Sie die Tastenbelegung für die Schnellumsc
menu.hint_key_record Konfigurieren Sie die Taste für den Aufnahmestart menu.hint_key_record Konfigurieren Sie die Taste für den Aufnahmestart
menu.hint_key_repeatblock Die Verzögerung nach einem Tastendruck bis die Box reagieren soll menu.hint_key_repeatblock Die Verzögerung nach einem Tastendruck bis die Box reagieren soll
menu.hint_key_repeatblockgeneric Die Verzögerung zwischen den Tastewiederholungen bis die Box reagieren soll menu.hint_key_repeatblockgeneric Die Verzögerung zwischen den Tastewiederholungen bis die Box reagieren soll
menu.hint_key_right Wählen Sie die Funktion für die Tasten 'links' und 'rechts' im TV/Radio-Modus menu.hint_key_right Wählen Sie die Funktion für die Tasten 'links' und 'rechts' im TV/Radio- und Movieplayer-Modus
menu.hint_key_save Speichern Sie Ihre Tastenbelegungen in einer Datei ab menu.hint_key_save Speichern Sie Ihre Tastenbelegungen in einer Datei ab
menu.hint_key_screenshot Weisen Sie eine Taste zu, um Menü- und/oder TV-Screenshots zu speichern menu.hint_key_screenshot Weisen Sie eine Taste zu, um Menü- und/oder TV-Screenshots zu speichern
menu.hint_key_sort Weisen Sie eine Taste für das Sortieren in der Kanalliste zu menu.hint_key_sort Weisen Sie eine Taste für das Sortieren in der Kanalliste zu

View File

@@ -809,7 +809,7 @@ keybindingmenu.head Edit Keybindings
keybindingmenu.lastchannel Quick Zap keybindingmenu.lastchannel Quick Zap
keybindingmenu.longkeypress_duration Long key-press keybindingmenu.longkeypress_duration Long key-press
keybindingmenu.misc Misc keybindingmenu.misc Misc
keybindingmenu.mode_left_right_key_tv Left/Right Key Behavior in TV-Mode keybindingmenu.mode_left_right_key_tv Left/Right key behaviour
keybindingmenu.mode_left_right_key_tv_infobar Show Infobar keybindingmenu.mode_left_right_key_tv_infobar Show Infobar
keybindingmenu.mode_left_right_key_tv_volume Volume Control keybindingmenu.mode_left_right_key_tv_volume Volume Control
keybindingmenu.mode_left_right_key_tv_vzap Virtual Zap keybindingmenu.mode_left_right_key_tv_vzap Virtual Zap
@@ -1107,7 +1107,7 @@ menu.hint_key_quickzap Configure keybingdings for quick\nchannel switch
menu.hint_key_record Assign button to start a recording menu.hint_key_record Assign button to start a recording
menu.hint_key_repeatblock Delay after button press and before\nfirst key repeat menu.hint_key_repeatblock Delay after button press and before\nfirst key repeat
menu.hint_key_repeatblockgeneric Delay between key repeats\nwhile button pressed menu.hint_key_repeatblockgeneric Delay between key repeats\nwhile button pressed
menu.hint_key_right Select 'right' function in live TV/Radio mode menu.hint_key_right Select function for 'left' and 'right' keys in live TV/Radio mode and movieplayer mode
menu.hint_key_save Save keybindings to file menu.hint_key_save Save keybindings to file
menu.hint_key_screenshot Assign button to save GUI and/or TV screenshot menu.hint_key_screenshot Assign button to save GUI and/or TV screenshot
menu.hint_key_sort Assign button to change channel list sort order menu.hint_key_sort Assign button to change channel list sort order

View File

@@ -940,18 +940,41 @@ void CInfoViewer::loop(bool show_dot)
} else if (msg == CRCInput::RC_sat || msg == CRCInput::RC_favorites) { } else if (msg == CRCInput::RC_sat || msg == CRCInput::RC_favorites) {
g_RCInput->postMsg (msg, 0); g_RCInput->postMsg (msg, 0);
res = messages_return::cancel_info; res = messages_return::cancel_info;
} } else if (msg == CRCInput::RC_help || msg == CRCInput::RC_info) {
else if (msg == CRCInput::RC_help || msg == CRCInput::RC_info) {
g_RCInput->postMsg (NeutrinoMessages::SHOW_EPG, 0); g_RCInput->postMsg (NeutrinoMessages::SHOW_EPG, 0);
res = messages_return::cancel_info; res = messages_return::cancel_info;
} else if ((msg == NeutrinoMessages::EVT_TIMER) && (data == fader.GetFadeTimer())) { } else if ((msg == NeutrinoMessages::EVT_TIMER) && (data == fader.GetFadeTimer())) {
if(fader.FadeDone()) if(fader.FadeDone())
res = messages_return::cancel_info; res = messages_return::cancel_info;
} else if ((msg == CRCInput::RC_ok) || (msg == CRCInput::RC_home) || (msg == CRCInput::RC_timeout)) { } else if ((msg == CRCInput::RC_ok) || (msg == CRCInput::RC_home) || (msg == CRCInput::RC_timeout)) {
if ((g_settings.mode_left_right_key_tv == SNeutrinoSettings::VZAP) && (msg == CRCInput::RC_ok))
{
if (fileplay)
{
// in movieplayer mode process vzap keys in movieplayer.cpp
//printf("%s:%d: imitate VZAP; RC_ok\n", __func__, __LINE__);
CMoviePlayerGui::getInstance().setFromInfoviewer(true);
g_RCInput->postMsg (msg, data);
hideIt = true;
}
}
if(fader.StartFadeOut()) if(fader.StartFadeOut())
timeoutEnd = CRCInput::calcTimeoutEnd (1); timeoutEnd = CRCInput::calcTimeoutEnd (1);
else else
res = messages_return::cancel_info; res = messages_return::cancel_info;
} else if ((g_settings.mode_left_right_key_tv == SNeutrinoSettings::VZAP) && ((msg == CRCInput::RC_right) || (msg == CRCInput::RC_left ))) {
if (fileplay)
{
// in movieplayer mode process vzap keys in movieplayer.cpp
//printf("%s:%d: imitate VZAP; RC_left/right\n", __func__, __LINE__);
CMoviePlayerGui::getInstance().setFromInfoviewer(true);
g_RCInput->postMsg (msg, data);
hideIt = true;
}
else
setSwitchMode(IV_MODE_VIRTUAL_ZAP);
res = messages_return::cancel_all;
hideIt = true;
} else if ((msg == NeutrinoMessages::EVT_TIMER) && (data == sec_timer_id)) { } else if ((msg == NeutrinoMessages::EVT_TIMER) && (data == sec_timer_id)) {
showSNR (); showSNR ();
if (timeset) if (timeset)
@@ -986,10 +1009,6 @@ void CInfoViewer::loop(bool show_dot)
g_RCInput->postMsg (msg, data); g_RCInput->postMsg (msg, data);
res = messages_return::cancel_info; res = messages_return::cancel_info;
} else if ((g_settings.mode_left_right_key_tv == SNeutrinoSettings::VZAP) && ((msg == CRCInput::RC_right) || (msg == CRCInput::RC_left ))) {
setSwitchMode(IV_MODE_VIRTUAL_ZAP);
res = messages_return::cancel_all;
hideIt = true;
} else if (msg == NeutrinoMessages::EVT_TIMESET) { } else if (msg == NeutrinoMessages::EVT_TIMESET) {
/* handle timeset event in upper layer, ignore here */ /* handle timeset event in upper layer, ignore here */
res = neutrino->handleMsg (msg, data); res = neutrino->handleMsg (msg, data);

View File

@@ -51,6 +51,7 @@
#include <driver/display.h> #include <driver/display.h>
#include <driver/abstime.h> #include <driver/abstime.h>
#include <driver/record.h> #include <driver/record.h>
#include <driver/volume.h>
#include <eitd/edvbstring.h> #include <eitd/edvbstring.h>
#include <system/helpers.h> #include <system/helpers.h>
@@ -74,6 +75,7 @@
extern cVideo * videoDecoder; extern cVideo * videoDecoder;
extern CRemoteControl *g_RemoteControl; /* neutrino.cpp */ extern CRemoteControl *g_RemoteControl; /* neutrino.cpp */
extern CInfoClock *InfoClock; extern CInfoClock *InfoClock;
extern CVolume* g_volume;
#define TIMESHIFT_SECONDS 3 #define TIMESHIFT_SECONDS 3
#define ISO_MOUNT_POINT "/media/iso" #define ISO_MOUNT_POINT "/media/iso"
@@ -189,6 +191,8 @@ void CMoviePlayerGui::Init(void)
info_1 = ""; info_1 = "";
info_2 = ""; info_2 = "";
filelist_it = filelist.end(); filelist_it = filelist.end();
vzap_it = filelist_it;
fromInfoviewer = false;
keyPressed = CMoviePlayerGui::PLUGIN_PLAYSTATE_NORMAL; keyPressed = CMoviePlayerGui::PLUGIN_PLAYSTATE_NORMAL;
isLuaPlay = false; isLuaPlay = false;
haveLuaInfoFunc = false; haveLuaInfoFunc = false;
@@ -901,6 +905,55 @@ bool CMoviePlayerGui::SetPosition(int pos, bool absolute)
return res; return res;
} }
void CMoviePlayerGui::quickZap(neutrino_msg_t msg)
{
if ((msg == CRCInput::RC_right) || msg == (neutrino_msg_t) g_settings.key_quickzap_up)
{
//printf("CMoviePlayerGui::%s: CRCInput::RC_right or g_settings.key_quickzap_up\n", __func__);
if (isLuaPlay)
{
playstate = CMoviePlayerGui::STOPPED;
keyPressed = CMoviePlayerGui::PLUGIN_PLAYSTATE_NEXT;
ClearQueue();
}
else if (!filelist.empty())
{
if (filelist_it < (filelist.end() - 1))
{
playstate = CMoviePlayerGui::STOPPED;
++filelist_it;
}
else if (repeat_mode == REPEAT_ALL)
{
playstate = CMoviePlayerGui::STOPPED;
++filelist_it;
if (filelist_it == filelist.end())
{
filelist_it = filelist.begin();
}
}
}
}
else if ((msg == CRCInput::RC_left) || msg == (neutrino_msg_t) g_settings.key_quickzap_down)
{
//printf("CMoviePlayerGui::%s: CRCInput::RC_left or g_settings.key_quickzap_down\n", __func__);
if (isLuaPlay)
{
playstate = CMoviePlayerGui::STOPPED;
keyPressed = CMoviePlayerGui::PLUGIN_PLAYSTATE_PREV;
ClearQueue();
}
else if (filelist.size() > 1)
{
if (filelist_it != filelist.begin())
{
playstate = CMoviePlayerGui::STOPPED;
--filelist_it;
}
}
}
}
void CMoviePlayerGui::PlayFileLoop(void) void CMoviePlayerGui::PlayFileLoop(void)
{ {
bool first_start = true; bool first_start = true;
@@ -993,29 +1046,36 @@ void CMoviePlayerGui::PlayFileLoop(void)
playstate = CMoviePlayerGui::STOPPED; playstate = CMoviePlayerGui::STOPPED;
keyPressed = CMoviePlayerGui::PLUGIN_PLAYSTATE_STOP; keyPressed = CMoviePlayerGui::PLUGIN_PLAYSTATE_STOP;
ClearQueue(); ClearQueue();
} else if (isLuaPlay && (msg == (neutrino_msg_t) CRCInput::RC_right)) { } else if (msg == CRCInput::RC_left || msg == CRCInput::RC_right) {
playstate = CMoviePlayerGui::STOPPED; bool reset_vzap_it = true;
keyPressed = CMoviePlayerGui::PLUGIN_PLAYSTATE_NEXT; switch (g_settings.mode_left_right_key_tv)
ClearQueue(); {
} else if (isLuaPlay && (msg == (neutrino_msg_t) CRCInput::RC_left)) { case SNeutrinoSettings::INFOBAR:
playstate = CMoviePlayerGui::STOPPED; callInfoViewer();
keyPressed = CMoviePlayerGui::PLUGIN_PLAYSTATE_PREV; break;
ClearQueue(); case SNeutrinoSettings::VZAP:
} else if ((!filelist.empty() && msg == (neutrino_msg_t) CRCInput::RC_right)) { if (fromInfoviewer)
if (filelist_it < (filelist.end() - 1)) { {
++filelist_it; set_vzap_it(msg == CRCInput::RC_right);
playstate = CMoviePlayerGui::STOPPED; reset_vzap_it = false;
} else if (repeat_mode == REPEAT_ALL) { fromInfoviewer = false;
++filelist_it; }
if (filelist_it == filelist.end()) callInfoViewer(reset_vzap_it);
filelist_it = filelist.begin(); break;
playstate = CMoviePlayerGui::STOPPED; case SNeutrinoSettings::VOLUME:
} g_volume->setVolume(msg);
} else if (filelist.size() > 1 && msg == (neutrino_msg_t) CRCInput::RC_left) { break;
if (filelist_it != filelist.begin()) { default: /* SNeutrinoSettings::ZAP */
playstate = CMoviePlayerGui::STOPPED; quickZap(msg);
--filelist_it; break;
} }
} else if (msg == (neutrino_msg_t) g_settings.key_quickzap_up || msg == (neutrino_msg_t) g_settings.key_quickzap_down) {
quickZap(msg);
} else if (fromInfoviewer && msg == CRCInput::RC_ok && !filelist.empty()) {
printf("CMoviePlayerGui::%s: start playlist movie #%d\n", __func__, vzap_it - filelist.begin());
fromInfoviewer = false;
playstate = CMoviePlayerGui::STOPPED;
filelist_it = vzap_it;
} else if (timeshift == TSHIFT_MODE_OFF && !isWebTV /* && !isYT */ && (msg == (neutrino_msg_t) g_settings.mpkey_next_repeat_mode)) { } else if (timeshift == TSHIFT_MODE_OFF && !isWebTV /* && !isYT */ && (msg == (neutrino_msg_t) g_settings.mpkey_next_repeat_mode)) {
repeat_mode = (repeat_mode_enum)((int)repeat_mode + 1); repeat_mode = (repeat_mode_enum)((int)repeat_mode + 1);
if (repeat_mode > (int) REPEAT_ALL) if (repeat_mode > (int) REPEAT_ALL)
@@ -1282,15 +1342,48 @@ void CMoviePlayerGui::PlayFileEnd(bool restore)
} }
} }
void CMoviePlayerGui::callInfoViewer() void CMoviePlayerGui::set_vzap_it(bool up)
{ {
//printf("CMoviePlayerGui::%s: vzap_it: %d count %s\n", __func__, vzap_it - filelist.begin(), up ? "up" : "down");
if (up)
{
if (vzap_it < (filelist.end() - 1))
++vzap_it;
}
else
{
if (vzap_it > filelist.begin())
--vzap_it;
}
//printf("CMoviePlayerGui::%s: vzap_it: %d\n", __func__, vzap_it - filelist.begin());
}
void CMoviePlayerGui::callInfoViewer(bool init_vzap_it)
{
if (init_vzap_it)
{
//printf("CMoviePlayerGui::%s: init_vzap_it\n", __func__);
vzap_it = filelist_it;
}
if (timeshift != TSHIFT_MODE_OFF) { if (timeshift != TSHIFT_MODE_OFF) {
g_InfoViewer->showTitle(CNeutrinoApp::getInstance()->channelList->getActiveChannel()); g_InfoViewer->showTitle(CNeutrinoApp::getInstance()->channelList->getActiveChannel());
return; return;
} }
if (isMovieBrowser && p_movie_info) { if (isMovieBrowser && p_movie_info)
g_InfoViewer->showMovieTitle(playstate, p_movie_info->epgEpgId >>16, p_movie_info->epgChannel, p_movie_info->epgTitle, p_movie_info->epgInfo1, {
MI_MOVIE_INFO *mi;
mi = p_movie_info;
if (!filelist.empty() && g_settings.mode_left_right_key_tv == SNeutrinoSettings::VZAP)
{
if (vzap_it <= filelist.end()) {
unsigned idx = vzap_it - filelist.begin();
//printf("CMoviePlayerGui::%s: idx: %d\n", __func__, idx);
mi = milist[idx];
}
}
g_InfoViewer->showMovieTitle(playstate, mi->epgEpgId >>16, mi->epgChannel, mi->epgTitle, mi->epgInfo1,
duration, position, repeat_mode); duration, position, repeat_mode);
return; return;
} }

View File

@@ -153,6 +153,9 @@ class CMoviePlayerGui : public CMenuTarget
CFileFilter tsfilefilter; CFileFilter tsfilefilter;
CFileList filelist; CFileList filelist;
CFileList::iterator filelist_it; CFileList::iterator filelist_it;
CFileList::iterator vzap_it;
void set_vzap_it(bool up);
bool fromInfoviewer;
std::string Path_local; std::string Path_local;
int menu_ret; int menu_ret;
bool autoshot_done; bool autoshot_done;
@@ -177,8 +180,9 @@ class CMoviePlayerGui : public CMenuTarget
void PlayFileEnd(bool restore = true); void PlayFileEnd(bool restore = true);
void cutNeutrino(); void cutNeutrino();
void quickZap(neutrino_msg_t msg);
void showHelpTS(void); void showHelpTS(void);
void callInfoViewer(); void callInfoViewer(bool init_vzap_it = true);
void fillPids(); void fillPids();
bool getAudioName(int pid, std::string &apidtitle); bool getAudioName(int pid, std::string &apidtitle);
void getCurrentAudioName( bool file_player, std::string &audioname); void getCurrentAudioName( bool file_player, std::string &audioname);
@@ -236,6 +240,7 @@ class CMoviePlayerGui : public CMenuTarget
size_t GetReadCount(); size_t GetReadCount();
std::string GetFile() { return pretty_name; } std::string GetFile() { return pretty_name; }
void restoreNeutrino(); void restoreNeutrino();
void setFromInfoviewer(bool f) { fromInfoviewer = f; };
void setBlockedFromPlugin(bool b) { blockedFromPlugin = b; }; void setBlockedFromPlugin(bool b) { blockedFromPlugin = b; };
bool getBlockedFromPlugin() { return blockedFromPlugin; }; bool getBlockedFromPlugin() { return blockedFromPlugin; };
void setLuaInfoFunc(lua_State* L, bool func) { luaState = L; haveLuaInfoFunc = func; }; void setLuaInfoFunc(lua_State* L, bool func) { luaState = L; haveLuaInfoFunc = func; };