2 * Copyright (C) 2012-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
11 #include "addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr.h"
21 class CPVRClientCapabilities
24 CPVRClientCapabilities() = default;
25 virtual ~CPVRClientCapabilities() = default;
27 CPVRClientCapabilities(const CPVRClientCapabilities
& other
);
28 const CPVRClientCapabilities
& operator=(const CPVRClientCapabilities
& other
);
30 const CPVRClientCapabilities
& operator=(const PVR_ADDON_CAPABILITIES
& addonCapabilities
);
34 /////////////////////////////////////////////////////////////////////////////////
38 /////////////////////////////////////////////////////////////////////////////////
41 * @brief Check whether this add-on supports TV channels.
42 * @return True if supported, false otherwise.
44 bool SupportsTV() const { return m_addonCapabilities
&& m_addonCapabilities
->bSupportsTV
; }
47 * @brief Check whether this add-on supports radio channels.
48 * @return True if supported, false otherwise.
50 bool SupportsRadio() const { return m_addonCapabilities
&& m_addonCapabilities
->bSupportsRadio
; }
53 * @brief Check whether this add-on supports providers.
54 * @return True if supported, false otherwise.
56 bool SupportsProviders() const
58 return m_addonCapabilities
&& m_addonCapabilities
->bSupportsProviders
;
62 * @brief Check whether this add-on supports channel groups.
63 * @return True if supported, false otherwise.
65 bool SupportsChannelGroups() const
67 return m_addonCapabilities
&& m_addonCapabilities
->bSupportsChannelGroups
;
71 * @brief Check whether this add-on supports scanning for new channels on the backend.
72 * @return True if supported, false otherwise.
74 bool SupportsChannelScan() const
76 return m_addonCapabilities
&& m_addonCapabilities
->bSupportsChannelScan
;
80 * @brief Check whether this add-on supports the following functions:
81 * DeleteChannel, RenameChannel, DialogChannelSettings and DialogAddChannel.
83 * @return True if supported, false otherwise.
85 bool SupportsChannelSettings() const
87 return m_addonCapabilities
&& m_addonCapabilities
->bSupportsChannelSettings
;
91 * @brief Check whether this add-on supports descramble information for playing channels.
92 * @return True if supported, false otherwise.
94 bool SupportsDescrambleInfo() const
96 return m_addonCapabilities
&& m_addonCapabilities
->bSupportsDescrambleInfo
;
99 /////////////////////////////////////////////////////////////////////////////////
103 /////////////////////////////////////////////////////////////////////////////////
106 * @brief Check whether this add-on provides EPG information.
107 * @return True if supported, false otherwise.
109 bool SupportsEPG() const { return m_addonCapabilities
&& m_addonCapabilities
->bSupportsEPG
; }
112 * @brief Check whether this add-on supports asynchronous transfer of epg events.
113 * @return True if supported, false otherwise.
115 bool SupportsAsyncEPGTransfer() const
117 return m_addonCapabilities
&& m_addonCapabilities
->bSupportsAsyncEPGTransfer
;
120 /////////////////////////////////////////////////////////////////////////////////
124 /////////////////////////////////////////////////////////////////////////////////
127 * @brief Check whether this add-on supports the creation and editing of timers.
128 * @return True if supported, false otherwise.
130 bool SupportsTimers() const
132 return m_addonCapabilities
&& m_addonCapabilities
->bSupportsTimers
;
135 /////////////////////////////////////////////////////////////////////////////////
139 /////////////////////////////////////////////////////////////////////////////////
142 * @brief Check whether this add-on supports recordings.
143 * @return True if supported, false otherwise.
145 bool SupportsRecordings() const
147 return m_addonCapabilities
&& m_addonCapabilities
->bSupportsRecordings
;
151 * @brief Check whether this add-on supports undelete of deleted recordings.
152 * @return True if supported, false otherwise.
154 bool SupportsRecordingsUndelete() const
156 return m_addonCapabilities
&& m_addonCapabilities
->bSupportsRecordings
&&
157 m_addonCapabilities
->bSupportsRecordingsUndelete
;
161 * @brief Check whether this add-on supports play count for recordings.
162 * @return True if supported, false otherwise.
164 bool SupportsRecordingsPlayCount() const
166 return m_addonCapabilities
&& m_addonCapabilities
->bSupportsRecordings
&&
167 m_addonCapabilities
->bSupportsRecordingPlayCount
;
171 * @brief Check whether this add-on supports store/retrieve of last played position for recordings..
172 * @return True if supported, false otherwise.
174 bool SupportsRecordingsLastPlayedPosition() const
176 return m_addonCapabilities
&& m_addonCapabilities
->bSupportsRecordings
&&
177 m_addonCapabilities
->bSupportsLastPlayedPosition
;
181 * @brief Check whether this add-on supports retrieving an edit decision list for recordings.
182 * @return True if supported, false otherwise.
184 bool SupportsRecordingsEdl() const
186 return m_addonCapabilities
&& m_addonCapabilities
->bSupportsRecordings
&&
187 m_addonCapabilities
->bSupportsRecordingEdl
;
191 * @brief Check whether this add-on supports retrieving an edit decision list for epg tags.
192 * @return True if supported, false otherwise.
194 bool SupportsEpgTagEdl() const
196 return m_addonCapabilities
&& m_addonCapabilities
->bSupportsEPG
&&
197 m_addonCapabilities
->bSupportsEPGEdl
;
201 * @brief Check whether this add-on supports renaming recordings..
202 * @return True if supported, false otherwise.
204 bool SupportsRecordingsRename() const
206 return m_addonCapabilities
&& m_addonCapabilities
->bSupportsRecordings
&&
207 m_addonCapabilities
->bSupportsRecordingsRename
;
211 * @brief Check whether this add-on supports changing lifetime of recording.
212 * @return True if supported, false otherwise.
214 bool SupportsRecordingsLifetimeChange() const
216 return m_addonCapabilities
&& m_addonCapabilities
->bSupportsRecordings
&&
217 m_addonCapabilities
->bSupportsRecordingsLifetimeChange
;
221 * @brief Obtain a list with all possible values for recordings lifetime.
222 * @param list out, the list with the values or an empty list, if lifetime is not supported.
224 void GetRecordingsLifetimeValues(std::vector
<std::pair
<std::string
, int>>& list
) const;
227 * @brief Check whether this add-on supports retrieving the size recordings..
228 * @return True if supported, false otherwise.
230 bool SupportsRecordingsSize() const
232 return m_addonCapabilities
&& m_addonCapabilities
->bSupportsRecordings
&&
233 m_addonCapabilities
->bSupportsRecordingSize
;
237 * @brief Check whether this add-on supports deleting recordings.
238 * @return True if supported, false otherwise.
240 bool SupportsRecordingsDelete() const
242 return m_addonCapabilities
&& m_addonCapabilities
->bSupportsRecordings
&&
243 m_addonCapabilities
->bSupportsRecordingsDelete
;
246 /////////////////////////////////////////////////////////////////////////////////
250 /////////////////////////////////////////////////////////////////////////////////
253 * @brief Check whether this add-on provides an input stream. false if Kodi handles the stream.
254 * @return True if supported, false otherwise.
256 bool HandlesInputStream() const
258 return m_addonCapabilities
&& m_addonCapabilities
->bHandlesInputStream
;
262 * @brief Check whether this add-on demultiplexes packets.
263 * @return True if supported, false otherwise.
265 bool HandlesDemuxing() const
267 return m_addonCapabilities
&& m_addonCapabilities
->bHandlesDemuxing
;
271 void InitRecordingsLifetimeValues();
273 std::unique_ptr
<PVR_ADDON_CAPABILITIES
> m_addonCapabilities
;
274 std::vector
<std::pair
<std::string
, int>> m_recordingsLifetimeValues
;