Merge remote-tracking branch 'uncool/cst-next'

This need buildfixes and some functional updates...


Origin commit data
------------------
Branch: ni/coolstream
Commit: eeee5bacab
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2015-12-13 (Sun, 13 Dec 2015)



------------------
This commit was generated by Migit
This commit is contained in:
Stefan Seyfried
2015-12-13 17:41:55 +01:00
320 changed files with 21291 additions and 13199 deletions

View File

@@ -52,6 +52,7 @@
#include <eitd/edvbstring.h>
#include <zapit/capmt.h>
#include <zapit/zapit.h>
#include <driver/abstime.h>
void CCAMMenuHandler::init(void)
{
@@ -107,13 +108,38 @@ int CCAMMenuHandler::doMainMenu()
CMenuWidget* cammenu = new CMenuWidget(LOCALE_CI_SETTINGS, NEUTRINO_ICON_SETTINGS);
cammenu->addIntroItems();
#ifdef BOXMODEL_APOLLO
int fecount = CFEManager::getInstance()->getFrontendCount();
char fename[fecount+1][255];
#endif
if (!g_settings.easymenu) {
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));
cammenu->addItem( new CMenuOptionNumberChooser(LOCALE_CI_CLOCK, &g_settings.ci_clock, true, 6, 12, 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));
#ifdef BOXMODEL_APOLLO
CMenuOptionChooser::keyval_ext feselect[fecount+1];
feselect[0].key = -1;
feselect[0].value = NONEXISTANT_LOCALE;
feselect[0].valname = g_Locale->getText(LOCALE_OPTIONS_OFF);
int select_count = 1;
for (int i = 0; i < fecount; i++) {
CFrontend * fe = CFEManager::getInstance()->getFE(i);
int num = fe->getNumber();
snprintf(fename[select_count], sizeof(fename[select_count]), "%d: %s", num+1, fe->getName());
feselect[select_count].key = num;
feselect[select_count].value = NONEXISTANT_LOCALE;
feselect[select_count].valname = fename[select_count];
select_count++;
}
CMenuOptionChooser * mc = new CMenuOptionChooser(LOCALE_CI_TUNER, &g_settings.ci_tuner, feselect, select_count, true, this);
cammenu->addItem(mc);
#endif
cammenu->addItem( GenericMenuSeparatorLine );
}
@@ -393,9 +419,26 @@ int CCAMMenuHandler::handleCamMsg(const neutrino_msg_t msg, neutrino_msg_data_t
std::string ENQAnswer;
CEnquiryInput *Inquiry = new CEnquiryInput((char *)convertDVBUTF8(pMmiEnquiry->enquiryText, strlen(pMmiEnquiry->enquiryText), 0).c_str(), &ENQAnswer, pMmiEnquiry->answerlen, pMmiEnquiry->blind != 0, NONEXISTANT_LOCALE);
Inquiry->exec(NULL, "");
delete Inquiry;
if (/* !from_menu && */ g_settings.ci_save_pincode && pMmiEnquiry->blind != 0 && (int) g_settings.ci_pincode.length() == pMmiEnquiry->answerlen) {
static int acount = 0;
static time_t last_ask = 0;
ENQAnswer = g_settings.ci_pincode;
printf("CCAMMenuHandler::handleCamMsg: using saved answer [%s] (#%d, time diff %d)\n", ENQAnswer.c_str(), acount, (int) (time_monotonic() - last_ask));
if ((time_monotonic() - last_ask) < 10) {
acount++;
if (acount > 4)
g_settings.ci_pincode.clear();
} else {
last_ask = time_monotonic();
acount = 0;
}
} else {
CEnquiryInput *Inquiry = new CEnquiryInput((char *)convertDVBUTF8(pMmiEnquiry->enquiryText, strlen(pMmiEnquiry->enquiryText), 0).c_str(), &ENQAnswer, pMmiEnquiry->answerlen, pMmiEnquiry->blind != 0, NONEXISTANT_LOCALE);
Inquiry->exec(NULL, "");
delete Inquiry;
g_settings.ci_pincode = ENQAnswer;
}
printf("CCAMMenuHandler::handleCamMsg: input=[%s]\n", ENQAnswer.c_str());
@@ -504,12 +547,23 @@ int CCAMMenuHandler::doMenu(int slot, CA_SLOT_TYPE slotType)
return res;
}
bool CCAMMenuHandler::changeNotify(const neutrino_locale_t OptionName, void * /*Data*/)
bool CCAMMenuHandler::changeNotify(const neutrino_locale_t OptionName, void * Data)
{
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);
return true;
}
else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_CI_SAVE_PINCODE)) {
int enabled = *(int *) Data;
if (!enabled) {
printf("CCAMMenuHandler::changeNotify: clear saved pincode\n");
g_settings.ci_pincode.clear();
}
}
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);
}
return false;
}