diff --git a/src/gui/cam_menu.cpp b/src/gui/cam_menu.cpp index dce3ffa89..4f68f9ba7 100644 --- a/src/gui/cam_menu.cpp +++ b/src/gui/cam_menu.cpp @@ -54,6 +54,8 @@ #include #include +int CISlot = 0; + //NI CA init extern Zapit_config zapitCfg; @@ -158,14 +160,8 @@ int CCAMMenuHandler::doMainMenu() if(CiSlots) { #if BOXMODEL_VUPLUS cammenu->addItem(new CMenuOptionChooser(LOCALE_CI_DELAY, &g_settings.ci_delay, CI_DELAY_OPTIONS, CI_DELAY_OPTION_COUNT, true, this)); - cammenu->addItem(new CMenuOptionChooser(LOCALE_CI_RPR, &g_settings.ci_rpr, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_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)); @@ -219,6 +215,14 @@ int CCAMMenuHandler::doMainMenu() snprintf(tmp, sizeof(tmp), "ca_ci_reset%d", i); cammenu->addItem(new CMenuForwarder(LOCALE_CI_RESET, true, NULL, this, tmp)); memset(name1,0,sizeof(name1)); +if (i == 0) { // only for slot 0 valid - fix later +#if HAVE_ARM_HARDWARE || HAVE_MIPS_HARDWARE + cammenu->addItem(new CMenuOptionChooser(LOCALE_CI_CLOCK, &g_settings.ci_clock[i], CI_CLOCK_OPTIONS, CI_CLOCK_OPTION_COUNT, true, this)); +#else + cammenu->addItem(new CMenuOptionNumberChooser(LOCALE_CI_CLOCK, &g_settings.ci_clock[i], true, 6, 12, this)); +#endif + cammenu->addItem(new CMenuOptionChooser(LOCALE_CI_RPR, &g_settings.ci_rpr[i], OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this)); +} } else { snprintf(str1, sizeof(str1), "%s %d", g_Locale->getText(LOCALE_CI_EMPTY), i); tempMenu = new CMenuWidget(str1, NEUTRINO_ICON_SETTINGS); @@ -557,7 +561,6 @@ int CCAMMenuHandler::doMenu(int slot, CA_SLOT_TYPE slotType) menu_type = slotType; while(!doexit) { printf("CCAMMenuHandler::doMenu: enter menu for slot %d\n", slot); - timeoutEnd = CRCInput::calcTimeoutEnd(10); ca->MenuEnter(slotType, slot); @@ -620,15 +623,15 @@ bool CCAMMenuHandler::changeNotify(const neutrino_locale_t OptionName, void * Da return true; } else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_CI_RPR)) { - printf("CCAMMenuHandler::changeNotify: ci_rpr %d\n", g_settings.ci_rpr); - ca->SetCIRelevantPidsRouting(g_settings.ci_rpr); + printf("CCAMMenuHandler::changeNotify: ci_rpr[%d] %d\n", CISlot, g_settings.ci_rpr[CISlot]); + ca->SetCIRelevantPidsRouting(g_settings.ci_rpr[CISlot]); 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); + printf("CCAMMenuHandler::changeNotify: ci_clock[%s] %d\n", CISlot, g_settings.ci_clock[CISlot]); + ca->SetTSClock(g_settings.ci_clock[CISlot] * 1000000); return true; } else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_CI_SAVE_PINCODE)) { diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 85d965681..c288dc7eb 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -458,7 +458,7 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.clockrec = configfile.getInt32( "clockrec", 1); g_settings.video_dbdr = configfile.getInt32("video_dbdr", 0); - for(int i = 0; i < VIDEOMENU_VIDEOMODE_OPTION_COUNT; i++) { + for (int i = 0; i < VIDEOMENU_VIDEOMODE_OPTION_COUNT; i++) { sprintf(cfg_key, "enabled_video_mode_%d", i); g_settings.enabled_video_modes[i] = configfile.getInt32(cfg_key, 0); } @@ -468,7 +468,7 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.enabled_video_modes[9] = 1; // 720p 60Hz //NI #endif - for(int i = 0; i < VIDEOMENU_VIDEOMODE_OPTION_COUNT; i++) { + for (int i = 0; i < VIDEOMENU_VIDEOMODE_OPTION_COUNT; i++) { sprintf(cfg_key, "enabled_auto_mode_%d", i); g_settings.enabled_auto_modes[i] = configfile.getInt32(cfg_key, 1); } @@ -482,14 +482,25 @@ int CNeutrinoApp::loadSetup(const char * fname) #endif g_settings.ci_standby_reset = configfile.getInt32("ci_standby_reset", 0); + #if HAVE_ARM_HARDWARE || HAVE_MIPS_HARDWARE - g_settings.ci_clock = configfile.getInt32("ci_clock", 6); // TODO: for each slot + for (int i = 0; i < cCA::GetInstance()->GetNumberCISlots(); i++) { + sprintf(cfg_key, "ci_clock_%d", i); + g_settings.ci_clock[i] = configfile.getInt32(cfg_key, 6); + } #else - g_settings.ci_clock = configfile.getInt32("ci_clock", 9); // TODO: for each slot + for (int i = 0; i < cCA::GetInstance()->GetNumberCISlots(); i++) { + sprintf(cfg_key, "ci_clock_%d", i); + g_settings.ci_clock[i] = configfile.getInt32(cfg_key, 9); + } #endif + #if BOXMODEL_VUPLUS g_settings.ci_delay = configfile.getInt32("ci_delay", 256); - g_settings.ci_rpr = configfile.getInt32("ci_rpr", 0); // TODO: for each slot + for (int i = 0; i < cCA::GetInstance()->GetNumberCISlots(); i++) { + sprintf(cfg_key, "ci_rpr_%d", i); + g_settings.ci_rpr[i] = configfile.getInt32(cfg_key, 9); + } #endif g_settings.ci_ignore_messages = configfile.getInt32("ci_ignore_messages", 0); // TODO: for each slot g_settings.ci_save_pincode = configfile.getInt32("ci_save_pincode", 0); // TODO: for each slot @@ -1479,10 +1490,17 @@ void CNeutrinoApp::saveSetup(const char * fname) configfile.setInt32( "standby_cpufreq", g_settings.standby_cpufreq); configfile.setInt32("ci_standby_reset", g_settings.ci_standby_reset); - configfile.setInt32("ci_clock", g_settings.ci_clock); // TODO: for each slot + for (int i = 0; i < cCA::GetInstance()->GetNumberCISlots(); i++) { + sprintf(cfg_key, "ci_clock_%d", i); + configfile.setInt32(cfg_key, g_settings.ci_clock[i]); + } + #if BOXMODEL_VUPLUS - configfile.setInt32("ci_delay", g_settings.ci_delay); // TODO: for each slot - configfile.setInt32("ci_rpr", g_settings.ci_rpr); // TODO: for each slot + configfile.setInt32("ci_delay", g_settings.ci_delay); + for (int i = 0; i < cCA::GetInstance()->GetNumberCISlots(); i++) { + sprintf(cfg_key, "ci_rpr_%d", i); + configfile.setInt32(cfg_key, g_settings.ci_rpr[i]); + } #endif configfile.setInt32("ci_ignore_messages", g_settings.ci_ignore_messages); // TODO: for each slot configfile.setInt32("ci_save_pincode", g_settings.ci_save_pincode); // TODO: for each slot @@ -2746,10 +2764,10 @@ TIMER_START(); ZapStart_arg.startchannelradio_id = g_settings.startchannelradio_id; ZapStart_arg.uselastchannel = g_settings.uselastchannel; ZapStart_arg.video_mode = g_settings.video_Mode; - ZapStart_arg.ci_clock = g_settings.ci_clock; // TODO: for each slot + memcpy(ZapStart_arg.ci_clock, g_settings.ci_clock, sizeof(g_settings.ci_clock)); #if BOXMODEL_VUPLUS - ZapStart_arg.ci_delay = g_settings.ci_delay; // TODO: for each slot - ZapStart_arg.ci_rpr = g_settings.ci_rpr; // TODO: for each slot + ZapStart_arg.ci_delay = g_settings.ci_delay; + memcpy(ZapStart_arg.ci_rpr, g_settings.ci_rpr, sizeof(g_settings.ci_rpr)); #endif ZapStart_arg.volume = g_settings.hdmi_cec_volume ? 85 : g_settings.current_volume; ZapStart_arg.webtv_xml = &g_settings.webtv_xml; diff --git a/src/system/settings.h b/src/system/settings.h index e38562f1b..f23048d36 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -285,10 +285,10 @@ struct SNeutrinoSettings int avsync; int clockrec; int ci_standby_reset; - int ci_clock; // TODO: for each slot + int ci_clock[4]; #if BOXMODEL_VUPLUS int ci_delay; - int ci_rpr; // TODO: for each slot + int ci_rpr[4]; #endif int ci_ignore_messages; // TODO: for each slot int ci_save_pincode; // TODO: for each slot diff --git a/src/zapit/include/zapit/zapit.h b/src/zapit/include/zapit/zapit.h index 4128dd180..f022c15bf 100644 --- a/src/zapit/include/zapit/zapit.h +++ b/src/zapit/include/zapit/zapit.h @@ -44,10 +44,10 @@ typedef struct ZAPIT_start_arg int video_mode; uint32_t osd_resolution; int volume; - int ci_clock; // TODO: for each slot + int ci_clock[4]; #if BOXMODEL_VUPLUS int ci_delay; - int ci_rpr; // TODO: for each slot + int ci_rpr[4]; #endif std::list *webtv_xml; std::list *webradio_xml; diff --git a/src/zapit/src/zapit.cpp b/src/zapit/src/zapit.cpp index c11688721..7f7d2e68f 100644 --- a/src/zapit/src/zapit.cpp +++ b/src/zapit/src/zapit.cpp @@ -2594,16 +2594,22 @@ bool CZapit::Start(Z_start_arg *ZapStart_arg) } // set ci clock to ZapStart_arg->ci_clock - ca->SetTSClock(ZapStart_arg->ci_clock * 1000000); - ca->Start(); + for (int i = 0; i < ca->GetNumberCISlots(); i++) { + ca->SetTSClock(ZapStart_arg->ci_clock[i] * 1000000); + } #if BOXMODEL_VUPLUS //dvb wait delay for ci response ca->SetCIDelay(ZapStart_arg->ci_delay); + /// relevant pids routing - ca->SetCIRelevantPidsRouting(ZapStart_arg->ci_rpr); + for (int i = 0; i < ca->GetNumberCISlots(); i++) { + ca->SetCIRelevantPidsRouting(ZapStart_arg->ci_rpr[i]); + } #endif + ca->Start(); + eventServer = new CEventServer; if (!zapit_server.prepare(ZAPIT_UDS_NAME)) { perror(ZAPIT_UDS_NAME);