Compile under VDR 2.3.1

This commit is contained in:
kamel5 2018-03-08 13:02:38 +01:00 committed by kamel5
parent 8287bb5f7d
commit cbc6f44264
19 changed files with 670 additions and 5 deletions

View File

@ -5,9 +5,15 @@ cChannelColumn::cChannelColumn(int num, const cChannel *channel, cMyTime *myTime
this->channel = channel; this->channel = channel;
this->num = num; this->num = num;
this->myTime = myTime; this->myTime = myTime;
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
#else
hasTimer = channel->HasTimer(); hasTimer = channel->HasTimer();
#endif
hasSwitchTimer = SwitchTimers.ChannelInSwitchList(channel); hasSwitchTimer = SwitchTimers.ChannelInSwitchList(channel);
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
#else
schedulesLock = new cSchedulesLock(false, 100); schedulesLock = new cSchedulesLock(false, 100);
#endif
header = NULL; header = NULL;
} }
@ -15,7 +21,10 @@ cChannelColumn::~cChannelColumn(void) {
if (header) if (header)
delete header; delete header;
grids.Clear(); grids.Clear();
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
#else
delete schedulesLock; delete schedulesLock;
#endif
} }
void cChannelColumn::clearGrids() { void cChannelColumn::clearGrids() {
@ -33,7 +42,12 @@ void cChannelColumn::drawHeader() {
} }
bool cChannelColumn::readGrids() { bool cChannelColumn::readGrids() {
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
LOCK_SCHEDULES_READ;
const cSchedules* schedules = Schedules;
#else
schedules = cSchedules::Schedules(*schedulesLock); schedules = cSchedules::Schedules(*schedulesLock);
#endif
const cSchedule *Schedule = NULL; const cSchedule *Schedule = NULL;
Schedule = schedules->GetSchedule(channel); Schedule = schedules->GetSchedule(channel);
if (!Schedule) { if (!Schedule) {
@ -186,7 +200,12 @@ void cChannelColumn::AddNewGridsAtStart() {
return; return;
} }
//if not, i have to add new ones to the list //if not, i have to add new ones to the list
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
LOCK_SCHEDULES_READ;
const cSchedules* schedules = Schedules;
#else
schedules = cSchedules::Schedules(*schedulesLock); schedules = cSchedules::Schedules(*schedulesLock);
#endif
const cSchedule *Schedule = NULL; const cSchedule *Schedule = NULL;
Schedule = schedules->GetSchedule(channel); Schedule = schedules->GetSchedule(channel);
if (!Schedule) { if (!Schedule) {
@ -234,7 +253,12 @@ void cChannelColumn::AddNewGridsAtEnd() {
return; return;
} }
//if not, i have to add new ones to the list //if not, i have to add new ones to the list
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
LOCK_SCHEDULES_READ;
const cSchedules* schedules = Schedules;
#else
schedules = cSchedules::Schedules(*schedulesLock); schedules = cSchedules::Schedules(*schedulesLock);
#endif
const cSchedule *Schedule = NULL; const cSchedule *Schedule = NULL;
Schedule = schedules->GetSchedule(channel); Schedule = schedules->GetSchedule(channel);
if (!Schedule) { if (!Schedule) {
@ -342,7 +366,10 @@ cGrid *cChannelColumn::addDummyGrid(time_t start, time_t end, cGrid *firstGrid,
} }
void cChannelColumn::SetTimers() { void cChannelColumn::SetTimers() {
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
#else
hasTimer = channel->HasTimer(); hasTimer = channel->HasTimer();
#endif
hasSwitchTimer = SwitchTimers.ChannelInSwitchList(channel); hasSwitchTimer = SwitchTimers.ChannelInSwitchList(channel);
for (cGrid *grid = grids.First(); grid; grid = grids.Next(grid)) { for (cGrid *grid = grids.First(); grid; grid = grids.Next(grid)) {
bool gridHadTimer = grid->HasTimer(); bool gridHadTimer = grid->HasTimer();

View File

@ -20,7 +20,10 @@ private:
const cChannel *channel; const cChannel *channel;
cHeaderGrid *header; cHeaderGrid *header;
cList<cGrid> grids; cList<cGrid> grids;
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
#else
cSchedulesLock *schedulesLock; cSchedulesLock *schedulesLock;
#endif
const cSchedules *schedules; const cSchedules *schedules;
bool hasTimer; bool hasTimer;
bool hasSwitchTimer; bool hasSwitchTimer;
@ -50,7 +53,11 @@ public:
void ClearOutdatedEnd(); void ClearOutdatedEnd();
int GetNum() {return num;}; int GetNum() {return num;};
void SetNum(int num) {this->num = num;}; void SetNum(int num) {this->num = num;};
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
void setTimer();
#else
void setTimer() {hasTimer = channel->HasTimer();}; void setTimer() {hasTimer = channel->HasTimer();};
#endif
bool HasTimer() { return hasTimer; }; bool HasTimer() { return hasTimer; };
void setSwitchTimer() {hasSwitchTimer = SwitchTimers.ChannelInSwitchList(channel);}; void setSwitchTimer() {hasSwitchTimer = SwitchTimers.ChannelInSwitchList(channel);};
bool HasSwitchTimer() { return hasSwitchTimer; }; bool HasSwitchTimer() { return hasSwitchTimer; };

View File

@ -10,12 +10,21 @@ cChannelGroups::~cChannelGroups(void) {
void cChannelGroups::ReadChannelGroups(void) { void cChannelGroups::ReadChannelGroups(void) {
bool setStart = false; bool setStart = false;
int lastChannelNumber = 0; int lastChannelNumber = 0;
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
LOCK_CHANNELS_READ;
const cChannel *first = Channels->First();
#else
const cChannel *first = Channels.First(); const cChannel *first = Channels.First();
#endif
if (!first->GroupSep()) { if (!first->GroupSep()) {
channelGroups.push_back(cChannelGroup(tr("Main Program"))); channelGroups.push_back(cChannelGroup(tr("Main Program")));
setStart = true; setStart = true;
} }
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
for (const cChannel *channel = Channels->First(); channel; channel = Channels->Next(channel)) {
#else
for (const cChannel *channel = Channels.First(); channel; channel = Channels.Next(channel)) { for (const cChannel *channel = Channels.First(); channel; channel = Channels.Next(channel)) {
#endif
if (setStart && (channelGroups.size() > 0)) { if (setStart && (channelGroups.size() > 0)) {
channelGroups[channelGroups.size()-1].SetChannelStart(channel->Number()); channelGroups[channelGroups.size()-1].SetChannelStart(channel->Number());
setStart = false; setStart = false;
@ -103,7 +112,12 @@ void cChannelGroups::DrawChannelGroups(const cChannel *start, const cChannel *st
int groupLast = group; int groupLast = group;
int line = 0; int line = 0;
int lineStart = 0; int lineStart = 0;
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
LOCK_CHANNELS_READ;
for (const cChannel *channel = Channels->Next(start); channel; channel = Channels->Next(channel)) {
#else
for (const cChannel *channel = Channels.Next(start); channel; channel = Channels.Next(channel)) { for (const cChannel *channel = Channels.Next(start); channel; channel = Channels.Next(channel)) {
#endif
if (channel->GroupSep()) if (channel->GroupSep())
continue; continue;
group = GetGroup(channel); group = GetGroup(channel);

View File

@ -11,7 +11,12 @@ cChannelJump::cChannelJump(cChannelGroups *channelGroups) {
pixmapText = NULL; pixmapText = NULL;
channel = 0; channel = 0;
if (!tvguideConfig.hideLastGroup) { if (!tvguideConfig.hideLastGroup) {
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
LOCK_CHANNELS_READ;
maxChannels = Channels->MaxNumber();
#else
maxChannels = Channels.MaxNumber(); maxChannels = Channels.MaxNumber();
#endif
} else { } else {
maxChannels = channelGroups->GetLastValidChannel(); maxChannels = channelGroups->GetLastValidChannel();
} }

View File

@ -9,7 +9,12 @@ cDetailView::~cDetailView(void){
Cancel(-1); Cancel(-1);
while (Active()) while (Active())
cCondWait::SleepMs(10); cCondWait::SleepMs(10);
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
LOCK_CHANNELS_READ;
footer->LeaveDetailedViewMode(Channels->GetByChannelID(event->ChannelID()));
#else
footer->LeaveDetailedViewMode(Channels.GetByChannelID(event->ChannelID())); footer->LeaveDetailedViewMode(Channels.GetByChannelID(event->ChannelID()));
#endif
if (view) if (view)
delete view; delete view;
} }
@ -42,7 +47,12 @@ void cDetailView::InitiateView(void) {
dateTime = cString::sprintf("%s %s - %s (%d %s)", *event->GetDateString(), *event->GetTimeString(), *event->GetEndTimeString(), event->Duration()/60, tr("min")); dateTime = cString::sprintf("%s %s - %s (%d %s)", *event->GetDateString(), *event->GetTimeString(), *event->GetEndTimeString(), event->Duration()/60, tr("min"));
} }
view->SetDateTime(*dateTime); view->SetDateTime(*dateTime);
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
LOCK_CHANNELS_READ;
view->SetChannel(Channels->GetByChannelID(event->ChannelID(), true));
#else
view->SetChannel(Channels.GetByChannelID(event->ChannelID(), true)); view->SetChannel(Channels.GetByChannelID(event->ChannelID(), true));
#endif
view->SetEventID(event->EventID()); view->SetEventID(event->EventID());
view->SetEvent(event); view->SetEvent(event);
} }
@ -90,7 +100,12 @@ std::string cDetailView::LoadReruns(void) {
continue; continue;
i++; i++;
sstrReruns << *DayDateTime(r->event->StartTime()); sstrReruns << *DayDateTime(r->event->StartTime());
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
LOCK_CHANNELS_READ;
const cChannel *channel = Channels->GetByChannelID(r->event->ChannelID(), true, true);
#else
cChannel *channel = Channels.GetByChannelID(r->event->ChannelID(), true, true); cChannel *channel = Channels.GetByChannelID(r->event->ChannelID(), true, true);
#endif
if (channel) { if (channel) {
sstrReruns << ", " << trVDR("Channel") << " " << channel->Number() << ":"; sstrReruns << ", " << trVDR("Channel") << " " << channel->Number() << ":";
sstrReruns << " " << channel->ShortName(true); sstrReruns << " " << channel->ShortName(true);

View File

@ -280,7 +280,12 @@ void cImageCache::CreateLogoCache(void) {
return; return;
if (tvguideConfig.numLogosInitial > 0) { if (tvguideConfig.numLogosInitial > 0) {
int channelsCached = 0; int channelsCached = 0;
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
LOCK_CHANNELS_READ;
for (const cChannel *channel = Channels->First(); channel; channel = Channels->Next(channel)) {
#else
for (const cChannel *channel = Channels.First(); channel; channel = Channels.Next(channel)) { for (const cChannel *channel = Channels.First(); channel; channel = Channels.Next(channel)) {
#endif
if (channelsCached >= tvguideConfig.numLogosInitial) if (channelsCached >= tvguideConfig.numLogosInitial)
break; break;
if (!channel->GroupSep()) { if (!channel->GroupSep()) {

View File

@ -10,6 +10,7 @@
#include "tools.h" #include "tools.h"
#include "switchtimer.h" #include "switchtimer.h"
#include "timerconflict.h" #include "timerconflict.h"
#include <vdr/timers.h>
#include "recmanager.h" #include "recmanager.h"
static int CompareRecording(const void *p1, const void *p2) { static int CompareRecording(const void *p1, const void *p2) {
@ -55,15 +56,27 @@ bool cRecManager::CheckEventForTimer(const cEvent *event) {
return hasTimer; return hasTimer;
} }
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
const cTimer *cRecManager::GetTimerForEvent(const cEvent *event) {
const cTimer *timer = NULL;
#else
cTimer *cRecManager::GetTimerForEvent(const cEvent *event) { cTimer *cRecManager::GetTimerForEvent(const cEvent *event) {
cTimer *timer = NULL; cTimer *timer = NULL;
#endif
if (tvguideConfig.useRemoteTimers && pRemoteTimers) { if (tvguideConfig.useRemoteTimers && pRemoteTimers) {
RemoteTimers_GetMatch_v1_0 rtMatch; RemoteTimers_GetMatch_v1_0 rtMatch;
rtMatch.event = event; rtMatch.event = event;
pRemoteTimers->Service("RemoteTimers::GetMatch-v1.0", &rtMatch); pRemoteTimers->Service("RemoteTimers::GetMatch-v1.0", &rtMatch);
timer = rtMatch.timer; timer = rtMatch.timer;
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
return timer;
}
LOCK_TIMERS_READ;
timer = Timers->GetMatch(event);
#else
} else } else
timer = Timers.GetMatch(event); timer = Timers.GetMatch(event);
#endif
return timer; return timer;
} }
@ -79,19 +92,36 @@ cTimer *cRecManager::createTimer(const cEvent *event, std::string path) {
cTimer *cRecManager::createLocalTimer(const cEvent *event, std::string path) { cTimer *cRecManager::createLocalTimer(const cEvent *event, std::string path) {
cTimer *timer = new cTimer(event); cTimer *timer = new cTimer(event);
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
LOCK_TIMERS_WRITE;
cTimer *t = Timers->GetTimer(timer);
#else
cTimer *t = Timers.GetTimer(timer); cTimer *t = Timers.GetTimer(timer);
#endif
if (t) { if (t) {
t->OnOff(); t->OnOff();
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
t->SetEvent(event);
#else
t->SetEventFromSchedule(); t->SetEventFromSchedule();
#endif
delete timer; delete timer;
timer = t; timer = t;
isyslog("timer %s reactivated", *t->ToDescr()); isyslog("timer %s reactivated", *t->ToDescr());
} else { } else {
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
Timers->Add(timer);
#else
Timers.Add(timer); Timers.Add(timer);
#endif
isyslog("timer %s added (active)", *timer->ToDescr()); isyslog("timer %s added (active)", *timer->ToDescr());
} }
SetTimerPath(timer, event, path); SetTimerPath(timer, event, path);
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
Timers->SetModified();
#else
Timers.SetModified(); Timers.SetModified();
#endif
return timer; return timer;
} }
@ -148,7 +178,12 @@ void cRecManager::SetTimerPath(cTimer *timer, const cEvent *event, std::string p
} }
void cRecManager::DeleteTimer(int timerID) { void cRecManager::DeleteTimer(int timerID) {
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
LOCK_TIMERS_READ;
const cTimer *t = Timers->Get(timerID);
#else
cTimer *t = Timers.Get(timerID); cTimer *t = Timers.Get(timerID);
#endif
if (!t) if (!t)
return; return;
DeleteTimer(t); DeleteTimer(t);
@ -165,21 +200,43 @@ void cRecManager::DeleteTimer(const cEvent *event) {
} }
void cRecManager::DeleteLocalTimer(const cEvent *event) { void cRecManager::DeleteLocalTimer(const cEvent *event) {
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
LOCK_TIMERS_READ;
const cTimer *t = Timers->GetMatch(event);
#else
cTimer *t = Timers.GetMatch(event); cTimer *t = Timers.GetMatch(event);
#endif
if (!t) if (!t)
return; return;
DeleteTimer(t); DeleteTimer(t);
} }
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
void cRecManager::DeleteTimer(const cTimer *timer) {
LOCK_TIMERS_WRITE;
cTimers* timers = Timers;
cTimer* t = timers->GetTimer((cTimer*)timer); // #TODO dirty cast
if (t->Recording()) {
t->Skip();
cRecordControls::Process(timers, time(NULL));
}
#else
void cRecManager::DeleteTimer(cTimer *timer) { void cRecManager::DeleteTimer(cTimer *timer) {
if (timer->Recording()) { if (timer->Recording()) {
timer->Skip(); timer->Skip();
cRecordControls::Process(time(NULL)); cRecordControls::Process(time(NULL));
} }
#endif
isyslog("timer %s deleted", *timer->ToDescr()); isyslog("timer %s deleted", *timer->ToDescr());
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
timers->Del(t, true);
timers->SetModified();
#else
Timers.Del(timer, true); Timers.Del(timer, true);
Timers.SetModified(); Timers.SetModified();
#endif
} }
void cRecManager::DeleteRemoteTimer(const cEvent *event) { void cRecManager::DeleteRemoteTimer(const cEvent *event) {
@ -196,7 +253,11 @@ void cRecManager::DeleteRemoteTimer(const cEvent *event) {
} }
} }
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
void cRecManager::SaveTimer(const cTimer *timer, cTimer newTimerSettings) {
#else
void cRecManager::SaveTimer(cTimer *timer, cTimer newTimerSettings) { void cRecManager::SaveTimer(cTimer *timer, cTimer newTimerSettings) {
#endif
if (!timer) if (!timer)
return; return;
@ -208,33 +269,63 @@ void cRecManager::SaveTimer(cTimer *timer, cTimer newTimerSettings) {
int stop = newTimerSettings.Stop(); int stop = newTimerSettings.Stop();
std::string fileName = newTimerSettings.File(); std::string fileName = newTimerSettings.File();
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
((cTimer*)timer)->SetDay(day);
((cTimer*)timer)->SetStart(start);
((cTimer*)timer)->SetStop(stop);
((cTimer*)timer)->SetPriority(prio);
((cTimer*)timer)->SetLifetime(lifetime);
((cTimer*)timer)->SetFile(fileName.c_str());
#else
timer->SetDay(day); timer->SetDay(day);
timer->SetStart(start); timer->SetStart(start);
timer->SetStop(stop); timer->SetStop(stop);
timer->SetPriority(prio); timer->SetPriority(prio);
timer->SetLifetime(lifetime); timer->SetLifetime(lifetime);
timer->SetFile(fileName.c_str()); timer->SetFile(fileName.c_str());
#endif
if (timer->HasFlags(tfActive) && !active) if (timer->HasFlags(tfActive) && !active)
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
((cTimer*)timer)->ClrFlags(tfActive);
else if (!timer->HasFlags(tfActive) && active)
((cTimer*)timer)->SetFlags(tfActive);
#else
timer->ClrFlags(tfActive); timer->ClrFlags(tfActive);
else if (!timer->HasFlags(tfActive) && active) else if (!timer->HasFlags(tfActive) && active)
timer->SetFlags(tfActive); timer->SetFlags(tfActive);
timer->SetEventFromSchedule(); timer->SetEventFromSchedule();
#endif
if (tvguideConfig.useRemoteTimers && pRemoteTimers) { if (tvguideConfig.useRemoteTimers && pRemoteTimers) {
RemoteTimers_Timer_v1_0 rt; RemoteTimers_Timer_v1_0 rt;
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
rt.timer = (cTimer*)timer;
#else
rt.timer = timer; rt.timer = timer;
#endif
if (!pRemoteTimers->Service("RemoteTimers::ModTimer-v1.0", &rt)) if (!pRemoteTimers->Service("RemoteTimers::ModTimer-v1.0", &rt))
rt.timer = NULL; rt.timer = NULL;
RefreshRemoteTimers(); RefreshRemoteTimers();
} else { } else {
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
LOCK_TIMERS_WRITE;
Timers->SetModified();
#else
Timers.SetModified(); Timers.SetModified();
#endif
} }
} }
bool cRecManager::IsRecorded(const cEvent *event) { bool cRecManager::IsRecorded(const cEvent *event) {
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
LOCK_TIMERS_WRITE;
cTimer *timer = Timers->GetMatch(event);
#else
cTimer *timer = Timers.GetMatch(event); cTimer *timer = Timers.GetMatch(event);
#endif
if (!timer) if (!timer)
return false; return false;
return timer->Recording(); return timer->Recording();
@ -260,7 +351,10 @@ cTVGuideTimerConflicts *cRecManager::CheckTimerConflict(void) {
} }
void cRecManager::CreateSeriesTimer(cTimer *seriesTimer) { void cRecManager::CreateSeriesTimer(cTimer *seriesTimer) {
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
#else
seriesTimer->SetEventFromSchedule(); seriesTimer->SetEventFromSchedule();
#endif
if (tvguideConfig.useRemoteTimers && pRemoteTimers) { if (tvguideConfig.useRemoteTimers && pRemoteTimers) {
RemoteTimers_Timer_v1_0 rt; RemoteTimers_Timer_v1_0 rt;
rt.timer = seriesTimer; rt.timer = seriesTimer;
@ -268,8 +362,15 @@ void cRecManager::CreateSeriesTimer(cTimer *seriesTimer) {
isyslog("%s", *rt.errorMsg); isyslog("%s", *rt.errorMsg);
RefreshRemoteTimers(); RefreshRemoteTimers();
} else { } else {
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
LOCK_TIMERS_WRITE;
cTimers* timers = Timers;
timers->Add(seriesTimer);
timers->SetModified();
#else
Timers.Add(seriesTimer); Timers.Add(seriesTimer);
Timers.SetModified(); Timers.SetModified();
#endif
} }
} }
@ -316,9 +417,14 @@ const cEvent **cRecManager::PerformSearchTimerSearch(std::string epgSearchString
numResults = results.size(); numResults = results.size();
if (numResults > 0) { if (numResults > 0) {
searchResults = new const cEvent *[numResults]; searchResults = new const cEvent *[numResults];
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
LOCK_SCHEDULES_READ;
const cSchedules* schedules = Schedules;
#else
cSchedulesLock schedulesLock; cSchedulesLock schedulesLock;
const cSchedules *schedules; const cSchedules *schedules;
schedules = cSchedules::Schedules(schedulesLock); schedules = cSchedules::Schedules(schedulesLock);
#endif
const cEvent *event = NULL; const cEvent *event = NULL;
int index=0; int index=0;
for (std::list<std::string>::iterator it=results.begin(); it != results.end(); ++it) { for (std::list<std::string>::iterator it=results.begin(); it != results.end(); ++it) {
@ -328,7 +434,12 @@ const cEvent **cRecManager::PerformSearchTimerSearch(std::string epgSearchString
int eventID = atoi(flds[1].c_str()); int eventID = atoi(flds[1].c_str());
std::string channelID = flds[7]; std::string channelID = flds[7];
tChannelID chanID = tChannelID::FromString(channelID.c_str()); tChannelID chanID = tChannelID::FromString(channelID.c_str());
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
LOCK_CHANNELS_READ;
const cChannel *channel = Channels->GetByChannelID(chanID);
#else
cChannel *channel = Channels.GetByChannelID(chanID); cChannel *channel = Channels.GetByChannelID(chanID);
#endif
if (channel) { if (channel) {
const cSchedule *Schedule = NULL; const cSchedule *Schedule = NULL;
Schedule = schedules->GetSchedule(channel); Schedule = schedules->GetSchedule(channel);
@ -435,24 +546,45 @@ void cRecManager::DeleteSearchTimer(cTVGuideSearchTimer *searchTimer, bool delTi
return; return;
int searchTimerID = searchTimer->GetID(); int searchTimerID = searchTimer->GetID();
if (delTimers) { if (delTimers) {
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
LOCK_TIMERS_WRITE;
cTimer *timer = Timers->First();
#else
cTimer *timer = Timers.First(); cTimer *timer = Timers.First();
#endif
while(timer) { while(timer) {
if (!timer->Recording()) { if (!timer->Recording()) {
char* searchID = GetAuxValue(timer, "s-id"); char* searchID = GetAuxValue(timer, "s-id");
if (searchID) { if (searchID) {
if (searchTimerID == atoi(searchID)) { if (searchTimerID == atoi(searchID)) {
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
cTimer* timerNext = Timers->Next(timer);
#else
cTimer* timerNext = Timers.Next(timer); cTimer* timerNext = Timers.Next(timer);
#endif
DeleteTimer(timer); DeleteTimer(timer);
timer = timerNext; timer = timerNext;
} else { } else {
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
timer = Timers->Next(timer);
#else
timer = Timers.Next(timer); timer = Timers.Next(timer);
#endif
} }
free(searchID); free(searchID);
} else { } else {
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
timer = Timers->Next(timer);
#else
timer = Timers.Next(timer); timer = Timers.Next(timer);
#endif
} }
} else { } else {
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
timer = Timers->Next(timer);
#else
timer = Timers.Next(timer); timer = Timers.Next(timer);
#endif
} }
} }
} }
@ -505,13 +637,24 @@ void cRecManager::DeleteSwitchTimer(const cEvent *event) {
} }
} }
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
const cRecording **cRecManager::SearchForRecordings(std::string searchString, int &numResults) {
const cRecording **matchingRecordings = NULL;
#else
cRecording **cRecManager::SearchForRecordings(std::string searchString, int &numResults) { cRecording **cRecManager::SearchForRecordings(std::string searchString, int &numResults) {
cRecording **matchingRecordings = NULL; cRecording **matchingRecordings = NULL;
#endif
int num = 0; int num = 0;
numResults = 0; numResults = 0;
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
LOCK_RECORDINGS_READ;
for (const cRecording *recording = Recordings->First(); recording; recording = Recordings->Next(recording)) {
#else
for (cRecording *recording = Recordings.First(); recording; recording = Recordings.Next(recording)) { for (cRecording *recording = Recordings.First(); recording; recording = Recordings.Next(recording)) {
#endif
std::string s1 = recording->Name(); std::string s1 = recording->Name();
std::string s2 = searchString; std::string s2 = searchString;
if (s1.empty() || s2.empty()) continue; if (s1.empty() || s2.empty()) continue;
@ -542,7 +685,11 @@ cRecording **cRecManager::SearchForRecordings(std::string searchString, int &num
} }
if (match) { if (match) {
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
matchingRecordings = (const cRecording **)realloc(matchingRecordings, (num + 1) * sizeof(cRecording *));
#else
matchingRecordings = (cRecording **)realloc(matchingRecordings, (num + 1) * sizeof(cRecording *)); matchingRecordings = (cRecording **)realloc(matchingRecordings, (num + 1) * sizeof(cRecording *));
#endif
matchingRecordings[num++] = recording; matchingRecordings[num++] = recording;
} }
} }
@ -619,10 +766,26 @@ void cRecManager::GetFavorites(std::vector<cTVGuideSearchTimer> *favorites) {
const cEvent **cRecManager::WhatsOnNow(bool nowOrNext, int &numResults) { const cEvent **cRecManager::WhatsOnNow(bool nowOrNext, int &numResults) {
std::vector<const cEvent*> tmpResults; std::vector<const cEvent*> tmpResults;
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
LOCK_SCHEDULES_READ;
LOCK_CHANNELS_READ;
const cChannels* channels = Channels;
const cSchedules* schedules = Schedules;
#else
cSchedulesLock schedulesLock; cSchedulesLock schedulesLock;
const cSchedules *schedules = cSchedules::Schedules(schedulesLock); const cSchedules *schedules = cSchedules::Schedules(schedulesLock);
#endif
const cChannel *startChannel = NULL, *stopChannel = NULL; const cChannel *startChannel = NULL, *stopChannel = NULL;
if (tvguideConfig.favLimitChannels) { if (tvguideConfig.favLimitChannels) {
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
startChannel = Channels->GetByNumber(tvguideConfig.favStartChannel);
stopChannel = Channels->GetByNumber(tvguideConfig.favStopChannel);
}
if (!startChannel)
startChannel = Channels->First();
for (const cChannel *channel = startChannel; channel; channel = Channels->Next(channel)) {
#else
startChannel = Channels.GetByNumber(tvguideConfig.favStartChannel); startChannel = Channels.GetByNumber(tvguideConfig.favStartChannel);
stopChannel = Channels.GetByNumber(tvguideConfig.favStopChannel); stopChannel = Channels.GetByNumber(tvguideConfig.favStopChannel);
} }
@ -630,6 +793,7 @@ const cEvent **cRecManager::WhatsOnNow(bool nowOrNext, int &numResults) {
startChannel = Channels.First(); startChannel = Channels.First();
for (const cChannel *channel = startChannel; channel; channel = Channels.Next(channel)) { for (const cChannel *channel = startChannel; channel; channel = Channels.Next(channel)) {
#endif
if (channel->GroupSep()) continue; if (channel->GroupSep()) continue;
const cSchedule *Schedule = schedules->GetSchedule(channel); const cSchedule *Schedule = schedules->GetSchedule(channel);
if (!Schedule) continue; if (!Schedule) continue;
@ -679,10 +843,26 @@ const cEvent **cRecManager::UserDefinedTime(int userTime, int &numResults) {
if (searchTime < now) if (searchTime < now)
searchTime += 24*60*60; searchTime += 24*60*60;
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
LOCK_CHANNELS_READ;
LOCK_SCHEDULES_READ;
const cChannels* channels = Channels;
const cSchedules* schedules = Schedules;
#else
cSchedulesLock schedulesLock; cSchedulesLock schedulesLock;
const cSchedules *schedules = cSchedules::Schedules(schedulesLock); const cSchedules *schedules = cSchedules::Schedules(schedulesLock);
#endif
const cChannel *startChannel = NULL, *stopChannel = NULL; const cChannel *startChannel = NULL, *stopChannel = NULL;
if (tvguideConfig.favLimitChannels) { if (tvguideConfig.favLimitChannels) {
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
startChannel = Channels->GetByNumber(tvguideConfig.favStartChannel);
stopChannel = Channels->GetByNumber(tvguideConfig.favStopChannel);
}
if (!startChannel)
startChannel = Channels->First();
for (const cChannel *channel = startChannel; channel; channel = Channels->Next(channel)) {
#else
startChannel = Channels.GetByNumber(tvguideConfig.favStartChannel); startChannel = Channels.GetByNumber(tvguideConfig.favStartChannel);
stopChannel = Channels.GetByNumber(tvguideConfig.favStopChannel); stopChannel = Channels.GetByNumber(tvguideConfig.favStopChannel);
} }
@ -690,6 +870,7 @@ const cEvent **cRecManager::UserDefinedTime(int userTime, int &numResults) {
startChannel = Channels.First(); startChannel = Channels.First();
for (const cChannel *channel = startChannel; channel; channel = Channels.Next(channel)) { for (const cChannel *channel = startChannel; channel; channel = Channels.Next(channel)) {
#endif
if (channel->GroupSep()) continue; if (channel->GroupSep()) continue;
const cSchedule *Schedule = schedules->GetSchedule(channel); const cSchedule *Schedule = schedules->GetSchedule(channel);
if (!Schedule) continue; if (!Schedule) continue;

View File

@ -28,17 +28,29 @@ public:
bool EpgSearchAvailable(void) {return epgSearchAvailable;}; bool EpgSearchAvailable(void) {return epgSearchAvailable;};
bool RefreshRemoteTimers(void); bool RefreshRemoteTimers(void);
bool CheckEventForTimer(const cEvent *event); bool CheckEventForTimer(const cEvent *event);
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
const cTimer *GetTimerForEvent(const cEvent *event);
#else
cTimer *GetTimerForEvent(const cEvent *event); cTimer *GetTimerForEvent(const cEvent *event);
#endif
cTimer *createTimer(const cEvent *event, std::string path = ""); cTimer *createTimer(const cEvent *event, std::string path = "");
cTimer *createLocalTimer(const cEvent *event, std::string path); cTimer *createLocalTimer(const cEvent *event, std::string path);
cTimer *createRemoteTimer(const cEvent *event, std::string path); cTimer *createRemoteTimer(const cEvent *event, std::string path);
void SetTimerPath(cTimer *timer, const cEvent *event, std::string path); void SetTimerPath(cTimer *timer, const cEvent *event, std::string path);
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
void DeleteTimer(const cTimer *timer);
#else
void DeleteTimer(cTimer *timer); void DeleteTimer(cTimer *timer);
#endif
void DeleteTimer(int timerID); void DeleteTimer(int timerID);
void DeleteTimer(const cEvent *event); void DeleteTimer(const cEvent *event);
void DeleteLocalTimer(const cEvent *event); void DeleteLocalTimer(const cEvent *event);
void DeleteRemoteTimer(const cEvent *event); void DeleteRemoteTimer(const cEvent *event);
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
void SaveTimer(const cTimer *timer, cTimer newTimerSettings);
#else
void SaveTimer(cTimer *timer, cTimer newTimerSettings); void SaveTimer(cTimer *timer, cTimer newTimerSettings);
#endif
bool IsRecorded(const cEvent *event); bool IsRecorded(const cEvent *event);
cTVGuideTimerConflicts *CheckTimerConflict(void); cTVGuideTimerConflicts *CheckTimerConflict(void);
void CreateSeriesTimer(cTimer *seriesTimer); void CreateSeriesTimer(cTimer *seriesTimer);
@ -52,7 +64,11 @@ public:
void UpdateSearchTimers(void); void UpdateSearchTimers(void);
bool CreateSwitchTimer(const cEvent *event, cSwitchTimer switchTimer); bool CreateSwitchTimer(const cEvent *event, cSwitchTimer switchTimer);
void DeleteSwitchTimer(const cEvent *event); void DeleteSwitchTimer(const cEvent *event);
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
const cRecording **SearchForRecordings(std::string searchString, int &numResults);
#else
cRecording **SearchForRecordings(std::string searchString, int &numResults); cRecording **SearchForRecordings(std::string searchString, int &numResults);
#endif
const cEvent **LoadReruns(const cEvent *event, int &numResults); const cEvent **LoadReruns(const cEvent *event, int &numResults);
void GetFavorites(std::vector<cTVGuideSearchTimer> *favorites); void GetFavorites(std::vector<cTVGuideSearchTimer> *favorites);
const cEvent **WhatsOnNow(bool nowOrNext, int &numResults); const cEvent **WhatsOnNow(bool nowOrNext, int &numResults);

View File

@ -1817,7 +1817,12 @@ void cRecMenuItemEvent::Draw(void) {
if (!event) if (!event)
return; return;
int logoX = DrawIcons(); int logoX = DrawIcons();
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
LOCK_CHANNELS_READ;
const cChannel *channel = Channels->GetByChannelID(event->ChannelID());
#else
const cChannel *channel = Channels.GetByChannelID(event->ChannelID()); const cChannel *channel = Channels.GetByChannelID(event->ChannelID());
#endif
cString channelName = ""; cString channelName = "";
if (channel) if (channel)
channelName = channel->Name(); channelName = channel->Name();
@ -1913,7 +1918,11 @@ eRecMenuState cRecMenuItemEvent::ProcessKey(eKeys Key) {
// --- cRecMenuItemChannelChooser ------------------------------------------------------- // --- cRecMenuItemChannelChooser -------------------------------------------------------
cRecMenuItemChannelChooser::cRecMenuItemChannelChooser(cString text, cRecMenuItemChannelChooser::cRecMenuItemChannelChooser(cString text,
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
const cChannel *initialChannel,
#else
cChannel *initialChannel, cChannel *initialChannel,
#endif
bool active, bool active,
int *callback, int *callback,
eRecMenuState action) { eRecMenuState action) {
@ -1998,15 +2007,29 @@ eRecMenuState cRecMenuItemChannelChooser::ProcessKey(eKeys Key) {
fresh = true; fresh = true;
if (!channel) if (!channel)
return rmsConsumed; return rmsConsumed;
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
const cChannel *prev = channel;
LOCK_CHANNELS_READ;
const cChannel *firstChannel = Channels->First();
#else
cChannel *prev = channel; cChannel *prev = channel;
cChannel *firstChannel = Channels.First(); cChannel *firstChannel = Channels.First();
#endif
if(firstChannel->GroupSep()) if(firstChannel->GroupSep())
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
firstChannel = Channels->Next(firstChannel);
#else
firstChannel = Channels.Next(firstChannel); firstChannel = Channels.Next(firstChannel);
#endif
if (prev == firstChannel) { if (prev == firstChannel) {
if (!initialChannelSet) if (!initialChannelSet)
channel = NULL; channel = NULL;
} else { } else {
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
while (prev = Channels->Prev(prev)) {
#else
while (prev = Channels.Prev(prev)) { while (prev = Channels.Prev(prev)) {
#endif
if(!prev->GroupSep()) { if(!prev->GroupSep()) {
channel = prev; channel = prev;
break; break;
@ -2023,14 +2046,30 @@ eRecMenuState cRecMenuItemChannelChooser::ProcessKey(eKeys Key) {
return rmsConsumed; return rmsConsumed;
break; } break; }
case kRight: { case kRight: {
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
LOCK_CHANNELS_READ;
#endif
fresh = true; fresh = true;
if (!channel) { if (!channel) {
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
channel = Channels->First();
#else
channel = Channels.First(); channel = Channels.First();
#endif
if(channel->GroupSep()) if(channel->GroupSep())
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
channel = Channels->Next(channel);
#else
channel = Channels.Next(channel); channel = Channels.Next(channel);
#endif
} else { } else {
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
const cChannel *next = channel;
while (next = Channels->Next(next)) {
#else
cChannel *next = channel; cChannel *next = channel;
while (next = Channels.Next(next)) { while (next = Channels.Next(next)) {
#endif
if(!next->GroupSep()) { if(!next->GroupSep()) {
channel = next; channel = next;
break; break;
@ -2052,7 +2091,12 @@ eRecMenuState cRecMenuItemChannelChooser::ProcessKey(eKeys Key) {
fresh = false; fresh = false;
} }
channelNumber = channelNumber * 10 + (Key - k0); channelNumber = channelNumber * 10 + (Key - k0);
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
LOCK_CHANNELS_READ;
const cChannel *chanNew = Channels->GetByNumber(channelNumber);
#else
cChannel *chanNew = Channels.GetByNumber(channelNumber); cChannel *chanNew = Channels.GetByNumber(channelNumber);
#endif
if (chanNew) { if (chanNew) {
channel = chanNew; channel = chanNew;
DrawValue(); DrawValue();
@ -2214,7 +2258,11 @@ eRecMenuState cRecMenuItemDayChooser::ProcessKey(eKeys Key) {
} }
// --- cRecMenuItemRecording ------------------------------------------------------- // --- cRecMenuItemRecording -------------------------------------------------------
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
cRecMenuItemRecording::cRecMenuItemRecording(const cRecording *recording, bool active) {
#else
cRecMenuItemRecording::cRecMenuItemRecording(cRecording *recording, bool active) { cRecMenuItemRecording::cRecMenuItemRecording(cRecording *recording, bool active) {
#endif
selectable = true; selectable = true;
this->recording = recording; this->recording = recording;
this->active = active; this->active = active;
@ -2242,7 +2290,12 @@ void cRecMenuItemRecording::Draw(void) {
if (!recording) if (!recording)
return; return;
const cRecordingInfo *recInfo = recording->Info(); const cRecordingInfo *recInfo = recording->Info();
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
LOCK_CHANNELS_READ;
const cChannel *channel = Channels->GetByChannelID(recInfo->ChannelID());
#else
cChannel *channel = Channels.GetByChannelID(recInfo->ChannelID()); cChannel *channel = Channels.GetByChannelID(recInfo->ChannelID());
#endif
cString channelName = tr("unknown channel"); cString channelName = tr("unknown channel");
if (channel) if (channel)
channelName = channel->Name(); channelName = channel->Name();
@ -2457,7 +2510,11 @@ void cRecMenuItemTimelineHeader::Show(void) {
// --- cRecMenuItemTimelineTimer ------------------------------------------------------- // --- cRecMenuItemTimelineTimer -------------------------------------------------------
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
cRecMenuItemTimelineTimer::cRecMenuItemTimelineTimer(const cTimer *timer, time_t start, time_t stop, std::vector<cTVGuideTimerConflict*> conflictsToday, cRecMenuItemTimelineHeader *header, bool active) {
#else
cRecMenuItemTimelineTimer::cRecMenuItemTimelineTimer(cTimer *timer, time_t start, time_t stop, std::vector<cTVGuideTimerConflict*> conflictsToday, cRecMenuItemTimelineHeader *header, bool active) { cRecMenuItemTimelineTimer::cRecMenuItemTimelineTimer(cTimer *timer, time_t start, time_t stop, std::vector<cTVGuideTimerConflict*> conflictsToday, cRecMenuItemTimelineHeader *header, bool active) {
#endif
conflicts = conflictsToday; conflicts = conflictsToday;
defaultBackground = false; defaultBackground = false;
pixmapBack = NULL; pixmapBack = NULL;
@ -2604,7 +2661,11 @@ void cRecMenuItemTimelineTimer::Show(void) {
if (pixmapTimerConflicts) pixmapTimerConflicts->SetLayer(6); if (pixmapTimerConflicts) pixmapTimerConflicts->SetLayer(6);
} }
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
const cTimer *cRecMenuItemTimelineTimer::GetTimerValue(void) {
#else
cTimer *cRecMenuItemTimelineTimer::GetTimerValue(void) { cTimer *cRecMenuItemTimelineTimer::GetTimerValue(void) {
#endif
return timer; return timer;
} }

View File

@ -123,7 +123,11 @@ public:
virtual bool GetBoolValue(void) { return false; }; virtual bool GetBoolValue(void) { return false; };
virtual cString GetStringValue(void) { return cString(""); }; virtual cString GetStringValue(void) { return cString(""); };
virtual const cEvent *GetEventValue(void) { return NULL; }; virtual const cEvent *GetEventValue(void) { return NULL; };
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
virtual const cTimer *GetTimerValue(void) { return NULL; };
#else
virtual cTimer *GetTimerValue(void) { return NULL; }; virtual cTimer *GetTimerValue(void) { return NULL; };
#endif
virtual eRecMenuState ProcessKey(eKeys Key) { return rmsNotConsumed; }; virtual eRecMenuState ProcessKey(eKeys Key) { return rmsNotConsumed; };
}; };
@ -489,7 +493,11 @@ public:
class cRecMenuItemChannelChooser : public cRecMenuItem { class cRecMenuItemChannelChooser : public cRecMenuItem {
private: private:
cString text; cString text;
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
const cChannel *channel;
#else
cChannel *channel; cChannel *channel;
#endif
int channelNumber; int channelNumber;
int *callback; int *callback;
bool initialChannelSet; bool initialChannelSet;
@ -498,7 +506,11 @@ private:
void DrawValue(void); void DrawValue(void);
public: public:
cRecMenuItemChannelChooser (cString text, cRecMenuItemChannelChooser (cString text,
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
const cChannel *initialChannel,
#else
cChannel *initialChannel, cChannel *initialChannel,
#endif
bool active = false, bool active = false,
int *callback = NULL, int *callback = NULL,
eRecMenuState action = rmsNotConsumed); eRecMenuState action = rmsNotConsumed);
@ -548,10 +560,18 @@ public:
// --- cRecMenuItemRecording ------------------------------------------------------- // --- cRecMenuItemRecording -------------------------------------------------------
class cRecMenuItemRecording : public cRecMenuItem { class cRecMenuItemRecording : public cRecMenuItem {
private: private:
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
const cRecording *recording;
#else
cRecording *recording; cRecording *recording;
#endif
cPixmap *pixmapText; cPixmap *pixmapText;
public: public:
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
cRecMenuItemRecording(const cRecording *recording, bool active);
#else
cRecMenuItemRecording(cRecording *recording, bool active); cRecMenuItemRecording(cRecording *recording, bool active);
#endif
virtual ~cRecMenuItemRecording(void); virtual ~cRecMenuItemRecording(void);
void SetPixmaps(void); void SetPixmaps(void);
void Hide(void); void Hide(void);
@ -563,7 +583,11 @@ public:
class cRecMenuItemTimelineHeader : public cRecMenuItem { class cRecMenuItemTimelineHeader : public cRecMenuItem {
private: private:
time_t day; time_t day;
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
const cTimer *timer;
#else
cTimer *timer; cTimer *timer;
#endif
std::vector<cTVGuideTimerConflict*> conflicts; std::vector<cTVGuideTimerConflict*> conflicts;
cPixmap *pixmapTimeline; cPixmap *pixmapTimeline;
cPixmap *pixmapTimerInfo; cPixmap *pixmapTimerInfo;
@ -579,7 +603,11 @@ public:
virtual ~cRecMenuItemTimelineHeader(void); virtual ~cRecMenuItemTimelineHeader(void);
void SetDay(time_t day) { this->day = day; }; void SetDay(time_t day) { this->day = day; };
void SetPixmaps(void); void SetPixmaps(void);
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
void SetCurrentTimer(const cTimer *timer) { this->timer = timer; };
#else
void SetCurrentTimer(cTimer *timer) { this->timer = timer; }; void SetCurrentTimer(cTimer *timer) { this->timer = timer; };
#endif
void UnsetCurrentTimer(void) { timer = NULL; }; void UnsetCurrentTimer(void) { timer = NULL; };
void RefreshTimerDisplay(void); void RefreshTimerDisplay(void);
void Hide(void); void Hide(void);
@ -590,7 +618,11 @@ public:
// --- cRecMenuItemTimelineTimer ------------------------------------------------------- // --- cRecMenuItemTimelineTimer -------------------------------------------------------
class cRecMenuItemTimelineTimer : public cRecMenuItem { class cRecMenuItemTimelineTimer : public cRecMenuItem {
private: private:
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
const cTimer *timer;
#else
cTimer *timer; cTimer *timer;
#endif
std::vector<cTVGuideTimerConflict*> conflicts; std::vector<cTVGuideTimerConflict*> conflicts;
cPixmap *pixmapBack; cPixmap *pixmapBack;
cPixmap *pixmapTimerConflicts; cPixmap *pixmapTimerConflicts;
@ -605,7 +637,11 @@ private:
void DrawTimerConflicts(void); void DrawTimerConflicts(void);
void DrawNoTimerInfo(void); void DrawNoTimerInfo(void);
public: public:
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
cRecMenuItemTimelineTimer(const cTimer *timer, time_t start, time_t stop, std::vector<cTVGuideTimerConflict*> conflictsToday, cRecMenuItemTimelineHeader *header, bool active);
#else
cRecMenuItemTimelineTimer(cTimer *timer, time_t start, time_t stop, std::vector<cTVGuideTimerConflict*> conflictsToday, cRecMenuItemTimelineHeader *header, bool active); cRecMenuItemTimelineTimer(cTimer *timer, time_t start, time_t stop, std::vector<cTVGuideTimerConflict*> conflictsToday, cRecMenuItemTimelineHeader *header, bool active);
#endif
virtual ~cRecMenuItemTimelineTimer(void); virtual ~cRecMenuItemTimelineTimer(void);
void setActive(void); void setActive(void);
void setInactive(void); void setInactive(void);
@ -613,7 +649,11 @@ public:
void Hide(void); void Hide(void);
void Show(void); void Show(void);
void Draw(void); void Draw(void);
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
const cTimer *GetTimerValue(void);
#else
cTimer *GetTimerValue(void); cTimer *GetTimerValue(void);
#endif
eRecMenuState ProcessKey(eKeys Key); eRecMenuState ProcessKey(eKeys Key);
}; };

View File

@ -125,7 +125,12 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) {
timerIndex = menu->GetTimerConflictIndex(); timerIndex = menu->GetTimerConflictIndex();
} else break; } else break;
int timerID = timerConflicts->GetCurrentConflictTimerID(timerIndex); int timerID = timerConflicts->GetCurrentConflictTimerID(timerIndex);
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
LOCK_TIMERS_READ;
const cTimer *t = Timers->Get(timerID);
#else
cTimer *t = Timers.Get(timerID); cTimer *t = Timers.Get(timerID);
#endif
if (t) { if (t) {
const cEvent *ev = t->Event(); const cEvent *ev = t->Event();
if (ev) { if (ev) {
@ -156,7 +161,12 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) {
timerIndex = menu->GetTimerConflictIndex(); timerIndex = menu->GetTimerConflictIndex();
} else break; } else break;
int timerID = timerConflicts->GetCurrentConflictTimerID(timerIndex); int timerID = timerConflicts->GetCurrentConflictTimerID(timerIndex);
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
LOCK_TIMERS_READ;
const cTimer *timer = Timers->Get(timerID);
#else
cTimer *timer = Timers.Get(timerID); cTimer *timer = Timers.Get(timerID);
#endif
if (timer) { if (timer) {
delete activeMenu; delete activeMenu;
activeMenu = new cRecMenuEditTimer(timer, rmsSaveTimerConflictMenu); activeMenu = new cRecMenuEditTimer(timer, rmsSaveTimerConflictMenu);
@ -167,7 +177,11 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) {
//caller: cRecMenuEditTimer //caller: cRecMenuEditTimer
//save timer from current timer conflict //save timer from current timer conflict
cTimer timerModified; cTimer timerModified;
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
const cTimer *originalTimer;
#else
cTimer *originalTimer; cTimer *originalTimer;
#endif
if (cRecMenuEditTimer *menu = dynamic_cast<cRecMenuEditTimer*>(activeMenu)) { if (cRecMenuEditTimer *menu = dynamic_cast<cRecMenuEditTimer*>(activeMenu)) {
timerModified = menu->GetTimer(); timerModified = menu->GetTimer();
originalTimer = menu->GetOriginalTimer(); originalTimer = menu->GetOriginalTimer();
@ -200,7 +214,12 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) {
break; break;
case rmsEditTimer: { case rmsEditTimer: {
//edit timer for active event //edit timer for active event
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
LOCK_TIMERS_READ;
const cTimer *timer = recManager->GetTimerForEvent(event);
#else
cTimer *timer = recManager->GetTimerForEvent(event); cTimer *timer = recManager->GetTimerForEvent(event);
#endif
if (timer) { if (timer) {
delete activeMenu; delete activeMenu;
activeMenu = new cRecMenuEditTimer(timer, rmsSaveTimer); activeMenu = new cRecMenuEditTimer(timer, rmsSaveTimer);
@ -211,7 +230,11 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) {
//caller: cRecMenuEditTimer //caller: cRecMenuEditTimer
//save timer for active event //save timer for active event
cTimer timerModified; cTimer timerModified;
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
const cTimer *originalTimer;
#else
cTimer *originalTimer; cTimer *originalTimer;
#endif
if (cRecMenuEditTimer *menu = dynamic_cast<cRecMenuEditTimer*>(activeMenu)) { if (cRecMenuEditTimer *menu = dynamic_cast<cRecMenuEditTimer*>(activeMenu)) {
timerModified = menu->GetTimer(); timerModified = menu->GetTimer();
originalTimer = menu->GetOriginalTimer(); originalTimer = menu->GetOriginalTimer();
@ -230,7 +253,12 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) {
recFolder = menu->GetFolder(); recFolder = menu->GetFolder();
} }
delete activeMenu; delete activeMenu;
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
LOCK_CHANNELS_READ;
const cChannel *channel = Channels->GetByChannelID(event->ChannelID());
#else
cChannel *channel = Channels.GetByChannelID(event->ChannelID()); cChannel *channel = Channels.GetByChannelID(event->ChannelID());
#endif
activeMenu = new cRecMenuSeriesTimer(channel, event, recFolder); activeMenu = new cRecMenuSeriesTimer(channel, event, recFolder);
activeMenu->Display(); activeMenu->Display();
break; } break; }
@ -472,7 +500,11 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) {
activeMenu = new cRecMenuRecordingSearch(searchString); activeMenu = new cRecMenuRecordingSearch(searchString);
} else { } else {
int numSearchResults = 0; int numSearchResults = 0;
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
const cRecording **searchResult = recManager->SearchForRecordings(searchString, numSearchResults);
#else
cRecording **searchResult = recManager->SearchForRecordings(searchString, numSearchResults); cRecording **searchResult = recManager->SearchForRecordings(searchString, numSearchResults);
#endif
if (numSearchResults == 0) { if (numSearchResults == 0) {
activeMenu = new cRecMenuRecordingSearchNotFound(searchString); activeMenu = new cRecMenuRecordingSearchNotFound(searchString);
} else { } else {
@ -606,7 +638,12 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) {
timerConflict = menu->GetTimerConflictIndex(); timerConflict = menu->GetTimerConflictIndex();
} else break; } else break;
int timerID = timerConflicts->GetCurrentConflictTimerID(timerConflict); int timerID = timerConflicts->GetCurrentConflictTimerID(timerConflict);
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
LOCK_TIMERS_READ;
const cTimer *timer = Timers->Get(timerID);
#else
cTimer *timer = Timers.Get(timerID); cTimer *timer = Timers.Get(timerID);
#endif
if (timer) { if (timer) {
const cEvent *event = timer->Event(); const cEvent *event = timer->Event();
if (event) { if (event) {
@ -648,7 +685,12 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) {
originalConflictIndex = menu->GetTimerConflictIndex(); originalConflictIndex = menu->GetTimerConflictIndex();
} else break; } else break;
int originalTimerID = timerConflicts->GetCurrentConflictTimerID(originalConflictIndex); int originalTimerID = timerConflicts->GetCurrentConflictTimerID(originalConflictIndex);
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
LOCK_TIMERS_READ;
const cTimer *timerOriginal = Timers->Get(originalTimerID);
#else
cTimer *timerOriginal = Timers.Get(originalTimerID); cTimer *timerOriginal = Timers.Get(originalTimerID);
#endif
if (replace && timerOriginal) { if (replace && timerOriginal) {
recManager->DeleteTimer(timerOriginal->Event()); recManager->DeleteTimer(timerOriginal->Event());
recManager->createTimer(replace); recManager->createTimer(replace);
@ -674,7 +716,11 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) {
activeMenu->Display(); activeMenu->Display();
break; } break; }
case rmsTimelineTimerEdit: { case rmsTimelineTimerEdit: {
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
const cTimer *timer;
#else
cTimer *timer; cTimer *timer;
#endif
if (cRecMenuTimeline *menu = dynamic_cast<cRecMenuTimeline*>(activeMenu)) { if (cRecMenuTimeline *menu = dynamic_cast<cRecMenuTimeline*>(activeMenu)) {
timer = menu->GetTimer(); timer = menu->GetTimer();
} else break; } else break;
@ -686,7 +732,11 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) {
break;} break;}
case rmsTimelineTimerSave: { case rmsTimelineTimerSave: {
cTimer timerModified; cTimer timerModified;
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
const cTimer *originalTimer;
#else
cTimer *originalTimer; cTimer *originalTimer;
#endif
if (cRecMenuEditTimer *menu = dynamic_cast<cRecMenuEditTimer*>(activeMenu)) { if (cRecMenuEditTimer *menu = dynamic_cast<cRecMenuEditTimer*>(activeMenu)) {
timerModified = menu->GetTimer(); timerModified = menu->GetTimer();
originalTimer = menu->GetOriginalTimer(); originalTimer = menu->GetOriginalTimer();
@ -701,7 +751,11 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) {
activeMenu->Display(); activeMenu->Display();
break; } break; }
case rmsTimelineTimerDelete: { case rmsTimelineTimerDelete: {
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
const cTimer *timer;
#else
cTimer *timer; cTimer *timer;
#endif
if (cRecMenuEditTimer *menu = dynamic_cast<cRecMenuEditTimer*>(activeMenu)) { if (cRecMenuEditTimer *menu = dynamic_cast<cRecMenuEditTimer*>(activeMenu)) {
timer = menu->GetOriginalTimer(); timer = menu->GetOriginalTimer();
} else break; } else break;
@ -818,9 +872,16 @@ void cRecMenuManager::DisplaySearchTimerList(void) {
activeMenu->Display(); activeMenu->Display();
} }
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
bool cRecMenuManager::DisplayTimerConflict(const cTimer *timer) {
int timerID = 0;
LOCK_TIMERS_READ;
for (const cTimer *t = Timers->First(); t; t = Timers->Next(t)) {
#else
bool cRecMenuManager::DisplayTimerConflict(cTimer *timer) { bool cRecMenuManager::DisplayTimerConflict(cTimer *timer) {
int timerID = 0; int timerID = 0;
for (cTimer *t = Timers.First(); t; t = Timers.Next(t)) { for (cTimer *t = Timers.First(); t; t = Timers.Next(t)) {
#endif
if (t == timer) if (t == timer)
return DisplayTimerConflict(timerID); return DisplayTimerConflict(timerID);
timerID++; timerID++;

View File

@ -23,7 +23,11 @@ private:
void SetBackground(void); void SetBackground(void);
void DeleteBackground(void); void DeleteBackground(void);
void DisplaySearchTimerList(void); void DisplaySearchTimerList(void);
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
bool DisplayTimerConflict(const cTimer *timer);
#else
bool DisplayTimerConflict(cTimer *timer); bool DisplayTimerConflict(cTimer *timer);
#endif
bool DisplayTimerConflict(int timerID); bool DisplayTimerConflict(int timerID);
void DisplayDetailedView(const cEvent *ev); void DisplayDetailedView(const cEvent *ev);
void DisplayFavoriteResults(std::string header, const cEvent **result, int numResults); void DisplayFavoriteResults(std::string header, const cEvent **result, int numResults);

View File

@ -105,7 +105,12 @@ std::string cRecMenuAskFolder::GetFolder(void) {
// --- cRecMenuConfirmTimer --------------------------------------------------------- // --- cRecMenuConfirmTimer ---------------------------------------------------------
cRecMenuConfirmTimer::cRecMenuConfirmTimer(const cEvent *event) { cRecMenuConfirmTimer::cRecMenuConfirmTimer(const cEvent *event) {
SetWidthPercent(50); SetWidthPercent(50);
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
LOCK_CHANNELS_READ;
const cString channelName = Channels->GetByChannelID(event->ChannelID())->Name();
#else
cString channelName = Channels.GetByChannelID(event->ChannelID())->Name(); cString channelName = Channels.GetByChannelID(event->ChannelID())->Name();
#endif
cString message; cString message;
bool eventHasTimer = false; bool eventHasTimer = false;
if (tvguideConfig.useRemoteTimers && pRemoteTimers) { if (tvguideConfig.useRemoteTimers && pRemoteTimers) {
@ -143,7 +148,12 @@ cRecMenuConfirmTimer::cRecMenuConfirmTimer(const cEvent *event) {
// --- cRecMenuConfirmDeleteTimer --------------------------------------------------------- // --- cRecMenuConfirmDeleteTimer ---------------------------------------------------------
cRecMenuConfirmDeleteTimer::cRecMenuConfirmDeleteTimer(const cEvent *event) { cRecMenuConfirmDeleteTimer::cRecMenuConfirmDeleteTimer(const cEvent *event) {
SetWidthPercent(50); SetWidthPercent(50);
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
LOCK_CHANNELS_READ;
const cString channelName = Channels->GetByChannelID(event->ChannelID())->Name();
#else
cString channelName = Channels.GetByChannelID(event->ChannelID())->Name(); cString channelName = Channels.GetByChannelID(event->ChannelID())->Name();
#endif
cString text = cString::sprintf("%s\n%s\n%s %s - %s\n%s", cString text = cString::sprintf("%s\n%s\n%s %s - %s\n%s",
tr("Timer deleted"), tr("Timer deleted"),
*channelName, *channelName,
@ -165,7 +175,12 @@ cRecMenuConfirmDeleteTimer::cRecMenuConfirmDeleteTimer(const cEvent *event) {
// --- cRecMenuAskDeleteTimer --------------------------------------------------------- // --- cRecMenuAskDeleteTimer ---------------------------------------------------------
cRecMenuAskDeleteTimer::cRecMenuAskDeleteTimer(const cEvent *event) { cRecMenuAskDeleteTimer::cRecMenuAskDeleteTimer(const cEvent *event) {
SetWidthPercent(50); SetWidthPercent(50);
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
LOCK_CHANNELS_READ;
const cString channelName = Channels->GetByChannelID(event->ChannelID())->Name();
#else
cString channelName = Channels.GetByChannelID(event->ChannelID())->Name(); cString channelName = Channels.GetByChannelID(event->ChannelID())->Name();
#endif
cString text = cString::sprintf("%s \"%s, %s\" %s", cString text = cString::sprintf("%s \"%s, %s\" %s",
tr("Timer"), tr("Timer"),
*channelName, *channelName,
@ -228,7 +243,12 @@ cRecMenuTimerConflict::cRecMenuTimerConflict(cTVGuideTimerConflict *conflict) {
SetFooter(new cRecMenuItemButton(tr("Ignore Conflict"), rmsIgnoreTimerConflict, false, true)); SetFooter(new cRecMenuItemButton(tr("Ignore Conflict"), rmsIgnoreTimerConflict, false, true));
int i=0; int i=0;
for(std::vector<int>::iterator it = conflict->timerIDs.begin(); it != conflict->timerIDs.end(); it++) { for(std::vector<int>::iterator it = conflict->timerIDs.begin(); it != conflict->timerIDs.end(); it++) {
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
LOCK_TIMERS_READ;
const cTimer *timer = Timers->Get(*it);
#else
const cTimer *timer = Timers.Get(*it); const cTimer *timer = Timers.Get(*it);
#endif
if (timer) { if (timer) {
if (!AddMenuItemInitial(new cRecMenuItemTimer( timer, if (!AddMenuItemInitial(new cRecMenuItemTimer( timer,
rmsTimerConflictShowInfo, rmsTimerConflictShowInfo,
@ -252,7 +272,12 @@ cRecMenuTimerConflict::cRecMenuTimerConflict(cTVGuideTimerConflict *conflict) {
cRecMenuItem *cRecMenuTimerConflict::GetMenuItem(int number) { cRecMenuItem *cRecMenuTimerConflict::GetMenuItem(int number) {
if ((number >= 0) && (number < conflict->timerIDs.size())) { if ((number >= 0) && (number < conflict->timerIDs.size())) {
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
LOCK_TIMERS_READ;
const cTimer *timer = Timers->Get(conflict->timerIDs[number]);
#else
const cTimer *timer = Timers.Get(conflict->timerIDs[number]); const cTimer *timer = Timers.Get(conflict->timerIDs[number]);
#endif
cRecMenuItem *result = new cRecMenuItemTimer( timer, cRecMenuItem *result = new cRecMenuItemTimer( timer,
rmsTimerConflictShowInfo, rmsTimerConflictShowInfo,
rmsDeleteTimerConflictMenu, rmsDeleteTimerConflictMenu,
@ -353,8 +378,14 @@ cRecMenuNoRerunsFound::cRecMenuNoRerunsFound(cString searchString) {
// --- cRecMenuConfirmRerunUsed --------------------------------------------------------- // --- cRecMenuConfirmRerunUsed ---------------------------------------------------------
cRecMenuConfirmRerunUsed::cRecMenuConfirmRerunUsed(const cEvent *original, const cEvent *replace) { cRecMenuConfirmRerunUsed::cRecMenuConfirmRerunUsed(const cEvent *original, const cEvent *replace) {
SetWidthPercent(70); SetWidthPercent(70);
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
LOCK_CHANNELS_READ;
const cString channelOrig = Channels->GetByChannelID(original->ChannelID())->Name();
const cString channelReplace = Channels->GetByChannelID(replace->ChannelID())->Name();
#else
cString channelOrig = Channels.GetByChannelID(original->ChannelID())->Name(); cString channelOrig = Channels.GetByChannelID(original->ChannelID())->Name();
cString channelReplace = Channels.GetByChannelID(replace->ChannelID())->Name(); cString channelReplace = Channels.GetByChannelID(replace->ChannelID())->Name();
#endif
cString message1 = tr("Timer for"); cString message1 = tr("Timer for");
cString message2 = tr("replaced by rerun"); cString message2 = tr("replaced by rerun");
cString text = cString::sprintf("%s\n\"%s\", %s %s, %s\n%s\n\"%s\", %s %s, %s", cString text = cString::sprintf("%s\n\"%s\", %s %s, %s\n%s\n\"%s\", %s %s, %s",
@ -378,7 +409,12 @@ cRecMenuConfirmRerunUsed::cRecMenuConfirmRerunUsed(const cEvent *original, const
} }
// --- cRecMenuEditTimer --------------------------------------------------------- // --- cRecMenuEditTimer ---------------------------------------------------------
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
cRecMenuEditTimer::cRecMenuEditTimer(const cTimer *timer, eRecMenuState nextState) {
const cTimer *originalTimer;
#else
cRecMenuEditTimer::cRecMenuEditTimer(cTimer *timer, eRecMenuState nextState) { cRecMenuEditTimer::cRecMenuEditTimer(cTimer *timer, eRecMenuState nextState) {
#endif
SetWidthPercent(70); SetWidthPercent(70);
if (!timer) if (!timer)
return; return;
@ -435,7 +471,11 @@ cRecMenuEditTimer::cRecMenuEditTimer(cTimer *timer, eRecMenuState nextState) {
Arrange(); Arrange();
} }
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
const cTimer *cRecMenuEditTimer::GetOriginalTimer(void) {
#else
cTimer *cRecMenuEditTimer::GetOriginalTimer(void) { cTimer *cRecMenuEditTimer::GetOriginalTimer(void) {
#endif
return originalTimer; return originalTimer;
} }
@ -473,7 +513,11 @@ cTimer cRecMenuEditTimer::GetTimer(void) {
******************************************************************************************/ ******************************************************************************************/
// --- cRecMenuSeriesTimer --------------------------------------------------------- // --- cRecMenuSeriesTimer ---------------------------------------------------------
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
cRecMenuSeriesTimer::cRecMenuSeriesTimer(const cChannel *initialChannel, const cEvent *event, std::string folder) {
#else
cRecMenuSeriesTimer::cRecMenuSeriesTimer(cChannel *initialChannel, const cEvent *event, std::string folder) { cRecMenuSeriesTimer::cRecMenuSeriesTimer(cChannel *initialChannel, const cEvent *event, std::string folder) {
#endif
if (!initialChannel) if (!initialChannel)
return; return;
timerActive = true; timerActive = true;
@ -508,7 +552,12 @@ cRecMenuSeriesTimer::cRecMenuSeriesTimer(cChannel *initialChannel, const cEvent
} }
cTimer *cRecMenuSeriesTimer::GetTimer(void) { cTimer *cRecMenuSeriesTimer::GetTimer(void) {
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
LOCK_CHANNELS_READ;
const cChannel *chan = Channels->GetByNumber(channel);
#else
cChannel *chan = Channels.GetByNumber(channel); cChannel *chan = Channels.GetByNumber(channel);
#endif
cTimer *seriesTimer = new cTimer(NULL, NULL, chan); cTimer *seriesTimer = new cTimer(NULL, NULL, chan);
cString fileName = "TITLE EPISODE"; cString fileName = "TITLE EPISODE";
if (folder.size() > 0) { if (folder.size() > 0) {
@ -789,8 +838,14 @@ void cRecMenuSearchTimerEdit::InitMenuItems(void) {
startChannel = 1; startChannel = 1;
if (stopChannel == 0) if (stopChannel == 0)
stopChannel = 1; stopChannel = 1;
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
LOCK_CHANNELS_READ;
useChannelSubMenu.push_back(new cRecMenuItemChannelChooser(tr("Start Channel"), Channels->GetByNumber(startChannel), false, &startChannel, rmsSearchTimerSave));
useChannelSubMenu.push_back(new cRecMenuItemChannelChooser(tr("Stop Channel"), Channels->GetByNumber(stopChannel), false, &stopChannel, rmsSearchTimerSave));
#else
useChannelSubMenu.push_back(new cRecMenuItemChannelChooser(tr("Start Channel"), Channels.GetByNumber(startChannel), false, &startChannel, rmsSearchTimerSave)); useChannelSubMenu.push_back(new cRecMenuItemChannelChooser(tr("Start Channel"), Channels.GetByNumber(startChannel), false, &startChannel, rmsSearchTimerSave));
useChannelSubMenu.push_back(new cRecMenuItemChannelChooser(tr("Stop Channel"), Channels.GetByNumber(stopChannel), false, &stopChannel, rmsSearchTimerSave)); useChannelSubMenu.push_back(new cRecMenuItemChannelChooser(tr("Stop Channel"), Channels.GetByNumber(stopChannel), false, &stopChannel, rmsSearchTimerSave));
#endif
useTimeSubMenu.push_back(new cRecMenuItemTime(tr("Start after"), startTime, false, &startTime, rmsSearchTimerSave)); useTimeSubMenu.push_back(new cRecMenuItemTime(tr("Start after"), startTime, false, &startTime, rmsSearchTimerSave));
useTimeSubMenu.push_back(new cRecMenuItemTime(tr("Start before"), stopTime, false, &stopTime, rmsSearchTimerSave)); useTimeSubMenu.push_back(new cRecMenuItemTime(tr("Start before"), stopTime, false, &stopTime, rmsSearchTimerSave));
@ -1214,7 +1269,12 @@ const cEvent *cRecMenuSearchResults::GetEvent(void) {
// --- cRecMenuSearchConfirmTimer --------------------------------------------------------- // --- cRecMenuSearchConfirmTimer ---------------------------------------------------------
cRecMenuSearchConfirmTimer::cRecMenuSearchConfirmTimer(const cEvent *event, eRecMenuState nextAction) { cRecMenuSearchConfirmTimer::cRecMenuSearchConfirmTimer(const cEvent *event, eRecMenuState nextAction) {
SetWidthPercent(50); SetWidthPercent(50);
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
LOCK_CHANNELS_READ;
const cString channelName = Channels->GetByChannelID(event->ChannelID())->Name();
#else
cString channelName = Channels.GetByChannelID(event->ChannelID())->Name(); cString channelName = Channels.GetByChannelID(event->ChannelID())->Name();
#endif
cString message = tr("Timer created"); cString message = tr("Timer created");
cString text = cString::sprintf("%s\n%s\n%s %s - %s\n%s", cString text = cString::sprintf("%s\n%s\n%s %s - %s\n%s",
*message, *message,
@ -1279,7 +1339,11 @@ cRecMenuRecordingSearch::cRecMenuRecordingSearch(std::string search) {
} }
// --- cRecMenuRecordingSearchResults --------------------------------------------------------- // --- cRecMenuRecordingSearchResults ---------------------------------------------------------
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
cRecMenuRecordingSearchResults::cRecMenuRecordingSearchResults(std::string searchString, const cRecording **searchResults, int numResults) {
#else
cRecMenuRecordingSearchResults::cRecMenuRecordingSearchResults(std::string searchString, cRecording **searchResults, int numResults) { cRecMenuRecordingSearchResults::cRecMenuRecordingSearchResults(std::string searchString, cRecording **searchResults, int numResults) {
#endif
this->searchString = searchString; this->searchString = searchString;
this->searchResults = searchResults; this->searchResults = searchResults;
SetWidthPercent(80); SetWidthPercent(80);
@ -1363,7 +1427,13 @@ void cRecMenuTimeline::SetStartStop(void) {
void cRecMenuTimeline::GetTimersForDay(void) { void cRecMenuTimeline::GetTimersForDay(void) {
timersToday.clear(); timersToday.clear();
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
LOCK_TIMERS_READ;
const cTimers* timers = Timers;
for (const cTimer *t = Timers->First(); t; t = Timers->Next(t)) {
#else
for (cTimer *t = Timers.First(); t; t = Timers.Next(t)) { for (cTimer *t = Timers.First(); t; t = Timers.Next(t)) {
#endif
if (((t->StartTime() > timeStart) && (t->StartTime() <= timeStop)) || ((t->StopTime() > timeStart) && (t->StopTime() <= timeStop))) { if (((t->StartTime() > timeStart) && (t->StartTime() <= timeStop)) || ((t->StopTime() > timeStart) && (t->StopTime() <= timeStop))) {
timersToday.push_back(t); timersToday.push_back(t);
} }
@ -1437,7 +1507,11 @@ void cRecMenuTimeline::ClearMenu(void) {
header->UnsetCurrentTimer(); header->UnsetCurrentTimer();
} }
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
const cTimer *cRecMenuTimeline::GetTimer(void) {
#else
cTimer *cRecMenuTimeline::GetTimer(void) { cTimer *cRecMenuTimeline::GetTimer(void) {
#endif
if (cRecMenuItemTimelineTimer *activeItem = dynamic_cast<cRecMenuItemTimelineTimer*>(GetActiveMenuItem())) if (cRecMenuItemTimelineTimer *activeItem = dynamic_cast<cRecMenuItemTimelineTimer*>(GetActiveMenuItem()))
return activeItem->GetTimerValue(); return activeItem->GetTimerValue();
return NULL; return NULL;

View File

@ -115,7 +115,11 @@ public:
// --- cRecMenuEditTimer --------------------------------------------------------- // --- cRecMenuEditTimer ---------------------------------------------------------
class cRecMenuEditTimer: public cRecMenu { class cRecMenuEditTimer: public cRecMenu {
private: private:
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
const cTimer *originalTimer;
#else
cTimer *originalTimer; cTimer *originalTimer;
#endif
bool timerActive; bool timerActive;
time_t day; time_t day;
int start; int start;
@ -124,10 +128,15 @@ private:
int lifetime; int lifetime;
char folder[TEXTINPUTLENGTH]; char folder[TEXTINPUTLENGTH];
public: public:
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
cRecMenuEditTimer(const cTimer *timer, eRecMenuState nextState);
const cTimer *GetOriginalTimer(void);
#else
cRecMenuEditTimer(cTimer *timer, eRecMenuState nextState); cRecMenuEditTimer(cTimer *timer, eRecMenuState nextState);
cTimer *GetOriginalTimer(void);
#endif
virtual ~cRecMenuEditTimer(void) {}; virtual ~cRecMenuEditTimer(void) {};
cTimer GetTimer(void); cTimer GetTimer(void);
cTimer *GetOriginalTimer(void);
}; };
/****************************************************************************************** /******************************************************************************************
@ -148,7 +157,11 @@ class cRecMenuSeriesTimer: public cRecMenu {
int lifetime; int lifetime;
void CalculateTimes(const cEvent *event); void CalculateTimes(const cEvent *event);
public: public:
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
cRecMenuSeriesTimer(const cChannel *initialChannel, const cEvent *event, std::string folder);
#else
cRecMenuSeriesTimer(cChannel *initialChannel, const cEvent *event, std::string folder); cRecMenuSeriesTimer(cChannel *initialChannel, const cEvent *event, std::string folder);
#endif
virtual ~cRecMenuSeriesTimer(void) {}; virtual ~cRecMenuSeriesTimer(void) {};
cTimer *GetTimer(void); cTimer *GetTimer(void);
}; };
@ -412,10 +425,18 @@ public:
class cRecMenuRecordingSearchResults: public cRecMenu { class cRecMenuRecordingSearchResults: public cRecMenu {
private: private:
std::string searchString; std::string searchString;
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
const cRecording **searchResults;
#else
cRecording **searchResults; cRecording **searchResults;
#endif
int numResults; int numResults;
public: public:
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
cRecMenuRecordingSearchResults(std::string searchString, const cRecording **searchResults, int numResults);
#else
cRecMenuRecordingSearchResults(std::string searchString, cRecording **searchResults, int numResults); cRecMenuRecordingSearchResults(std::string searchString, cRecording **searchResults, int numResults);
#endif
cRecMenuItem *GetMenuItem(int number); cRecMenuItem *GetMenuItem(int number);
int GetTotalNumMenuItems(void); int GetTotalNumMenuItems(void);
virtual ~cRecMenuRecordingSearchResults(void) { virtual ~cRecMenuRecordingSearchResults(void) {
@ -438,7 +459,11 @@ public:
// --- cRecMenuTimeline --------------------------------------------------------- // --- cRecMenuTimeline ---------------------------------------------------------
class cRecMenuTimeline: public cRecMenu { class cRecMenuTimeline: public cRecMenu {
private: private:
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
std::vector<const cTimer*> timersToday;
#else
std::vector<cTimer*> timersToday; std::vector<cTimer*> timersToday;
#endif
int numTimersToday; int numTimersToday;
time_t today; time_t today;
time_t timeStart; time_t timeStart;
@ -459,7 +484,11 @@ public:
virtual ~cRecMenuTimeline(void) { virtual ~cRecMenuTimeline(void) {
}; };
eRecMenuState ProcessKey(eKeys Key); eRecMenuState ProcessKey(eKeys Key);
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
const cTimer *GetTimer(void);
#else
cTimer *GetTimer(void); cTimer *GetTimer(void);
#endif
}; };
/****************************************************************************************** /******************************************************************************************

View File

@ -16,8 +16,14 @@ cTVGuideSearchTimer::cTVGuideSearchTimer(void) {
startTime = 0000; startTime = 0000;
stopTime = 2359; stopTime = 2359;
useChannel = false; useChannel = false;
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
LOCK_CHANNELS_READ;
channelMin = Channels->GetByNumber(cDevice::CurrentChannel());
channelMax = Channels->GetByNumber(cDevice::CurrentChannel());
#else
channelMin = Channels.GetByNumber(cDevice::CurrentChannel()); channelMin = Channels.GetByNumber(cDevice::CurrentChannel());
channelMax = Channels.GetByNumber(cDevice::CurrentChannel()); channelMax = Channels.GetByNumber(cDevice::CurrentChannel());
#endif
channelGroup = ""; channelGroup = "";
useCase = false; useCase = false;
mode = 0; mode = 0;
@ -239,7 +245,12 @@ bool cTVGuideSearchTimer::Parse(bool readTemplate) {
char *channelMinbuffer = NULL; char *channelMinbuffer = NULL;
char *channelMaxbuffer = NULL; char *channelMaxbuffer = NULL;
int channels = sscanf(values[value].c_str(), "%a[^|]|%a[^|]", &channelMinbuffer, &channelMaxbuffer); int channels = sscanf(values[value].c_str(), "%a[^|]|%a[^|]", &channelMinbuffer, &channelMaxbuffer);
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
LOCK_CHANNELS_READ;
channelMin = Channels->GetByChannelID(tChannelID::FromString(channelMinbuffer), true, true);
#else
channelMin = Channels.GetByChannelID(tChannelID::FromString(channelMinbuffer), true, true); channelMin = Channels.GetByChannelID(tChannelID::FromString(channelMinbuffer), true, true);
#endif
if (!channelMin) { if (!channelMin) {
channelMin = channelMax = NULL; channelMin = channelMax = NULL;
useChannel = 0; useChannel = 0;
@ -247,7 +258,11 @@ bool cTVGuideSearchTimer::Parse(bool readTemplate) {
if (channels == 1) if (channels == 1)
channelMax = channelMin; channelMax = channelMin;
else { else {
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
channelMax = Channels->GetByChannelID(tChannelID::FromString(channelMaxbuffer), true, true);
#else
channelMax = Channels.GetByChannelID(tChannelID::FromString(channelMaxbuffer), true, true); channelMax = Channels.GetByChannelID(tChannelID::FromString(channelMaxbuffer), true, true);
#endif
if (!channelMax) { if (!channelMax) {
channelMin = channelMax = NULL; channelMin = channelMax = NULL;
useChannel = 0; useChannel = 0;
@ -511,7 +526,12 @@ int cTVGuideSearchTimer::GetNumTimers(void) {
int numTimers = 0; int numTimers = 0;
if (ID < 0) if (ID < 0)
return numTimers; return numTimers;
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
LOCK_TIMERS_READ;
for (const cTimer *timer = Timers->First(); timer; timer = Timers->Next(timer)) {
#else
for (cTimer *timer = Timers.First(); timer; timer = Timers.Next(timer)) { for (cTimer *timer = Timers.First(); timer; timer = Timers.Next(timer)) {
#endif
char* searchID = GetAuxValue(timer, "s-id"); char* searchID = GetAuxValue(timer, "s-id");
if (!searchID) continue; if (!searchID) continue;
if (ID == atoi(searchID)) if (ID == atoi(searchID))
@ -525,7 +545,12 @@ int cTVGuideSearchTimer::GetNumRecordings(void) {
int numRecordings = 0; int numRecordings = 0;
if (ID < 0) if (ID < 0)
return numRecordings; return numRecordings;
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
LOCK_RECORDINGS_READ;
for (const cRecording *recording = Recordings->First(); recording; recording = Recordings->Next(recording)) {
#else
for (cRecording *recording = Recordings.First(); recording; recording = Recordings.Next(recording)) { for (cRecording *recording = Recordings.First(); recording; recording = Recordings.Next(recording)) {
#endif
if (recording->IsEdited()) if (recording->IsEdited())
continue; continue;
if (!recording->Info()) if (!recording->Info())
@ -568,3 +593,22 @@ void cTVGuideSearchTimer::Dump(void) {
esyslog("tvguide searchtimer: useDescription: %d", useDescription); esyslog("tvguide searchtimer: useDescription: %d", useDescription);
} }
void cTVGuideSearchTimer::SetStartChannel(int startChannel)
{
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
LOCK_CHANNELS_READ;
channelMin = Channels->GetByNumber(startChannel);
#else
channelMin = Channels.GetByNumber(startChannel);
#endif
};
void cTVGuideSearchTimer::SetStopChannel(int stopChannel)
{
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
LOCK_CHANNELS_READ;
channelMax = Channels->GetByNumber(stopChannel);
#else
channelMax = Channels.GetByNumber(stopChannel);
#endif
};

View File

@ -11,8 +11,13 @@ private:
int startTime; int startTime;
int stopTime; int stopTime;
int useChannel; int useChannel;
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
const cChannel *channelMin;
const cChannel *channelMax;
#else
cChannel *channelMin; cChannel *channelMin;
cChannel *channelMax; cChannel *channelMax;
#endif
std::string channelGroup; std::string channelGroup;
int useCase; int useCase;
int mode; int mode;
@ -106,8 +111,8 @@ public:
void SetUseSubtitle(bool useSubtitle) { this->useSubtitle = useSubtitle; }; void SetUseSubtitle(bool useSubtitle) { this->useSubtitle = useSubtitle; };
void SetUseDesription(bool useDescription) { this->useDescription = useDescription; }; void SetUseDesription(bool useDescription) { this->useDescription = useDescription; };
void SetUseChannel(bool useChannel) { this->useChannel = useChannel; }; void SetUseChannel(bool useChannel) { this->useChannel = useChannel; };
void SetStartChannel(int startChannel) { channelMin = Channels.GetByNumber(startChannel); }; void SetStartChannel(int startChannel);
void SetStopChannel(int stopChannel) { channelMax = Channels.GetByNumber(stopChannel); }; void SetStopChannel(int stopChannel);
void SetUseTime(bool useTime) { this->useTime = useTime; }; void SetUseTime(bool useTime) { this->useTime = useTime; };
void SetStartTime(int startTime) { this->startTime = startTime; }; void SetStartTime(int startTime) { this->startTime = startTime; };
void SetStopTime(int stopTime) { this->stopTime = stopTime; }; void SetStopTime(int stopTime) { this->stopTime = stopTime; };

View File

@ -86,7 +86,12 @@ void cTVGuideTimerConflicts::CalculateConflicts(void) {
cTimeInterval *unionSet = NULL; cTimeInterval *unionSet = NULL;
int numTimers = conflicts[i]->timerIDs.size(); int numTimers = conflicts[i]->timerIDs.size();
for (int j=0; j < numTimers; j++) { for (int j=0; j < numTimers; j++) {
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
LOCK_TIMERS_READ;
const cTimer *timer = Timers->Get(conflicts[i]->timerIDs[j]);
#else
const cTimer *timer = Timers.Get(conflicts[i]->timerIDs[j]); const cTimer *timer = Timers.Get(conflicts[i]->timerIDs[j]);
#endif
if (timer) { if (timer) {
if (!unionSet) { if (!unionSet) {
unionSet = new cTimeInterval(timer->StartTime(), timer->StopTime()); unionSet = new cTimeInterval(timer->StartTime(), timer->StopTime());
@ -105,7 +110,12 @@ void cTVGuideTimerConflicts::CalculateConflicts(void) {
cTimeInterval *intersect = NULL; cTimeInterval *intersect = NULL;
for (int j=0; j < numTimers; j++) { for (int j=0; j < numTimers; j++) {
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
LOCK_TIMERS_READ;
const cTimer *timer = Timers->Get(conflicts[i]->timerIDs[j]);
#else
const cTimer *timer = Timers.Get(conflicts[i]->timerIDs[j]); const cTimer *timer = Timers.Get(conflicts[i]->timerIDs[j]);
#endif
if (timer) { if (timer) {
if (!intersect) { if (!intersect) {
intersect = new cTimeInterval(timer->StartTime(), timer->StopTime()); intersect = new cTimeInterval(timer->StartTime(), timer->StopTime());

View File

@ -73,11 +73,20 @@ void cTvGuideOsd::Show(void) {
void cTvGuideOsd::drawOsd() { void cTvGuideOsd::drawOsd() {
cPixmap::Lock(); cPixmap::Lock();
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
LOCK_CHANNELS_READ;
const cChannel *startChannel = Channels->GetByNumber(cDevice::CurrentChannel());
#else
cChannel *startChannel = Channels.GetByNumber(cDevice::CurrentChannel()); cChannel *startChannel = Channels.GetByNumber(cDevice::CurrentChannel());
#endif
int numBack = tvguideConfig.numGrids / 2; int numBack = tvguideConfig.numGrids / 2;
int offset = 0; int offset = 0;
const cChannel *newStartChannel = startChannel; const cChannel *newStartChannel = startChannel;
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
for (; newStartChannel ; newStartChannel = Channels->Prev(newStartChannel)) {
#else
for (; newStartChannel ; newStartChannel = Channels.Prev(newStartChannel)) { for (; newStartChannel ; newStartChannel = Channels.Prev(newStartChannel)) {
#endif
if (newStartChannel && !newStartChannel->GroupSep()) { if (newStartChannel && !newStartChannel->GroupSep()) {
offset++; offset++;
} }
@ -85,7 +94,11 @@ void cTvGuideOsd::drawOsd() {
break; break;
} }
if (!newStartChannel) if (!newStartChannel)
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
newStartChannel = Channels->First();
#else
newStartChannel = Channels.First(); newStartChannel = Channels.First();
#endif
offset--; offset--;
if (offset < 0) if (offset < 0)
offset = 0; offset = 0;
@ -122,7 +135,12 @@ void cTvGuideOsd::readChannels(const cChannel *channelStart) {
columns.Clear(); columns.Clear();
if (!channelStart) if (!channelStart)
return; return;
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
LOCK_CHANNELS_READ;
for (const cChannel *channel = channelStart; channel; channel = Channels->Next(channel)) {
#else
for (const cChannel *channel = channelStart; channel; channel = Channels.Next(channel)) { for (const cChannel *channel = channelStart; channel; channel = Channels.Next(channel)) {
#endif
if (!channel->GroupSep()) { if (!channel->GroupSep()) {
if (channelGroups->IsInLastGroup(channel)) { if (channelGroups->IsInLastGroup(channel)) {
break; break;
@ -144,7 +162,11 @@ void cTvGuideOsd::readChannels(const cChannel *channelStart) {
int numCurrent = columns.Count(); int numCurrent = columns.Count();
int numBack = tvguideConfig.numGrids - numCurrent; int numBack = tvguideConfig.numGrids - numCurrent;
int newChannelNumber = columns.First()->getChannel()->Number() - numBack; int newChannelNumber = columns.First()->getChannel()->Number() - numBack;
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
const cChannel *newStart = Channels->GetByNumber(newChannelNumber);
#else
const cChannel *newStart = Channels.GetByNumber(newChannelNumber); const cChannel *newStart = Channels.GetByNumber(newChannelNumber);
#endif
readChannels(newStart); readChannels(newStart);
} }
} }
@ -213,7 +235,12 @@ void cTvGuideOsd::channelForward() {
bool colAdded = false; bool colAdded = false;
if (!colRight) { if (!colRight) {
const cChannel *channelRight = activeGrid->column->getChannel(); const cChannel *channelRight = activeGrid->column->getChannel();
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
LOCK_CHANNELS_READ;
while (channelRight = Channels->Next(channelRight)) {
#else
while (channelRight = Channels.Next(channelRight)) { while (channelRight = Channels.Next(channelRight)) {
#endif
if (!channelRight->GroupSep()) { if (!channelRight->GroupSep()) {
if (channelGroups->IsInLastGroup(channelRight)) { if (channelGroups->IsInLastGroup(channelRight)) {
break; break;
@ -263,7 +290,12 @@ void cTvGuideOsd::channelBack() {
bool colAdded = false; bool colAdded = false;
if (!colLeft) { if (!colLeft) {
const cChannel *channelLeft = activeGrid->column->getChannel(); const cChannel *channelLeft = activeGrid->column->getChannel();
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
LOCK_CHANNELS_READ;
while (channelLeft = Channels->Prev(channelLeft)) {
#else
while (channelLeft = Channels.Prev(channelLeft)) { while (channelLeft = Channels.Prev(channelLeft)) {
#endif
if (!channelLeft->GroupSep()) { if (!channelLeft->GroupSep()) {
colLeft = new cChannelColumn(0, channelLeft, myTime); colLeft = new cChannelColumn(0, channelLeft, myTime);
if (colLeft->readGrids()) { if (colLeft->readGrids()) {
@ -434,11 +466,21 @@ void cTvGuideOsd::processKeyGreen() {
if (tvguideConfig.channelJumpMode == eGroupJump) { if (tvguideConfig.channelJumpMode == eGroupJump) {
int prevNum = channelGroups->GetPrevGroupChannelNumber(currentChannel); int prevNum = channelGroups->GetPrevGroupChannelNumber(currentChannel);
if (prevNum) { if (prevNum) {
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
LOCK_CHANNELS_READ;
prev = Channels->GetByNumber(prevNum);
#else
prev = Channels.GetByNumber(prevNum); prev = Channels.GetByNumber(prevNum);
#endif
} }
} else if (tvguideConfig.channelJumpMode == eNumJump) { } else if (tvguideConfig.channelJumpMode == eNumJump) {
int i = tvguideConfig.jumpChannels + 1; int i = tvguideConfig.jumpChannels + 1;
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
LOCK_CHANNELS_READ;
for (const cChannel *channel = firstChannel; channel; channel = Channels->Prev(channel)) {
#else
for (const cChannel *channel = firstChannel; channel; channel = Channels.Prev(channel)) { for (const cChannel *channel = firstChannel; channel; channel = Channels.Prev(channel)) {
#endif
if (!channel->GroupSep()) { if (!channel->GroupSep()) {
prev = channel; prev = channel;
i--; i--;
@ -470,11 +512,21 @@ void cTvGuideOsd::processKeyYellow() {
if (tvguideConfig.channelJumpMode == eGroupJump) { if (tvguideConfig.channelJumpMode == eGroupJump) {
int nextNum = channelGroups->GetNextGroupChannelNumber(currentChannel); int nextNum = channelGroups->GetNextGroupChannelNumber(currentChannel);
if (nextNum) { if (nextNum) {
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
LOCK_CHANNELS_READ;
next = Channels->GetByNumber(nextNum);
#else
next = Channels.GetByNumber(nextNum); next = Channels.GetByNumber(nextNum);
#endif
} }
} else if (tvguideConfig.channelJumpMode == eNumJump) { } else if (tvguideConfig.channelJumpMode == eNumJump) {
int i=0; int i=0;
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
LOCK_CHANNELS_READ;
for (const cChannel *channel = firstChannel; channel; channel = Channels->Next(channel)) {
#else
for (const cChannel *channel = firstChannel; channel; channel = Channels.Next(channel)) { for (const cChannel *channel = firstChannel; channel; channel = Channels.Next(channel)) {
#endif
if (channelGroups->IsInLastGroup(channel)) { if (channelGroups->IsInLastGroup(channel)) {
break; break;
} }
@ -625,7 +677,12 @@ void cTvGuideOsd::CheckTimeout(void) {
int newChannelNum = channelJumper->GetChannel(); int newChannelNum = channelJumper->GetChannel();
delete channelJumper; delete channelJumper;
channelJumper = NULL; channelJumper = NULL;
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
LOCK_CHANNELS_READ;
const cChannel *newChannel = Channels->GetByNumber(newChannelNum);
#else
const cChannel *newChannel = Channels.GetByNumber(newChannelNum); const cChannel *newChannel = Channels.GetByNumber(newChannelNum);
#endif
if (newChannel) { if (newChannel) {
readChannels(newChannel); readChannels(newChannel);
if (columns.Count() > 0) { if (columns.Count() > 0) {

10
view.c
View File

@ -120,7 +120,12 @@ void cView::DrawHeader(void) {
pixmapHeader->DrawText(cPoint(xText, ySubtitle), CutText(subTitle, textWidthMax, fontHeader).c_str(), theme.Color(clrFont), theme.Color(clrStatusHeader), fontHeader); pixmapHeader->DrawText(cPoint(xText, ySubtitle), CutText(subTitle, textWidthMax, fontHeader).c_str(), theme.Color(clrFont), theme.Color(clrStatusHeader), fontHeader);
//REC Icon //REC Icon
eTimerMatch timerMatch=tmNone; eTimerMatch timerMatch=tmNone;
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
LOCK_TIMERS_READ;
const cTimer *ti;
#else
cTimer *ti; cTimer *ti;
#endif
if (!event) if (!event)
return; return;
if (tvguideConfig.useRemoteTimers && pRemoteTimers) { if (tvguideConfig.useRemoteTimers && pRemoteTimers) {
@ -130,7 +135,12 @@ void cView::DrawHeader(void) {
timerMatch = (eTimerMatch)rtMatch.timerMatch; timerMatch = (eTimerMatch)rtMatch.timerMatch;
ti = rtMatch.timer; ti = rtMatch.timer;
} else { } else {
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
LOCK_TIMERS_READ;
ti=Timers->GetMatch(event, &timerMatch);
#else
ti=Timers.GetMatch(event, &timerMatch); ti=Timers.GetMatch(event, &timerMatch);
#endif
} }
if (timerMatch == tmFull) { if (timerMatch == tmFull) {
cString recIconText(" REC "); cString recIconText(" REC ");