eventlist: signalize remote timers

Origin commit data
------------------
Branch: ni/coolstream
Commit: 518d70158a
Author: TangoCash <eric@loxat.de>
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
This commit is contained in:
TangoCash
2019-04-25 22:40:11 +02:00
committed by vanhofen
parent 146e1ab7fa
commit 8d7680b8df
2 changed files with 20 additions and 17 deletions

View File

@@ -145,7 +145,9 @@ void CEventList::UpdateTimerList(void)
{ {
timerlist.clear(); timerlist.clear();
g_Timerd->getTimerList (timerlist); g_Timerd->getTimerList (timerlist);
g_Timerd->getRecordingSafety(timerPre,timerPost); CTimerList *Timerlist = new CTimerList;
Timerlist->RemoteBoxTimerList(timerlist);
sort(timerlist.begin(), timerlist.end());
} }
// Function: HasTimerConflicts // 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 // Houdini added for Private Premiere EPG, start sorted by start date/time
sort(evtlist.begin(),evtlist.end(),sortByDateTime); sort(evtlist.begin(),evtlist.end(),sortByDateTime);
timerlist.clear(); UpdateTimerList();
g_Timerd->getTimerList (timerlist);
} }
current_event = (unsigned int)-1; current_event = (unsigned int)-1;
@@ -369,7 +370,9 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna
}else{ }else{
readEvents(epg_id); readEvents(epg_id);
} }
UpdateTimerList(); UpdateTimerList();
g_Timerd->getRecordingSafety(timerPre,timerPost);
bool dont_hide = false; bool dont_hide = false;
paintHead(channel_id, channelname, channelname_prev, channelname_next); 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 if(etype == CTimerd::TIMER_RECORD) //remove timer event
{ {
g_Timerd->removeTimerEvent(tID); g_Timerd->removeTimerEvent(tID);
timerlist.clear(); UpdateTimerList();
g_Timerd->getTimerList (timerlist);
paint(evtlist[selected].channelID); paint(evtlist[selected].channelID);
paintFoot(evtlist[selected].channelID); paintFoot(evtlist[selected].channelID);
continue; continue;
@@ -532,8 +534,7 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna
m.exec(NULL, ""); m.exec(NULL, "");
timeoutEnd = CRCInput::calcTimeoutEnd(timeout); timeoutEnd = CRCInput::calcTimeoutEnd(timeout);
} }
timerlist.clear(); UpdateTimerList();
g_Timerd->getTimerList (timerlist);
paint(used_id); paint(used_id);
paintFoot(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); CTimerd::CTimerEventTypes etype = isScheduled(evtlist[selected].channelID, &evtlist[selected], &tID);
if(etype == CTimerd::TIMER_ZAPTO) { if(etype == CTimerd::TIMER_ZAPTO) {
g_Timerd->removeTimerEvent(tID); g_Timerd->removeTimerEvent(tID);
timerlist.clear(); UpdateTimerList();
g_Timerd->getTimerList (timerlist);
paint(evtlist[selected].channelID); paint(evtlist[selected].channelID);
paintFoot(evtlist[selected].channelID); paintFoot(evtlist[selected].channelID);
continue; 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].startTime - ANNOUNCETIME - (g_settings.zapto_pre_time * 60), 0,
evtlist[selected].eventID, evtlist[selected].startTime, 0); evtlist[selected].eventID, evtlist[selected].startTime, 0);
//ShowMsg(LOCALE_TIMER_EVENTTIMED_TITLE, LOCALE_TIMER_EVENTTIMED_MSG, CMsgBox::mbrBack, CMsgBox::mbBack, NEUTRINO_ICON_INFO); //ShowMsg(LOCALE_TIMER_EVENTTIMED_TITLE, LOCALE_TIMER_EVENTTIMED_MSG, CMsgBox::mbrBack, CMsgBox::mbBack, NEUTRINO_ICON_INFO);
timerlist.clear(); UpdateTimerList();
g_Timerd->getTimerList (timerlist);
paint(evtlist[selected].channelID ); paint(evtlist[selected].channelID );
paintFoot(evtlist[selected].channelID ); paintFoot(evtlist[selected].channelID );
timeoutEnd = CRCInput::calcTimeoutEnd(timeout); 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; CTimerList *Timerlist = new CTimerList;
Timerlist->exec(NULL, ""); Timerlist->exec(NULL, "");
delete Timerlist; delete Timerlist;
timerlist.clear(); UpdateTimerList();
g_Timerd->getTimerList (timerlist);
paintHead(channel_id, channelname); paintHead(channel_id, channelname);
oldIndex = -1; oldIndex = -1;
@@ -646,8 +644,7 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna
g_RCInput->postMsg( msg, data ); g_RCInput->postMsg( msg, data );
} }
/* in case timer was added in g_EpgData */ /* in case timer was added in g_EpgData */
timerlist.clear(); UpdateTimerList();
g_Timerd->getTimerList (timerlist);
paintHead(channel_id, in_search ? search_head_name : channelname); paintHead(channel_id, in_search ? search_head_name : channelname);
oldIndex = -1; oldIndex = -1;
oldEventID = -1; oldEventID = -1;
@@ -710,7 +707,7 @@ CTimerd::CTimerEventTypes CEventList::isScheduled(t_channel_id channel_id, CChan
{ {
CTimerd::TimerList::iterator timer = timerlist.begin(); CTimerd::TimerList::iterator timer = timerlist.begin();
for(; timer != timerlist.end(); ++timer) { 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->epgID == event->eventID) {
if(timer->epg_starttime == event->startTime) { if(timer->epg_starttime == event->startTime) {
bool isTimeShiftTimer = false; bool isTimeShiftTimer = false;
@@ -725,6 +722,10 @@ CTimerd::CTimerEventTypes CEventList::isScheduled(t_channel_id channel_id, CChan
return timer->eventType; 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; 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; const char * icontype = etype == CTimerd::TIMER_ZAPTO ? NEUTRINO_ICON_MARKER_ZAP : 0;
if(etype == CTimerd::TIMER_RECORD){ if(etype == CTimerd::TIMER_RECORD){
icontype = NEUTRINO_ICON_MARKER_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{ }else{
if (timerID > 0 && CRecordManager::getInstance()->CheckRecordingId_if_Timeshift(timerID)) if (timerID > 0 && CRecordManager::getInstance()->CheckRecordingId_if_Timeshift(timerID))
icontype = NEUTRINO_ICON_MARKER_TIMESHIFT; icontype = NEUTRINO_ICON_MARKER_TIMESHIFT;

View File

@@ -88,7 +88,6 @@ class CTimerList : public CMenuTarget, public CListHelpers
int newTimer(); int newTimer();
/* todo: properly import the enum CVFD::MODES */ /* todo: properly import the enum CVFD::MODES */
CVFD::MODES saved_displaymode; CVFD::MODES saved_displaymode;
void RemoteBoxTimerList(CTimerd::TimerList &timerlist);
bool RemoteBoxSetup(); bool RemoteBoxSetup();
void RemoteBoxSelect(); void RemoteBoxSelect();
std::string RemoteBoxConnectUrl(std::string _rbname); 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 const char * convertTimerType2String(const CTimerd::CTimerEventTypes type); // UTF-8
static std::string convertTimerRepeat2String(const CTimerd::CTimerEventRepeat rep); // UTF-8 static std::string convertTimerRepeat2String(const CTimerd::CTimerEventRepeat rep); // UTF-8
static std::string convertChannelId2String(const t_channel_id id); // 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); bool askUserOnTimerConflict(time_t announceTime, time_t stopTime, t_channel_id channel_id = 0);