From 8d7680b8df7d83a58a5b814f65aa73413216d473 Mon Sep 17 00:00:00 2001 From: TangoCash Date: Thu, 25 Apr 2019 22:40:11 +0200 Subject: [PATCH] eventlist: signalize remote timers Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/518d70158a4c6965e8bb4e769f2e68bd166edfdf Author: TangoCash Date: 2019-04-25 (Thu, 25 Apr 2019) Origin message was: ------------------ - eventlist: signalize remote timers ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/eventlist.cpp | 35 +++++++++++++++++++---------------- src/gui/timerlist.h | 2 +- 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index 1e0858e69..d5f28f116 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -145,7 +145,9 @@ void CEventList::UpdateTimerList(void) { timerlist.clear(); g_Timerd->getTimerList (timerlist); - g_Timerd->getRecordingSafety(timerPre,timerPost); + CTimerList *Timerlist = new CTimerList; + Timerlist->RemoteBoxTimerList(timerlist); + sort(timerlist.begin(), timerlist.end()); } // Function: HasTimerConflicts @@ -230,8 +232,7 @@ void CEventList::readEvents(const t_channel_id channel_id) // Houdini added for Private Premiere EPG, start sorted by start date/time sort(evtlist.begin(),evtlist.end(),sortByDateTime); - timerlist.clear(); - g_Timerd->getTimerList (timerlist); + UpdateTimerList(); } current_event = (unsigned int)-1; @@ -369,7 +370,9 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna }else{ readEvents(epg_id); } + UpdateTimerList(); + g_Timerd->getRecordingSafety(timerPre,timerPost); bool dont_hide = false; paintHead(channel_id, channelname, channelname_prev, channelname_next); @@ -477,8 +480,7 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna if(etype == CTimerd::TIMER_RECORD) //remove timer event { g_Timerd->removeTimerEvent(tID); - timerlist.clear(); - g_Timerd->getTimerList (timerlist); + UpdateTimerList(); paint(evtlist[selected].channelID); paintFoot(evtlist[selected].channelID); continue; @@ -532,8 +534,7 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna m.exec(NULL, ""); timeoutEnd = CRCInput::calcTimeoutEnd(timeout); } - timerlist.clear(); - g_Timerd->getTimerList (timerlist); + UpdateTimerList(); paint(used_id); paintFoot(used_id); } @@ -544,8 +545,7 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna CTimerd::CTimerEventTypes etype = isScheduled(evtlist[selected].channelID, &evtlist[selected], &tID); if(etype == CTimerd::TIMER_ZAPTO) { g_Timerd->removeTimerEvent(tID); - timerlist.clear(); - g_Timerd->getTimerList (timerlist); + UpdateTimerList(); paint(evtlist[selected].channelID); paintFoot(evtlist[selected].channelID); continue; @@ -556,8 +556,7 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna evtlist[selected].startTime - ANNOUNCETIME - (g_settings.zapto_pre_time * 60), 0, evtlist[selected].eventID, evtlist[selected].startTime, 0); //ShowMsg(LOCALE_TIMER_EVENTTIMED_TITLE, LOCALE_TIMER_EVENTTIMED_MSG, CMsgBox::mbrBack, CMsgBox::mbBack, NEUTRINO_ICON_INFO); - timerlist.clear(); - g_Timerd->getTimerList (timerlist); + UpdateTimerList(); paint(evtlist[selected].channelID ); paintFoot(evtlist[selected].channelID ); timeoutEnd = CRCInput::calcTimeoutEnd(timeout); @@ -602,8 +601,7 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna CTimerList *Timerlist = new CTimerList; Timerlist->exec(NULL, ""); delete Timerlist; - timerlist.clear(); - g_Timerd->getTimerList (timerlist); + UpdateTimerList(); paintHead(channel_id, channelname); oldIndex = -1; @@ -646,8 +644,7 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna g_RCInput->postMsg( msg, data ); } /* in case timer was added in g_EpgData */ - timerlist.clear(); - g_Timerd->getTimerList (timerlist); + UpdateTimerList(); paintHead(channel_id, in_search ? search_head_name : channelname); oldIndex = -1; oldEventID = -1; @@ -710,7 +707,7 @@ CTimerd::CTimerEventTypes CEventList::isScheduled(t_channel_id channel_id, CChan { CTimerd::TimerList::iterator timer = timerlist.begin(); for(; timer != timerlist.end(); ++timer) { - if(timer->channel_id == channel_id && (timer->eventType == CTimerd::TIMER_ZAPTO || timer->eventType == CTimerd::TIMER_RECORD)) { + if(timer->channel_id == channel_id && (timer->eventType == CTimerd::TIMER_ZAPTO || timer->eventType == CTimerd::TIMER_RECORD || CTimerd::TIMER_REMOTEBOX)) { if(timer->epgID == event->eventID) { if(timer->epg_starttime == event->startTime) { bool isTimeShiftTimer = false; @@ -725,6 +722,10 @@ CTimerd::CTimerEventTypes CEventList::isScheduled(t_channel_id channel_id, CChan return timer->eventType; } } + if (timer->eventType == CTimerd::TIMER_REMOTEBOX && timer->alarmTime + timer->rem_pre == event->startTime) { + printf("alarmTime: %ld + rem_pre %d = startTime %ld ?\n",timer->alarmTime, timer->rem_pre, event->startTime); + return timer->eventType; + } } } return (CTimerd::CTimerEventTypes) 0; @@ -799,6 +800,8 @@ void CEventList::paintItem(unsigned int pos, t_channel_id channel_idI) const char * icontype = etype == CTimerd::TIMER_ZAPTO ? NEUTRINO_ICON_MARKER_ZAP : 0; if(etype == CTimerd::TIMER_RECORD){ icontype = NEUTRINO_ICON_MARKER_RECORD; + }else if (etype == CTimerd::TIMER_REMOTEBOX){ + icontype = NEUTRINO_ICON_MARKER_RECORD_GRAY; // do we need another icon for remote timers? }else{ if (timerID > 0 && CRecordManager::getInstance()->CheckRecordingId_if_Timeshift(timerID)) icontype = NEUTRINO_ICON_MARKER_TIMESHIFT; diff --git a/src/gui/timerlist.h b/src/gui/timerlist.h index b0e7b84b9..9142abc4e 100644 --- a/src/gui/timerlist.h +++ b/src/gui/timerlist.h @@ -88,7 +88,6 @@ class CTimerList : public CMenuTarget, public CListHelpers int newTimer(); /* todo: properly import the enum CVFD::MODES */ CVFD::MODES saved_displaymode; - void RemoteBoxTimerList(CTimerd::TimerList &timerlist); bool RemoteBoxSetup(); void RemoteBoxSelect(); std::string RemoteBoxConnectUrl(std::string _rbname); @@ -110,6 +109,7 @@ class CTimerList : public CMenuTarget, public CListHelpers static const char * convertTimerType2String(const CTimerd::CTimerEventTypes type); // UTF-8 static std::string convertTimerRepeat2String(const CTimerd::CTimerEventRepeat rep); // UTF-8 static std::string convertChannelId2String(const t_channel_id id); // UTF-8 + void RemoteBoxTimerList(CTimerd::TimerList &timerlist); }; bool askUserOnTimerConflict(time_t announceTime, time_t stopTime, t_channel_id channel_id = 0);