From fb0cdcf1e6aa8950afcb6102d6b6421a1f6ccda7 Mon Sep 17 00:00:00 2001 From: FlatTV Date: Wed, 1 Jan 2020 12:31:33 +0100 Subject: [PATCH] Zap when recording needs CAM Signed-off-by: GetAway --- data/locale/deutsch.locale | 1 + data/locale/english.locale | 1 + src/gui/cam_menu.cpp | 2 +- src/neutrino.cpp | 9 ++++++++- src/system/locals.h | 1 + src/system/locals_intern.h | 1 + src/system/settings.h | 3 +-- 7 files changed, 14 insertions(+), 4 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index f1a9e32c9..513b1374b 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -309,6 +309,7 @@ ci.ignore_msg CA Meldungen ignorieren ci.init_failed CAM-Init fehlgeschlagen ci.init_ok CAM-Init beendet ci.inserted CAM im Slot +ci.rec_zapto Umschalten bei Aufnahmen mit CAM ci.removed CAM entfernt -> Slot ci.reset Reset ci.reset_standby Reset nach Standby diff --git a/data/locale/english.locale b/data/locale/english.locale index 1357f7ef8..4d1f4ab53 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -309,6 +309,7 @@ ci.ignore_msg Ignore CA messages ci.init_failed CAM init failed ci.init_ok CAM init complete ci.inserted CAM inserted in slot +ci.rec_zapto Zap when recording needs CAM ci.removed CAM removed from slot ci.reset Reset ci.reset_standby Reset after standby diff --git a/src/gui/cam_menu.cpp b/src/gui/cam_menu.cpp index dd9ffcf22..99bdf94ef 100644 --- a/src/gui/cam_menu.cpp +++ b/src/gui/cam_menu.cpp @@ -150,8 +150,8 @@ int CCAMMenuHandler::doMainMenu() } cammenu->addItem( new CMenuOptionChooser(LOCALE_CI_IGNORE_MSG, &g_settings.ci_ignore_messages, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true)); cammenu->addItem( new CMenuOptionChooser(LOCALE_CI_SAVE_PINCODE, &g_settings.ci_save_pincode, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this)); -#if 0 cammenu->addItem( new CMenuOptionChooser(LOCALE_CI_REC_ZAPTO, &g_settings.ci_rec_zapto, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this)); +#if 0 CMenuOptionChooser *ci_mode = new CMenuOptionChooser(LOCALE_CI_MODE, &g_settings.ci_mode, OPTIONS_CI_MODE_OPTIONS, OPTIONS_CI_MODE_OPTION_COUNT, true, NULL); ci_mode->setHint(NEUTRINO_ICON_HINT_IMAGELOGO, LOCALE_MENU_HINT_CI_MODE); cammenu->addItem(ci_mode); diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 9e902b7d7..39e9f1d07 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -466,6 +466,7 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.ci_save_pincode = configfile.getInt32("ci_save_pincode", 0); g_settings.ci_pincode = configfile.getString("ci_pincode", ""); g_settings.ci_tuner = configfile.getInt32("ci_tuner", -1); + g_settings.ci_rec_zapto = configfile.getInt32("ci_rec_zapto", 0); #ifndef CPU_FREQ g_settings.cpufreq = 0; @@ -1358,6 +1359,7 @@ void CNeutrinoApp::saveSetup(const char * fname) configfile.setInt32("ci_save_pincode", g_settings.ci_save_pincode); configfile.setString("ci_pincode", g_settings.ci_pincode); configfile.setInt32("ci_tuner", g_settings.ci_tuner); + configfile.setInt32("ci_rec_zapto", g_settings.ci_rec_zapto); configfile.setInt32( "make_hd_list", g_settings.make_hd_list); configfile.setInt32( "make_webtv_list", g_settings.make_webtv_list); @@ -3731,7 +3733,12 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) if((eventinfo->channel_id != live_channel_id) && !(SAME_TRANSPONDER(live_channel_id, eventinfo->channel_id))) zapTo(eventinfo->channel_id); } - + // zap to CI Channel + if(g_settings.ci_rec_zapto){ + CZapitChannel * ch = CServiceManager::getInstance()->FindChannel(eventinfo->channel_id); + if (ch && ch->bUseCI && (eventinfo->channel_id != live_channel_id)) + zapTo(eventinfo->channel_id); + } if (g_settings.recording_type != CNeutrinoApp::RECORDING_OFF) { CRecordManager::getInstance()->Record(eventinfo); autoshift = CRecordManager::getInstance()->TimeshiftOnly(); diff --git a/src/system/locals.h b/src/system/locals.h index 24b39adfd..c1f076873 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -336,6 +336,7 @@ typedef enum LOCALE_CI_INIT_FAILED, LOCALE_CI_INIT_OK, LOCALE_CI_INSERTED, + LOCALE_CI_REC_ZAPTO, LOCALE_CI_REMOVED, LOCALE_CI_RESET, LOCALE_CI_RESET_STANDBY, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index de5be53ab..9743134a6 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -336,6 +336,7 @@ const char * locale_real_names[] = "ci.init_failed", "ci.init_ok", "ci.inserted", + "ci.rec_zapto", "ci.removed", "ci.reset", "ci.reset_standby", diff --git a/src/system/settings.h b/src/system/settings.h index cabc1a6ac..082a2a1b6 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -288,8 +288,7 @@ struct SNeutrinoSettings int ci_ignore_messages; int ci_save_pincode; int ci_tuner; - - + int ci_rec_zapto; std::string ci_pincode; int radiotext_enable; int webradio_xml_auto;