mirror of
				https://projects.vdr-developer.org/git/vdr-plugin-tvguide.git
				synced 2023-10-05 13:01:48 +00:00 
			
		
		
		
	Some changes for VDR < 2.3.0
This commit is contained in:
		
							
								
								
									
										68
									
								
								recmanager.c
									
									
									
									
									
								
							
							
						
						
									
										68
									
								
								recmanager.c
									
									
									
									
									
								
							| @@ -56,26 +56,21 @@ bool cRecManager::CheckEventForTimer(const cEvent *event) { | ||||
|     return hasTimer; | ||||
| } | ||||
|  | ||||
| #if VDRVERSNUM >= 20301 | ||||
| const cTimer *cRecManager::GetTimerForEvent(const cEvent *event) { | ||||
|     const cTimer *timer = NULL; | ||||
| #else | ||||
| cTimer *cRecManager::GetTimerForEvent(const cEvent *event) { | ||||
|     cTimer *timer = NULL; | ||||
| #endif | ||||
|     if (tvguideConfig.useRemoteTimers && pRemoteTimers) { | ||||
|         RemoteTimers_GetMatch_v1_0 rtMatch; | ||||
|         rtMatch.event = event; | ||||
|         pRemoteTimers->Service("RemoteTimers::GetMatch-v1.0", &rtMatch); | ||||
|         timer = rtMatch.timer; | ||||
| #if VDRVERSNUM >= 20301 | ||||
|         return timer; | ||||
|     } | ||||
|  | ||||
| #if VDRVERSNUM >= 20301 | ||||
|     LOCK_TIMERS_READ; | ||||
|     timer = Timers->GetMatch(event); | ||||
| #else | ||||
|     } else | ||||
|         timer = Timers.GetMatch(event); | ||||
|     timer = Timers.GetMatch(event); | ||||
| #endif | ||||
|     return timer; | ||||
| } | ||||
| @@ -208,41 +203,42 @@ void cRecManager::DeleteTimer(const cEvent *event) { | ||||
|  | ||||
| void cRecManager::DeleteLocalTimer(const cEvent *event) { | ||||
|     dsyslog ("%s %s %d\n", __FILE__, __func__,  __LINE__); | ||||
|     const cTimer *t; | ||||
| #if VDRVERSNUM >= 20301 | ||||
|     cTimer *t; | ||||
|     { | ||||
|     LOCK_TIMERS_WRITE; | ||||
|     LOCK_TIMERS_READ; | ||||
|     t = Timers->GetMatch(event); | ||||
|     } | ||||
| #else | ||||
|     cTimer *t = Timers.GetMatch(event); | ||||
|     t = Timers.GetMatch(event); | ||||
| #endif | ||||
|     if (!t) | ||||
|         return; | ||||
|     DeleteTimer(t); | ||||
| } | ||||
|  | ||||
| void cRecManager::DeleteTimer(cTimer *timer) { | ||||
| void cRecManager::DeleteTimer(const cTimer *timer) { | ||||
|     dsyslog ("%s %s %d\n", __FILE__, __func__,  __LINE__); | ||||
| #if VDRVERSNUM >= 20301 | ||||
|     LOCK_TIMERS_WRITE; | ||||
|     cTimers* timers = Timers; | ||||
|     cTimer* t = timers->GetTimer(timer); | ||||
| #else | ||||
|     cTimers* timers = &Timers; | ||||
|     cTimer* t = timers->GetTimer((cTimer*)timer); | ||||
| #endif | ||||
|     if (timer->Recording()) { | ||||
|         timer->Skip(); | ||||
|  | ||||
|     if (t->Recording()) { | ||||
|         t->Skip(); | ||||
| #if VDRVERSNUM >= 20301 | ||||
|         cRecordControls::Process(Timers, time(NULL)); | ||||
|         cRecordControls::Process(timers, time(NULL)); | ||||
| #else | ||||
|         cRecordControls::Process(time(NULL)); | ||||
| #endif | ||||
|     } | ||||
|     isyslog("timer %s deleted", *timer->ToDescr()); | ||||
| #if VDRVERSNUM >= 20301 | ||||
|     Timers->Del(timer, true); | ||||
|     Timers->SetModified(); | ||||
| #else | ||||
|     Timers.Del(timer, true); | ||||
|     Timers.SetModified(); | ||||
| #endif | ||||
|         } | ||||
|     isyslog("timer %s deleted", *t->ToDescr()); | ||||
|     timers->Del(t, true); | ||||
|     timers->SetModified(); | ||||
| } | ||||
|  | ||||
| void cRecManager::DeleteRemoteTimer(const cEvent *event) { | ||||
| @@ -259,19 +255,17 @@ void cRecManager::DeleteRemoteTimer(const cEvent *event) { | ||||
|     } | ||||
| } | ||||
|  | ||||
| #if VDRVERSNUM >= 20301 | ||||
| void cRecManager::SaveTimer(const cTimer *t, cTimer newTimerSettings) { | ||||
|     if (!t) | ||||
| #else | ||||
| void cRecManager::SaveTimer(cTimer *timer, cTimer newTimerSettings) { | ||||
|     if (!timer) | ||||
| #endif | ||||
|         return; | ||||
|  | ||||
| #if VDRVERSNUM >= 20301 | ||||
|     LOCK_TIMERS_WRITE; | ||||
|     cTimer *timer = Timers->GetTimer(t); | ||||
| #else | ||||
|     cTimer *timer = Timers.GetTimer((cTimer*)t); | ||||
| #endif | ||||
|  | ||||
|     bool active = newTimerSettings.HasFlags(tfActive); | ||||
|     int prio = newTimerSettings.Priority(); | ||||
|     int lifetime = newTimerSettings.Lifetime(); | ||||
| @@ -622,24 +616,20 @@ void cRecManager::DeleteSwitchTimer(const cEvent *event) { | ||||
|     } | ||||
| } | ||||
|  | ||||
| #if VDRVERSNUM >= 20301 | ||||
| const cRecording **cRecManager::SearchForRecordings(std::string searchString, int &numResults) { | ||||
|  | ||||
|     const cRecording **matchingRecordings = NULL; | ||||
| #else | ||||
| cRecording **cRecManager::SearchForRecordings(std::string searchString, int &numResults) { | ||||
|  | ||||
|     cRecording **matchingRecordings = NULL; | ||||
| #endif | ||||
|     int num = 0; | ||||
|     numResults = 0; | ||||
|  | ||||
| #if VDRVERSNUM >= 20301 | ||||
|     LOCK_RECORDINGS_READ; | ||||
|     for (const cRecording *recording = Recordings->First(); recording; recording = Recordings->Next(recording)) { | ||||
|     const cRecordings* recordings = Recordings; | ||||
| #else | ||||
|     for (cRecording *recording = Recordings.First(); recording; recording = Recordings.Next(recording)) { | ||||
|     const cRecordings* recordings = &Recordings; | ||||
| #endif | ||||
|  | ||||
|     for (const cRecording *recording = recordings->First(); recording; recording = recordings->Next(recording)) { | ||||
|         std::string s1 = recording->Name(); | ||||
|         std::string s2 = searchString; | ||||
|         if (s1.empty() || s2.empty()) continue; | ||||
| @@ -670,11 +660,7 @@ cRecording **cRecManager::SearchForRecordings(std::string searchString, int &num | ||||
|         } | ||||
|  | ||||
|         if (match) { | ||||
| #if VDRVERSNUM >= 20301 | ||||
|             matchingRecordings = (const cRecording **)realloc(matchingRecordings, (num + 1) * sizeof(cRecording *)); | ||||
| #else | ||||
|             matchingRecordings = (cRecording **)realloc(matchingRecordings, (num + 1) * sizeof(cRecording *)); | ||||
| #endif | ||||
|             matchingRecordings[num++] = recording; | ||||
|         } | ||||
|     } | ||||
|   | ||||
							
								
								
									
										14
									
								
								recmanager.h
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								recmanager.h
									
									
									
									
									
								
							| @@ -28,25 +28,17 @@ public: | ||||
|     bool EpgSearchAvailable(void) {return epgSearchAvailable;}; | ||||
|     bool RefreshRemoteTimers(void); | ||||
|     bool CheckEventForTimer(const cEvent *event); | ||||
| #if VDRVERSNUM >= 20301 | ||||
|     const cTimer *GetTimerForEvent(const cEvent *event); | ||||
| #else | ||||
|     cTimer *GetTimerForEvent(const cEvent *event); | ||||
| #endif | ||||
|     cTimer *createTimer(const cEvent *event, std::string path = ""); | ||||
|     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); | ||||
|     void DeleteTimer(cTimer *timer); | ||||
|     void DeleteTimer(const cTimer *timer); | ||||
|     void DeleteTimer(int timerID); | ||||
|     void DeleteTimer(const cEvent *event); | ||||
|     void DeleteLocalTimer(const cEvent *event); | ||||
|     void DeleteRemoteTimer(const cEvent *event); | ||||
| #if VDRVERSNUM >= 20301 | ||||
|     void SaveTimer(const cTimer *timer, cTimer newTimerSettings); | ||||
| #else | ||||
|     void SaveTimer(cTimer *timer, cTimer newTimerSettings); | ||||
| #endif | ||||
|     bool IsRecorded(const cEvent *event); | ||||
|     cTVGuideTimerConflicts *CheckTimerConflict(void); | ||||
|     void CreateSeriesTimer(cTimer *seriesTimer); | ||||
| @@ -60,11 +52,7 @@ public: | ||||
|     void UpdateSearchTimers(void); | ||||
|     bool CreateSwitchTimer(const cEvent *event, cSwitchTimer switchTimer); | ||||
|     void DeleteSwitchTimer(const cEvent *event); | ||||
| #if VDRVERSNUM >= 20301 | ||||
|     const cRecording **SearchForRecordings(std::string searchString, int &numResults); | ||||
| #else | ||||
|     cRecording **SearchForRecordings(std::string searchString, int &numResults); | ||||
| #endif | ||||
|     const cEvent **LoadReruns(const cEvent *event, int &numResults); | ||||
|     void GetFavorites(std::vector<cTVGuideSearchTimer> *favorites); | ||||
|     const cEvent **WhatsOnNow(bool nowOrNext, int &numResults); | ||||
|   | ||||
| @@ -2259,11 +2259,7 @@ eRecMenuState cRecMenuItemDayChooser::ProcessKey(eKeys Key) { | ||||
| } | ||||
|  | ||||
| // --- cRecMenuItemRecording  ------------------------------------------------------- | ||||
| #if VDRVERSNUM >= 20301 | ||||
| cRecMenuItemRecording::cRecMenuItemRecording(const cRecording *recording, bool active) { | ||||
| #else | ||||
| cRecMenuItemRecording::cRecMenuItemRecording(cRecording *recording, bool active) { | ||||
| #endif | ||||
|     selectable = true; | ||||
|     this->recording = recording; | ||||
|     this->active = active; | ||||
| @@ -2511,11 +2507,7 @@ void cRecMenuItemTimelineHeader::Show(void) { | ||||
|  | ||||
|  | ||||
| // --- cRecMenuItemTimelineTimer  ------------------------------------------------------- | ||||
| #if VDRVERSNUM >= 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) { | ||||
| #endif | ||||
|     conflicts = conflictsToday; | ||||
|     defaultBackground = false; | ||||
|     pixmapBack = NULL; | ||||
| @@ -2662,11 +2654,7 @@ void cRecMenuItemTimelineTimer::Show(void) { | ||||
|     if (pixmapTimerConflicts) pixmapTimerConflicts->SetLayer(6); | ||||
| } | ||||
|  | ||||
| #if VDRVERSNUM >= 20301 | ||||
| const cTimer *cRecMenuItemTimelineTimer::GetTimerValue(void) { | ||||
| #else | ||||
| cTimer *cRecMenuItemTimelineTimer::GetTimerValue(void) { | ||||
| #endif | ||||
|     return timer;     | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -123,11 +123,7 @@ public: | ||||
|     virtual bool GetBoolValue(void) { return false; }; | ||||
|     virtual cString GetStringValue(void) { return cString(""); }; | ||||
|     virtual const cEvent *GetEventValue(void) { return NULL; }; | ||||
| #if VDRVERSNUM >= 20301 | ||||
|     virtual const cTimer *GetTimerValue(void) { return NULL; }; | ||||
| #else | ||||
|     virtual cTimer *GetTimerValue(void) { return NULL; }; | ||||
| #endif | ||||
|     virtual eRecMenuState ProcessKey(eKeys Key) { return rmsNotConsumed; }; | ||||
| }; | ||||
|  | ||||
| @@ -560,18 +556,10 @@ public: | ||||
| // --- cRecMenuItemRecording  ------------------------------------------------------- | ||||
| class cRecMenuItemRecording : public cRecMenuItem { | ||||
| private: | ||||
| #if VDRVERSNUM >= 20301 | ||||
|     const cRecording *recording; | ||||
| #else | ||||
|     cRecording *recording; | ||||
| #endif | ||||
|     cPixmap *pixmapText; | ||||
| public: | ||||
| #if VDRVERSNUM >= 20301 | ||||
|     cRecMenuItemRecording(const cRecording *recording, bool active); | ||||
| #else | ||||
|     cRecMenuItemRecording(cRecording *recording, bool active); | ||||
| #endif | ||||
|     virtual ~cRecMenuItemRecording(void); | ||||
|     void SetPixmaps(void); | ||||
|     void Hide(void); | ||||
| @@ -583,11 +571,7 @@ public: | ||||
| class cRecMenuItemTimelineHeader : public cRecMenuItem { | ||||
| private: | ||||
|     time_t day; | ||||
| #if VDRVERSNUM >= 20301 | ||||
|     const cTimer *timer; | ||||
| #else | ||||
|     cTimer *timer; | ||||
| #endif | ||||
|     std::vector<cTVGuideTimerConflict*> conflicts; | ||||
|     cPixmap *pixmapTimeline; | ||||
|     cPixmap *pixmapTimerInfo; | ||||
| @@ -603,11 +587,7 @@ public: | ||||
|     virtual ~cRecMenuItemTimelineHeader(void); | ||||
|     void SetDay(time_t day) { this->day = day; }; | ||||
|     void SetPixmaps(void); | ||||
| #if VDRVERSNUM >= 20301 | ||||
|     void SetCurrentTimer(const cTimer *timer) { this->timer = timer; }; | ||||
| #else | ||||
|     void SetCurrentTimer(cTimer *timer) { this->timer = timer; }; | ||||
| #endif | ||||
|     void UnsetCurrentTimer(void) { timer = NULL; }; | ||||
|     void RefreshTimerDisplay(void); | ||||
|     void Hide(void); | ||||
| @@ -618,11 +598,7 @@ public: | ||||
| // --- cRecMenuItemTimelineTimer  ------------------------------------------------------- | ||||
| class cRecMenuItemTimelineTimer : public cRecMenuItem { | ||||
| private: | ||||
| #if VDRVERSNUM >= 20301 | ||||
|     const cTimer *timer; | ||||
| #else | ||||
|     cTimer *timer; | ||||
| #endif | ||||
|     std::vector<cTVGuideTimerConflict*> conflicts; | ||||
|     cPixmap *pixmapBack; | ||||
|     cPixmap *pixmapTimerConflicts; | ||||
| @@ -637,11 +613,7 @@ private: | ||||
|     void DrawTimerConflicts(void); | ||||
|     void DrawNoTimerInfo(void); | ||||
| public: | ||||
| #if VDRVERSNUM >= 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); | ||||
| #endif | ||||
|     virtual ~cRecMenuItemTimelineTimer(void); | ||||
|     void setActive(void); | ||||
|     void setInactive(void); | ||||
| @@ -649,11 +621,7 @@ public: | ||||
|     void Hide(void); | ||||
|     void Show(void);  | ||||
|     void Draw(void); | ||||
| #if VDRVERSNUM >= 20301 | ||||
|     const cTimer *GetTimerValue(void); | ||||
| #else | ||||
|     cTimer *GetTimerValue(void); | ||||
| #endif | ||||
|     eRecMenuState ProcessKey(eKeys Key); | ||||
| }; | ||||
|  | ||||
| @@ -721,4 +689,4 @@ public: | ||||
|     eRecMenuState ProcessKey(eKeys Key); | ||||
| }; | ||||
|  | ||||
| #endif //__TVGUIDE_RECMENUITEM_H | ||||
| #endif //__TVGUIDE_RECMENUITEM_H | ||||
|   | ||||
| @@ -166,7 +166,7 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) { | ||||
|             LOCK_TIMERS_READ; | ||||
|             const cTimer *timer = Timers->Get(timerID); | ||||
| #else | ||||
|             cTimer *timer = Timers.Get(timerID); | ||||
|             const cTimer *timer = Timers.Get(timerID); | ||||
| #endif | ||||
|             if (timer) { | ||||
|                 delete activeMenu; | ||||
| @@ -178,11 +178,7 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) { | ||||
|             //caller: cRecMenuEditTimer | ||||
|             //save timer from current timer conflict | ||||
|             cTimer timerModified; | ||||
| #if VDRVERSNUM >= 20301 | ||||
|             const cTimer *originalTimer; | ||||
| #else | ||||
|             cTimer *originalTimer; | ||||
| #endif | ||||
|             if (cRecMenuEditTimer *menu = dynamic_cast<cRecMenuEditTimer*>(activeMenu)) { | ||||
|                 timerModified = menu->GetTimer(); | ||||
|                 originalTimer = menu->GetOriginalTimer(); | ||||
| @@ -216,14 +212,14 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) { | ||||
|             break; | ||||
|         case rmsEditTimer: { | ||||
|             //edit timer for active event | ||||
| #if VDRVERSNUM >= 20301 | ||||
|             const cTimer *timer; | ||||
| #if VDRVERSNUM >= 20301 | ||||
|             { | ||||
|             LOCK_TIMERS_READ; | ||||
|             timer = recManager->GetTimerForEvent(event); | ||||
|             } | ||||
| #else | ||||
|             cTimer *timer = recManager->GetTimerForEvent(event); | ||||
|             timer = recManager->GetTimerForEvent(event); | ||||
| #endif | ||||
|             if (timer) { | ||||
|                 delete activeMenu; | ||||
| @@ -235,11 +231,7 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) { | ||||
|             //caller: cRecMenuEditTimer | ||||
|             //save timer for active event | ||||
|             cTimer timerModified; | ||||
| #if VDRVERSNUM >= 20301 | ||||
|             const cTimer *originalTimer; | ||||
| #else | ||||
|             cTimer *originalTimer; | ||||
| #endif | ||||
|             if (cRecMenuEditTimer *menu = dynamic_cast<cRecMenuEditTimer*>(activeMenu)) { | ||||
|                 timerModified = menu->GetTimer(); | ||||
|                 originalTimer = menu->GetOriginalTimer(); | ||||
| @@ -505,11 +497,7 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) { | ||||
|                 activeMenu = new cRecMenuRecordingSearch(searchString); | ||||
|             } else { | ||||
|                 int numSearchResults = 0; | ||||
| #if VDRVERSNUM >= 20301 | ||||
|                 const cRecording **searchResult = recManager->SearchForRecordings(searchString, numSearchResults); | ||||
| #else | ||||
|                 cRecording **searchResult = recManager->SearchForRecordings(searchString, numSearchResults); | ||||
| #endif | ||||
|                 if (numSearchResults == 0) { | ||||
|                     activeMenu = new cRecMenuRecordingSearchNotFound(searchString); | ||||
|                 } else { | ||||
| @@ -721,11 +709,7 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) { | ||||
|             activeMenu->Display(); | ||||
|             break; } | ||||
|         case rmsTimelineTimerEdit: { | ||||
| #if VDRVERSNUM >= 20301 | ||||
|             const cTimer *timer; | ||||
| #else | ||||
|             cTimer *timer; | ||||
| #endif | ||||
|             if (cRecMenuTimeline *menu = dynamic_cast<cRecMenuTimeline*>(activeMenu)) { | ||||
|                 timer = menu->GetTimer(); | ||||
|             } else break; | ||||
| @@ -737,11 +721,7 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) { | ||||
|             break;} | ||||
|         case rmsTimelineTimerSave: { | ||||
|             cTimer timerModified; | ||||
| #if VDRVERSNUM >= 20301 | ||||
|             const cTimer *originalTimer; | ||||
| #else | ||||
|             cTimer *originalTimer; | ||||
| #endif | ||||
|             if (cRecMenuEditTimer *menu = dynamic_cast<cRecMenuEditTimer*>(activeMenu)) { | ||||
|                 timerModified = menu->GetTimer(); | ||||
|                 originalTimer = menu->GetOriginalTimer(); | ||||
| @@ -756,11 +736,7 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) { | ||||
|             activeMenu->Display(); | ||||
|             break; } | ||||
|         case rmsTimelineTimerDelete: { | ||||
| #if VDRVERSNUM >= 20301 | ||||
|             const cTimer *timer; | ||||
| #else | ||||
|             cTimer *timer; | ||||
| #endif | ||||
|             if (cRecMenuEditTimer *menu = dynamic_cast<cRecMenuEditTimer*>(activeMenu)) { | ||||
|                 timer = menu->GetOriginalTimer(); | ||||
|             } else break; | ||||
| @@ -770,7 +746,7 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) { | ||||
|             recManager->DeleteTimer(Timers->GetTimer(timer)); | ||||
|             } | ||||
| #else | ||||
|             recManager->DeleteTimer(Timers.GetTimer(timer)); | ||||
|             recManager->DeleteTimer(Timers.GetTimer((cTimer*)timer)); | ||||
| #endif | ||||
|             delete activeMenu; | ||||
|             if (timerConflicts) { | ||||
| @@ -884,15 +860,13 @@ void cRecMenuManager::DisplaySearchTimerList(void) { | ||||
|     activeMenu->Display(); | ||||
| } | ||||
|  | ||||
| #if VDRVERSNUM >= 20301 | ||||
| bool cRecMenuManager::DisplayTimerConflict(const cTimer *timer) { | ||||
|     int timerID = 0; | ||||
| #if VDRVERSNUM >= 20301 | ||||
|     LOCK_TIMERS_READ; | ||||
|     for (const cTimer *t = Timers->First(); t; t = Timers->Next(t)) { | ||||
| #else | ||||
| bool cRecMenuManager::DisplayTimerConflict(cTimer *timer) { | ||||
|     int timerID = 0; | ||||
|     for (cTimer *t = Timers.First(); t; t = Timers.Next(t)) { | ||||
|     for (const cTimer *t = Timers.First(); t; t = Timers.Next(t)) { | ||||
| #endif | ||||
|         if (t == timer) | ||||
|             return DisplayTimerConflict(timerID); | ||||
|   | ||||
| @@ -15,6 +15,7 @@ private: | ||||
|     cRecMenu *activeMenuBuffer; | ||||
|     cRecMenu *activeMenuBuffer2; | ||||
|     const cEvent *event; | ||||
|     const cEvent *displayEvent; | ||||
|     cRecManager *recManager; | ||||
|     cTVGuideTimerConflicts *timerConflicts; | ||||
|     cDetailView *detailView; | ||||
| @@ -23,14 +24,11 @@ private: | ||||
|     void SetBackground(void); | ||||
|     void DeleteBackground(void); | ||||
|     void DisplaySearchTimerList(void); | ||||
| #if VDRVERSNUM >= 20301 | ||||
|     bool DisplayTimerConflict(const cTimer *timer); | ||||
| #else | ||||
|     bool DisplayTimerConflict(cTimer *timer); | ||||
| #endif | ||||
|     bool DisplayTimerConflict(int timerID); | ||||
|     void DisplayDetailedView(const cEvent *ev); | ||||
|     void DisplayFavoriteResults(std::string header, const cEvent **result, int numResults); | ||||
|     eOSState StateMachine(eRecMenuState nextState); | ||||
| public: | ||||
|     cRecMenuManager(void); | ||||
|     virtual ~cRecMenuManager(void); | ||||
| @@ -39,8 +37,7 @@ public: | ||||
|     void Start(const cEvent *event); | ||||
|     void StartFavorites(void); | ||||
|     void Close(void); | ||||
|     eOSState StateMachine(eRecMenuState nextState); | ||||
|     eOSState ProcessKey(eKeys Key); | ||||
| }; | ||||
|  | ||||
| #endif //__TVGUIDE_RECMENUMANAGER_H | ||||
| #endif //__TVGUIDE_RECMENUMANAGER_H | ||||
|   | ||||
							
								
								
									
										43
									
								
								recmenus.c
									
									
									
									
									
								
							
							
						
						
									
										43
									
								
								recmenus.c
									
									
									
									
									
								
							| @@ -111,7 +111,7 @@ cRecMenuConfirmTimer::cRecMenuConfirmTimer(const cEvent *event) { | ||||
|     LOCK_CHANNELS_READ; | ||||
|     const cString channelName = Channels->GetByChannelID(event->ChannelID())->Name(); | ||||
| #else | ||||
|     cString channelName = Channels.GetByChannelID(event->ChannelID())->Name(); | ||||
|     const cString channelName = Channels.GetByChannelID(event->ChannelID())->Name(); | ||||
| #endif | ||||
|     cString message; | ||||
|     bool eventHasTimer = false; | ||||
| @@ -155,7 +155,7 @@ cRecMenuConfirmDeleteTimer::cRecMenuConfirmDeleteTimer(const cEvent *event) { | ||||
|     LOCK_CHANNELS_READ; | ||||
|     const cString channelName = Channels->GetByChannelID(event->ChannelID())->Name(); | ||||
| #else | ||||
|     cString channelName = Channels.GetByChannelID(event->ChannelID())->Name(); | ||||
|     const cString channelName = Channels.GetByChannelID(event->ChannelID())->Name(); | ||||
| #endif | ||||
|     cString text = cString::sprintf("%s\n%s\n%s %s - %s\n%s",  | ||||
|                                     tr("Timer deleted"),  | ||||
| @@ -183,7 +183,7 @@ cRecMenuAskDeleteTimer::cRecMenuAskDeleteTimer(const cEvent *event) { | ||||
|     LOCK_CHANNELS_READ; | ||||
|     const cString channelName = Channels->GetByChannelID(event->ChannelID())->Name(); | ||||
| #else | ||||
|     cString channelName = Channels.GetByChannelID(event->ChannelID())->Name(); | ||||
|     const cString channelName = Channels.GetByChannelID(event->ChannelID())->Name(); | ||||
| #endif | ||||
|     cString text = cString::sprintf("%s \"%s, %s\" %s",  | ||||
|                                     tr("Timer"), | ||||
| @@ -387,8 +387,8 @@ cRecMenuConfirmRerunUsed::cRecMenuConfirmRerunUsed(const cEvent *original, const | ||||
|     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 channelReplace = Channels.GetByChannelID(replace->ChannelID())->Name(); | ||||
|     const cString channelOrig = Channels.GetByChannelID(original->ChannelID())->Name(); | ||||
|     const cString channelReplace = Channels.GetByChannelID(replace->ChannelID())->Name(); | ||||
| #endif | ||||
|     cString message1 = tr("Timer for"); | ||||
|     cString message2 = tr("replaced by rerun"); | ||||
| @@ -413,12 +413,7 @@ cRecMenuConfirmRerunUsed::cRecMenuConfirmRerunUsed(const cEvent *original, const | ||||
| } | ||||
|  | ||||
| // --- cRecMenuEditTimer  --------------------------------------------------------- | ||||
| #if VDRVERSNUM >= 20301 | ||||
| cRecMenuEditTimer::cRecMenuEditTimer(const cTimer *timer, eRecMenuState nextState) { | ||||
| //    const cTimer *originalTimer; | ||||
| #else | ||||
| cRecMenuEditTimer::cRecMenuEditTimer(cTimer *timer, eRecMenuState nextState) { | ||||
| #endif | ||||
|     SetWidthPercent(70); | ||||
|     if (!timer) | ||||
|         return; | ||||
| @@ -475,11 +470,7 @@ cRecMenuEditTimer::cRecMenuEditTimer(cTimer *timer, eRecMenuState nextState) { | ||||
|     Arrange(); | ||||
| } | ||||
|  | ||||
| #if VDRVERSNUM >= 20301 | ||||
| const cTimer *cRecMenuEditTimer::GetOriginalTimer(void) { | ||||
| #else | ||||
| cTimer *cRecMenuEditTimer::GetOriginalTimer(void) { | ||||
| #endif | ||||
|     return originalTimer; | ||||
| } | ||||
|  | ||||
| @@ -517,11 +508,7 @@ cTimer cRecMenuEditTimer::GetTimer(void) { | ||||
| ******************************************************************************************/ | ||||
|  | ||||
| // --- cRecMenuSeriesTimer --------------------------------------------------------- | ||||
| #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) { | ||||
| #endif | ||||
|     if (!initialChannel) | ||||
|         return; | ||||
|     timerActive = true; | ||||
| @@ -540,7 +527,11 @@ cRecMenuSeriesTimer::cRecMenuSeriesTimer(cChannel *initialChannel, const cEvent | ||||
|     SetHeader(infoItem); | ||||
|  | ||||
|     AddMenuItem(new cRecMenuItemBool(tr("Timer Active"), timerActive, false, false, &timerActive)); | ||||
| #if VDRVERSNUM >= 20301 | ||||
|     AddMenuItem(new cRecMenuItemChannelChooser(tr("Channel"), initialChannel, false, &channel)); | ||||
| #else | ||||
|     AddMenuItem(new cRecMenuItemChannelChooser(tr("Channel"), (cChannel*)initialChannel, false, &channel)); | ||||
| #endif | ||||
|     AddMenuItem(new cRecMenuItemTime(tr("Series Timer start time"), start, false, &start)); | ||||
|     AddMenuItem(new cRecMenuItemTime(tr("Series Timer stop time"), stop, false, &stop)); | ||||
|     AddMenuItem(new cRecMenuItemDayChooser(tr("Days to record"), dayOfWeek, false, &dayOfWeek)); | ||||
| @@ -1277,7 +1268,7 @@ cRecMenuSearchConfirmTimer::cRecMenuSearchConfirmTimer(const cEvent *event, eRec | ||||
|     LOCK_CHANNELS_READ; | ||||
|     const cString channelName = Channels->GetByChannelID(event->ChannelID())->Name(); | ||||
| #else | ||||
|     cString channelName = Channels.GetByChannelID(event->ChannelID())->Name(); | ||||
|     const cString channelName = Channels.GetByChannelID(event->ChannelID())->Name(); | ||||
| #endif | ||||
|     cString message = tr("Timer created"); | ||||
|     cString text = cString::sprintf("%s\n%s\n%s %s - %s\n%s",  | ||||
| @@ -1343,11 +1334,7 @@ cRecMenuRecordingSearch::cRecMenuRecordingSearch(std::string search) { | ||||
| } | ||||
|  | ||||
| // --- cRecMenuRecordingSearchResults  --------------------------------------------------------- | ||||
| #if VDRVERSNUM >= 20301 | ||||
| cRecMenuRecordingSearchResults::cRecMenuRecordingSearchResults(std::string searchString, const cRecording **searchResults, int numResults) { | ||||
| #else | ||||
| cRecMenuRecordingSearchResults::cRecMenuRecordingSearchResults(std::string searchString, cRecording **searchResults, int numResults) { | ||||
| #endif | ||||
|     this->searchString = searchString; | ||||
|     this->searchResults = searchResults; | ||||
|     SetWidthPercent(80); | ||||
| @@ -1364,8 +1351,8 @@ cRecMenuRecordingSearchResults::cRecMenuRecordingSearchResults(std::string searc | ||||
|     cRecMenuItem *buttons = new cRecMenuItemButtonYesNo(tr("Adapt Search"), tr("Close"), rmsRecordingSearch, rmsClose, false); | ||||
|     SetFooter(buttons); | ||||
|     if (searchResults && (numResults > 0)) { | ||||
|         for (int i=0; i<numResults; i++) { | ||||
|             if (!AddMenuItemInitial(new cRecMenuItemRecording(searchResults[i], (i==0)?true:false))) | ||||
|         for (int i = 0; i < numResults; i++) { | ||||
|             if (!AddMenuItemInitial(new cRecMenuItemRecording(searchResults[i], (i == 0) ? true : false))) | ||||
|                 break; | ||||
|         } | ||||
|     } | ||||
| @@ -1436,7 +1423,7 @@ void cRecMenuTimeline::GetTimersForDay(void) { | ||||
| //    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 (const cTimer *t = Timers.First(); t; t = Timers.Next(t)) { | ||||
| #endif | ||||
|         if (((t->StartTime() > timeStart) && (t->StartTime() <= timeStop)) || ((t->StopTime() > timeStart) && (t->StopTime() <= timeStop))) { | ||||
|             timersToday.push_back(t); | ||||
| @@ -1511,11 +1498,7 @@ void cRecMenuTimeline::ClearMenu(void) { | ||||
|     header->UnsetCurrentTimer(); | ||||
| } | ||||
|  | ||||
| #if VDRVERSNUM >= 20301 | ||||
| const cTimer *cRecMenuTimeline::GetTimer(void) { | ||||
| #else | ||||
| cTimer *cRecMenuTimeline::GetTimer(void) { | ||||
| #endif | ||||
|     if (cRecMenuItemTimelineTimer *activeItem = dynamic_cast<cRecMenuItemTimelineTimer*>(GetActiveMenuItem())) | ||||
|         return activeItem->GetTimerValue(); | ||||
|     return NULL; | ||||
|   | ||||
							
								
								
									
										34
									
								
								recmenus.h
									
									
									
									
									
								
							
							
						
						
									
										34
									
								
								recmenus.h
									
									
									
									
									
								
							| @@ -115,11 +115,7 @@ public: | ||||
| // --- cRecMenuEditTimer  --------------------------------------------------------- | ||||
| class cRecMenuEditTimer: public cRecMenu { | ||||
| private: | ||||
| #if VDRVERSNUM >= 20301 | ||||
|     const cTimer *originalTimer; | ||||
| #else | ||||
|     cTimer *originalTimer; | ||||
| #endif | ||||
|     bool timerActive; | ||||
|     time_t day; | ||||
|     int start; | ||||
| @@ -128,13 +124,8 @@ private: | ||||
|     int lifetime; | ||||
|     char folder[TEXTINPUTLENGTH]; | ||||
| public: | ||||
| #if VDRVERSNUM >= 20301 | ||||
|     cRecMenuEditTimer(const cTimer *timer, eRecMenuState nextState); | ||||
|     const cTimer *GetOriginalTimer(void); | ||||
| #else | ||||
|     cRecMenuEditTimer(cTimer *timer, eRecMenuState nextState); | ||||
|     cTimer *GetOriginalTimer(void); | ||||
| #endif | ||||
|     virtual ~cRecMenuEditTimer(void) {}; | ||||
|     cTimer GetTimer(void); | ||||
| }; | ||||
| @@ -157,11 +148,7 @@ class cRecMenuSeriesTimer: public cRecMenu { | ||||
|     int lifetime; | ||||
|     void CalculateTimes(const cEvent *event); | ||||
| public: | ||||
| #if VDRVERSNUM >= 20301 | ||||
|     cRecMenuSeriesTimer(const cChannel *initialChannel, const cEvent *event, std::string folder); | ||||
| #else | ||||
|     cRecMenuSeriesTimer(cChannel *initialChannel, const cEvent *event, std::string folder); | ||||
| #endif | ||||
|     virtual ~cRecMenuSeriesTimer(void) {}; | ||||
|     cTimer *GetTimer(void); | ||||
| }; | ||||
| @@ -425,18 +412,10 @@ public: | ||||
| class cRecMenuRecordingSearchResults: public cRecMenu { | ||||
| private: | ||||
|     std::string searchString; | ||||
| #if VDRVERSNUM >= 20301 | ||||
|     const cRecording **searchResults; | ||||
| #else | ||||
|     cRecording **searchResults; | ||||
| #endif | ||||
|     int numResults; | ||||
| public: | ||||
| #if VDRVERSNUM >= 20301 | ||||
|     cRecMenuRecordingSearchResults(std::string searchString, const cRecording **searchResults, int numResults); | ||||
| #else | ||||
|     cRecMenuRecordingSearchResults(std::string searchString, cRecording **searchResults, int numResults); | ||||
| #endif | ||||
|     cRecMenuItem *GetMenuItem(int number); | ||||
|     int GetTotalNumMenuItems(void); | ||||
|     virtual ~cRecMenuRecordingSearchResults(void) { | ||||
| @@ -459,11 +438,7 @@ public: | ||||
| // --- cRecMenuTimeline  --------------------------------------------------------- | ||||
| class cRecMenuTimeline: public cRecMenu { | ||||
| private: | ||||
| #if VDRVERSNUM >= 20301 | ||||
|     std::vector<const cTimer*> timersToday; | ||||
| #else | ||||
|     std::vector<cTimer*> timersToday; | ||||
| #endif | ||||
|     int numTimersToday; | ||||
|     time_t today; | ||||
|     time_t timeStart; | ||||
| @@ -479,16 +454,11 @@ private: | ||||
|     void ClearMenu(void); | ||||
| public: | ||||
|     cRecMenuTimeline(cTVGuideTimerConflicts *timerConflicts); | ||||
|     virtual ~cRecMenuTimeline(void) {}; | ||||
|     cRecMenuItem *GetMenuItem(int number); | ||||
|     int GetTotalNumMenuItems(void); | ||||
|     virtual ~cRecMenuTimeline(void) { | ||||
|     }; | ||||
|     eRecMenuState ProcessKey(eKeys Key); | ||||
| #if VDRVERSNUM >= 20301 | ||||
|     const cTimer *GetTimer(void); | ||||
| #else | ||||
|     cTimer *GetTimer(void); | ||||
| #endif | ||||
| }; | ||||
|  | ||||
| /****************************************************************************************** | ||||
| @@ -511,4 +481,4 @@ public: | ||||
|     virtual ~cRecMenuFavorites(void); | ||||
| }; | ||||
|  | ||||
| #endif //__TVGUIDE_RECMENUS_H | ||||
| #endif //__TVGUIDE_RECMENUS_H | ||||
|   | ||||
		Reference in New Issue
	
	Block a user