summaryrefslogtreecommitdiffstats
path: root/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_timers.h
diff options
context:
space:
mode:
Diffstat (limited to 'xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_timers.h')
-rw-r--r--xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_timers.h412
1 files changed, 412 insertions, 0 deletions
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_timers.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_timers.h
new file mode 100644
index 0000000..209726d
--- /dev/null
+++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_timers.h
@@ -0,0 +1,412 @@
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
23extern "C"
24{
25#endif /* __cplusplus */
26
27 //============================================================================
28 /// @defgroup cpp_kodi_addon_pvr_Defs_Timer_PVR_TIMER_ definition PVR_TIMER (various)
29 /// @ingroup cpp_kodi_addon_pvr_Defs_Timer
30 /// @brief **PVR timer various different definitions**\n
31 /// This mostly used on @ref cpp_kodi_addon_pvr_Defs_Timer_PVRTimer "kodi::addon::PVRTimer"
32 /// to define default or not available.
33 ///
34 ///@{
35
36 //============================================================================
37 /// @brief Numeric PVR timer type definitions (@ref kodi::addon::PVRTimer::SetTimerType()
38 /// values).
39 ///
40 /// "Null" value for a numeric timer type.
41 #define PVR_TIMER_TYPE_NONE 0
42 //----------------------------------------------------------------------------
43
44 //============================================================================
45 /// @brief Special @ref kodi::addon::PVRTimer::SetClientIndex() value to indicate
46 /// that a timer has not (yet) a valid client index.
47 ///
48 /// Timer has not (yet) a valid client index.
49 #define PVR_TIMER_NO_CLIENT_INDEX 0
50 //----------------------------------------------------------------------------
51
52 //============================================================================
53 /// @brief Special @ref kodi::addon::PVRTimer::SetParentClientIndex() value to
54 /// indicate that a timer has no parent.
55 ///
56 /// Timer has no parent; it was not scheduled by a repeating timer.
57 #define PVR_TIMER_NO_PARENT PVR_TIMER_NO_CLIENT_INDEX
58 //----------------------------------------------------------------------------
59
60 //============================================================================
61 /// @brief Special @ref kodi::addon::PVRTimer::SetEPGUid() value to indicate
62 /// that a timer has no EPG event uid.
63 ///
64 /// Timer has no EPG event unique identifier.
65 #define PVR_TIMER_NO_EPG_UID EPG_TAG_INVALID_UID
66 //----------------------------------------------------------------------------
67
68 //============================================================================
69 /// @brief Special @ref kodi::addon::PVRTimer::SetClientChannelUid() value to
70 /// indicate "any channel". Useful for some repeating timer types.
71 ///
72 /// denotes "any channel", not a specific one.
73 ///
74 #define PVR_TIMER_ANY_CHANNEL -1
75 //----------------------------------------------------------------------------
76
77 //============================================================================
78 /// @brief Value where set in background to inform that related part not used.
79 ///
80 /// Normally this related parts need not to set by this as it is default.
81 #define PVR_TIMER_VALUE_NOT_AVAILABLE -1
82 //----------------------------------------------------------------------------
83
84 ///@}
85 //----------------------------------------------------------------------------
86
87
88 //============================================================================
89 /// @defgroup cpp_kodi_addon_pvr_Defs_Timer_PVR_TIMER_TYPES enum PVR_TIMER_TYPES
90 /// @ingroup cpp_kodi_addon_pvr_Defs_Timer
91 /// @brief **PVR timer type attributes (@ref kodi::addon::PVRTimerType::SetAttributes() values).**\n
92 /// To defines the attributes for a type. These values are bit fields that can be
93 /// used together.
94 ///
95 ///--------------------------------------------------------------------------
96 ///
97 /// **Example:**
98 /// ~~~~~~~~~~~~~{.cpp}
99 /// kodi::addon::PVRTimerType tag;
100 /// tag.SetAttributes(PVR_TIMER_TYPE_IS_MANUAL | PVR_TIMER_TYPE_IS_REPEATING);
101 /// ~~~~~~~~~~~~~
102 ///
103 ///@{
104 typedef enum PVR_TIMER_TYPES
105 {
106 /// @brief __0000 0000 0000 0000 0000 0000 0000 0000__ :\n Empty attribute value.
107 PVR_TIMER_TYPE_ATTRIBUTE_NONE = 0,
108
109 /// @brief __0000 0000 0000 0000 0000 0000 0000 0001__ :\n Defines whether this is a type for
110 /// manual (time-based) or epg-based timers.
111 PVR_TIMER_TYPE_IS_MANUAL = (1 << 0),
112
113 /// @brief __0000 0000 0000 0000 0000 0000 0000 0010__ :\n Defines whether this is a type for
114 /// repeating or one-shot timers.
115 PVR_TIMER_TYPE_IS_REPEATING = (1 << 1),
116
117 /// @brief __0000 0000 0000 0000 0000 0000 0000 0100__ :\n Timers of this type must not be edited
118 /// by Kodi.
119 PVR_TIMER_TYPE_IS_READONLY = (1 << 2),
120
121 /// @brief __0000 0000 0000 0000 0000 0000 0000 1000__ :\n Timers of this type must not be created
122 /// by Kodi. All other operations are allowed, though.
123 PVR_TIMER_TYPE_FORBIDS_NEW_INSTANCES = (1 << 3),
124
125 /// @brief __0000 0000 0000 0000 0000 0000 0001 0000__ :\n This type supports enabling/disabling
126 /// of the timer (@ref kodi::addon::PVRTimer::SetState() with
127 /// @ref PVR_TIMER_STATE_SCHEDULED | @ref PVR_TIMER_STATE_DISABLED).
128 PVR_TIMER_TYPE_SUPPORTS_ENABLE_DISABLE = (1 << 4),
129
130 /// @brief __0000 0000 0000 0000 0000 0000 0010 0000__ :\n This type supports channels
131 /// (@ref kodi::addon::PVRTimer::SetClientChannelUid()).
132 PVR_TIMER_TYPE_SUPPORTS_CHANNELS = (1 << 5),
133
134 /// @brief __0000 0000 0000 0000 0000 0000 0100 0000__ :\n This type supports a recording start
135 /// time (@ref kodi::addon::PVRTimer::SetStartTime()).
136 PVR_TIMER_TYPE_SUPPORTS_START_TIME = (1 << 6),
137
138 /// @brief __0000 0000 0000 0000 0000 0000 1000 0000__ :\n This type supports matching epg episode
139 /// title using@ref kodi::addon::PVRTimer::SetEPGSearchString().
140 PVR_TIMER_TYPE_SUPPORTS_TITLE_EPG_MATCH = (1 << 7),
141
142 /// @brief __0000 0000 0000 0000 0000 0001 0000 0000__ :\n This type supports matching "more" epg
143 /// data (not just episode title) using @ref kodi::addon::PVRTimer::SetEPGSearchString().
144 /// Setting @ref PVR_TIMER_TYPE_SUPPORTS_FULLTEXT_EPG_MATCH implies
145 /// @ref PVR_TIMER_TYPE_SUPPORTS_TITLE_EPG_MATCH.
146 PVR_TIMER_TYPE_SUPPORTS_FULLTEXT_EPG_MATCH = (1 << 8),
147
148 /// @brief __0000 0000 0000 0000 0000 0010 0000 0000__ :\n This type supports a first day the
149 /// timer gets active (@ref kodi::addon::PVRTimer::SetFirstDay()).
150 PVR_TIMER_TYPE_SUPPORTS_FIRST_DAY = (1 << 9),
151
152 /// @brief __0000 0000 0000 0000 0000 0100 0000 0000__ :\n This type supports weekdays for
153 /// defining the recording schedule (@ref kodi::addon::PVRTimer::SetWeekdays()).
154 PVR_TIMER_TYPE_SUPPORTS_WEEKDAYS = (1 << 10),
155
156 /// @brief __0000 0000 0000 0000 0000 1000 0000 0000__ :\n This type supports the <b>"record only new episodes"</b> feature
157 /// (@ref kodi::addon::PVRTimer::SetPreventDuplicateEpisodes()).
158 PVR_TIMER_TYPE_SUPPORTS_RECORD_ONLY_NEW_EPISODES = (1 << 11),
159
160 /// @brief __0000 0000 0000 0000 0001 0000 0000 0000__ :\n This type supports pre and post record time (@ref kodi::addon::PVRTimer::SetMarginStart(),
161 /// @ref kodi::addon::PVRTimer::SetMarginEnd()).
162 PVR_TIMER_TYPE_SUPPORTS_START_END_MARGIN = (1 << 12),
163
164 /// @brief __0000 0000 0000 0000 0010 0000 0000 0000__ :\n This type supports recording priority (@ref kodi::addon::PVRTimer::SetPriority()).
165 PVR_TIMER_TYPE_SUPPORTS_PRIORITY = (1 << 13),
166
167 /// @brief __0000 0000 0000 0000 0100 0000 0000 0000__ :\n This type supports recording lifetime (@ref kodi::addon::PVRTimer::SetLifetime()).
168 PVR_TIMER_TYPE_SUPPORTS_LIFETIME = (1 << 14),
169
170 /// @brief __0000 0000 0000 0000 1000 0000 0000 0000__ :\n This type supports placing recordings in user defined folders
171 /// (@ref kodi::addon::PVRTimer::SetDirectory()).
172 PVR_TIMER_TYPE_SUPPORTS_RECORDING_FOLDERS = (1 << 15),
173
174 /// @brief __0000 0000 0000 0001 0000 0000 0000 0000__ :\n This type supports a list of recording groups
175 /// (@ref kodi::addon::PVRTimer::SetRecordingGroup()).
176 PVR_TIMER_TYPE_SUPPORTS_RECORDING_GROUP = (1 << 16),
177
178 /// @brief __0000 0000 0000 0010 0000 0000 0000 0000__ :\n This type supports a recording end time (@ref kodi::addon::PVRTimer::SetEndTime()).
179 PVR_TIMER_TYPE_SUPPORTS_END_TIME = (1 << 17),
180
181 /// @brief __0000 0000 0000 0100 0000 0000 0000 0000__ :\n Enables an 'Any Time' over-ride option for start time
182 /// (using @ref kodi::addon::PVRTimer::SetStartAnyTime()).
183 PVR_TIMER_TYPE_SUPPORTS_START_ANYTIME = (1 << 18),
184
185 /// @brief __0000 0000 0000 1000 0000 0000 0000 0000__ :\n Enables a separate <b>'Any Time'</b> over-ride for end time
186 /// (using @ref kodi::addon::PVRTimer::SetEndAnyTime()).
187 PVR_TIMER_TYPE_SUPPORTS_END_ANYTIME = (1 << 19),
188
189 /// @brief __0000 0000 0001 0000 0000 0000 0000 0000__ :\n This type supports specifying a maximum recordings setting'
190 /// (@ref kodi::addon::PVRTimer::SetMaxRecordings()).
191 PVR_TIMER_TYPE_SUPPORTS_MAX_RECORDINGS = (1 << 20),
192
193 /// @brief __0000 0000 0010 0000 0000 0000 0000 0000__ :\n This type should not appear on any create menus which don't
194 /// provide an associated @ref cpp_kodi_addon_pvr_Defs_epg_PVREPGTag "EPG tag".
195 PVR_TIMER_TYPE_REQUIRES_EPG_TAG_ON_CREATE = (1 << 21),
196
197 /// @brief __0000 0000 0100 0000 0000 0000 0000 0000__ :\n This type should not appear on any create menus which provide an
198 /// associated @ref cpp_kodi_addon_pvr_Defs_epg_PVREPGTag "EPG tag".
199 PVR_TIMER_TYPE_FORBIDS_EPG_TAG_ON_CREATE = (1 << 22),
200
201 /// @brief __0000 0000 1000 0000 0000 0000 0000 0000__ :\n This type should not appear on any create menus unless associated
202 /// with an @ref cpp_kodi_addon_pvr_Defs_epg_PVREPGTag "EPG tag" with
203 /// 'series' attributes.
204 ///
205 /// Following conditions allow this:
206 /// - @ref kodi::addon::PVREPGTag::SetFlags() have flag @ref EPG_TAG_FLAG_IS_SERIES
207 /// - @ref kodi::addon::PVREPGTag::SetSeriesNumber() > 0
208 /// - @ref kodi::addon::PVREPGTag::SetEpisodeNumber() > 0
209 /// - @ref kodi::addon::PVREPGTag::SetEpisodePartNumber() > 0
210 ///
211 /// Implies @ref PVR_TIMER_TYPE_REQUIRES_EPG_TAG_ON_CREATE.
212 PVR_TIMER_TYPE_REQUIRES_EPG_SERIES_ON_CREATE = (1 << 23),
213
214 /// @brief __0000 0001 0000 0000 0000 0000 0000 0000__ :\n This type supports 'any channel', for example when defining a timer
215 /// rule that should match any channel instaed of a particular channel.
216 PVR_TIMER_TYPE_SUPPORTS_ANY_CHANNEL = (1 << 24),
217
218 /// @brief __0000 0010 0000 0000 0000 0000 0000 0000__ :\n This type should not appear on any create menus which don't provide
219 /// an associated @ref cpp_kodi_addon_pvr_Defs_epg_PVREPGTag "EPG tag" with
220 /// a series link.
221 PVR_TIMER_TYPE_REQUIRES_EPG_SERIESLINK_ON_CREATE = (1 << 25),
222
223 /// @brief __0000 0100 0000 0000 0000 0000 0000 0000__ :\n This type allows deletion of an otherwise read-only timer.
224 PVR_TIMER_TYPE_SUPPORTS_READONLY_DELETE = (1 << 26),
225
226 /// @brief __0000 1000 0000 0000 0000 0000 0000 0000__ :\n Timers of this type do trigger a reminder if time is up.
227 PVR_TIMER_TYPE_IS_REMINDER = (1 << 27),
228
229 /// @brief __0001 0000 0000 0000 0000 0000 0000 0000__ :\n This type supports pre record time (@ref kodi::addon::PVRTimer::SetMarginStart()).
230 PVR_TIMER_TYPE_SUPPORTS_START_MARGIN = (1 << 28),
231
232 /// @brief __0010 0000 0000 0000 0000 0000 0000 0000__ :\n This type supports post record time (@ref kodi::addon::PVRTimer::SetMarginEnd()).
233 PVR_TIMER_TYPE_SUPPORTS_END_MARGIN = (1 << 29),
234 } PVR_TIMER_TYPES;
235 ///@}
236 //----------------------------------------------------------------------------
237
238 //============================================================================
239 /// @defgroup cpp_kodi_addon_pvr_Defs_Timer_PVR_WEEKDAY enum PVR_WEEKDAY
240 /// @ingroup cpp_kodi_addon_pvr_Defs_Timer
241 /// @brief **PVR timer weekdays** (@ref kodi::addon::PVRTimer::SetWeekdays() **values**)\n
242 /// Used to select the days of a week you want.
243 ///
244 /// It can be also used to select several days e.g.:
245 /// ~~~~~~~~~~~~~{.cpp}
246 /// ...
247 /// unsigned int day = PVR_WEEKDAY_MONDAY | PVR_WEEKDAY_SATURDAY;
248 /// ...
249 /// ~~~~~~~~~~~~~
250 ///
251 ///@{
252 typedef enum PVR_WEEKDAYS
253 {
254 /// @brief __0000 0000__ : Nothing selected.
255 PVR_WEEKDAY_NONE = 0,
256
257 /// @brief __0000 0001__ : To select Monday.
258 PVR_WEEKDAY_MONDAY = (1 << 0),
259
260 /// @brief __0000 0010__ : To select Tuesday.
261 PVR_WEEKDAY_TUESDAY = (1 << 1),
262
263 /// @brief __0000 0100__ : To select Wednesday.
264 PVR_WEEKDAY_WEDNESDAY = (1 << 2),
265
266 /// @brief __0000 1000__ : To select Thursday.
267 PVR_WEEKDAY_THURSDAY = (1 << 3),
268
269 /// @brief __0001 0000__ : To select Friday.
270 PVR_WEEKDAY_FRIDAY = (1 << 4),
271
272 /// @brief __0010 0000__ : To select Saturday.
273 PVR_WEEKDAY_SATURDAY = (1 << 5),
274
275 /// @brief __0100 0000__ : To select Sunday.
276 PVR_WEEKDAY_SUNDAY = (1 << 6),
277
278 /// @brief __0111 1111__ : To select all days of week.
279 PVR_WEEKDAY_ALLDAYS = PVR_WEEKDAY_MONDAY | PVR_WEEKDAY_TUESDAY | PVR_WEEKDAY_WEDNESDAY |
280 PVR_WEEKDAY_THURSDAY | PVR_WEEKDAY_FRIDAY | PVR_WEEKDAY_SATURDAY |
281 PVR_WEEKDAY_SUNDAY
282 } PVR_WEEKDAY;
283 ///@}
284 //----------------------------------------------------------------------------
285
286 //============================================================================
287 /// @defgroup cpp_kodi_addon_pvr_Defs_Timer_PVR_TIMER_STATE enum PVR_TIMER_STATE
288 /// @ingroup cpp_kodi_addon_pvr_Defs_Timer
289 /// @brief **PVR timer states**\n
290 /// To set within @ref cpp_kodi_addon_pvr_Defs_Timer_PVRTimer "kodi::addon::PVRTimer"
291 /// the needed state about.
292 ///
293 ///@{
294 typedef enum PVR_TIMER_STATE
295 {
296 /// @brief __0__ : The timer was just created on the backend and is not yet active.
297 ///
298 /// This state must not be used for timers just created on the client side.
299 PVR_TIMER_STATE_NEW = 0,
300
301 /// @brief __1__ : The timer is scheduled for recording.
302 PVR_TIMER_STATE_SCHEDULED = 1,
303
304 /// @brief __2__ : The timer is currently recordings.
305 PVR_TIMER_STATE_RECORDING = 2,
306
307 /// @brief __3__ : The recording completed successfully.
308 PVR_TIMER_STATE_COMPLETED = 3,
309
310 /// @brief __4__ : Recording started, but was aborted.
311 PVR_TIMER_STATE_ABORTED = 4,
312
313 /// @brief __5__ : The timer was scheduled, but was canceled.
314 PVR_TIMER_STATE_CANCELLED = 5,
315
316 /// @brief __6__ : The scheduled timer conflicts with another one, but will be
317 /// recorded.
318 PVR_TIMER_STATE_CONFLICT_OK = 6,
319
320 /// @brief __7__ : The scheduled timer conflicts with another one and won't be
321 /// recorded.
322 PVR_TIMER_STATE_CONFLICT_NOK = 7,
323
324 /// @brief __8__ : The timer is scheduled, but can't be recorded for some reason.
325 PVR_TIMER_STATE_ERROR = 8,
326
327 /// @brief __9__ : The timer was disabled by the user, can be enabled via setting
328 /// the state to @ref PVR_TIMER_STATE_SCHEDULED.
329 PVR_TIMER_STATE_DISABLED = 9,
330 } PVR_TIMER_STATE;
331 ///@}
332 //----------------------------------------------------------------------------
333
334 /*!
335 * @brief "C" PVR add-on timer event.
336 *
337 * Structure used to interface in "C" between Kodi and Addon.
338 *
339 * See @ref cpp_kodi_addon_pvr_Defs_Timer_PVRTimer "kodi::addon::PVRTimer" for
340 * description of values.
341 */
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
373 /*!
374 * @brief "C" PVR add-on timer event type.
375 *
376 * Structure used to interface in "C" between Kodi and Addon.
377 *
378 * See @ref cpp_kodi_addon_pvr_Defs_Timer_PVRTimerType "kodi::addon::PVRTimerType" for
379 * description of values.
380 */
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 */