Fix set lastmode; introduce sending an actionKey for LCD4linux

We have a problem since the introduction of moviebrowser_mode.
Lastmode is no longer reset correctly, because the new mode is overlaid by another mode
and thus the original mode cannot be restored. Neutrino becomes unusable and has to be
restarted. (Example below)
Generally the opening of a window, like the MB or Channellist is also no Neutrino_mode in
the sense as it was invented once. It is just a window and not a mode that Neutrino is in.
Example: Neutrino is in TV_MODUS and you open the MB. You can see, Neutrino is still in TV_MODUS.
I reverted the code and now an open window can say for example to the lcd4linux 'hello i'm open, here is mb'.
When running a window we send some kind of AktionKey. After the actions in the window, the AktionKey is cleared.
Now to the current bug:

1. boot on a TV channel.
2. switch to a WebTV channel. (in my case PlutoTV Star Trek)
3. play a TS over the Moviebrowser and stop it. (MODE_WEBTV is detected and the WebTV stream is restarted)
4. call the MB a second time and start and stop the TS.
5. the WebTV stream does not restart anymore.
6. exit the MB now.
7. neutrino becomes not operable.
This commit is contained in:
GetAway
2023-09-14 18:53:26 +02:00
parent 6634c1824b
commit 3e6d45b65a
8 changed files with 34 additions and 69 deletions

View File

@@ -928,17 +928,9 @@ int CMovieBrowser::exec(CMenuTarget* parent, const std::string & actionKey)
framebuffer->paintBackground(); // clear screen
// restore last mode to allow tv/radio while copying
CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE, m_LastMode);
// TODO: signalize running action
CMovieCut mc;
bool res = mc.copyMovie(m_movieSelectionHandler, onefile);
// tell neutrino we're in moviebrowser mode again
m_LastMode = CNeutrinoApp::getInstance()->getMode();
CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE, NeutrinoModes::mode_moviebrowser | NeutrinoModes::norezap);
//g_RCInput->clearRCMsg();
if (res == 0)
ShowMsg(LOCALE_MESSAGEBOX_ERROR, LOCALE_MOVIEBROWSER_COPY_FAILED, CMsgBox::mbrCancel, CMsgBox::mbCancel, NEUTRINO_ICON_ERROR);
@@ -963,17 +955,9 @@ int CMovieBrowser::exec(CMenuTarget* parent, const std::string & actionKey)
framebuffer->paintBackground(); // clear screen
// restore last mode to allow tv/radio while cutting
CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE, m_LastMode);
// TODO: signalize running action
CMovieCut mc;
bool res = mc.cutMovie(m_movieSelectionHandler);
// tell neutrino we're in moviebrowser mode again
m_LastMode = CNeutrinoApp::getInstance()->getMode();
CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE, NeutrinoModes::mode_moviebrowser | NeutrinoModes::norezap);
//g_RCInput->clearRCMsg();
if (!res)
ShowMsg(LOCALE_MESSAGEBOX_ERROR, LOCALE_MOVIEBROWSER_CUT_FAILED, CMsgBox::mbrCancel, CMsgBox::mbCancel, NEUTRINO_ICON_ERROR);
@@ -1001,17 +985,9 @@ int CMovieBrowser::exec(CMenuTarget* parent, const std::string & actionKey)
framebuffer->paintBackground(); // clear screen
// restore last mode to allow tv/radio while truncating
CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE, m_LastMode);
// TODO: signalize running action
CMovieCut mc;
bool res = mc.truncateMovie(m_movieSelectionHandler);
// tell neutrino we're in moviebrowser mode again
m_LastMode = CNeutrinoApp::getInstance()->getMode();
CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE, NeutrinoModes::mode_moviebrowser | NeutrinoModes::norezap);
//g_RCInput->clearRCMsg();
if (!res)
ShowMsg(LOCALE_MESSAGEBOX_ERROR, LOCALE_MOVIEBROWSER_TRUNCATE_FAILED, CMsgBox::mbrCancel, CMsgBox::mbCancel, NEUTRINO_ICON_ERROR);
@@ -1049,10 +1025,6 @@ int CMovieBrowser::exec(const char* path)
neutrino_msg_t msg;
neutrino_msg_data_t data;
// tell neutrino we're in moviebrowser mode
m_LastMode = CNeutrinoApp::getInstance()->getMode();
CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE, NeutrinoModes::mode_moviebrowser | NeutrinoModes::norezap);
CVFD::getInstance()->setMode(CVFD::MODE_MENU_UTF8, g_Locale->getText(LOCALE_MOVIEBROWSER_HEAD));
loadSettings(&m_settings);
@@ -1083,6 +1055,10 @@ int CMovieBrowser::exec(const char* path)
if (paint() == false)
return menu_ret;// paint failed due to less memory, exit
#ifdef ENABLE_LCD4LINUX
if (g_settings.lcd4l_support)
CLCD4l::getInstance()->setActionKey("moviebrowser");
#endif
bool loop = true;
bool result;
int timeout = g_settings.timing[SNeutrinoSettings::TIMING_FILEBROWSER];
@@ -1153,14 +1129,6 @@ int CMovieBrowser::exec(const char* path)
loop = false;
g_RCInput->postMsg(msg, data);
}
else if (msg == NeutrinoMessages::CHANGEMODE)
{
if ((data & NeutrinoModes::mode_mask) != NeutrinoModes::mode_moviebrowser)
{
loop = false;
m_LastMode = data;
}
}
else if (CNeutrinoApp::getInstance()->handleMsg(msg, data) & messages_return::cancel_all)
{
TRACE("[mb]->exec: getInstance\n");
@@ -1187,8 +1155,10 @@ int CMovieBrowser::exec(const char* path)
TRACE("[mb] force reload next time\n");
fileInfoStale();
}
CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE, m_LastMode | NeutrinoModes::norezap);
#ifdef ENABLE_LCD4LINUX
if (g_settings.lcd4l_support)
CLCD4l::getInstance()->clearActionKey();
#endif
return (res);
}

View File

@@ -195,8 +195,6 @@ class CMovieBrowser : public CMenuTarget, public CProgressSignals
Font* m_pcFontTitle;
std::string m_textTitle;
int m_LastMode;
MB_PARENTAL_LOCK m_parentalLock;
MB_STORAGE_TYPE m_storageType;