11 #include "XBDateTime.h" 12 #include "pvr/timers/PVRTimerType.h" 13 #include "threads/CriticalSection.h" 14 #include "utils/ISerializable.h" 26 enum class TimerOperationResult
42 const std::shared_ptr<CPVRChannel>& channel,
43 unsigned int iClientId);
52 void FillAddonData(
PVR_TIMER& timer)
const;
55 void Serialize(
CVariant& value)
const override;
57 static constexpr
int DEFAULT_PVRRECORD_INSTANTRECORDTIME = -1;
66 static std::shared_ptr<CPVRTimerInfoTag> CreateInstantTimerTag(
67 const std::shared_ptr<CPVRChannel>& channel,
68 int iDuration = DEFAULT_PVRRECORD_INSTANTRECORDTIME);
77 static std::shared_ptr<CPVRTimerInfoTag> CreateTimerTag(
78 const std::shared_ptr<CPVRChannel>& channel,
const CDateTime& start,
int iDuration);
89 static std::shared_ptr<CPVRTimerInfoTag> CreateFromEpg(
const std::shared_ptr<CPVREpgInfoTag>& tag,
92 bool bReadOnly =
false);
100 static std::shared_ptr<CPVRTimerInfoTag> CreateFromEpg(
const std::shared_ptr<CPVREpgInfoTag>& tag,
101 bool bCreateRule =
false);
110 static std::shared_ptr<CPVRTimerInfoTag> CreateReminderFromDate(
113 const std::shared_ptr<CPVRTimerInfoTag>& parent = std::shared_ptr<CPVRTimerInfoTag>());
121 static std::shared_ptr<CPVRTimerInfoTag> CreateReminderFromEpg(
122 const std::shared_ptr<CPVREpgInfoTag>& tag,
123 const std::shared_ptr<CPVRTimerInfoTag>& parent = std::shared_ptr<CPVRTimerInfoTag>());
129 void SetEpgInfoTag(
const std::shared_ptr<CPVREpgInfoTag>& tag);
136 std::shared_ptr<CPVREpgInfoTag> GetEpgInfoTag(
bool bCreate =
true)
const;
143 bool UpdateEntry(
const std::shared_ptr<const CPVRTimerInfoTag>& tag);
151 bool UpdateChildState(
const std::shared_ptr<const CPVRTimerInfoTag>& childTimer,
bool bAdd);
156 void ResetChildState();
202 const std::shared_ptr<CPVRTimerType>
GetTimerType()
const {
return m_timerType; }
208 void SetTimerType(
const std::shared_ptr<CPVRTimerType>& type);
214 bool IsTimerRule()
const {
return m_timerType && m_timerType->IsTimerRule(); }
220 bool IsReminder()
const {
return m_timerType && m_timerType->IsReminder(); }
226 bool IsManual()
const {
return m_timerType && m_timerType->IsManual(); }
244 bool IsOwnedByClient()
const;
256 const std::string& Path()
const;
282 unsigned int TimerID()
const {
return m_iTimerId; }
312 const std::string& Title()
const;
318 bool HasChannel()
const;
324 std::shared_ptr<CPVRChannel> Channel()
const;
330 void UpdateChannel();
336 std::string ChannelName()
const;
342 std::string ChannelIcon()
const;
360 void SetStartFromUTC(
const CDateTime& start);
366 void SetStartFromLocalTime(
const CDateTime& start);
384 void SetEndFromUTC(
const CDateTime& end);
390 void SetEndFromLocalTime(
const CDateTime& end);
408 void SetFirstDayFromUTC(
const CDateTime& firstDay);
414 void SetFirstDayFromLocalTime(
const CDateTime& firstDay);
434 int GetDuration()
const;
452 unsigned int WeekDays()
const {
return m_iWeekdays; }
485 const std::string& SeriesLink()
const;
497 bool AddToClient()
const;
505 TimerOperationResult DeleteFromClient(
bool bForce =
false)
const;
512 bool UpdateOnClient();
524 bool DeleteFromDatabase();
530 std::string GetNotificationText()
const;
536 std::string GetDeletedNotificationText()
const;
543 const std::string& Summary()
const;
548 void UpdateSummary();
555 std::string GetStatus(
bool bRadio)
const;
561 std::string GetTypeAsString()
const;
570 static std::string GetWeekdaysString(
unsigned int iWeekdays,
572 bool bLongMultiDaysFormat);
578 std::string GetWeekdaysString()
const;
579 void UpdateEpgInfoTag();
581 static std::shared_ptr<CPVRTimerInfoTag> CreateFromDate(
582 const std::shared_ptr<CPVRChannel>& channel,
585 bool bCreateReminder,
588 mutable CCriticalSection m_critSection;
590 std::string m_strTitle;
592 m_strEpgSearchString;
593 bool m_bFullTextEpgSearch =
595 std::string m_strDirectory;
596 std::string m_strSummary;
600 int m_iParentClientIndex;
601 int m_iClientChannelUid;
602 bool m_bStartAnyTime =
604 bool m_bEndAnyTime =
false;
607 int m_iMaxRecordings =
609 unsigned int m_iWeekdays;
611 m_iPreventDupEpisodes;
612 unsigned int m_iRecordingGroup =
614 std::string m_strFileNameAndPath;
616 unsigned int m_iTimerId = 0;
623 std::string m_strSeriesLink;
628 std::shared_ptr<CPVRTimerType> m_timerType;
630 unsigned int m_iTVChildTimersActive = 0;
631 unsigned int m_iTVChildTimersConflictNOK = 0;
632 unsigned int m_iTVChildTimersRecording = 0;
633 unsigned int m_iTVChildTimersErrors = 0;
634 unsigned int m_iRadioChildTimersActive = 0;
635 unsigned int m_iRadioChildTimersConflictNOK = 0;
636 unsigned int m_iRadioChildTimersRecording = 0;
637 unsigned int m_iRadioChildTimersErrors = 0;
639 mutable std::shared_ptr<CPVREpgInfoTag> m_epgTag;
640 mutable std::shared_ptr<CPVRChannel> m_channel;
642 mutable bool m_bProbedEpgTag =
false;
6 : The scheduled timer conflicts with another one, but will be recorded.
Definition: pvr_timers.h:315
bool IsManual() const
Checks whether this is a manual (vs. epg-based) timer.
Definition: PVRTimerInfoTag.h:226
Definition: GUIDialogPVRTimerSettings.h:31
int ClientChannelUID() const
The UID of the channel for this timer.
Definition: PVRTimerInfoTag.h:294
bool IsBroken() const
Whether this timer is broken.
Definition: PVRTimerInfoTag.h:174
bool IsReminder() const
Checks whether this is a reminder timer (vs. recording timer).
Definition: PVRTimerInfoTag.h:220
void SetTimerID(unsigned int id)
Set the local ID for this timer.
Definition: PVRTimerInfoTag.h:288
int ClientID() const
The ID of the client for this timer.
Definition: PVRTimerInfoTag.h:238
#define PVR_TIMER_NO_PARENT
Special kodi::addon::PVRTimer::SetParentClientIndex() value to indicate that a timer has no parent...
Definition: pvr_timers.h:55
Definition: ContextMenuManager.h:24
bool IsTimerRule() const
Checks whether this is a timer rule (vs. one time timer).
Definition: PVRTimerInfoTag.h:214
bool IsDisabled() const
Whether this timer is disabled, for example by the user.
Definition: PVRTimerInfoTag.h:196
bool IsActive() const
Whether this timer is active.
Definition: PVRTimerInfoTag.h:162
PVR_TIMER_STATE State() const
The state for this timer.
Definition: PVRTimerInfoTag.h:300
bool IsRadio() const
Whether this timer is for Radio or TV.
Definition: PVRTimerInfoTag.h:250
bool IsEpgBased() const
Checks whether this is an epg-based (vs. manual) timer.
Definition: PVRTimerInfoTag.h:232
unsigned int MarginEnd() const
Get time in minutes to end the recording after the end time of the programme.
Definition: PVRTimerInfoTag.h:446
unsigned int TimerID() const
The local ID for this timer, as given by Kodi.
Definition: PVRTimerInfoTag.h:282
bool HasConflict() const
Whether this timer has a conflict.
Definition: PVRTimerInfoTag.h:184
1 : The timer is scheduled for recording.
Definition: pvr_timers.h:299
9 : The timer was disabled by the user, can be enabled via setting the state to PVR_TIMER_STATE_SCHED...
Definition: pvr_timers.h:326
unsigned int WeekDays() const
For timer rules, the days of week this timer rule is scheduled for.
Definition: PVRTimerInfoTag.h:452
unsigned int UniqueBroadcastID() const
Get the UID of the epg event associated with this timer tag, if any.
Definition: PVRTimerInfoTag.h:491
int ClientIndex() const
The index for this timer, as given by the client.
Definition: PVRTimerInfoTag.h:263
bool IsStartAnyTime() const
For timer rules, whether start time is "any time", not a particular time.
Definition: PVRTimerInfoTag.h:458
Definition: ISerializable.h:13
void SetState(PVR_TIMER_STATE state)
Set the state for this timer.
Definition: PVRTimerInfoTag.h:306
Definition: PVRTimerInfoTag.h:33
int ParentClientIndex() const
The index for the parent of this timer, as given by the client. Timers scheduled by a timer rule will...
Definition: PVRTimerInfoTag.h:270
8 : The timer is scheduled, but can't be recorded for some reason.
Definition: pvr_timers.h:322
2 : The timer is currently recordings.
Definition: pvr_timers.h:302
DateTime class, which uses FileTime as it's base.
Definition: XBDateTime.h:63
PVR_TIMER_STATE
Definition: pvr_timers.h:291
const std::string & EpgSearchString() const
For timer rules, the epg data match string for searches. Format is backend-dependent, for example regexp.
Definition: PVRTimerInfoTag.h:479
unsigned int MarginStart() const
Get time in minutes to start the recording before the start time of the programme.
Definition: PVRTimerInfoTag.h:440
const std::shared_ptr< CPVRTimerType > GetTimerType() const
Gets the type of this timer.
Definition: PVRTimerInfoTag.h:202
"C" PVR add-on timer event.
Definition: pvr_timers.h:339
bool IsRecording() const
Whether this timer is currently recording.
Definition: PVRTimerInfoTag.h:190
Definition: PVRDatabase.h:33
bool IsEndAnyTime() const
For timer rules, whether end time is "any time", not a particular time.
Definition: PVRTimerInfoTag.h:464
bool IsFullTextEpgSearch() const
For timer rules, whether only the EPG programme title shall be searched or also other data like the p...
Definition: PVRTimerInfoTag.h:472
7 : The scheduled timer conflicts with another one and won't be recorded.
Definition: pvr_timers.h:319
bool HasParent() const
Whether this timer has a parent.
Definition: PVRTimerInfoTag.h:276