From bf2937d86c316edb716c6fe1bdb97e7c706f675c Mon Sep 17 00:00:00 2001 From: kamel5 Date: Thu, 8 Mar 2018 13:30:41 +0100 Subject: [PATCH] Cosmetic changes / SwitchTimer& operator / std:min,std:max --- channelcolumn.c | 14 +++++------ channelcolumn.h | 4 +-- channelgroups.c | 6 ++--- channeljump.c | 2 +- detailview.c | 6 ++--- imagecache.c | 10 ++++---- recmanager.c | 64 ++++++++++++++++++++++++------------------------ recmanager.h | 8 +++--- recmenuitem.c | 28 ++++++++++----------- recmenuitem.h | 20 +++++++-------- recmenumanager.c | 26 ++++++++++---------- recmenumanager.h | 2 +- recmenus.c | 30 +++++++++++------------ recmenus.h | 14 +++++------ searchtimer.c | 14 +++++------ searchtimer.h | 2 +- statusheader.c | 2 +- switchtimer.c | 11 +++++++++ switchtimer.h | 4 +++ timerconflict.c | 4 +-- tvguideosd.c | 24 +++++++++--------- view.c | 4 +-- 22 files changed, 157 insertions(+), 142 deletions(-) diff --git a/channelcolumn.c b/channelcolumn.c index 666b6b5..6a65428 100644 --- a/channelcolumn.c +++ b/channelcolumn.c @@ -5,12 +5,12 @@ cChannelColumn::cChannelColumn(int num, const cChannel *channel, cMyTime *myTime this->channel = channel; this->num = num; this->myTime = myTime; -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 #else hasTimer = channel->HasTimer(); #endif hasSwitchTimer = SwitchTimers.ChannelInSwitchList(channel); -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 #else schedulesLock = new cSchedulesLock(false, 100); #endif @@ -21,7 +21,7 @@ cChannelColumn::~cChannelColumn(void) { if (header) delete header; grids.Clear(); -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 #else delete schedulesLock; #endif @@ -42,7 +42,7 @@ void cChannelColumn::drawHeader() { } bool cChannelColumn::readGrids() { -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 LOCK_SCHEDULES_READ; const cSchedules* schedules = Schedules; #else @@ -200,7 +200,7 @@ void cChannelColumn::AddNewGridsAtStart() { return; } //if not, i have to add new ones to the list -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 LOCK_SCHEDULES_READ; const cSchedules* schedules = Schedules; #else @@ -253,7 +253,7 @@ void cChannelColumn::AddNewGridsAtEnd() { return; } //if not, i have to add new ones to the list -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 LOCK_SCHEDULES_READ; const cSchedules* schedules = Schedules; #else @@ -366,7 +366,7 @@ cGrid *cChannelColumn::addDummyGrid(time_t start, time_t end, cGrid *firstGrid, } void cChannelColumn::SetTimers() { -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 #else hasTimer = channel->HasTimer(); #endif diff --git a/channelcolumn.h b/channelcolumn.h index 799500f..cd32e82 100644 --- a/channelcolumn.h +++ b/channelcolumn.h @@ -20,7 +20,7 @@ private: const cChannel *channel; cHeaderGrid *header; cList grids; -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 #else cSchedulesLock *schedulesLock; #endif @@ -53,7 +53,7 @@ public: void ClearOutdatedEnd(); int GetNum() {return num;}; void SetNum(int num) {this->num = num;}; -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 void setTimer(); #else void setTimer() {hasTimer = channel->HasTimer();}; diff --git a/channelgroups.c b/channelgroups.c index 7046679..793b75e 100644 --- a/channelgroups.c +++ b/channelgroups.c @@ -10,7 +10,7 @@ cChannelGroups::~cChannelGroups(void) { void cChannelGroups::ReadChannelGroups(void) { bool setStart = false; int lastChannelNumber = 0; -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 LOCK_CHANNELS_READ; const cChannel *first = Channels->First(); #else @@ -20,7 +20,7 @@ void cChannelGroups::ReadChannelGroups(void) { channelGroups.push_back(cChannelGroup(tr("Main Program"))); setStart = true; } -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 for (const cChannel *channel = Channels->First(); channel; channel = Channels->Next(channel)) { #else for (const cChannel *channel = Channels.First(); channel; channel = Channels.Next(channel)) { @@ -112,7 +112,7 @@ void cChannelGroups::DrawChannelGroups(const cChannel *start, const cChannel *st int groupLast = group; int line = 0; int lineStart = 0; -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 LOCK_CHANNELS_READ; for (const cChannel *channel = Channels->Next(start); channel; channel = Channels->Next(channel)) { #else diff --git a/channeljump.c b/channeljump.c index 8793217..7e641f5 100644 --- a/channeljump.c +++ b/channeljump.c @@ -11,7 +11,7 @@ cChannelJump::cChannelJump(cChannelGroups *channelGroups) { pixmapText = NULL; channel = 0; if (!tvguideConfig.hideLastGroup) { -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 LOCK_CHANNELS_READ; maxChannels = Channels->MaxNumber(); #else diff --git a/detailview.c b/detailview.c index e074de2..ec927c6 100644 --- a/detailview.c +++ b/detailview.c @@ -9,7 +9,7 @@ cDetailView::~cDetailView(void){ Cancel(-1); while (Active()) cCondWait::SleepMs(10); -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 LOCK_CHANNELS_READ; footer->LeaveDetailedViewMode(Channels->GetByChannelID(event->ChannelID())); #else @@ -47,7 +47,7 @@ void cDetailView::InitiateView(void) { dateTime = cString::sprintf("%s %s - %s (%d %s)", *event->GetDateString(), *event->GetTimeString(), *event->GetEndTimeString(), event->Duration()/60, tr("min")); } view->SetDateTime(*dateTime); -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 LOCK_CHANNELS_READ; view->SetChannel(Channels->GetByChannelID(event->ChannelID(), true)); #else @@ -100,7 +100,7 @@ std::string cDetailView::LoadReruns(void) { continue; i++; sstrReruns << *DayDateTime(r->event->StartTime()); -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 LOCK_CHANNELS_READ; const cChannel *channel = Channels->GetByChannelID(r->event->ChannelID(), true, true); #else diff --git a/imagecache.c b/imagecache.c index 5b95e54..1dc4ef4 100644 --- a/imagecache.c +++ b/imagecache.c @@ -280,7 +280,7 @@ void cImageCache::CreateLogoCache(void) { return; if (tvguideConfig.numLogosInitial > 0) { int channelsCached = 0; -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 LOCK_CHANNELS_READ; for (const cChannel *channel = Channels->First(); channel; channel = Channels->Next(channel)) { #else @@ -460,7 +460,7 @@ void cImageCache::AddCornersHorizontal(cImage *img, bool active) { } if (!cornerLeft || !cornerRight) return; - int maxX = min(cornerWidth, imgWidth); + int maxX = std::min(cornerWidth, imgWidth); for (int row = 0; row < cornerHeight; row++) { for (int col = 0; col < maxX; ++col) { img->SetPixel(cPoint(col, row), cornerLeft->GetPixel(cPoint(col, row))); @@ -482,7 +482,7 @@ void cImageCache::AddCornersVertical(cImage *img, bool active) { } if (!cornerHead || !cornerBottom) return; - int maxY = min(cornerHeight, imgHeight); + int maxY = std::min(cornerHeight, imgHeight); for (int row = 0; row < maxY; row++) { for (int col = 0; col < cornerWidth; ++col) { img->SetPixel(cPoint(col, row), cornerHead->GetPixel(cPoint(col, row))); @@ -527,7 +527,7 @@ void cImageCache::AddCornersGroupHorizontal(cImage *img) { int imgWidth = img->Width(); int imgHeight = img->Height(); int heightHeadBottom = groupsHead->Height(); - int maxY = min(heightHeadBottom, imgHeight); + int maxY = std::min(heightHeadBottom, imgHeight); for (int row = 0; row < maxY; row++) { for (int col = 0; col < imgWidth; ++col) { img->SetPixel(cPoint(col, row), groupsHead->GetPixel(cPoint(col, row))); @@ -542,7 +542,7 @@ void cImageCache::AddCornersGroupVertical(cImage *img) { int imgWidth = img->Width(); int imgHeight = img->Height(); int widthLeftRight = groupsLeft->Width(); - int maxX = min(widthLeftRight, imgWidth); + int maxX = std::min(widthLeftRight, imgWidth); for (int row = 0; row < imgHeight; row++) { for (int col = 0; col < maxX; ++col) { img->SetPixel(cPoint(col, row), groupsLeft->GetPixel(cPoint(col, row))); diff --git a/recmanager.c b/recmanager.c index 3ad735c..1b03353 100644 --- a/recmanager.c +++ b/recmanager.c @@ -56,7 +56,7 @@ bool cRecManager::CheckEventForTimer(const cEvent *event) { return hasTimer; } -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 const cTimer *cRecManager::GetTimerForEvent(const cEvent *event) { const cTimer *timer = NULL; #else @@ -68,7 +68,7 @@ cTimer *cRecManager::GetTimerForEvent(const cEvent *event) { rtMatch.event = event; pRemoteTimers->Service("RemoteTimers::GetMatch-v1.0", &rtMatch); timer = rtMatch.timer; -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 return timer; } LOCK_TIMERS_READ; @@ -92,7 +92,7 @@ cTimer *cRecManager::createTimer(const cEvent *event, std::string path) { cTimer *cRecManager::createLocalTimer(const cEvent *event, std::string path) { cTimer *timer = new cTimer(event); -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 LOCK_TIMERS_WRITE; cTimer *t = Timers->GetTimer(timer); #else @@ -100,7 +100,7 @@ cTimer *cRecManager::createLocalTimer(const cEvent *event, std::string path) { #endif if (t) { t->OnOff(); -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 t->SetEvent(event); #else t->SetEventFromSchedule(); @@ -109,7 +109,7 @@ cTimer *cRecManager::createLocalTimer(const cEvent *event, std::string path) { timer = t; isyslog("timer %s reactivated", *t->ToDescr()); } else { -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 Timers->Add(timer); #else Timers.Add(timer); @@ -117,7 +117,7 @@ cTimer *cRecManager::createLocalTimer(const cEvent *event, std::string path) { isyslog("timer %s added (active)", *timer->ToDescr()); } SetTimerPath(timer, event, path); -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 Timers->SetModified(); #else Timers.SetModified(); @@ -178,7 +178,7 @@ void cRecManager::SetTimerPath(cTimer *timer, const cEvent *event, std::string p } void cRecManager::DeleteTimer(int timerID) { -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 LOCK_TIMERS_READ; const cTimer *t = Timers->Get(timerID); #else @@ -200,7 +200,7 @@ void cRecManager::DeleteTimer(const cEvent *event) { } void cRecManager::DeleteLocalTimer(const cEvent *event) { -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 LOCK_TIMERS_READ; const cTimer *t = Timers->GetMatch(event); #else @@ -212,7 +212,7 @@ void cRecManager::DeleteLocalTimer(const cEvent *event) { } -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 void cRecManager::DeleteTimer(const cTimer *timer) { LOCK_TIMERS_WRITE; cTimers* timers = Timers; @@ -230,7 +230,7 @@ void cRecManager::DeleteTimer(cTimer *timer) { } #endif isyslog("timer %s deleted", *timer->ToDescr()); -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 timers->Del(t, true); timers->SetModified(); #else @@ -253,7 +253,7 @@ void cRecManager::DeleteRemoteTimer(const cEvent *event) { } } -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 void cRecManager::SaveTimer(const cTimer *timer, cTimer newTimerSettings) { #else void cRecManager::SaveTimer(cTimer *timer, cTimer newTimerSettings) { @@ -269,7 +269,7 @@ void cRecManager::SaveTimer(cTimer *timer, cTimer newTimerSettings) { int stop = newTimerSettings.Stop(); std::string fileName = newTimerSettings.File(); -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 ((cTimer*)timer)->SetDay(day); ((cTimer*)timer)->SetStart(start); ((cTimer*)timer)->SetStop(stop); @@ -286,7 +286,7 @@ void cRecManager::SaveTimer(cTimer *timer, cTimer newTimerSettings) { #endif if (timer->HasFlags(tfActive) && !active) -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 ((cTimer*)timer)->ClrFlags(tfActive); else if (!timer->HasFlags(tfActive) && active) ((cTimer*)timer)->SetFlags(tfActive); @@ -300,7 +300,7 @@ void cRecManager::SaveTimer(cTimer *timer, cTimer newTimerSettings) { #endif if (tvguideConfig.useRemoteTimers && pRemoteTimers) { RemoteTimers_Timer_v1_0 rt; -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 rt.timer = (cTimer*)timer; #else rt.timer = timer; @@ -309,7 +309,7 @@ void cRecManager::SaveTimer(cTimer *timer, cTimer newTimerSettings) { rt.timer = NULL; RefreshRemoteTimers(); } else { -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 LOCK_TIMERS_WRITE; Timers->SetModified(); #else @@ -320,7 +320,7 @@ void cRecManager::SaveTimer(cTimer *timer, cTimer newTimerSettings) { bool cRecManager::IsRecorded(const cEvent *event) { -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 LOCK_TIMERS_WRITE; cTimer *timer = Timers->GetMatch(event); #else @@ -351,7 +351,7 @@ cTVGuideTimerConflicts *cRecManager::CheckTimerConflict(void) { } void cRecManager::CreateSeriesTimer(cTimer *seriesTimer) { -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 #else seriesTimer->SetEventFromSchedule(); #endif @@ -362,7 +362,7 @@ void cRecManager::CreateSeriesTimer(cTimer *seriesTimer) { isyslog("%s", *rt.errorMsg); RefreshRemoteTimers(); } else { -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 LOCK_TIMERS_WRITE; cTimers* timers = Timers; timers->Add(seriesTimer); @@ -417,7 +417,7 @@ const cEvent **cRecManager::PerformSearchTimerSearch(std::string epgSearchString numResults = results.size(); if (numResults > 0) { searchResults = new const cEvent *[numResults]; -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 LOCK_SCHEDULES_READ; const cSchedules* schedules = Schedules; #else @@ -434,7 +434,7 @@ const cEvent **cRecManager::PerformSearchTimerSearch(std::string epgSearchString int eventID = atoi(flds[1].c_str()); std::string channelID = flds[7]; tChannelID chanID = tChannelID::FromString(channelID.c_str()); -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 LOCK_CHANNELS_READ; const cChannel *channel = Channels->GetByChannelID(chanID); #else @@ -546,7 +546,7 @@ void cRecManager::DeleteSearchTimer(cTVGuideSearchTimer *searchTimer, bool delTi return; int searchTimerID = searchTimer->GetID(); if (delTimers) { -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 LOCK_TIMERS_WRITE; cTimer *timer = Timers->First(); #else @@ -557,7 +557,7 @@ void cRecManager::DeleteSearchTimer(cTVGuideSearchTimer *searchTimer, bool delTi char* searchID = GetAuxValue(timer, "s-id"); if (searchID) { if (searchTimerID == atoi(searchID)) { -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 cTimer* timerNext = Timers->Next(timer); #else cTimer* timerNext = Timers.Next(timer); @@ -565,7 +565,7 @@ void cRecManager::DeleteSearchTimer(cTVGuideSearchTimer *searchTimer, bool delTi DeleteTimer(timer); timer = timerNext; } else { -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 timer = Timers->Next(timer); #else timer = Timers.Next(timer); @@ -573,14 +573,14 @@ void cRecManager::DeleteSearchTimer(cTVGuideSearchTimer *searchTimer, bool delTi } free(searchID); } else { -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 timer = Timers->Next(timer); #else timer = Timers.Next(timer); #endif } } else { -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 timer = Timers->Next(timer); #else timer = Timers.Next(timer); @@ -637,7 +637,7 @@ void cRecManager::DeleteSwitchTimer(const cEvent *event) { } } -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 const cRecording **cRecManager::SearchForRecordings(std::string searchString, int &numResults) { const cRecording **matchingRecordings = NULL; @@ -649,7 +649,7 @@ cRecording **cRecManager::SearchForRecordings(std::string searchString, int &num int num = 0; numResults = 0; -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 LOCK_RECORDINGS_READ; for (const cRecording *recording = Recordings->First(); recording; recording = Recordings->Next(recording)) { #else @@ -685,7 +685,7 @@ cRecording **cRecManager::SearchForRecordings(std::string searchString, int &num } if (match) { -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 matchingRecordings = (const cRecording **)realloc(matchingRecordings, (num + 1) * sizeof(cRecording *)); #else matchingRecordings = (cRecording **)realloc(matchingRecordings, (num + 1) * sizeof(cRecording *)); @@ -766,7 +766,7 @@ void cRecManager::GetFavorites(std::vector *favorites) { const cEvent **cRecManager::WhatsOnNow(bool nowOrNext, int &numResults) { std::vector tmpResults; -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 LOCK_SCHEDULES_READ; LOCK_CHANNELS_READ; const cChannels* channels = Channels; @@ -777,7 +777,7 @@ const cEvent **cRecManager::WhatsOnNow(bool nowOrNext, int &numResults) { #endif const cChannel *startChannel = NULL, *stopChannel = NULL; if (tvguideConfig.favLimitChannels) { -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 startChannel = Channels->GetByNumber(tvguideConfig.favStartChannel); stopChannel = Channels->GetByNumber(tvguideConfig.favStopChannel); } @@ -843,7 +843,7 @@ const cEvent **cRecManager::UserDefinedTime(int userTime, int &numResults) { if (searchTime < now) searchTime += 24*60*60; -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 LOCK_CHANNELS_READ; LOCK_SCHEDULES_READ; const cChannels* channels = Channels; @@ -854,7 +854,7 @@ const cEvent **cRecManager::UserDefinedTime(int userTime, int &numResults) { #endif const cChannel *startChannel = NULL, *stopChannel = NULL; if (tvguideConfig.favLimitChannels) { -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 startChannel = Channels->GetByNumber(tvguideConfig.favStartChannel); stopChannel = Channels->GetByNumber(tvguideConfig.favStopChannel); } diff --git a/recmanager.h b/recmanager.h index 53b8146..4fa3a46 100644 --- a/recmanager.h +++ b/recmanager.h @@ -28,7 +28,7 @@ public: bool EpgSearchAvailable(void) {return epgSearchAvailable;}; bool RefreshRemoteTimers(void); bool CheckEventForTimer(const cEvent *event); -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 const cTimer *GetTimerForEvent(const cEvent *event); #else cTimer *GetTimerForEvent(const cEvent *event); @@ -37,7 +37,7 @@ public: cTimer *createLocalTimer(const cEvent *event, std::string path); cTimer *createRemoteTimer(const cEvent *event, std::string path); void SetTimerPath(cTimer *timer, const cEvent *event, std::string path); -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 void DeleteTimer(const cTimer *timer); #else void DeleteTimer(cTimer *timer); @@ -46,7 +46,7 @@ public: void DeleteTimer(const cEvent *event); void DeleteLocalTimer(const cEvent *event); void DeleteRemoteTimer(const cEvent *event); -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 void SaveTimer(const cTimer *timer, cTimer newTimerSettings); #else void SaveTimer(cTimer *timer, cTimer newTimerSettings); @@ -64,7 +64,7 @@ public: void UpdateSearchTimers(void); bool CreateSwitchTimer(const cEvent *event, cSwitchTimer switchTimer); void DeleteSwitchTimer(const cEvent *event); -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 const cRecording **SearchForRecordings(std::string searchString, int &numResults); #else cRecording **SearchForRecordings(std::string searchString, int &numResults); diff --git a/recmenuitem.c b/recmenuitem.c index c45a317..318c667 100644 --- a/recmenuitem.c +++ b/recmenuitem.c @@ -1817,7 +1817,7 @@ void cRecMenuItemEvent::Draw(void) { if (!event) return; int logoX = DrawIcons(); -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 LOCK_CHANNELS_READ; const cChannel *channel = Channels->GetByChannelID(event->ChannelID()); #else @@ -1918,7 +1918,7 @@ eRecMenuState cRecMenuItemEvent::ProcessKey(eKeys Key) { // --- cRecMenuItemChannelChooser ------------------------------------------------------- cRecMenuItemChannelChooser::cRecMenuItemChannelChooser(cString text, -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 const cChannel *initialChannel, #else cChannel *initialChannel, @@ -2007,7 +2007,7 @@ eRecMenuState cRecMenuItemChannelChooser::ProcessKey(eKeys Key) { fresh = true; if (!channel) return rmsConsumed; -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 const cChannel *prev = channel; LOCK_CHANNELS_READ; const cChannel *firstChannel = Channels->First(); @@ -2016,7 +2016,7 @@ eRecMenuState cRecMenuItemChannelChooser::ProcessKey(eKeys Key) { cChannel *firstChannel = Channels.First(); #endif if(firstChannel->GroupSep()) -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 firstChannel = Channels->Next(firstChannel); #else firstChannel = Channels.Next(firstChannel); @@ -2025,7 +2025,7 @@ eRecMenuState cRecMenuItemChannelChooser::ProcessKey(eKeys Key) { if (!initialChannelSet) channel = NULL; } else { -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 while (prev = Channels->Prev(prev)) { #else while (prev = Channels.Prev(prev)) { @@ -2046,24 +2046,24 @@ eRecMenuState cRecMenuItemChannelChooser::ProcessKey(eKeys Key) { return rmsConsumed; break; } case kRight: { -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 LOCK_CHANNELS_READ; #endif fresh = true; if (!channel) { -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 channel = Channels->First(); #else channel = Channels.First(); #endif if(channel->GroupSep()) -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 channel = Channels->Next(channel); #else channel = Channels.Next(channel); #endif } else { -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 const cChannel *next = channel; while (next = Channels->Next(next)) { #else @@ -2091,7 +2091,7 @@ eRecMenuState cRecMenuItemChannelChooser::ProcessKey(eKeys Key) { fresh = false; } channelNumber = channelNumber * 10 + (Key - k0); -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 LOCK_CHANNELS_READ; const cChannel *chanNew = Channels->GetByNumber(channelNumber); #else @@ -2258,7 +2258,7 @@ eRecMenuState cRecMenuItemDayChooser::ProcessKey(eKeys Key) { } // --- cRecMenuItemRecording ------------------------------------------------------- -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 cRecMenuItemRecording::cRecMenuItemRecording(const cRecording *recording, bool active) { #else cRecMenuItemRecording::cRecMenuItemRecording(cRecording *recording, bool active) { @@ -2290,7 +2290,7 @@ void cRecMenuItemRecording::Draw(void) { if (!recording) return; const cRecordingInfo *recInfo = recording->Info(); -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 LOCK_CHANNELS_READ; const cChannel *channel = Channels->GetByChannelID(recInfo->ChannelID()); #else @@ -2510,7 +2510,7 @@ void cRecMenuItemTimelineHeader::Show(void) { // --- cRecMenuItemTimelineTimer ------------------------------------------------------- -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 cRecMenuItemTimelineTimer::cRecMenuItemTimelineTimer(const cTimer *timer, time_t start, time_t stop, std::vector conflictsToday, cRecMenuItemTimelineHeader *header, bool active) { #else cRecMenuItemTimelineTimer::cRecMenuItemTimelineTimer(cTimer *timer, time_t start, time_t stop, std::vector conflictsToday, cRecMenuItemTimelineHeader *header, bool active) { @@ -2661,7 +2661,7 @@ void cRecMenuItemTimelineTimer::Show(void) { if (pixmapTimerConflicts) pixmapTimerConflicts->SetLayer(6); } -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 const cTimer *cRecMenuItemTimelineTimer::GetTimerValue(void) { #else cTimer *cRecMenuItemTimelineTimer::GetTimerValue(void) { diff --git a/recmenuitem.h b/recmenuitem.h index 2f9106a..9ff2749 100644 --- a/recmenuitem.h +++ b/recmenuitem.h @@ -123,7 +123,7 @@ public: virtual bool GetBoolValue(void) { return false; }; virtual cString GetStringValue(void) { return cString(""); }; virtual const cEvent *GetEventValue(void) { return NULL; }; -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 virtual const cTimer *GetTimerValue(void) { return NULL; }; #else virtual cTimer *GetTimerValue(void) { return NULL; }; @@ -493,7 +493,7 @@ public: class cRecMenuItemChannelChooser : public cRecMenuItem { private: cString text; -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 const cChannel *channel; #else cChannel *channel; @@ -506,7 +506,7 @@ private: void DrawValue(void); public: cRecMenuItemChannelChooser (cString text, -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 const cChannel *initialChannel, #else cChannel *initialChannel, @@ -560,14 +560,14 @@ public: // --- cRecMenuItemRecording ------------------------------------------------------- class cRecMenuItemRecording : public cRecMenuItem { private: -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 const cRecording *recording; #else cRecording *recording; #endif cPixmap *pixmapText; public: -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 cRecMenuItemRecording(const cRecording *recording, bool active); #else cRecMenuItemRecording(cRecording *recording, bool active); @@ -583,7 +583,7 @@ public: class cRecMenuItemTimelineHeader : public cRecMenuItem { private: time_t day; -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 const cTimer *timer; #else cTimer *timer; @@ -603,7 +603,7 @@ public: virtual ~cRecMenuItemTimelineHeader(void); void SetDay(time_t day) { this->day = day; }; void SetPixmaps(void); -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 void SetCurrentTimer(const cTimer *timer) { this->timer = timer; }; #else void SetCurrentTimer(cTimer *timer) { this->timer = timer; }; @@ -618,7 +618,7 @@ public: // --- cRecMenuItemTimelineTimer ------------------------------------------------------- class cRecMenuItemTimelineTimer : public cRecMenuItem { private: -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 const cTimer *timer; #else cTimer *timer; @@ -637,7 +637,7 @@ private: void DrawTimerConflicts(void); void DrawNoTimerInfo(void); public: -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 cRecMenuItemTimelineTimer(const cTimer *timer, time_t start, time_t stop, std::vector conflictsToday, cRecMenuItemTimelineHeader *header, bool active); #else cRecMenuItemTimelineTimer(cTimer *timer, time_t start, time_t stop, std::vector conflictsToday, cRecMenuItemTimelineHeader *header, bool active); @@ -649,7 +649,7 @@ public: void Hide(void); void Show(void); void Draw(void); -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 const cTimer *GetTimerValue(void); #else cTimer *GetTimerValue(void); diff --git a/recmenumanager.c b/recmenumanager.c index cb4bf12..4844373 100644 --- a/recmenumanager.c +++ b/recmenumanager.c @@ -125,7 +125,7 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) { timerIndex = menu->GetTimerConflictIndex(); } else break; int timerID = timerConflicts->GetCurrentConflictTimerID(timerIndex); -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 LOCK_TIMERS_READ; const cTimer *t = Timers->Get(timerID); #else @@ -161,7 +161,7 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) { timerIndex = menu->GetTimerConflictIndex(); } else break; int timerID = timerConflicts->GetCurrentConflictTimerID(timerIndex); -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 LOCK_TIMERS_READ; const cTimer *timer = Timers->Get(timerID); #else @@ -177,7 +177,7 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) { //caller: cRecMenuEditTimer //save timer from current timer conflict cTimer timerModified; -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 const cTimer *originalTimer; #else cTimer *originalTimer; @@ -214,7 +214,7 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) { break; case rmsEditTimer: { //edit timer for active event -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 LOCK_TIMERS_READ; const cTimer *timer = recManager->GetTimerForEvent(event); #else @@ -230,7 +230,7 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) { //caller: cRecMenuEditTimer //save timer for active event cTimer timerModified; -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 const cTimer *originalTimer; #else cTimer *originalTimer; @@ -253,7 +253,7 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) { recFolder = menu->GetFolder(); } delete activeMenu; -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 LOCK_CHANNELS_READ; const cChannel *channel = Channels->GetByChannelID(event->ChannelID()); #else @@ -500,7 +500,7 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) { activeMenu = new cRecMenuRecordingSearch(searchString); } else { int numSearchResults = 0; -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 const cRecording **searchResult = recManager->SearchForRecordings(searchString, numSearchResults); #else cRecording **searchResult = recManager->SearchForRecordings(searchString, numSearchResults); @@ -638,7 +638,7 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) { timerConflict = menu->GetTimerConflictIndex(); } else break; int timerID = timerConflicts->GetCurrentConflictTimerID(timerConflict); -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 LOCK_TIMERS_READ; const cTimer *timer = Timers->Get(timerID); #else @@ -685,7 +685,7 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) { originalConflictIndex = menu->GetTimerConflictIndex(); } else break; int originalTimerID = timerConflicts->GetCurrentConflictTimerID(originalConflictIndex); -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 LOCK_TIMERS_READ; const cTimer *timerOriginal = Timers->Get(originalTimerID); #else @@ -716,7 +716,7 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) { activeMenu->Display(); break; } case rmsTimelineTimerEdit: { -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 const cTimer *timer; #else cTimer *timer; @@ -732,7 +732,7 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) { break;} case rmsTimelineTimerSave: { cTimer timerModified; -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 const cTimer *originalTimer; #else cTimer *originalTimer; @@ -751,7 +751,7 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) { activeMenu->Display(); break; } case rmsTimelineTimerDelete: { -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 const cTimer *timer; #else cTimer *timer; @@ -872,7 +872,7 @@ void cRecMenuManager::DisplaySearchTimerList(void) { activeMenu->Display(); } -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 bool cRecMenuManager::DisplayTimerConflict(const cTimer *timer) { int timerID = 0; LOCK_TIMERS_READ; diff --git a/recmenumanager.h b/recmenumanager.h index 0cc4455..163a117 100644 --- a/recmenumanager.h +++ b/recmenumanager.h @@ -23,7 +23,7 @@ private: void SetBackground(void); void DeleteBackground(void); void DisplaySearchTimerList(void); -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 bool DisplayTimerConflict(const cTimer *timer); #else bool DisplayTimerConflict(cTimer *timer); diff --git a/recmenus.c b/recmenus.c index 51a50b6..bb2e3df 100644 --- a/recmenus.c +++ b/recmenus.c @@ -105,7 +105,7 @@ std::string cRecMenuAskFolder::GetFolder(void) { // --- cRecMenuConfirmTimer --------------------------------------------------------- cRecMenuConfirmTimer::cRecMenuConfirmTimer(const cEvent *event) { SetWidthPercent(50); -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 LOCK_CHANNELS_READ; const cString channelName = Channels->GetByChannelID(event->ChannelID())->Name(); #else @@ -148,7 +148,7 @@ cRecMenuConfirmTimer::cRecMenuConfirmTimer(const cEvent *event) { // --- cRecMenuConfirmDeleteTimer --------------------------------------------------------- cRecMenuConfirmDeleteTimer::cRecMenuConfirmDeleteTimer(const cEvent *event) { SetWidthPercent(50); -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 LOCK_CHANNELS_READ; const cString channelName = Channels->GetByChannelID(event->ChannelID())->Name(); #else @@ -175,7 +175,7 @@ cRecMenuConfirmDeleteTimer::cRecMenuConfirmDeleteTimer(const cEvent *event) { // --- cRecMenuAskDeleteTimer --------------------------------------------------------- cRecMenuAskDeleteTimer::cRecMenuAskDeleteTimer(const cEvent *event) { SetWidthPercent(50); -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 LOCK_CHANNELS_READ; const cString channelName = Channels->GetByChannelID(event->ChannelID())->Name(); #else @@ -243,7 +243,7 @@ cRecMenuTimerConflict::cRecMenuTimerConflict(cTVGuideTimerConflict *conflict) { SetFooter(new cRecMenuItemButton(tr("Ignore Conflict"), rmsIgnoreTimerConflict, false, true)); int i=0; for(std::vector::iterator it = conflict->timerIDs.begin(); it != conflict->timerIDs.end(); it++) { -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 LOCK_TIMERS_READ; const cTimer *timer = Timers->Get(*it); #else @@ -272,7 +272,7 @@ cRecMenuTimerConflict::cRecMenuTimerConflict(cTVGuideTimerConflict *conflict) { cRecMenuItem *cRecMenuTimerConflict::GetMenuItem(int number) { if ((number >= 0) && (number < conflict->timerIDs.size())) { -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 LOCK_TIMERS_READ; const cTimer *timer = Timers->Get(conflict->timerIDs[number]); #else @@ -378,7 +378,7 @@ cRecMenuNoRerunsFound::cRecMenuNoRerunsFound(cString searchString) { // --- cRecMenuConfirmRerunUsed --------------------------------------------------------- cRecMenuConfirmRerunUsed::cRecMenuConfirmRerunUsed(const cEvent *original, const cEvent *replace) { SetWidthPercent(70); -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 LOCK_CHANNELS_READ; const cString channelOrig = Channels->GetByChannelID(original->ChannelID())->Name(); const cString channelReplace = Channels->GetByChannelID(replace->ChannelID())->Name(); @@ -409,7 +409,7 @@ cRecMenuConfirmRerunUsed::cRecMenuConfirmRerunUsed(const cEvent *original, const } // --- cRecMenuEditTimer --------------------------------------------------------- -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 cRecMenuEditTimer::cRecMenuEditTimer(const cTimer *timer, eRecMenuState nextState) { const cTimer *originalTimer; #else @@ -471,7 +471,7 @@ cRecMenuEditTimer::cRecMenuEditTimer(cTimer *timer, eRecMenuState nextState) { Arrange(); } -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 const cTimer *cRecMenuEditTimer::GetOriginalTimer(void) { #else cTimer *cRecMenuEditTimer::GetOriginalTimer(void) { @@ -513,7 +513,7 @@ cTimer cRecMenuEditTimer::GetTimer(void) { ******************************************************************************************/ // --- cRecMenuSeriesTimer --------------------------------------------------------- -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 cRecMenuSeriesTimer::cRecMenuSeriesTimer(const cChannel *initialChannel, const cEvent *event, std::string folder) { #else cRecMenuSeriesTimer::cRecMenuSeriesTimer(cChannel *initialChannel, const cEvent *event, std::string folder) { @@ -552,7 +552,7 @@ cRecMenuSeriesTimer::cRecMenuSeriesTimer(cChannel *initialChannel, const cEvent } cTimer *cRecMenuSeriesTimer::GetTimer(void) { -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 LOCK_CHANNELS_READ; const cChannel *chan = Channels->GetByNumber(channel); #else @@ -838,7 +838,7 @@ void cRecMenuSearchTimerEdit::InitMenuItems(void) { startChannel = 1; if (stopChannel == 0) stopChannel = 1; -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 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)); @@ -1269,7 +1269,7 @@ const cEvent *cRecMenuSearchResults::GetEvent(void) { // --- cRecMenuSearchConfirmTimer --------------------------------------------------------- cRecMenuSearchConfirmTimer::cRecMenuSearchConfirmTimer(const cEvent *event, eRecMenuState nextAction) { SetWidthPercent(50); -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 LOCK_CHANNELS_READ; const cString channelName = Channels->GetByChannelID(event->ChannelID())->Name(); #else @@ -1339,7 +1339,7 @@ cRecMenuRecordingSearch::cRecMenuRecordingSearch(std::string search) { } // --- cRecMenuRecordingSearchResults --------------------------------------------------------- -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 cRecMenuRecordingSearchResults::cRecMenuRecordingSearchResults(std::string searchString, const cRecording **searchResults, int numResults) { #else cRecMenuRecordingSearchResults::cRecMenuRecordingSearchResults(std::string searchString, cRecording **searchResults, int numResults) { @@ -1427,7 +1427,7 @@ void cRecMenuTimeline::SetStartStop(void) { void cRecMenuTimeline::GetTimersForDay(void) { timersToday.clear(); -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 LOCK_TIMERS_READ; const cTimers* timers = Timers; for (const cTimer *t = Timers->First(); t; t = Timers->Next(t)) { @@ -1507,7 +1507,7 @@ void cRecMenuTimeline::ClearMenu(void) { header->UnsetCurrentTimer(); } -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 const cTimer *cRecMenuTimeline::GetTimer(void) { #else cTimer *cRecMenuTimeline::GetTimer(void) { diff --git a/recmenus.h b/recmenus.h index 7031280..d366c29 100644 --- a/recmenus.h +++ b/recmenus.h @@ -115,7 +115,7 @@ public: // --- cRecMenuEditTimer --------------------------------------------------------- class cRecMenuEditTimer: public cRecMenu { private: -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 const cTimer *originalTimer; #else cTimer *originalTimer; @@ -128,7 +128,7 @@ private: int lifetime; char folder[TEXTINPUTLENGTH]; public: -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 cRecMenuEditTimer(const cTimer *timer, eRecMenuState nextState); const cTimer *GetOriginalTimer(void); #else @@ -157,7 +157,7 @@ class cRecMenuSeriesTimer: public cRecMenu { int lifetime; void CalculateTimes(const cEvent *event); public: -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 cRecMenuSeriesTimer(const cChannel *initialChannel, const cEvent *event, std::string folder); #else cRecMenuSeriesTimer(cChannel *initialChannel, const cEvent *event, std::string folder); @@ -425,14 +425,14 @@ public: class cRecMenuRecordingSearchResults: public cRecMenu { private: std::string searchString; -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 const cRecording **searchResults; #else cRecording **searchResults; #endif int numResults; public: -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 cRecMenuRecordingSearchResults(std::string searchString, const cRecording **searchResults, int numResults); #else cRecMenuRecordingSearchResults(std::string searchString, cRecording **searchResults, int numResults); @@ -459,7 +459,7 @@ public: // --- cRecMenuTimeline --------------------------------------------------------- class cRecMenuTimeline: public cRecMenu { private: -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 std::vector timersToday; #else std::vector timersToday; @@ -484,7 +484,7 @@ public: virtual ~cRecMenuTimeline(void) { }; eRecMenuState ProcessKey(eKeys Key); -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 const cTimer *GetTimer(void); #else cTimer *GetTimer(void); diff --git a/searchtimer.c b/searchtimer.c index 1af3f86..51a94c5 100644 --- a/searchtimer.c +++ b/searchtimer.c @@ -16,7 +16,7 @@ cTVGuideSearchTimer::cTVGuideSearchTimer(void) { startTime = 0000; stopTime = 2359; useChannel = false; -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 LOCK_CHANNELS_READ; channelMin = Channels->GetByNumber(cDevice::CurrentChannel()); channelMax = Channels->GetByNumber(cDevice::CurrentChannel()); @@ -245,7 +245,7 @@ bool cTVGuideSearchTimer::Parse(bool readTemplate) { char *channelMinbuffer = NULL; char *channelMaxbuffer = NULL; int channels = sscanf(values[value].c_str(), "%a[^|]|%a[^|]", &channelMinbuffer, &channelMaxbuffer); -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 LOCK_CHANNELS_READ; channelMin = Channels->GetByChannelID(tChannelID::FromString(channelMinbuffer), true, true); #else @@ -258,7 +258,7 @@ bool cTVGuideSearchTimer::Parse(bool readTemplate) { if (channels == 1) channelMax = channelMin; else { -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 channelMax = Channels->GetByChannelID(tChannelID::FromString(channelMaxbuffer), true, true); #else channelMax = Channels.GetByChannelID(tChannelID::FromString(channelMaxbuffer), true, true); @@ -526,7 +526,7 @@ int cTVGuideSearchTimer::GetNumTimers(void) { int numTimers = 0; if (ID < 0) return numTimers; -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 LOCK_TIMERS_READ; for (const cTimer *timer = Timers->First(); timer; timer = Timers->Next(timer)) { #else @@ -545,7 +545,7 @@ int cTVGuideSearchTimer::GetNumRecordings(void) { int numRecordings = 0; if (ID < 0) return numRecordings; -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 LOCK_RECORDINGS_READ; for (const cRecording *recording = Recordings->First(); recording; recording = Recordings->Next(recording)) { #else @@ -595,7 +595,7 @@ void cTVGuideSearchTimer::Dump(void) { void cTVGuideSearchTimer::SetStartChannel(int startChannel) { -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 LOCK_CHANNELS_READ; channelMin = Channels->GetByNumber(startChannel); #else @@ -605,7 +605,7 @@ void cTVGuideSearchTimer::SetStartChannel(int startChannel) void cTVGuideSearchTimer::SetStopChannel(int stopChannel) { -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 LOCK_CHANNELS_READ; channelMax = Channels->GetByNumber(stopChannel); #else diff --git a/searchtimer.h b/searchtimer.h index f9ed924..f83e6fe 100644 --- a/searchtimer.h +++ b/searchtimer.h @@ -11,7 +11,7 @@ private: int startTime; int stopTime; int useChannel; -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 const cChannel *channelMin; const cChannel *channelMax; #else diff --git a/statusheader.c b/statusheader.c index fab48b5..eee2473 100644 --- a/statusheader.c +++ b/statusheader.c @@ -82,7 +82,7 @@ void cStatusHeader::DrawInfoText(cGrid *grid) { int lineHeight = fontManager.FontStatusHeader->Height(); int textLines = description.Lines(); int maxLines = heightText / lineHeight; - int lines = min(textLines, maxLines); + int lines = std::min(textLines, maxLines); for (int i = 0; i < lines-1; i++) { pixmapText->DrawText(cPoint(x,y), description.GetLine(i), theme.Color(clrFont), colorTextBack, fontManager.FontStatusHeader); y += lineHeight; diff --git a/switchtimer.c b/switchtimer.c index f56c469..bf21553 100644 --- a/switchtimer.c +++ b/switchtimer.c @@ -20,6 +20,17 @@ cSwitchTimer::cSwitchTimer(const cEvent* Event) { } } +#if VDRVERSNUM >= 20305 +cSwitchTimer& cSwitchTimer::operator= (const cSwitchTimer &SwitchTimer) +{ + this->eventID = SwitchTimer.eventID; + this->startTime = SwitchTimer.startTime; + this->channelID = SwitchTimer.channelID; + this->switchMinsBefore = SwitchTimer.switchMinsBefore; + return *this; +} + +#endif bool cSwitchTimer::Parse(const char *s) { char *line; char *pos; diff --git a/switchtimer.h b/switchtimer.h index 09ebe88..867a821 100644 --- a/switchtimer.h +++ b/switchtimer.h @@ -10,6 +10,10 @@ public: tChannelID channelID; int switchMinsBefore; int announceOnly; +#if VDRVERSNUM >= 20305 + cSwitchTimer(const cSwitchTimer &SwitchTimer) { *this = SwitchTimer; }; + cSwitchTimer& operator= (const cSwitchTimer &SwitchTimer); +#endif cSwitchTimer(void); cSwitchTimer(const cEvent* Event); bool Parse(const char *s); diff --git a/timerconflict.c b/timerconflict.c index 79f2ce4..1312f7f 100644 --- a/timerconflict.c +++ b/timerconflict.c @@ -86,7 +86,7 @@ void cTVGuideTimerConflicts::CalculateConflicts(void) { cTimeInterval *unionSet = NULL; int numTimers = conflicts[i]->timerIDs.size(); for (int j=0; j < numTimers; j++) { -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 LOCK_TIMERS_READ; const cTimer *timer = Timers->Get(conflicts[i]->timerIDs[j]); #else @@ -110,7 +110,7 @@ void cTVGuideTimerConflicts::CalculateConflicts(void) { cTimeInterval *intersect = NULL; for (int j=0; j < numTimers; j++) { -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 LOCK_TIMERS_READ; const cTimer *timer = Timers->Get(conflicts[i]->timerIDs[j]); #else diff --git a/tvguideosd.c b/tvguideosd.c index 8ac19af..71491a7 100644 --- a/tvguideosd.c +++ b/tvguideosd.c @@ -73,7 +73,7 @@ void cTvGuideOsd::Show(void) { void cTvGuideOsd::drawOsd() { cPixmap::Lock(); -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 LOCK_CHANNELS_READ; const cChannel *startChannel = Channels->GetByNumber(cDevice::CurrentChannel()); #else @@ -82,7 +82,7 @@ void cTvGuideOsd::drawOsd() { int numBack = tvguideConfig.numGrids / 2; int offset = 0; const cChannel *newStartChannel = startChannel; -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 for (; newStartChannel ; newStartChannel = Channels->Prev(newStartChannel)) { #else for (; newStartChannel ; newStartChannel = Channels.Prev(newStartChannel)) { @@ -94,7 +94,7 @@ void cTvGuideOsd::drawOsd() { break; } if (!newStartChannel) -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 newStartChannel = Channels->First(); #else newStartChannel = Channels.First(); @@ -135,7 +135,7 @@ void cTvGuideOsd::readChannels(const cChannel *channelStart) { columns.Clear(); if (!channelStart) return; -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 LOCK_CHANNELS_READ; for (const cChannel *channel = channelStart; channel; channel = Channels->Next(channel)) { #else @@ -162,7 +162,7 @@ void cTvGuideOsd::readChannels(const cChannel *channelStart) { int numCurrent = columns.Count(); int numBack = tvguideConfig.numGrids - numCurrent; int newChannelNumber = columns.First()->getChannel()->Number() - numBack; -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 const cChannel *newStart = Channels->GetByNumber(newChannelNumber); #else const cChannel *newStart = Channels.GetByNumber(newChannelNumber); @@ -235,7 +235,7 @@ void cTvGuideOsd::channelForward() { bool colAdded = false; if (!colRight) { const cChannel *channelRight = activeGrid->column->getChannel(); -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 LOCK_CHANNELS_READ; while (channelRight = Channels->Next(channelRight)) { #else @@ -290,7 +290,7 @@ void cTvGuideOsd::channelBack() { bool colAdded = false; if (!colLeft) { const cChannel *channelLeft = activeGrid->column->getChannel(); -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 LOCK_CHANNELS_READ; while (channelLeft = Channels->Prev(channelLeft)) { #else @@ -466,7 +466,7 @@ void cTvGuideOsd::processKeyGreen() { if (tvguideConfig.channelJumpMode == eGroupJump) { int prevNum = channelGroups->GetPrevGroupChannelNumber(currentChannel); if (prevNum) { -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 LOCK_CHANNELS_READ; prev = Channels->GetByNumber(prevNum); #else @@ -475,7 +475,7 @@ void cTvGuideOsd::processKeyGreen() { } } else if (tvguideConfig.channelJumpMode == eNumJump) { int i = tvguideConfig.jumpChannels + 1; -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 LOCK_CHANNELS_READ; for (const cChannel *channel = firstChannel; channel; channel = Channels->Prev(channel)) { #else @@ -512,7 +512,7 @@ void cTvGuideOsd::processKeyYellow() { if (tvguideConfig.channelJumpMode == eGroupJump) { int nextNum = channelGroups->GetNextGroupChannelNumber(currentChannel); if (nextNum) { -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 LOCK_CHANNELS_READ; next = Channels->GetByNumber(nextNum); #else @@ -521,7 +521,7 @@ void cTvGuideOsd::processKeyYellow() { } } else if (tvguideConfig.channelJumpMode == eNumJump) { int i=0; -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 LOCK_CHANNELS_READ; for (const cChannel *channel = firstChannel; channel; channel = Channels->Next(channel)) { #else @@ -677,7 +677,7 @@ void cTvGuideOsd::CheckTimeout(void) { int newChannelNum = channelJumper->GetChannel(); delete channelJumper; channelJumper = NULL; -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 LOCK_CHANNELS_READ; const cChannel *newChannel = Channels->GetByNumber(newChannelNum); #else diff --git a/view.c b/view.c index 27ab255..9d1b7e3 100644 --- a/view.c +++ b/view.c @@ -120,7 +120,7 @@ void cView::DrawHeader(void) { pixmapHeader->DrawText(cPoint(xText, ySubtitle), CutText(subTitle, textWidthMax, fontHeader).c_str(), theme.Color(clrFont), theme.Color(clrStatusHeader), fontHeader); //REC Icon eTimerMatch timerMatch=tmNone; -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 LOCK_TIMERS_READ; const cTimer *ti; #else @@ -135,7 +135,7 @@ void cView::DrawHeader(void) { timerMatch = (eTimerMatch)rtMatch.timerMatch; ti = rtMatch.timer; } else { -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) +#if VDRVERSNUM >= 20301 LOCK_TIMERS_READ; ti=Timers->GetMatch(event, &timerMatch); #else