diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index eacd13a6a..6c243b528 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -947,9 +947,10 @@ int CChannelList::numericZap(int key) // -- quickzap "0" to last seen channel... if (key == g_settings.key_lastchannel) { t_channel_id channel_id = lastChList.getlast(1); - if(channel_id) { + if(channel_id && SameTP(channel_id)) { lastChList.clear_storedelay (); // ignore store delay zapTo_ChannelID(channel_id); + res = 0; } return res; } @@ -1099,7 +1100,10 @@ int CChannelList::numericZap(int key) if ( doZap ) { if(g_settings.timing[SNeutrinoSettings::TIMING_INFOBAR] == 0) g_InfoViewer->killTitle(); - zapTo( chn ); + if(SameTP(chanlist[chn]->channel_id)) { + zapTo( chn ); + res = 0; + } } else { showInfo(tuned); g_InfoViewer->killTitle(); @@ -1206,7 +1210,8 @@ void CChannelList::virtual_zap_mode(bool up) { if(g_settings.timing[SNeutrinoSettings::TIMING_INFOBAR] == 0) g_InfoViewer->killTitle(); - zapTo( chn ); + if(SameTP(chanlist[chn]->channel_id)) + zapTo( chn ); } else { @@ -1221,8 +1226,8 @@ void CChannelList::virtual_zap_mode(bool up) void CChannelList::quickZap(int key, bool cycle) { - if(chanlist.size() == 0) - return; + if(chanlist.size() == 0) + return; int bsize = bouquetList->Bouquets.size(); if(!cycle && bsize > 1) { @@ -1268,9 +1273,7 @@ printf("CChannelList::quickZap: new selected %d total %d active bouquet %d total else if ((key==g_settings.key_quickzap_up) || (key == CRCInput::RC_right)) { selected = (selected+1)%chanlist.size(); } - //printf("[neutrino] quick zap selected = %d bouquetList %x getActiveBouquetNumber %d orgChannelList %x\n", selected, bouquetList, bouquetList->getActiveBouquetNumber(), bouquetList->orgChannelList); - CNeutrinoApp::getInstance()->channelList->zapTo(getKey(selected)-1); } g_RCInput->clearRCMsg(); //FIXME test for n.103 @@ -1437,7 +1440,7 @@ void CChannelList::paintItem(int pos) bool iscurrent = true; unsigned int curr = liststart + pos; - if(!autoshift && CNeutrinoApp::getInstance()->recordingstatus && curr < chanlist.size()) { + if(CNeutrinoApp::getInstance()->recordingstatus && !autoshift && curr < chanlist.size()) { iscurrent = (chanlist[curr]->channel_id >> 16) == (rec_channel_id >> 16); //printf("recording %llx current %llx current = %s\n", rec_channel_id, chanlist[liststart + pos]->channel->channel_id, iscurrent? "yes" : "no"); } @@ -1681,12 +1684,15 @@ int CChannelList::getSelectedChannelIndex() const return this->selected; } -bool CChannelList::SameTP() +bool CChannelList::SameTP(t_channel_id channel_id) { bool iscurrent = true; - if(!autoshift && CNeutrinoApp::getInstance()->recordingstatus ) - iscurrent = (chanlist[selected]->channel_id >> 16) == (rec_channel_id >> 16); + if(channel_id == 0) + channel_id = chanlist[selected]->channel_id; + + if(CNeutrinoApp::getInstance()->recordingstatus && !autoshift) + iscurrent = (channel_id >> 16) == (rec_channel_id >> 16); return iscurrent; } diff --git a/src/gui/channellist.h b/src/gui/channellist.h index cce3a51ab..4d0f1c8c3 100644 --- a/src/gui/channellist.h +++ b/src/gui/channellist.h @@ -130,7 +130,7 @@ class CChannelList void SortAlpha(void); void SortSat(void); void ClearList(void); - bool SameTP(); + bool SameTP(t_channel_id channel_id = 0); //friend class CZapitChannel; }; #endif diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index c4c42ed32..2d9e4cbde 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -43,7 +43,7 @@ #include #include - +#include #include #include @@ -66,6 +66,7 @@ void sectionsd_getEventsServiceKey(t_channel_id serviceUniqueKey, CChannelEventL void sectionsd_getCurrentNextServiceKey(t_channel_id uniqueServiceKey, CSectionsdClient::responseGetCurrentNextInfoChannelID& current_next ); extern CRemoteControl *g_RemoteControl; /* neutrino.cpp */ +extern CBouquetList * bouquetList; /* neutrino.cpp */ extern CPictureViewer * g_PicViewer; extern CFrontend * frontend; extern cVideo * videoDecoder; @@ -771,8 +772,13 @@ fprintf(stderr, "after showchannellogo, mode = %d ret = %d logo_ok = %d\n",g_set g_RCInput->killTimer (fadeTimer); frameBuffer->setBlendLevel(g_settings.gtx_alpha1, g_settings.gtx_alpha2); } - if (virtual_zap_mode) - CNeutrinoApp::getInstance()->channelList->virtual_zap_mode(msg == CRCInput::RC_right); + if (virtual_zap_mode) { + /* if bouquet cycle set, do virtual over current bouquet */ + if(g_settings.zap_cycle && (bouquetList != NULL) && !(bouquetList->Bouquets.empty())) + bouquetList->Bouquets[bouquetList->getActiveBouquetNumber()]->channelList->virtual_zap_mode(msg == CRCInput::RC_right); + else + CNeutrinoApp::getInstance()->channelList->virtual_zap_mode(msg == CRCInput::RC_right); + } } aspectRatio = 0; diff --git a/src/neutrino.cpp b/src/neutrino.cpp index bd236429a..0dbd8d9ae 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -2572,6 +2572,13 @@ int CNeutrinoApp::run(int argc, char **argv) void CNeutrinoApp::quickZap(int msg) { + if(recordingstatus && !autoshift) { + StopSubtitles(); + int res = channelList->numericZap(g_settings.key_zaphistory); + if(res < 0) + StartSubtitles(); + return; + } if((bouquetList != NULL) && !(bouquetList->Bouquets.empty())) bouquetList->Bouquets[bouquetList->getActiveBouquetNumber()]->channelList->quickZap(msg, g_settings.zap_cycle); else @@ -2711,7 +2718,9 @@ void CNeutrinoApp::RealRun(CMenuWidget &mainMenu) else if( msg == (neutrino_msg_t) g_settings.key_lastchannel ) { // Quick Zap StopSubtitles(); - channelList->numericZap( msg ); + int res = channelList->numericZap( msg ); + if(res < 0) + StartSubtitles(); } else if( msg == (neutrino_msg_t) g_settings.key_plugin ) { g_PluginList->start_plugin_by_name(g_settings.onekey_plugin.c_str(), 0); @@ -3580,14 +3589,26 @@ void CNeutrinoApp::ExitRun(const bool /*write_si*/, int retcode) if (g_RCInput != NULL) delete g_RCInput; - stop_daemons(); - int fspeed = 0; funNotifier->changeNotify(NONEXISTANT_LOCALE, (void *) &fspeed); + CVFD::getInstance()->ShowText((char *) "Rebooting..."); + + stop_daemons(); + +#if 0 /* FIXME this next hack to test, until we find real crash on exit reason */ + system("/etc/init.d/rcK"); + system("/bin/sync"); + system("/bin/umount -a"); + + reboot(LINUX_REBOOT_CMD_RESTART); +#else + _exit(retcode); +#endif exit(retcode); } } } + void CNeutrinoApp::saveEpg() { struct stat my_stat; @@ -3605,6 +3626,7 @@ void CNeutrinoApp::saveEpg() } } } + void CNeutrinoApp::AudioMute( int newValue, bool isEvent ) { //printf("MUTE: val %d current %d event %d\n", newValue, current_muted, isEvent); diff --git a/src/neutrino_menue.cpp b/src/neutrino_menue.cpp index d4adf5aff..574eb9452 100644 --- a/src/neutrino_menue.cpp +++ b/src/neutrino_menue.cpp @@ -3040,6 +3040,7 @@ const char * CNeutrinoApp::digiIcon(int digi) case 0: return NEUTRINO_ICON_BUTTON_0; default: + return NULL; break; } }