12#include "../../AddonBase.h"
13#include "../../c-api/addon-instance/pvr.h"
46 m_cStructure->iClientIndex = 0;
49 m_cStructure->iParentClientIndex = 0;
51 m_cStructure->startTime = 0;
52 m_cStructure->endTime = 0;
53 m_cStructure->bStartAnyTime =
false;
54 m_cStructure->bEndAnyTime =
false;
55 m_cStructure->bFullTextEpgSearch =
false;
59 m_cStructure->iRecordingGroup = 0;
60 m_cStructure->firstDay = 0;
62 m_cStructure->iPreventDuplicateEpisodes = 0;
63 m_cStructure->iEpgUid = 0;
64 m_cStructure->iMarginStart = 0;
65 m_cStructure->iMarginEnd = 0;
116 void SetClientIndex(
unsigned int clientIndex) { m_cStructure->iClientIndex = clientIndex; }
161 void SetTimerType(
unsigned int timerType) { m_cStructure->iTimerType = timerType; }
170 strncpy(m_cStructure->strTitle, title.c_str(),
sizeof(m_cStructure->strTitle) - 1);
174 std::string
GetTitle()
const {
return m_cStructure->strTitle; }
184 m_cStructure->iParentClientIndex = parentClientIndex;
197 m_cStructure->iClientChannelUid = clientChannelUid;
208 void SetStartTime(time_t startTime) { m_cStructure->startTime = startTime; }
215 void SetEndTime(time_t endTime) { m_cStructure->endTime = endTime; }
224 void SetStartAnyTime(
bool startAnyTime) { m_cStructure->bStartAnyTime = startAnyTime; }
233 void SetEndAnyTime(
bool endAnyTime) { m_cStructure->bEndAnyTime = endAnyTime; }
244 strncpy(m_cStructure->strEpgSearchString, epgSearchString.c_str(),
245 sizeof(m_cStructure->strEpgSearchString) - 1);
256 m_cStructure->bFullTextEpgSearch = fullTextEpgSearch;
266 strncpy(m_cStructure->strDirectory, directory.c_str(),
sizeof(m_cStructure->strDirectory) - 1);
270 std::string
GetDirectory()
const {
return m_cStructure->strDirectory; }
276 strncpy(m_cStructure->strSummary, summary.c_str(),
sizeof(m_cStructure->strSummary) - 1);
280 std::string
GetSummary()
const {
return m_cStructure->strSummary; }
284 void SetPriority(
int priority) { m_cStructure->iPriority = priority; }
294 void SetLifetime(
int priority) { m_cStructure->iLifetime = priority; }
312 m_cStructure->iRecordingGroup = recordingGroup;
320 void SetFirstDay(time_t firstDay) { m_cStructure->firstDay = firstDay; }
341 void SetWeekdays(
unsigned int weekdays) { m_cStructure->iWeekdays = weekdays; }
344 unsigned int GetWeekdays()
const {
return m_cStructure->iWeekdays; }
357 m_cStructure->iPreventDuplicateEpisodes = preventDuplicateEpisodes;
363 return m_cStructure->iPreventDuplicateEpisodes;
371 void SetEPGUid(
unsigned int epgUid) { m_cStructure->iEpgUid = epgUid; }
374 unsigned int GetEPGUid()
const {
return m_cStructure->iEpgUid; }
379 void SetMarginStart(
unsigned int marginStart) { m_cStructure->iMarginStart = marginStart; }
387 void SetMarginEnd(
unsigned int marginEnd) { m_cStructure->iMarginEnd = marginEnd; }
411 void SetGenreType(
int genreType) { m_cStructure->iGenreType = genreType; }
449 void SetGenreSubType(
int genreSubType) { m_cStructure->iGenreSubType = genreSubType; }
461 strncpy(m_cStructure->strSeriesLink, seriesLink.c_str(),
462 sizeof(m_cStructure->strSeriesLink) - 1);
471 PVRTimer(
PVR_TIMER* data) : CStructHdl(data) {}
492 : m_instance(instance), m_handle(handle)
505 m_instance->toKodi->TransferTimerEntry(m_instance->toKodi->kodiInstance, m_handle, tag);
512 const ADDON_HANDLE m_handle;
538 m_cStructure->iPrioritiesDefault = -1;
539 m_cStructure->iLifetimesDefault = -1;
540 m_cStructure->iPreventDuplicateEpisodesDefault = -1;
541 m_cStructure->iRecordingGroupDefault = -1;
542 m_cStructure->iMaxRecordingsDefault = -1;
579 void SetId(
unsigned int id) { m_cStructure->iId = id; }
582 unsigned int GetId()
const {
return m_cStructure->iId; }
598 void SetAttributes(uint64_t attributes) { m_cStructure->iAttributes = attributes; }
611 strncpy(m_cStructure->strDescription, description.c_str(),
612 sizeof(m_cStructure->strDescription) - 1);
632 void SetPriorities(
const std::vector<PVRTypeIntValue>& priorities,
int prioritiesDefault = -1)
634 m_cStructure->iPrioritiesSize =
static_cast<unsigned int>(priorities.size());
635 for (
unsigned int i = 0;
636 i < m_cStructure->iPrioritiesSize && i <
sizeof(m_cStructure->priorities); ++i)
638 m_cStructure->priorities[i].iValue = priorities[i].GetCStructure()->iValue;
639 strncpy(m_cStructure->priorities[i].strDescription,
640 priorities[i].GetCStructure()->strDescription,
641 sizeof(m_cStructure->priorities[i].strDescription) - 1);
643 if (prioritiesDefault != -1)
644 m_cStructure->iPrioritiesDefault = prioritiesDefault;
650 std::vector<PVRTypeIntValue> ret;
651 for (
unsigned int i = 0; i < m_cStructure->iPrioritiesSize; ++i)
652 ret.emplace_back(m_cStructure->priorities[i].iValue,
653 m_cStructure->priorities[i].strDescription);
664 m_cStructure->iPrioritiesDefault = prioritiesDefault;
684 void SetLifetimes(
const std::vector<PVRTypeIntValue>& lifetimes,
int lifetimesDefault = -1)
686 m_cStructure->iLifetimesSize =
static_cast<unsigned int>(lifetimes.size());
687 for (
unsigned int i = 0;
688 i < m_cStructure->iLifetimesSize && i <
sizeof(m_cStructure->lifetimes); ++i)
690 m_cStructure->lifetimes[i].iValue = lifetimes[i].GetCStructure()->iValue;
691 strncpy(m_cStructure->lifetimes[i].strDescription,
692 lifetimes[i].GetCStructure()->strDescription,
693 sizeof(m_cStructure->lifetimes[i].strDescription) - 1);
695 if (lifetimesDefault != -1)
696 m_cStructure->iLifetimesDefault = lifetimesDefault;
702 std::vector<PVRTypeIntValue> ret;
703 for (
unsigned int i = 0; i < m_cStructure->iLifetimesSize; ++i)
704 ret.emplace_back(m_cStructure->lifetimes[i].iValue,
705 m_cStructure->lifetimes[i].strDescription);
716 m_cStructure->iLifetimesDefault = lifetimesDefault;
739 const std::vector<PVRTypeIntValue>& preventDuplicateEpisodes,
740 int preventDuplicateEpisodesDefault = -1)
742 m_cStructure->iPreventDuplicateEpisodesSize =
743 static_cast<unsigned int>(preventDuplicateEpisodes.size());
744 for (
unsigned int i = 0; i < m_cStructure->iPreventDuplicateEpisodesSize &&
745 i <
sizeof(m_cStructure->preventDuplicateEpisodes);
748 m_cStructure->preventDuplicateEpisodes[i].iValue =
749 preventDuplicateEpisodes[i].GetCStructure()->iValue;
750 strncpy(m_cStructure->preventDuplicateEpisodes[i].strDescription,
751 preventDuplicateEpisodes[i].GetCStructure()->strDescription,
752 sizeof(m_cStructure->preventDuplicateEpisodes[i].strDescription) - 1);
754 if (preventDuplicateEpisodesDefault != -1)
755 m_cStructure->iPreventDuplicateEpisodesDefault = preventDuplicateEpisodesDefault;
761 std::vector<PVRTypeIntValue> ret;
762 for (
unsigned int i = 0; i < m_cStructure->iPreventDuplicateEpisodesSize; ++i)
763 ret.emplace_back(m_cStructure->preventDuplicateEpisodes[i].iValue,
764 m_cStructure->preventDuplicateEpisodes[i].strDescription);
775 m_cStructure->iPreventDuplicateEpisodesDefault = preventDuplicateEpisodesDefault;
781 return m_cStructure->iPreventDuplicateEpisodesDefault;
797 int recordingGroupDefault = -1)
799 m_cStructure->iRecordingGroupSize =
static_cast<unsigned int>(recordingGroup.size());
800 for (
unsigned int i = 0;
801 i < m_cStructure->iRecordingGroupSize && i <
sizeof(m_cStructure->recordingGroup); ++i)
803 m_cStructure->recordingGroup[i].iValue = recordingGroup[i].GetCStructure()->iValue;
804 strncpy(m_cStructure->recordingGroup[i].strDescription,
805 recordingGroup[i].GetCStructure()->strDescription,
806 sizeof(m_cStructure->recordingGroup[i].strDescription) - 1);
808 if (recordingGroupDefault != -1)
809 m_cStructure->iRecordingGroupDefault = recordingGroupDefault;
815 std::vector<PVRTypeIntValue> ret;
816 for (
unsigned int i = 0; i < m_cStructure->iRecordingGroupSize; ++i)
817 ret.emplace_back(m_cStructure->recordingGroup[i].iValue,
818 m_cStructure->recordingGroup[i].strDescription);
829 m_cStructure->iRecordingGroupDefault = recordingGroupDefault;
848 int maxRecordingsDefault = -1)
850 m_cStructure->iMaxRecordingsSize =
static_cast<unsigned int>(maxRecordings.size());
851 for (
unsigned int i = 0;
852 i < m_cStructure->iMaxRecordingsSize && i <
sizeof(m_cStructure->maxRecordings); ++i)
854 m_cStructure->maxRecordings[i].iValue = maxRecordings[i].GetCStructure()->iValue;
855 strncpy(m_cStructure->maxRecordings[i].strDescription,
856 maxRecordings[i].GetCStructure()->strDescription,
857 sizeof(m_cStructure->maxRecordings[i].strDescription) - 1);
859 if (maxRecordingsDefault != -1)
860 m_cStructure->iMaxRecordingsDefault = maxRecordingsDefault;
866 std::vector<PVRTypeIntValue> ret;
867 for (
unsigned int i = 0; i < m_cStructure->iMaxRecordingsSize; ++i)
868 ret.emplace_back(m_cStructure->maxRecordings[i].iValue,
869 m_cStructure->maxRecordings[i].strDescription);
879 m_cStructure->iMaxRecordingsDefault = maxRecordingsDefault;
Definition: AddonBase.h:250
#define PVR_TIMER_TYPE_NONE
Numeric PVR timer type definitions (kodi::addon::PVRTimer::SetTimerType() values).
Definition: pvr_timers.h:39
#define PVR_TIMER_VALUE_NOT_AVAILABLE
Value where set in background to inform that related part not used.
Definition: pvr_timers.h:79
PVR_TIMER_STATE
Definition: pvr_timers.h:293
@ PVR_TIMER_STATE_NEW
0 : The timer was just created on the backend and is not yet active.
Definition: pvr_timers.h:297
@ PVR_WEEKDAY_NONE
0000 0000 : Nothing selected.
Definition: pvr_timers.h:253
time_t GetFirstDay() const
To get with SetFirstDay changed values.
Definition: Timers.h:323
void SetGenreSubType(int genreSubType)
optional Genre sub type.
Definition: Timers.h:449
unsigned int GetMarginStart() const
To get with SetMarginStart changed values.
Definition: Timers.h:382
void SetClientIndex(unsigned int clientIndex)
required The index of this timer given by the client.
Definition: Timers.h:116
void SetPriority(int priority)
optional The priority of this timer.
Definition: Timers.h:284
void SetStartTime(time_t startTime)
optional Start time of the recording in UTC.
Definition: Timers.h:208
unsigned int GetParentClientIndex() const
To get with SetParentClientIndex changed values.
Definition: Timers.h:188
unsigned int GetClientIndex() const
To get with SetClientIndex changed values.
Definition: Timers.h:119
unsigned int GetEPGUid() const
To get with SetEPGUid changed values.
Definition: Timers.h:374
void SetFirstDay(time_t firstDay)
optional The first day this timer is active, for repeating timers.
Definition: Timers.h:320
unsigned int GetWeekdays() const
To get with SetFirstDay changed values.
Definition: Timers.h:344
void SetPreventDuplicateEpisodes(unsigned int preventDuplicateEpisodes)
optional Prevent duplicate episodes.
Definition: Timers.h:355
unsigned int GetPreventDuplicateEpisodes() const
To get with SetPreventDuplicateEpisodes changed values.
Definition: Timers.h:361
void SetParentClientIndex(unsigned int parentClientIndex)
optional For timers scheduled by a repeating timer.
Definition: Timers.h:182
unsigned int GetTimerType() const
To get with SetTimerType changed values.
Definition: Timers.h:164
PVR_TIMER_STATE GetState() const
To get with SetState changed values.
Definition: Timers.h:138
void SetWeekdays(unsigned int weekdays)
optional Week days, for repeating timers (see PVR_WEEKDAY_* constant values)
Definition: Timers.h:341
void SetTitle(const std::string &title)
required A title for this timer.
Definition: Timers.h:168
void SetEndAnyTime(bool endAnyTime)
optional For EPG based (not Manual) timers indicates endTime does not apply.
Definition: Timers.h:233
void SetClientChannelUid(int clientChannelUid)
optional Unique identifier of the channel to record on.
Definition: Timers.h:195
void SetLifetime(int priority)
optional Lifetime of recordings created by this timer.
Definition: Timers.h:294
void SetSeriesLink(const std::string &seriesLink)
optional Series link for this timer.
Definition: Timers.h:459
time_t GetEndTime() const
To get with SetEndTime changed values.
Definition: Timers.h:218
void SetEPGUid(unsigned int epgUid)
optional EPG event id associated with this timer. Event ids must be unique for a channel.
Definition: Timers.h:371
void SetMaxRecordings(int maxRecordings)
optional Maximum number of recordings this timer shall create.
Definition: Timers.h:303
std::string GetDirectory() const
To get with SetDirectory changed values.
Definition: Timers.h:270
bool GetStartAnyTime() const
To get with SetStartAnyTime changed values.
Definition: Timers.h:227
void SetState(PVR_TIMER_STATE state)
required The state of this timer.
Definition: Timers.h:135
unsigned int GetMarginEnd() const
To get with SetMarginEnd changed values.
Definition: Timers.h:390
void SetTimerType(unsigned int timerType)
required The type of this timer.
Definition: Timers.h:161
int GetMaxRecordings() const
To get with SetMaxRecordings changed values.
Definition: Timers.h:306
std::string GetEPGSearchString() const
To get with SetEPGSearchString changed values.
Definition: Timers.h:249
void SetSummary(const std::string &summary)
optional The summary for this timer.
Definition: Timers.h:274
int GetPriority() const
To get with SetPriority changed values.
Definition: Timers.h:287
void SetStartAnyTime(bool startAnyTime)
optional For EPG based (not Manual) timers indicates startTime does not apply.
Definition: Timers.h:224
std::string GetTitle() const
To get with SetTitle changed values.
Definition: Timers.h:174
void SetDirectory(const std::string &directory)
optional The (relative) directory where the recording will be stored in.
Definition: Timers.h:264
unsigned int GetRecordingGroup() const
To get with SetRecordingGroup changed values.
Definition: Timers.h:316
int GetClientChannelUid() const
To get with SetClientChannelUid changed values.
Definition: Timers.h:201
int GetLifetime() const
To get with SetLifetime changed values.
Definition: Timers.h:297
time_t GetStartTime() const
To get with SetStartTime changed values.
Definition: Timers.h:211
std::string GetSummary() const
To get with SetDirectory changed values.
Definition: Timers.h:280
void SetFullTextEpgSearch(bool fullTextEpgSearch)
optional Indicates, whether SetEPGSearchString() is to match against the epg episode title only or al...
Definition: Timers.h:254
void SetEPGSearchString(const std::string &epgSearchString)
optional A string used to search epg data for repeating epg-based timers.
Definition: Timers.h:242
void SetRecordingGroup(unsigned int recordingGroup)
optional Integer ref to addon/backend defined list of recording groups.
Definition: Timers.h:310
void SetGenreType(int genreType)
optional Genre type.
Definition: Timers.h:411
bool GetEndAnyTime() const
To get with SetEndAnyTime changed values.
Definition: Timers.h:236
int GetGenreType() const
To get with SetGenreType changed values.
Definition: Timers.h:414
int GetGenreSubType() const
To get with SetGenreType changed values.
Definition: Timers.h:452
bool GetFullTextEpgSearch() const
To get with SetFullTextEpgSearch changed values.
Definition: Timers.h:260
void SetMarginEnd(unsigned int marginEnd)
optional If set, the backend ends the recording selected minutes after SetEndTime.
Definition: Timers.h:387
void SetEndTime(time_t endTime)
optional End time of the recording in UTC.
Definition: Timers.h:215
std::string GetSeriesLink() const
To get with SetSeriesLink changed values.
Definition: Timers.h:466
void SetMarginStart(unsigned int marginStart)
optional If set, the backend starts the recording selected minutes before SetStartTime.
Definition: Timers.h:379
std::vector< PVRTypeIntValue > GetPriorities() const
To get with SetPriorities changed values.
Definition: Timers.h:648
int GetLifetimesDefault() const
To get with SetLifetimesDefault changed values.
Definition: Timers.h:720
std::string GetDescription() const
To get with SetDescription changed values.
Definition: Timers.h:616
void SetLifetimes(const std::vector< PVRTypeIntValue > &lifetimes, int lifetimesDefault=-1)
optional Lifetime value definitions.
Definition: Timers.h:684
void SetMaxRecordings(const std::vector< PVRTypeIntValue > &maxRecordings, int maxRecordingsDefault=-1)
optional Array containing the possible values of PVRTimer::SetMaxRecordings().
Definition: Timers.h:847
void SetDescription(const std::string &description)
optional A short localized string describing the purpose of the type. (e.g. "Any time at this channel...
Definition: Timers.h:609
unsigned int GetId() const
To get with SetAttributes changed values.
Definition: Timers.h:582
int GetPrioritiesDefault() const
To get with SetPrioritiesDefault changed values.
Definition: Timers.h:668
void SetPreventDuplicateEpisodes(const std::vector< PVRTypeIntValue > &preventDuplicateEpisodes, int preventDuplicateEpisodesDefault=-1)
optional Prevent duplicate episodes value definitions.
Definition: Timers.h:738
std::vector< PVRTypeIntValue > GetRecordingGroups() const
To get with SetRecordingGroups changed values.
Definition: Timers.h:813
std::vector< PVRTypeIntValue > GetPreventDuplicateEpisodes() const
To get with SetPreventDuplicateEpisodes changed values.
Definition: Timers.h:759
int GetRecordingGroupDefault() const
To get with SetRecordingGroupDefault changed values.
Definition: Timers.h:833
void SetPrioritiesDefault(int prioritiesDefault)
optional The default value for PVRTimer::SetPriority().
Definition: Timers.h:662
int GetPreventDuplicateEpisodesDefault() const
To get with SetPreventDuplicateEpisodesDefault changed values.
Definition: Timers.h:779
void SetLifetimesDefault(int lifetimesDefault)
optional The default value for SetLifetimes().
Definition: Timers.h:714
void SetRecordingGroups(const std::vector< PVRTypeIntValue > &recordingGroup, int recordingGroupDefault=-1)
optional Array containing the possible values of PVRTimer::SetRecordingGroup()
Definition: Timers.h:796
int GetMaxRecordingsDefault() const
To get with SetMaxRecordingsDefault changed values.
Definition: Timers.h:883
void SetPriorities(const std::vector< PVRTypeIntValue > &priorities, int prioritiesDefault=-1)
optional Priority value definitions.
Definition: Timers.h:632
void SetId(unsigned int id)
required This type's identifier. Ids must be > PVR_TIMER_TYPE_NONE.
Definition: Timers.h:579
void SetMaxRecordingsDefault(int maxRecordingsDefault)
optional The default value for SetMaxRecordings().
Definition: Timers.h:877
void SetRecordingGroupDefault(int recordingGroupDefault)
optional The default value for PVRTimer::SetRecordingGroup().
Definition: Timers.h:827
void SetPreventDuplicateEpisodesDefault(int preventDuplicateEpisodesDefault)
optional The default value for PVRTimer::SetPreventDuplicateEpisodes().
Definition: Timers.h:773
void SetAttributes(uint64_t attributes)
required Defines the attributes for this type (PVR_TIMER_TYPE_* constants).
Definition: Timers.h:598
std::vector< PVRTypeIntValue > GetMaxRecordings() const
To get with SetMaxRecordings changed values.
Definition: Timers.h:864
uint64_t GetAttributes() const
To get with SetAttributes changed values.
Definition: Timers.h:601
std::vector< PVRTypeIntValue > GetLifetimes() const
To get with SetLifetimes changed values.
Definition: Timers.h:700
void Add(const kodi::addon::PVRTimer &tag)
To add and give content from addon to Kodi on related call.
Definition: Timers.h:503
"C" PVR add-on timer event type.
Definition: pvr_timers.h:380
"C" PVR add-on timer event.
Definition: pvr_timers.h:341