From 75e7bc7b288b1118878c072cedb5562b37726d7f Mon Sep 17 00:00:00 2001 From: max10 Date: Fri, 8 Jul 2016 12:20:41 +0200 Subject: [PATCH] add check-live-ci (thx DboxOldie) Conflicts: src/gui/cam_menu.cpp --- data/locale/deutsch.locale | 1 + data/locale/english.locale | 1 + src/gui/cam_menu.cpp | 50 ++++++++++++++++++++++++++++++-------- src/neutrino.cpp | 3 +++ src/system/locals.h | 1 + src/system/locals_intern.h | 1 + src/system/settings.h | 1 + 7 files changed, 48 insertions(+), 10 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 1a4c34599..309fdda79 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -305,6 +305,7 @@ channellist.show_infobox Sendungsfenster anzeigen channellist.show_res_icon Auflösung signalisieren channellist.since seit channellist.start Start +ci.check_live_slot CI-Slot auf Live-TV Nutzung prüfen ci.clock CI Takt (Mhz) ci.clock_high hoch ci.clock_normal normal diff --git a/data/locale/english.locale b/data/locale/english.locale index 6bb957a75..0f75a0e05 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -305,6 +305,7 @@ channellist.show_infobox Show bottom infobox channellist.show_res_icon Signalize resolution channellist.since since channellist.start starts +ci.check_live_slot Check CI-slot for live-tv use ci.clock CI clock (Mhz) ci.clock_high high ci.clock_normal normal diff --git a/src/gui/cam_menu.cpp b/src/gui/cam_menu.cpp index 99e984771..f7cce9862 100644 --- a/src/gui/cam_menu.cpp +++ b/src/gui/cam_menu.cpp @@ -73,11 +73,25 @@ const CMenuOptionChooser::keyval OPTIONS_CI_MODE_OPTIONS[] = }; #define OPTIONS_CI_MODE_OPTION_COUNT (sizeof(OPTIONS_CI_MODE_OPTIONS)/sizeof(CMenuOptionChooser::keyval)) -#define CI_CLOCK_OPTION_COUNT 2 -static const CMenuOptionChooser::keyval CI_CLOCK_OPTIONS[CI_CLOCK_OPTION_COUNT] = { - { 6, LOCALE_CI_CLOCK_NORMAL }, - { 7, LOCALE_CI_CLOCK_HIGH } +static const CMenuOptionChooser::keyval CI_CLOCK_OPTIONS[] = { + { 6, LOCALE_CI_CLOCK_NORMAL }, + { 7, LOCALE_CI_CLOCK_HIGH } +#if BOXMODEL_VUPLUS + ,{ 12, LOCALE_CI_CLOCK_EXTRA_HIGH } +#endif }; +#define CI_CLOCK_OPTION_COUNT (sizeof(CI_CLOCK_OPTIONS)/sizeof(CMenuOptionChooser::keyval)) + +#if BOXMODEL_VUPLUS +#define CI_DELAY_OPTION_COUNT 5 +static const CMenuOptionChooser::keyval_ext CI_DELAY_OPTIONS[CI_DELAY_OPTION_COUNT] = { + { 16, NONEXISTANT_LOCALE, "16" }, + { 32, NONEXISTANT_LOCALE, "32" }, + { 64, NONEXISTANT_LOCALE, "64" }, + { 128, NONEXISTANT_LOCALE, "128" }, + { 256, NONEXISTANT_LOCALE, "256" } +}; +#endif void CCAMMenuHandler::init(void) { @@ -141,18 +155,23 @@ int CCAMMenuHandler::doMainMenu() int CiSlots = ca ? ca->GetNumberCISlots() : 0; if(CiSlots) { - cammenu->addItem( new CMenuOptionChooser(LOCALE_CI_RESET_STANDBY, &g_settings.ci_standby_reset, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true)); +#if BOXMODEL_VUPLUS //FIXME: loacles not available + cammenu->addItem(new CMenuOptionChooser(LOCALE_CI_DELAY, &g_settings.ci_delay, CI_DELAY_OPTIONS, CI_DELAY_OPTION_COUNT, true, this)); +#endif + cammenu->addItem(new CMenuOptionChooser(LOCALE_CI_RESET_STANDBY, &g_settings.ci_standby_reset, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true)); #if HAVE_ARM_HARDWARE || HAVE_MIPS_HARDWARE cammenu->addItem( new CMenuOptionChooser(LOCALE_CI_CLOCK, &g_settings.ci_clock, CI_CLOCK_OPTIONS, CI_CLOCK_OPTION_COUNT, true, this)); #else cammenu->addItem( new CMenuOptionNumberChooser(LOCALE_CI_CLOCK, &g_settings.ci_clock, true, 6, 12, this)); #endif } - 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)); - cammenu->addItem( new CMenuOptionChooser(LOCALE_CI_REC_ZAPTO, &g_settings.ci_rec_zapto, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this)); + 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)); + cammenu->addItem(new CMenuOptionChooser(LOCALE_CI_CHECK_LIVE_SLOT, &g_settings.ci_check_live, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this)); + + cammenu->addItem(new CMenuOptionChooser(LOCALE_CI_REC_ZAPTO, &g_settings.ci_rec_zapto, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this)); 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_DEFAULT, LOCALE_MENU_HINT_CI_MODE); + cammenu->addItem(ci_mode); #ifdef BOXMODEL_CS_HD2 @@ -389,7 +408,7 @@ int CCAMMenuHandler::handleCamMsg(const neutrino_msg_t msg, neutrino_msg_data_t char * tptr = sptr; int bpos = 0; for(int li = 0; li < slen; li++) { - if((tptr[li] == 0x8A) || ((bpos > 38) && (tptr[li] == 0x20)) ) { + if(((unsigned char)tptr[li] == 0x8A) || ((bpos > 38) && (tptr[li] == 0x20)) ) { bpos = 0; tptr[li] = 0; printf("CCAMMenuHandler::handleCamMsg: subtitle: %s\n", sptr); @@ -590,6 +609,14 @@ int CCAMMenuHandler::doMenu(int slot, CA_SLOT_TYPE slotType) bool CCAMMenuHandler::changeNotify(const neutrino_locale_t OptionName, void * Data) { +#if BOXMODEL_VUPLUS + if (ARE_LOCALES_EQUAL(OptionName, LOCALE_CI_DELAY)) { + printf("CCAMMenuHandler::changeNotify: ci_delay %d\n", g_settings.ci_delay); + ca->SetCIDelay(g_settings.ci_delay); + return true; + } + else +#endif if (ARE_LOCALES_EQUAL(OptionName, LOCALE_CI_CLOCK)) { printf("CCAMMenuHandler::changeNotify: ci_clock %d\n", g_settings.ci_clock); ca->SetTSClock(g_settings.ci_clock * 1000000); @@ -602,6 +629,9 @@ bool CCAMMenuHandler::changeNotify(const neutrino_locale_t OptionName, void * Da g_settings.ci_pincode.clear(); } } + else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_CI_CHECK_LIVE_SLOT)) { + ca->setCheckLiveSlot(g_settings.ci_check_live); + } else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_CI_TUNER)) { printf("CCAMMenuHandler::changeNotify: bind CI to tuner %d\n", g_settings.ci_tuner); CCamManager::getInstance()->SetCITuner(g_settings.ci_tuner); diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 8cdd80e48..699a5c1c0 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -468,6 +468,7 @@ int CNeutrinoApp::loadSetup(const char * fname) #endif g_settings.ci_ignore_messages = configfile.getInt32("ci_ignore_messages", 0); g_settings.ci_save_pincode = configfile.getInt32("ci_save_pincode", 0); + g_settings.ci_check_live = configfile.getInt32("ci_check_live", 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); @@ -1394,6 +1395,7 @@ void CNeutrinoApp::saveSetup(const char * fname) configfile.setInt32("ci_clock", g_settings.ci_clock); configfile.setInt32("ci_ignore_messages", g_settings.ci_ignore_messages); configfile.setInt32("ci_save_pincode", g_settings.ci_save_pincode); + configfile.setInt32("ci_check_live", g_settings.ci_check_live); 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); @@ -2829,6 +2831,7 @@ TIMER_START(); delete hintBox; cCA::GetInstance()->Ready(true); + cCA::GetInstance()->setCheckLiveSlot(g_settings.ci_check_live); //InitZapper(); SHTDCNT::getInstance()->init(); diff --git a/src/system/locals.h b/src/system/locals.h index 6b1441f4b..09cf08907 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -332,6 +332,7 @@ typedef enum LOCALE_CHANNELLIST_SHOW_RES_ICON, LOCALE_CHANNELLIST_SINCE, LOCALE_CHANNELLIST_START, + LOCALE_CI_CHECK_LIVE_SLOT, LOCALE_CI_CLOCK, LOCALE_CI_CLOCK_HIGH, LOCALE_CI_CLOCK_NORMAL, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 80c858d37..45676759b 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -332,6 +332,7 @@ const char * locale_real_names[] = "channellist.show_res_icon", "channellist.since", "channellist.start", + "ci.check_live_slot", "ci.clock", "ci.clock_high", "ci.clock_normal", diff --git a/src/system/settings.h b/src/system/settings.h index 981c232a7..69f7f5023 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -287,6 +287,7 @@ struct SNeutrinoSettings int ci_clock; int ci_ignore_messages; int ci_save_pincode; + int ci_check_live; int ci_tuner; int ci_rec_zapto; int ci_mode;