Kodi Development  19.0
for Binary and Script based Add-Ons
pvr_timers.h
1 /*
2  * Copyright (C) 2005-2018 Team Kodi
3  * This file is part of Kodi - https://kodi.tv
4  *
5  * SPDX-License-Identifier: GPL-2.0-or-later
6  * See LICENSES/README.md for more information.
7  */
8 
9 #pragma once
10 
11 #ifndef C_API_ADDONINSTANCE_PVR_TIMERS_H
12 #define C_API_ADDONINSTANCE_PVR_TIMERS_H
13 
14 #include "pvr_defines.h"
15 
16 #include <stdbool.h>
17 #include <stdint.h>
18 #include <time.h>
19 
20 //¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
21 // "C" Definitions group 6 - PVR timers
22 #ifdef __cplusplus
23 extern "C"
24 {
25 #endif /* __cplusplus */
26 
27  //============================================================================
35 
36  //============================================================================
41  #define PVR_TIMER_TYPE_NONE 0
42  //----------------------------------------------------------------------------
43 
44  //============================================================================
49  #define PVR_TIMER_NO_CLIENT_INDEX 0
50  //----------------------------------------------------------------------------
51 
52  //============================================================================
57  #define PVR_TIMER_NO_PARENT PVR_TIMER_NO_CLIENT_INDEX
58  //----------------------------------------------------------------------------
59 
60  //============================================================================
65  #define PVR_TIMER_NO_EPG_UID EPG_TAG_INVALID_UID
66  //----------------------------------------------------------------------------
67 
68  //============================================================================
74  #define PVR_TIMER_ANY_CHANNEL -1
75  //----------------------------------------------------------------------------
76 
77  //============================================================================
81  #define PVR_TIMER_VALUE_NOT_AVAILABLE -1
82  //----------------------------------------------------------------------------
83 
85  //----------------------------------------------------------------------------
86 
87 
88  //============================================================================
104  typedef enum PVR_TIMER_TYPES
105  {
108 
112 
116 
120 
124 
129 
133 
137 
141 
147 
151 
155 
159 
163 
166 
169 
173 
177 
180 
184 
188 
192 
196 
200 
213 
217 
222 
225 
228 
231 
234  } PVR_TIMER_TYPES;
236  //----------------------------------------------------------------------------
237 
238  //============================================================================
252  typedef enum PVR_WEEKDAYS
253  {
256 
258  PVR_WEEKDAY_MONDAY = (1 << 0),
259 
262 
265 
268 
270  PVR_WEEKDAY_FRIDAY = (1 << 4),
271 
274 
276  PVR_WEEKDAY_SUNDAY = (1 << 6),
277 
284  //----------------------------------------------------------------------------
285 
286  //============================================================================
294  typedef enum PVR_TIMER_STATE
295  {
300 
303 
306 
309 
312 
315 
319 
323 
326 
330  } PVR_TIMER_STATE;
332  //----------------------------------------------------------------------------
333 
342  typedef struct PVR_TIMER
343  {
344  unsigned int iClientIndex;
345  unsigned int iParentClientIndex;
346  int iClientChannelUid;
347  time_t startTime;
348  time_t endTime;
349  bool bStartAnyTime;
350  bool bEndAnyTime;
351  enum PVR_TIMER_STATE state;
352  unsigned int iTimerType;
353  char strTitle[PVR_ADDON_NAME_STRING_LENGTH];
354  char strEpgSearchString[PVR_ADDON_NAME_STRING_LENGTH];
355  bool bFullTextEpgSearch;
356  char strDirectory[PVR_ADDON_URL_STRING_LENGTH];
357  char strSummary[PVR_ADDON_DESC_STRING_LENGTH];
358  int iPriority;
359  int iLifetime;
360  int iMaxRecordings;
361  unsigned int iRecordingGroup;
362  time_t firstDay;
363  unsigned int iWeekdays;
364  unsigned int iPreventDuplicateEpisodes;
365  unsigned int iEpgUid;
366  unsigned int iMarginStart;
367  unsigned int iMarginEnd;
368  int iGenreType;
369  int iGenreSubType;
370  char strSeriesLink[PVR_ADDON_URL_STRING_LENGTH];
371  } PVR_TIMER;
372 
381  typedef struct PVR_TIMER_TYPE
382  {
383  unsigned int iId;
384  uint64_t iAttributes;
385  char strDescription[PVR_ADDON_TIMERTYPE_STRING_LENGTH];
386 
387  unsigned int iPrioritiesSize;
388  struct PVR_ATTRIBUTE_INT_VALUE priorities[PVR_ADDON_TIMERTYPE_VALUES_ARRAY_SIZE];
389  int iPrioritiesDefault;
390 
391  unsigned int iLifetimesSize;
392  struct PVR_ATTRIBUTE_INT_VALUE lifetimes[PVR_ADDON_TIMERTYPE_VALUES_ARRAY_SIZE];
393  int iLifetimesDefault;
394 
395  unsigned int iPreventDuplicateEpisodesSize;
396  struct PVR_ATTRIBUTE_INT_VALUE preventDuplicateEpisodes[PVR_ADDON_TIMERTYPE_VALUES_ARRAY_SIZE];
397  unsigned int iPreventDuplicateEpisodesDefault;
398 
399  unsigned int iRecordingGroupSize;
400  struct PVR_ATTRIBUTE_INT_VALUE recordingGroup[PVR_ADDON_TIMERTYPE_VALUES_ARRAY_SIZE];
401  unsigned int iRecordingGroupDefault;
402 
403  unsigned int iMaxRecordingsSize;
404  struct PVR_ATTRIBUTE_INT_VALUE maxRecordings[PVR_ADDON_TIMERTYPE_VALUES_ARRAY_SIZE_SMALL];
405  int iMaxRecordingsDefault;
406  } PVR_TIMER_TYPE;
407 
408 #ifdef __cplusplus
409 }
410 #endif /* __cplusplus */
411 
412 #endif /* !C_API_ADDONINSTANCE_PVR_TIMERS_H */
PVR_TIMER_TYPE_SUPPORTS_TITLE_EPG_MATCH
@ PVR_TIMER_TYPE_SUPPORTS_TITLE_EPG_MATCH
0000 0000 0000 0000 0000 0000 1000 0000 : This type supports matching epg episode title usingkodi::a...
Definition: pvr_timers.h:140
PVR_TIMER_TYPE_SUPPORTS_END_TIME
@ PVR_TIMER_TYPE_SUPPORTS_END_TIME
0000 0000 0000 0010 0000 0000 0000 0000 : This type supports a recording end time (kodi::addon::PVRT...
Definition: pvr_timers.h:179
PVR_WEEKDAY_THURSDAY
@ PVR_WEEKDAY_THURSDAY
0000 1000 : To select Thursday.
Definition: pvr_timers.h:267
PVR_WEEKDAY_ALLDAYS
@ PVR_WEEKDAY_ALLDAYS
0111 1111 : To select all days of week.
Definition: pvr_timers.h:279
PVR_TIMER_TYPE_IS_REMINDER
@ PVR_TIMER_TYPE_IS_REMINDER
0000 1000 0000 0000 0000 0000 0000 0000 : Timers of this type do trigger a reminder if time is up.
Definition: pvr_timers.h:227
PVR_TIMER_TYPE_IS_REPEATING
@ PVR_TIMER_TYPE_IS_REPEATING
0000 0000 0000 0000 0000 0000 0000 0010 : Defines whether this is a type for repeating or one-shot t...
Definition: pvr_timers.h:115
PVR_TIMER_STATE_NEW
@ PVR_TIMER_STATE_NEW
0 : The timer was just created on the backend and is not yet active.
Definition: pvr_timers.h:299
PVR_TIMER_TYPE
"C" PVR add-on timer event type.
Definition: pvr_timers.h:382
PVR_TIMER_TYPES
PVR_TIMER_TYPES
Definition: pvr_timers.h:105
PVR_WEEKDAY_TUESDAY
@ PVR_WEEKDAY_TUESDAY
0000 0010 : To select Tuesday.
Definition: pvr_timers.h:261
PVR_TIMER_TYPE_SUPPORTS_ANY_CHANNEL
@ PVR_TIMER_TYPE_SUPPORTS_ANY_CHANNEL
0000 0001 0000 0000 0000 0000 0000 0000 : This type supports 'any channel', for example when definin...
Definition: pvr_timers.h:216
PVR_TIMER_TYPE_SUPPORTS_RECORD_ONLY_NEW_EPISODES
@ PVR_TIMER_TYPE_SUPPORTS_RECORD_ONLY_NEW_EPISODES
0000 0000 0000 0000 0000 1000 0000 0000 : This type supports the "record only new episodes" feature ...
Definition: pvr_timers.h:158
PVR_TIMER_TYPE_SUPPORTS_RECORDING_GROUP
@ PVR_TIMER_TYPE_SUPPORTS_RECORDING_GROUP
0000 0000 0000 0001 0000 0000 0000 0000 : This type supports a list of recording groups (kodi::addon...
Definition: pvr_timers.h:176
PVR_WEEKDAY_SUNDAY
@ PVR_WEEKDAY_SUNDAY
0100 0000 : To select Sunday.
Definition: pvr_timers.h:276
PVR_WEEKDAY_WEDNESDAY
@ PVR_WEEKDAY_WEDNESDAY
0000 0100 : To select Wednesday.
Definition: pvr_timers.h:264
PVR_TIMER_STATE_RECORDING
@ PVR_TIMER_STATE_RECORDING
2 : The timer is currently recordings.
Definition: pvr_timers.h:305
PVR_TIMER_TYPE_SUPPORTS_FIRST_DAY
@ PVR_TIMER_TYPE_SUPPORTS_FIRST_DAY
0000 0000 0000 0000 0000 0010 0000 0000 : This type supports a first day the timer gets active (kodi...
Definition: pvr_timers.h:150
PVR_TIMER
"C" PVR add-on timer event.
Definition: pvr_timers.h:343
PVR_TIMER_TYPE_SUPPORTS_ENABLE_DISABLE
@ PVR_TIMER_TYPE_SUPPORTS_ENABLE_DISABLE
0000 0000 0000 0000 0000 0000 0001 0000 : This type supports enabling/disabling of the timer (kodi::...
Definition: pvr_timers.h:128
PVR_TIMER_TYPE_SUPPORTS_START_TIME
@ PVR_TIMER_TYPE_SUPPORTS_START_TIME
0000 0000 0000 0000 0000 0000 0100 0000 : This type supports a recording start time (kodi::addon::PV...
Definition: pvr_timers.h:136
PVR_TIMER_STATE_COMPLETED
@ PVR_TIMER_STATE_COMPLETED
3 : The recording completed successfully.
Definition: pvr_timers.h:308
PVR_TIMER_TYPE_SUPPORTS_LIFETIME
@ PVR_TIMER_TYPE_SUPPORTS_LIFETIME
0000 0000 0000 0000 0100 0000 0000 0000 : This type supports recording lifetime (kodi::addon::PVRTim...
Definition: pvr_timers.h:168
PVR_TIMER_STATE_SCHEDULED
@ PVR_TIMER_STATE_SCHEDULED
1 : The timer is scheduled for recording.
Definition: pvr_timers.h:302
PVR_TIMER_TYPE_SUPPORTS_END_MARGIN
@ PVR_TIMER_TYPE_SUPPORTS_END_MARGIN
0010 0000 0000 0000 0000 0000 0000 0000 : This type supports post record time (kodi::addon::PVRTimer...
Definition: pvr_timers.h:233
PVR_TIMER_TYPE_FORBIDS_EPG_TAG_ON_CREATE
@ PVR_TIMER_TYPE_FORBIDS_EPG_TAG_ON_CREATE
0000 0000 0100 0000 0000 0000 0000 0000 : This type should not appear on any create menus which prov...
Definition: pvr_timers.h:199
PVR_WEEKDAY
PVR_WEEKDAY
Definition: pvr_timers.h:253
PVR_TIMER_TYPE_SUPPORTS_RECORDING_FOLDERS
@ PVR_TIMER_TYPE_SUPPORTS_RECORDING_FOLDERS
0000 0000 0000 0000 1000 0000 0000 0000 : This type supports placing recordings in user defined fold...
Definition: pvr_timers.h:172
PVR_ATTRIBUTE_INT_VALUE
"C" Representation of a general attribute integer value.
Definition: pvr_defines.h:48
PVR_WEEKDAY_FRIDAY
@ PVR_WEEKDAY_FRIDAY
0001 0000 : To select Friday.
Definition: pvr_timers.h:270
PVR_TIMER_TYPE_SUPPORTS_END_ANYTIME
@ PVR_TIMER_TYPE_SUPPORTS_END_ANYTIME
0000 0000 0000 1000 0000 0000 0000 0000 : Enables a separate 'Any Time' over-ride for end time (usin...
Definition: pvr_timers.h:187
PVR_TIMER_TYPE_IS_MANUAL
@ PVR_TIMER_TYPE_IS_MANUAL
0000 0000 0000 0000 0000 0000 0000 0001 : Defines whether this is a type for manual (time-based) or ...
Definition: pvr_timers.h:111
PVR_TIMER_TYPE_ATTRIBUTE_NONE
@ PVR_TIMER_TYPE_ATTRIBUTE_NONE
0000 0000 0000 0000 0000 0000 0000 0000 : Empty attribute value.
Definition: pvr_timers.h:107
PVR_TIMER_TYPE_REQUIRES_EPG_SERIESLINK_ON_CREATE
@ PVR_TIMER_TYPE_REQUIRES_EPG_SERIESLINK_ON_CREATE
0000 0010 0000 0000 0000 0000 0000 0000 : This type should not appear on any create menus which don'...
Definition: pvr_timers.h:221
PVR_TIMER_TYPE_SUPPORTS_START_END_MARGIN
@ PVR_TIMER_TYPE_SUPPORTS_START_END_MARGIN
0000 0000 0000 0000 0001 0000 0000 0000 : This type supports pre and post record time (kodi::addon::...
Definition: pvr_timers.h:162
PVR_TIMER_TYPE_SUPPORTS_FULLTEXT_EPG_MATCH
@ PVR_TIMER_TYPE_SUPPORTS_FULLTEXT_EPG_MATCH
0000 0000 0000 0000 0000 0001 0000 0000 : This type supports matching "more" epg data (not just epis...
Definition: pvr_timers.h:146
PVR_TIMER_STATE_ABORTED
@ PVR_TIMER_STATE_ABORTED
4 : Recording started, but was aborted.
Definition: pvr_timers.h:311
PVR_TIMER_STATE_CONFLICT_OK
@ PVR_TIMER_STATE_CONFLICT_OK
6 : The scheduled timer conflicts with another one, but will be recorded.
Definition: pvr_timers.h:318
PVR_TIMER_TYPE_REQUIRES_EPG_SERIES_ON_CREATE
@ PVR_TIMER_TYPE_REQUIRES_EPG_SERIES_ON_CREATE
0000 0000 1000 0000 0000 0000 0000 0000 : This type should not appear on any create menus unless ass...
Definition: pvr_timers.h:212
PVR_TIMER_STATE_ERROR
@ PVR_TIMER_STATE_ERROR
8 : The timer is scheduled, but can't be recorded for some reason.
Definition: pvr_timers.h:325
PVR_TIMER_STATE_CONFLICT_NOK
@ PVR_TIMER_STATE_CONFLICT_NOK
7 : The scheduled timer conflicts with another one and won't be recorded.
Definition: pvr_timers.h:322
PVR_TIMER_TYPE_SUPPORTS_START_ANYTIME
@ PVR_TIMER_TYPE_SUPPORTS_START_ANYTIME
0000 0000 0000 0100 0000 0000 0000 0000 : Enables an 'Any Time' over-ride option for start time (usi...
Definition: pvr_timers.h:183
PVR_TIMER_STATE_CANCELLED
@ PVR_TIMER_STATE_CANCELLED
5 : The timer was scheduled, but was canceled.
Definition: pvr_timers.h:314
PVR_TIMER_TYPE_SUPPORTS_CHANNELS
@ PVR_TIMER_TYPE_SUPPORTS_CHANNELS
0000 0000 0000 0000 0000 0000 0010 0000 : This type supports channels (kodi::addon::PVRTimer::SetCli...
Definition: pvr_timers.h:132
PVR_TIMER_TYPE_IS_READONLY
@ PVR_TIMER_TYPE_IS_READONLY
0000 0000 0000 0000 0000 0000 0000 0100 : Timers of this type must not be edited by Kodi.
Definition: pvr_timers.h:119
PVR_TIMER_TYPE_REQUIRES_EPG_TAG_ON_CREATE
@ PVR_TIMER_TYPE_REQUIRES_EPG_TAG_ON_CREATE
0000 0000 0010 0000 0000 0000 0000 0000 : This type should not appear on any create menus which don'...
Definition: pvr_timers.h:195
PVR_TIMER_TYPE_FORBIDS_NEW_INSTANCES
@ PVR_TIMER_TYPE_FORBIDS_NEW_INSTANCES
0000 0000 0000 0000 0000 0000 0000 1000 : Timers of this type must not be created by Kodi....
Definition: pvr_timers.h:123
PVR_TIMER_STATE
PVR_TIMER_STATE
Definition: pvr_timers.h:295
PVR_TIMER_TYPE_SUPPORTS_READONLY_DELETE
@ PVR_TIMER_TYPE_SUPPORTS_READONLY_DELETE
0000 0100 0000 0000 0000 0000 0000 0000 : This type allows deletion of an otherwise read-only timer.
Definition: pvr_timers.h:224
PVR_TIMER_STATE_DISABLED
@ PVR_TIMER_STATE_DISABLED
9 : The timer was disabled by the user, can be enabled via setting the state to PVR_TIMER_STATE_SCHED...
Definition: pvr_timers.h:329
PVR_TIMER_TYPE_SUPPORTS_START_MARGIN
@ PVR_TIMER_TYPE_SUPPORTS_START_MARGIN
0001 0000 0000 0000 0000 0000 0000 0000 : This type supports pre record time (kodi::addon::PVRTimer:...
Definition: pvr_timers.h:230
PVR_WEEKDAY_MONDAY
@ PVR_WEEKDAY_MONDAY
0000 0001 : To select Monday.
Definition: pvr_timers.h:258
PVR_TIMER_TYPE_SUPPORTS_PRIORITY
@ PVR_TIMER_TYPE_SUPPORTS_PRIORITY
0000 0000 0000 0000 0010 0000 0000 0000 : This type supports recording priority (kodi::addon::PVRTim...
Definition: pvr_timers.h:165
PVR_WEEKDAY_NONE
@ PVR_WEEKDAY_NONE
0000 0000 : Nothing selected.
Definition: pvr_timers.h:255
PVR_WEEKDAY_SATURDAY
@ PVR_WEEKDAY_SATURDAY
0010 0000 : To select Saturday.
Definition: pvr_timers.h:273
PVR_TIMER_TYPE_SUPPORTS_WEEKDAYS
@ PVR_TIMER_TYPE_SUPPORTS_WEEKDAYS
0000 0000 0000 0000 0000 0100 0000 0000 : This type supports weekdays for defining the recording sch...
Definition: pvr_timers.h:154
PVR_TIMER_TYPE_SUPPORTS_MAX_RECORDINGS
@ PVR_TIMER_TYPE_SUPPORTS_MAX_RECORDINGS
0000 0000 0001 0000 0000 0000 0000 0000 : This type supports specifying a maximum recordings setting...
Definition: pvr_timers.h:191