diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 6ef1f9349..62fbf6acd 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -2003,15 +2003,6 @@ void CNeutrinoApp::quickZap(int msg) int res; StopSubtitles(); - printf("CNeutrinoApp::quickZap haveFreeFrontend %d\n", CFEManager::getInstance()->haveFreeFrontend()); -#if 0 - if(!CFEManager::getInstance()->haveFreeFrontend()) - { - res = channelList->numericZap(g_settings.key_zaphistory); - StartSubtitles(res < 0); - return; - } -#endif bool ret; if(!bouquetList->Bouquets.empty()) ret = bouquetList->Bouquets[bouquetList->getActiveBouquetNumber()]->channelList->quickZap(msg, g_settings.zap_cycle); @@ -2457,6 +2448,17 @@ _repeat: return ((nNewChannel >= 0) ? menu_return::RETURN_EXIT_ALL : menu_return::RETURN_REPAINT); } +void CNeutrinoApp::zapTo(t_channel_id channel_id) +{ + bool recordingStatus = CRecordManager::getInstance()->RecordingStatus(channel_id); + if (!recordingStatus || (recordingStatus && CRecordManager::getInstance()->TimeshiftOnly()) || + (recordingStatus && channelList->SameTP(channel_id))) { + + dvbsub_stop(); + g_Zapit->zapTo_serviceID_NOWAIT(channel_id); + } +} + int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) { int res = 0; @@ -2751,14 +2753,10 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) //zap to rec channel in standby-mode if(mode == mode_standby){ CTimerd::RecordingInfo * eventinfo = (CTimerd::RecordingInfo *) data; - bool recordingStatus = CRecordManager::getInstance()->RecordingStatus(eventinfo->channel_id); t_channel_id live_channel_id = CZapit::getInstance()->GetCurrentChannelID(); - if( !recordingStatus && (eventinfo->channel_id != live_channel_id) && channelList->SameTP(eventinfo->channel_id) && !(SAME_TRANSPONDER(live_channel_id, eventinfo->channel_id)) ){ - dvbsub_stop(); - t_channel_id channel_id=eventinfo->channel_id; - g_Zapit->zapTo_serviceID_NOWAIT(channel_id); - } + if((eventinfo->channel_id != live_channel_id) && !(SAME_TRANSPONDER(live_channel_id, eventinfo->channel_id))) + zapTo(eventinfo->channel_id); } if (g_settings.recording_type != CNeutrinoApp::RECORDING_OFF) { @@ -2788,8 +2786,8 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) else if( msg == NeutrinoMessages::ZAPTO) { CTimerd::EventInfo * eventinfo = (CTimerd::EventInfo *) data; if (eventinfo->channel_id != CZapit::getInstance()->GetCurrentChannelID()){ - if( (recordingstatus == 0) || (recordingstatus && CRecordManager::getInstance()->TimeshiftOnly()) || (recordingstatus && CFEManager::getInstance()->haveFreeFrontend()) || - (recordingstatus && channelList->SameTP(eventinfo->channel_id)) ) { + if( (recordingstatus == 0) || (recordingstatus && CRecordManager::getInstance()->TimeshiftOnly()) || + (recordingstatus && channelList->SameTP(eventinfo->channel_id)) ) { bool isTVMode = CServiceManager::getInstance()->IsChannelTVChannel(eventinfo->channel_id); dvbsub_stop(); @@ -2839,13 +2837,7 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) if( g_settings.recording_zap_on_announce && (mode != mode_standby) && (eventinfo->channel_id != CZapit::getInstance()->GetCurrentChannelID())) { CRecordManager::getInstance()->StopAutoRecord(); - bool recordingStatus = CRecordManager::getInstance()->RecordingStatus(); - if ( !recordingStatus || (recordingStatus && CRecordManager::getInstance()->TimeshiftOnly()) || (recordingStatus && CFEManager::getInstance()->haveFreeFrontend()) || - (recordingStatus && channelList->SameTP(eventinfo->channel_id)) ){ - dvbsub_stop(); - t_channel_id channel_id=eventinfo->channel_id; - g_Zapit->zapTo_serviceID_NOWAIT(channel_id); - } + zapTo(eventinfo->channel_id); } if(( mode != mode_scart ) && ( mode != mode_standby ) && g_settings.recording_startstop_msg) { std::string name = g_Locale->getText(LOCALE_RECORDTIMER_ANNOUNCE); diff --git a/src/neutrino.h b/src/neutrino.h index 67a26d02a..821468789 100644 --- a/src/neutrino.h +++ b/src/neutrino.h @@ -213,6 +213,7 @@ public: int showChannelList(const neutrino_msg_t msg, bool from_menu = false); CPersonalizeGui & getPersonalizeGui() { return personalize; } bool getChannellistIsVisible() { return channellist_visible; } + void zapTo(t_channel_id channel_id); }; #endif