summaryrefslogtreecommitdiffstats
path: root/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_pvr.h
diff options
context:
space:
mode:
authormanuel <manuel@mausz.at>2020-07-02 23:09:26 +0200
committermanuel <manuel@mausz.at>2020-07-02 23:09:26 +0200
commit5f8335c1e49ce108ef3481863833c98efa00411b (patch)
treef02b5c1c9765bb6a14c8eb42bb4f81b9face0b55 /xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_pvr.h
parente317daf081a1048904fdf0b548946fa3ba6593a7 (diff)
downloadkodi-pvr-build-5f8335c1e49ce108ef3481863833c98efa00411b.tar.gz
kodi-pvr-build-5f8335c1e49ce108ef3481863833c98efa00411b.tar.bz2
kodi-pvr-build-5f8335c1e49ce108ef3481863833c98efa00411b.zip
sync with upstreamHEADmaster
Diffstat (limited to 'xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_pvr.h')
-rw-r--r--xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_pvr.h235
1 files changed, 0 insertions, 235 deletions
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_pvr.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_pvr.h
deleted file mode 100644
index 2a94f75..0000000
--- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_pvr.h
+++ /dev/null
@@ -1,235 +0,0 @@
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#include <string>
12#include <vector>
13#include <string.h>
14#include <stdlib.h>
15#include <stdio.h>
16#include "xbmc_pvr_types.h"
17#include "libXBMC_addon.h"
18
19#define DVD_TIME_BASE 1000000
20
21//! @todo original definition is in DVDClock.h
22#define DVD_NOPTS_VALUE 0xFFF0000000000000
23
24class CHelper_libXBMC_pvr
25{
26public:
27 CHelper_libXBMC_pvr(void)
28 {
29 m_Handle = nullptr;
30 m_Callbacks = nullptr;
31 }
32
33 ~CHelper_libXBMC_pvr(void)
34 {
35 if (m_Handle && m_Callbacks)
36 {
37 m_Handle->PVRLib_UnRegisterMe(m_Handle->addonData, m_Callbacks);
38 }
39 }
40
41 /*!
42 * @brief Resolve all callback methods
43 * @param handle Pointer to the add-on
44 * @return True when all methods were resolved, false otherwise.
45 */
46 bool RegisterMe(void* handle)
47 {
48 m_Handle = static_cast<AddonCB*>(handle);
49 if (m_Handle)
50 m_Callbacks = (AddonInstance_PVR*)m_Handle->PVRLib_RegisterMe(m_Handle->addonData);
51 if (!m_Callbacks)
52 fprintf(stderr, "libXBMC_pvr-ERROR: PVRLib_register_me can't get callback table from Kodi !!!\n");
53
54 return m_Callbacks != NULL;
55 }
56
57 /*!
58 * @brief Transfer an EPG tag from the add-on to XBMC
59 * @param handle The handle parameter that XBMC used when requesting the EPG data
60 * @param entry The entry to transfer to XBMC
61 */
62 void TransferEpgEntry(const ADDON_HANDLE handle, const EPG_TAG* entry)
63 {
64 return m_Callbacks->toKodi.TransferEpgEntry(m_Callbacks->toKodi.kodiInstance, handle, entry);
65 }
66
67 /*!
68 * @brief Transfer a channel entry from the add-on to XBMC
69 * @param handle The handle parameter that XBMC used when requesting the channel list
70 * @param entry The entry to transfer to XBMC
71 */
72 void TransferChannelEntry(const ADDON_HANDLE handle, const PVR_CHANNEL* entry)
73 {
74 return m_Callbacks->toKodi.TransferChannelEntry(m_Callbacks->toKodi.kodiInstance, handle, entry);
75 }
76
77 /*!
78 * @brief Transfer a timer entry from the add-on to XBMC
79 * @param handle The handle parameter that XBMC used when requesting the timers list
80 * @param entry The entry to transfer to XBMC
81 */
82 void TransferTimerEntry(const ADDON_HANDLE handle, const PVR_TIMER* entry)
83 {
84 return m_Callbacks->toKodi.TransferTimerEntry(m_Callbacks->toKodi.kodiInstance, handle, entry);
85 }
86
87 /*!
88 * @brief Transfer a recording entry from the add-on to XBMC
89 * @param handle The handle parameter that XBMC used when requesting the recordings list
90 * @param entry The entry to transfer to XBMC
91 */
92 void TransferRecordingEntry(const ADDON_HANDLE handle, const PVR_RECORDING* entry)
93 {
94 return m_Callbacks->toKodi.TransferRecordingEntry(m_Callbacks->toKodi.kodiInstance, handle, entry);
95 }
96
97 /*!
98 * @brief Transfer a channel group from the add-on to XBMC. The group will be created if it doesn't exist.
99 * @param handle The handle parameter that XBMC used when requesting the channel groups list
100 * @param entry The entry to transfer to XBMC
101 */
102 void TransferChannelGroup(const ADDON_HANDLE handle, const PVR_CHANNEL_GROUP* entry)
103 {
104 return m_Callbacks->toKodi.TransferChannelGroup(m_Callbacks->toKodi.kodiInstance, handle, entry);
105 }
106
107 /*!
108 * @brief Transfer a channel group member entry from the add-on to XBMC. The channel will be added to the group if the group can be found.
109 * @param handle The handle parameter that XBMC used when requesting the channel group members list
110 * @param entry The entry to transfer to XBMC
111 */
112 void TransferChannelGroupMember(const ADDON_HANDLE handle, const PVR_CHANNEL_GROUP_MEMBER* entry)
113 {
114 return m_Callbacks->toKodi.TransferChannelGroupMember(m_Callbacks->toKodi.kodiInstance, handle, entry);
115 }
116
117 /*!
118 * @brief Add or replace a menu hook for the context menu for this add-on
119 * @param hook The hook to add
120 */
121 void AddMenuHook(PVR_MENUHOOK* hook)
122 {
123 return m_Callbacks->toKodi.AddMenuHook(m_Callbacks->toKodi.kodiInstance, hook);
124 }
125
126 /*!
127 * @brief Display a notification in XBMC that a recording started or stopped on the server
128 * @param strRecordingName The name of the recording to display
129 * @param strFileName The filename of the recording
130 * @param bOn True when recording started, false when it stopped
131 */
132 void Recording(const char* strRecordingName, const char* strFileName, bool bOn)
133 {
134 return m_Callbacks->toKodi.Recording(m_Callbacks->toKodi.kodiInstance, strRecordingName, strFileName, bOn);
135 }
136
137 /*!
138 * @brief Request XBMC to update it's list of timers
139 */
140 void TriggerTimerUpdate(void)
141 {
142 return m_Callbacks->toKodi.TriggerTimerUpdate(m_Callbacks->toKodi.kodiInstance);
143 }
144
145 /*!
146 * @brief Request XBMC to update it's list of recordings
147 */
148 void TriggerRecordingUpdate(void)
149 {
150 return m_Callbacks->toKodi.TriggerRecordingUpdate(m_Callbacks->toKodi.kodiInstance);
151 }
152
153 /*!
154 * @brief Request XBMC to update it's list of channels
155 */
156 void TriggerChannelUpdate(void)
157 {
158 return m_Callbacks->toKodi.TriggerChannelUpdate(m_Callbacks->toKodi.kodiInstance);
159 }
160
161 /*!
162 * @brief Schedule an EPG update for the given channel channel
163 * @param iChannelUid The unique id of the channel for this add-on
164 */
165 void TriggerEpgUpdate(unsigned int iChannelUid)
166 {
167 return m_Callbacks->toKodi.TriggerEpgUpdate(m_Callbacks->toKodi.kodiInstance, iChannelUid);
168 }
169
170 /*!
171 * @brief Request XBMC to update it's list of channel groups
172 */
173 void TriggerChannelGroupsUpdate(void)
174 {
175 return m_Callbacks->toKodi.TriggerChannelGroupsUpdate(m_Callbacks->toKodi.kodiInstance);
176 }
177
178#ifdef USE_DEMUX
179 /*!
180 * @brief Free a packet that was allocated with AllocateDemuxPacket
181 * @param pPacket The packet to free
182 */
183 void FreeDemuxPacket(DemuxPacket* pPacket)
184 {
185 return m_Callbacks->toKodi.FreeDemuxPacket(m_Callbacks->toKodi.kodiInstance, pPacket);
186 }
187
188 /*!
189 * @brief Allocate a demux packet. Free with FreeDemuxPacket
190 * @param iDataSize The size of the data that will go into the packet
191 * @return The allocated packet
192 */
193 DemuxPacket* AllocateDemuxPacket(int iDataSize)
194 {
195 return m_Callbacks->toKodi.AllocateDemuxPacket(m_Callbacks->toKodi.kodiInstance, iDataSize);
196 }
197#endif
198
199 /*!
200 * @brief Notify a state change for a PVR backend connection
201 * @param strConnectionString The connection string reported by the backend that can be displayed in the UI.
202 * @param newState The new state.
203 * @param strMessage A localized addon-defined string representing the new state, that can be displayed
204 * in the UI or NULL if the Kodi-defined default string for the new state shall be displayed.
205 */
206 void ConnectionStateChange(const char *strConnectionString, PVR_CONNECTION_STATE newState, const char *strMessage)
207 {
208 return m_Callbacks->toKodi.ConnectionStateChange(m_Callbacks->toKodi.kodiInstance, strConnectionString, newState, strMessage);
209 }
210
211 /*!
212 * @brief Notify a state change for an EPG event
213 * @param tag The EPG event.
214 * @param newState The new state. For EPG_EVENT_CREATED and EPG_EVENT_UPDATED, tag must be filled with all available
215 * event data, not just a delta. For EPG_EVENT_DELETED, it is sufficient to fill EPG_TAG.iUniqueBroadcastId
216 */
217 void EpgEventStateChange(EPG_TAG *tag, EPG_EVENT_STATE newState)
218 {
219 return m_Callbacks->toKodi.EpgEventStateChange(m_Callbacks->toKodi.kodiInstance, tag, newState);
220 }
221
222 /*!
223 * @brief Get the codec id used by XBMC
224 * @param strCodecName The name of the codec
225 * @return The codec_id, or a codec_id with 0 values when not supported
226 */
227 xbmc_codec_t GetCodecByName(const char* strCodecName)
228 {
229 return m_Callbacks->toKodi.GetCodecByName(m_Callbacks->toKodi.kodiInstance, strCodecName);
230 }
231
232private:
233 AddonCB* m_Handle;
234 AddonInstance_PVR *m_Callbacks;
235};