void CAdZapMenu::Init() { CChannelList *channelList = CNeutrinoApp::getInstance()->channelList; channelId = channelList ? channelList->getActiveChannel_ChannelID() : -1; if(channelList) channelName = channelList->getActiveChannelName(); evtlist.clear(); CEitManager::getInstance()->getEventsServiceKey(channelId & 0xFFFFFFFFFFFFULL, evtlist); monitorLifeTime.tv_sec = 0; if (!evtlist.empty()) { sort(evtlist.begin(), evtlist.end(), sortByDateTime); monitorLifeTime.tv_sec = getMonitorLifeTime(); Update(); } printf("CAdZapMenu::%s: monitorLifeTime.tv_sec: %d\n", __func__, (uint) monitorLifeTime.tv_sec); }
int CEventListHandler::exec(CMenuTarget* parent, const std::string &/*actionKey*/) { int res = menu_return::RETURN_REPAINT; EventList *e; CChannelList *channelList; if (parent) parent->hide(); e = new EventList; channelList = CNeutrinoApp::getInstance()->channelList; e->exec(live_channel_id, channelList->getActiveChannelName()); // UTF-8 delete e; return res; }
void CAdZapMenu::Settings() { CChannelList *channelList = CNeutrinoApp::getInstance()->channelList; channelId = channelList ? channelList->getActiveChannel_ChannelID() : -1; if (channelId < 0) return; channelName = channelList->getActiveChannelName(); CMenuWidget *menu = new CMenuWidget(LOCALE_ADZAP, "settings", width); menu->addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_ADZAP_SWITCHBACK)); neutrino_locale_t minute = LOCALE_ADZAP_MINUTE; for (int shortcut = 1; shortcut < 10; shortcut++) { char actionKey[2]; actionKey[0] = '0' + shortcut; actionKey[1] = 0; bool selected = g_settings.adzap_zapBackPeriod == 60 * shortcut; menu->addItem(new CMenuForwarder(minute, true, "", this, actionKey, CRCInput::convertDigitToKey (shortcut)), selected); minute = LOCALE_ADZAP_MINUTES; } menu->addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_ADZAP_COMMIT)); menu->addItem(new CMenuForwarder(LOCALE_ADZAP_ENABLE, true, "", this, "enable", CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN)); menu->addItem(new CMenuForwarder(LOCALE_ADZAP_DISABLE, true, "", this, "disable", CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED)); CChannelEventList evtlist; sectionsd_getEventsServiceKey(azm->channelId & 0xFFFFFFFFFFFFULL, evtlist); azm->monitorLifeTime.tv_sec = 0; if (!evtlist.empty()) { sort(evtlist.begin(), evtlist.end(), sortByDateTime); CChannelEventList::iterator eli; struct timespec ts; clock_gettime(CLOCK_REALTIME, &ts); for (eli = evtlist.begin(); eli != evtlist.end(); ++eli) { if ((uint) eli->startTime + eli->duration > ts.tv_sec) { azm->monitorLifeTime.tv_sec = (uint) eli->startTime + eli->duration; azm->Update(); break; } } } menu->addItem(new CMenuForwarder(LOCALE_ADZAP_MONITOR, azm->monitorLifeTime.tv_sec, "", this, "monitor", CRCInput::RC_blue, NEUTRINO_ICON_BUTTON_BLUE)); monitor = false; menu->exec(NULL, ""); menu->hide(); delete menu; Update(); }