mirror of
				https://github.com/vdr-projects/vdr.git
				synced 2025-03-01 10:50:46 +00:00 
			
		
		
		
	The new functions cTimer::Start/StopTimeEvent() are now used in the LCARS skin to display the start/stop times of timers in the main menu
This commit is contained in:
		
							
								
								
									
										4
									
								
								HISTORY
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								HISTORY
									
									
									
									
									
								
							| @@ -9641,7 +9641,7 @@ Video Disk Recorder Revision History | ||||
| - No longer switching devices for pattern timers (thanks to Helmut Binder). | ||||
| - cTimer::TriggerRespawn() now only acts on local timers. | ||||
|  | ||||
| 2021-04-17: | ||||
| 2021-04-18: | ||||
|  | ||||
| - When spawning pattern timers, the new function cTimers::GetTimerForEvent() is now used | ||||
|   to check whether a matching event already has a local spawned timer. Reason: creating a timer | ||||
| @@ -9658,3 +9658,5 @@ Video Disk Recorder Revision History | ||||
|   the full margins. | ||||
| - Fixed the timer indicator in the Schedule menu in case an event is already over, but the | ||||
|   timer is still recording. | ||||
| - The new functions cTimer::Start/StopTimeEvent() are now used in the LCARS skin to display | ||||
|   the start/stop times of timers in the main menu. | ||||
|   | ||||
							
								
								
									
										13
									
								
								skinlcars.c
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								skinlcars.c
									
									
									
									
									
								
							| @@ -4,7 +4,7 @@ | ||||
|  * See the main source file 'vdr.c' for copyright information and | ||||
|  * how to reach the author. | ||||
|  * | ||||
|  * $Id: skinlcars.c 5.1 2020/12/26 15:49:01 kls Exp $ | ||||
|  * $Id: skinlcars.c 5.2 2021/04/18 14:56:40 kls Exp $ | ||||
|  */ | ||||
|  | ||||
| // "Star Trek: The Next Generation"(R) is a registered trademark of Paramount Pictures, | ||||
| @@ -1213,14 +1213,15 @@ void cSkinLCARSDisplayMenu::DrawTimer(const cTimer *Timer, int y, bool MultiRec) | ||||
|   osd->DrawRectangle(xs00, y, xs03 - 1, y + lineHeight - 1, ColorBg); | ||||
|   cString Date; | ||||
|   if (Timer->Recording()) | ||||
|      Date = cString::sprintf("-%s", *TimeString(Timer->StopTime())); | ||||
|      Date = cString::sprintf("-%s", *TimeString(Timer->StopTimeEvent())); | ||||
|   else { | ||||
|      time_t Now = time(NULL); | ||||
|      time_t StartTime = Timer->StartTimeEvent(); | ||||
|      cString Today = WeekDayName(Now); | ||||
|      cString Time = TimeString(Timer->StartTime()); | ||||
|      cString Day = WeekDayName(Timer->StartTime()); | ||||
|      if (Timer->StartTime() > Now + 6 * SECSINDAY) | ||||
|         Date = DayDateTime(Timer->StartTime()); | ||||
|      cString Time = TimeString(StartTime); | ||||
|      cString Day = WeekDayName(StartTime); | ||||
|      if (StartTime > Now + 6 * SECSINDAY) | ||||
|         Date = DayDateTime(StartTime); | ||||
|      else if (strcmp(Day, Today) != 0) | ||||
|         Date = cString::sprintf("%s %s", *Day, *Time); | ||||
|      else | ||||
|   | ||||
							
								
								
									
										24
									
								
								timers.c
									
									
									
									
									
								
							
							
						
						
									
										24
									
								
								timers.c
									
									
									
									
									
								
							| @@ -4,7 +4,7 @@ | ||||
|  * See the main source file 'vdr.c' for copyright information and | ||||
|  * how to reach the author. | ||||
|  * | ||||
|  * $Id: timers.c 5.13 2021/04/16 16:26:47 kls Exp $ | ||||
|  * $Id: timers.c 5.14 2021/04/18 14:56:40 kls Exp $ | ||||
|  */ | ||||
|  | ||||
| #include "timers.h" | ||||
| @@ -713,6 +713,28 @@ time_t cTimer::StopTime(void) const | ||||
|   return stopTime; | ||||
| } | ||||
|  | ||||
| time_t cTimer::StartTimeEvent(void) const | ||||
| { | ||||
|   if (event) { | ||||
|      if (HasFlags(tfVps) && event->Vps()) | ||||
|         return event->StartTime(); | ||||
|      else if (HasFlags(tfSpawned)) | ||||
|         return event->StartTime() - Setup.MarginStart * 60; | ||||
|      } | ||||
|   return StartTime(); | ||||
| } | ||||
|  | ||||
| time_t cTimer::StopTimeEvent(void) const | ||||
| { | ||||
|   if (event) { | ||||
|      if (HasFlags(tfVps) && event->Vps()) | ||||
|         return event->EndTime(); | ||||
|      else if (HasFlags(tfSpawned)) | ||||
|         return event->EndTime() + Setup.MarginStop * 60; | ||||
|      } | ||||
|   return StopTime(); | ||||
| } | ||||
|  | ||||
| #define EPGLIMITBEFORE   (1 * 3600) // Time in seconds before a timer's start time and | ||||
| #define EPGLIMITAFTER    (1 * 3600) // after its stop time within which EPG events will be taken into consideration. | ||||
|  | ||||
|   | ||||
							
								
								
									
										14
									
								
								timers.h
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								timers.h
									
									
									
									
									
								
							| @@ -4,7 +4,7 @@ | ||||
|  * See the main source file 'vdr.c' for copyright information and | ||||
|  * how to reach the author. | ||||
|  * | ||||
|  * $Id: timers.h 5.6 2021/04/13 13:54:00 kls Exp $ | ||||
|  * $Id: timers.h 5.7 2021/04/18 14:56:40 kls Exp $ | ||||
|  */ | ||||
|  | ||||
| #ifndef __TIMERS_H | ||||
| @@ -32,7 +32,7 @@ class cTimer : public cListObject { | ||||
|   friend class cMenuEditTimer; | ||||
| private: | ||||
|   int id; | ||||
|   mutable time_t startTime, stopTime; | ||||
|   mutable time_t startTime, stopTime; ///< the time_t value calculated from 'day', 'start' and 'stop' | ||||
|   int scheduleStateSet; | ||||
|   int scheduleStateSpawn; | ||||
|   int scheduleStateAdjust; | ||||
| @@ -42,8 +42,8 @@ private: | ||||
|   const cChannel *channel; | ||||
|   mutable time_t day; ///< midnight of the day this timer shall hit, or of the first day it shall hit in case of a repeating timer | ||||
|   int weekdays;       ///< bitmask, lowest bits: SSFTWTM  (the 'M' is the LSB) | ||||
|   int start; | ||||
|   int stop; | ||||
|   int start;          ///< the start and stop time of this timer as given by the user, | ||||
|   int stop;           ///< in the form hhmm, with hh (00..23) and mm (00..59) added as hh*100+mm | ||||
|   int priority; | ||||
|   int lifetime; | ||||
|   mutable char pattern[NAME_MAX * 2 + 1]; // same size as 'file', to be able to initially fill 'pattern' with 'file' in the 'Edit timer' menu | ||||
| @@ -96,8 +96,10 @@ public: | ||||
|   bool Matches(time_t t = 0, bool Directly = false, int Margin = 0) const; | ||||
|   eTimerMatch Matches(const cEvent *Event, int *Overlap = NULL) const; | ||||
|   bool Expired(void) const; | ||||
|   time_t StartTime(void) const; | ||||
|   time_t StopTime(void) const; | ||||
|   time_t StartTime(void) const; ///< the start time as given by the user | ||||
|   time_t StopTime(void) const; ///< the stop time as given by the user | ||||
|   time_t StartTimeEvent(void) const; ///< the start/stop times as given by the event (for VPS timers), by event plus margins (for spawned non-VPS timers), | ||||
|   time_t StopTimeEvent(void) const; ///< or by the user (for normal timers) | ||||
|   void SetId(int Id); | ||||
|   cTimer *SpawnPatternTimer(const cEvent *Event, cTimers *Timers); | ||||
|   bool SpawnPatternTimers(const cSchedules *Schedules, cTimers *Timers); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user