gui/movieplayer.cpp: get return status from filebrowser/moviebrowser

This commit is contained in:
[CST] Focus
2012-11-16 15:38:43 +04:00
parent 36fa514bed
commit ff47810841
2 changed files with 12 additions and 3 deletions

View File

@@ -223,7 +223,7 @@ int CMoviePlayerGui::exec(CMenuTarget * parent, const std::string & actionKey)
timeshift = 0; timeshift = 0;
return menu_return::RETURN_EXIT_ALL; return menu_return::RETURN_EXIT_ALL;
} }
return menu_return::RETURN_REPAINT; return menu_ret; //menu_return::RETURN_REPAINT;
} }
void CMoviePlayerGui::updateLcd() void CMoviePlayerGui::updateLcd()
@@ -286,6 +286,7 @@ void CMoviePlayerGui::fillPids()
bool CMoviePlayerGui::SelectFile() bool CMoviePlayerGui::SelectFile()
{ {
bool ret = false; bool ret = false;
menu_ret = menu_return::RETURN_REPAINT;
/*clear audiopids */ /*clear audiopids */
for (int i = 0; i < numpida; i++) { for (int i = 0; i < numpida; i++) {
@@ -344,7 +345,8 @@ bool CMoviePlayerGui::SelectFile()
ret = true; ret = true;
} }
} } else
menu_ret = moviebrowser->getMenuRet();
} }
else { // filebrowser else { // filebrowser
if (filebrowser->exec(Path_local.c_str()) == true) { if (filebrowser->exec(Path_local.c_str()) == true) {
@@ -380,7 +382,8 @@ bool CMoviePlayerGui::SelectFile()
} }
} }
} }
} } else
menu_ret = filebrowser->getMenuRet();
} }
if(ret && file_name.empty()) { if(ret && file_name.empty()) {
std::string::size_type pos = full_name.find_last_of('/'); std::string::size_type pos = full_name.find_last_of('/');
@@ -403,6 +406,7 @@ void CMoviePlayerGui::PlayFile(void)
{ {
neutrino_msg_t msg; neutrino_msg_t msg;
neutrino_msg_data_t data; neutrino_msg_data_t data;
menu_ret = menu_return::RETURN_REPAINT;
int position = 0, duration = 0; int position = 0, duration = 0;
bool first_start_timeshift = false; bool first_start_timeshift = false;
@@ -651,6 +655,9 @@ void CMoviePlayerGui::PlayFile(void)
msg == NeutrinoMessages::SHUTDOWN || msg == NeutrinoMessages::SHUTDOWN ||
msg == NeutrinoMessages::SLEEPTIMER) { // Exit for Record/Zapto Timers msg == NeutrinoMessages::SLEEPTIMER) { // Exit for Record/Zapto Timers
printf("CMoviePlayerGui::PlayFile: ZAPTO etc..\n"); printf("CMoviePlayerGui::PlayFile: ZAPTO etc..\n");
if(msg != NeutrinoMessages::ZAPTO)
menu_ret = menu_return::RETURN_EXIT_ALL;
playstate = CMoviePlayerGui::STOPPED; playstate = CMoviePlayerGui::STOPPED;
g_RCInput->postMsg(msg, data); g_RCInput->postMsg(msg, data);
} else if (msg == CRCInput::RC_timeout) { } else if (msg == CRCInput::RC_timeout) {
@@ -661,6 +668,7 @@ void CMoviePlayerGui::PlayFile(void)
if (CNeutrinoApp::getInstance()->handleMsg(msg, data) & messages_return::cancel_all) { if (CNeutrinoApp::getInstance()->handleMsg(msg, data) & messages_return::cancel_all) {
printf("CMoviePlayerGui::PlayFile: neutrino handleMsg messages_return::cancel_all\n"); printf("CMoviePlayerGui::PlayFile: neutrino handleMsg messages_return::cancel_all\n");
playstate = CMoviePlayerGui::STOPPED; playstate = CMoviePlayerGui::STOPPED;
menu_ret = menu_return::RETURN_EXIT_ALL;
} }
else if ( msg <= CRCInput::RC_MaxRC ) { else if ( msg <= CRCInput::RC_MaxRC ) {
update_lcd = true; update_lcd = true;

View File

@@ -94,6 +94,7 @@ class CMoviePlayerGui : public CMenuTarget
CFileBrowser * filebrowser; CFileBrowser * filebrowser;
CFileFilter tsfilefilter; CFileFilter tsfilefilter;
std::string Path_local; std::string Path_local;
int menu_ret;
/* playback from bookmark */ /* playback from bookmark */
CBookmarkManager * bookmarkmanager; CBookmarkManager * bookmarkmanager;