Permalink
Browse files

pvr: moved and renamed PVR_HANDLE from xbmc_pvr_types.h to ADDON_HAND…

…LE in xbmc_addon_types.h
  • Loading branch information...
1 parent b5fc9b4 commit 608d5e0c90bb63a89950079b6e9fc57f50cf3012 Lars Op den Kamp committed Apr 21, 2012
@@ -78,19 +78,19 @@ class CHelper_libXBMC_pvr
dlsym(m_libXBMC_pvr, "PVR_unregister_me");
if (PVR_unregister_me == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; }
- TransferEpgEntry = (void (*)(const PVR_HANDLE handle, const EPG_TAG *epgentry))
+ TransferEpgEntry = (void (*)(const ADDON_HANDLE handle, const EPG_TAG *epgentry))
dlsym(m_libXBMC_pvr, "PVR_transfer_epg_entry");
if (TransferEpgEntry == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; }
- TransferChannelEntry = (void (*)(const PVR_HANDLE handle, const PVR_CHANNEL *chan))
+ TransferChannelEntry = (void (*)(const ADDON_HANDLE handle, const PVR_CHANNEL *chan))
dlsym(m_libXBMC_pvr, "PVR_transfer_channel_entry");
if (TransferChannelEntry == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; }
- TransferTimerEntry = (void (*)(const PVR_HANDLE handle, const PVR_TIMER *timer))
+ TransferTimerEntry = (void (*)(const ADDON_HANDLE handle, const PVR_TIMER *timer))
dlsym(m_libXBMC_pvr, "PVR_transfer_timer_entry");
if (TransferTimerEntry == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; }
- TransferRecordingEntry = (void (*)(const PVR_HANDLE handle, const PVR_RECORDING *recording))
+ TransferRecordingEntry = (void (*)(const ADDON_HANDLE handle, const PVR_RECORDING *recording))
dlsym(m_libXBMC_pvr, "PVR_transfer_recording_entry");
if (TransferRecordingEntry == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; }
@@ -118,11 +118,11 @@ class CHelper_libXBMC_pvr
dlsym(m_libXBMC_pvr, "PVR_trigger_channel_groups_update");
if (TriggerChannelGroupsUpdate == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; }
- TransferChannelGroup = (void (*)(const PVR_HANDLE handle, const PVR_CHANNEL_GROUP *group))
+ TransferChannelGroup = (void (*)(const ADDON_HANDLE handle, const PVR_CHANNEL_GROUP *group))
dlsym(m_libXBMC_pvr, "PVR_transfer_channel_group");
if (TransferChannelGroup == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; }
- TransferChannelGroupMember = (void (*)(const PVR_HANDLE handle, const PVR_CHANNEL_GROUP_MEMBER *member))
+ TransferChannelGroupMember = (void (*)(const ADDON_HANDLE handle, const PVR_CHANNEL_GROUP_MEMBER *member))
dlsym(m_libXBMC_pvr, "PVR_transfer_channel_group_member");
if (TransferChannelGroupMember == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; }
@@ -139,18 +139,18 @@ class CHelper_libXBMC_pvr
return PVR_register_me(m_Handle) > 0;
}
- void (*TransferEpgEntry)(const PVR_HANDLE handle, const EPG_TAG *epgentry);
- void (*TransferChannelEntry)(const PVR_HANDLE handle, const PVR_CHANNEL *chan);
- void (*TransferTimerEntry)(const PVR_HANDLE handle, const PVR_TIMER *timer);
- void (*TransferRecordingEntry)(const PVR_HANDLE handle, const PVR_RECORDING *recording);
+ void (*TransferEpgEntry)(const ADDON_HANDLE handle, const EPG_TAG *epgentry);
+ void (*TransferChannelEntry)(const ADDON_HANDLE handle, const PVR_CHANNEL *chan);
+ void (*TransferTimerEntry)(const ADDON_HANDLE handle, const PVR_TIMER *timer);
+ void (*TransferRecordingEntry)(const ADDON_HANDLE handle, const PVR_RECORDING *recording);
void (*AddMenuHook)(PVR_MENUHOOK *hook);
void (*Recording)(const char *Name, const char *FileName, bool On);
void (*TriggerTimerUpdate)();
void (*TriggerRecordingUpdate)();
void (*TriggerChannelUpdate)();
void (*TriggerChannelGroupsUpdate)();
- void (*TransferChannelGroup)(const PVR_HANDLE handle, const PVR_CHANNEL_GROUP *group);
- void (*TransferChannelGroupMember)(const PVR_HANDLE handle, const PVR_CHANNEL_GROUP_MEMBER *member);
+ void (*TransferChannelGroup)(const ADDON_HANDLE handle, const PVR_CHANNEL_GROUP *group);
+ void (*TransferChannelGroupMember)(const ADDON_HANDLE handle, const PVR_CHANNEL_GROUP_MEMBER *member);
#ifdef USE_DEMUX
void (*FreeDemuxPacket)(DemuxPacket* pPacket);
DemuxPacket* (*AllocateDemuxPacket)(int iDataSize);
@@ -66,31 +66,31 @@ DLLEXPORT void PVR_unregister_me()
m_Handle->PVRLib_UnRegisterMe(m_Handle->addonData, m_cb);
}
-DLLEXPORT void PVR_transfer_epg_entry(const PVR_HANDLE handle, const EPG_TAG *epgentry)
+DLLEXPORT void PVR_transfer_epg_entry(const ADDON_HANDLE handle, const EPG_TAG *epgentry)
{
if (m_cb == NULL)
return;
m_cb->TransferEpgEntry(m_Handle->addonData, handle, epgentry);
}
-DLLEXPORT void PVR_transfer_channel_entry(const PVR_HANDLE handle, const PVR_CHANNEL *chan)
+DLLEXPORT void PVR_transfer_channel_entry(const ADDON_HANDLE handle, const PVR_CHANNEL *chan)
{
if (m_cb == NULL)
return;
m_cb->TransferChannelEntry(m_Handle->addonData, handle, chan);
}
-DLLEXPORT void PVR_transfer_timer_entry(const PVR_HANDLE handle, const PVR_TIMER *timer)
+DLLEXPORT void PVR_transfer_timer_entry(const ADDON_HANDLE handle, const PVR_TIMER *timer)
{
if (m_cb == NULL)
return;
m_cb->TransferTimerEntry(m_Handle->addonData, handle, timer);
}
-DLLEXPORT void PVR_transfer_recording_entry(const PVR_HANDLE handle, const PVR_RECORDING *recording)
+DLLEXPORT void PVR_transfer_recording_entry(const ADDON_HANDLE handle, const PVR_RECORDING *recording)
{
if (m_cb == NULL)
return;
@@ -162,15 +162,15 @@ DLLEXPORT DemuxPacket* PVR_allocate_demux_packet(int iDataSize)
return m_cb->AllocateDemuxPacket(m_Handle->addonData, iDataSize);
}
-DLLEXPORT void PVR_transfer_channel_group(const PVR_HANDLE handle, const PVR_CHANNEL_GROUP *group)
+DLLEXPORT void PVR_transfer_channel_group(const ADDON_HANDLE handle, const PVR_CHANNEL_GROUP *group)
{
if (m_cb == NULL)
return;
m_cb->TransferChannelGroup(m_Handle->addonData, handle, group);
}
-DLLEXPORT void PVR_transfer_channel_group_member(const PVR_HANDLE handle, const PVR_CHANNEL_GROUP_MEMBER *member)
+DLLEXPORT void PVR_transfer_channel_group_member(const ADDON_HANDLE handle, const PVR_CHANNEL_GROUP_MEMBER *member)
{
if (m_cb == NULL)
return;
@@ -174,19 +174,19 @@ typedef struct CB_GUILib
} CB_GUILib;
-typedef void (*PVRTransferEpgEntry)(void *userData, const PVR_HANDLE handle, const EPG_TAG *epgentry);
-typedef void (*PVRTransferChannelEntry)(void *userData, const PVR_HANDLE handle, const PVR_CHANNEL *chan);
-typedef void (*PVRTransferTimerEntry)(void *userData, const PVR_HANDLE handle, const PVR_TIMER *timer);
-typedef void (*PVRTransferRecordingEntry)(void *userData, const PVR_HANDLE handle, const PVR_RECORDING *recording);
+typedef void (*PVRTransferEpgEntry)(void *userData, const ADDON_HANDLE handle, const EPG_TAG *epgentry);
+typedef void (*PVRTransferChannelEntry)(void *userData, const ADDON_HANDLE handle, const PVR_CHANNEL *chan);
+typedef void (*PVRTransferTimerEntry)(void *userData, const ADDON_HANDLE handle, const PVR_TIMER *timer);
+typedef void (*PVRTransferRecordingEntry)(void *userData, const ADDON_HANDLE handle, const PVR_RECORDING *recording);
typedef void (*PVRAddMenuHook)(void *addonData, PVR_MENUHOOK *hook);
typedef void (*PVRRecording)(void *addonData, const char *Name, const char *FileName, bool On);
typedef void (*PVRTriggerChannelUpdate)(void *addonData);
typedef void (*PVRTriggerTimerUpdate)(void *addonData);
typedef void (*PVRTriggerRecordingUpdate)(void *addonData);
typedef void (*PVRTriggerChannelGroupsUpdate)(void *addonData);
-typedef void (*PVRTransferChannelGroup)(void *addonData, const PVR_HANDLE handle, const PVR_CHANNEL_GROUP *group);
-typedef void (*PVRTransferChannelGroupMember)(void *addonData, const PVR_HANDLE handle, const PVR_CHANNEL_GROUP_MEMBER *member);
+typedef void (*PVRTransferChannelGroup)(void *addonData, const ADDON_HANDLE handle, const PVR_CHANNEL_GROUP *group);
+typedef void (*PVRTransferChannelGroupMember)(void *addonData, const ADDON_HANDLE handle, const PVR_CHANNEL_GROUP_MEMBER *member);
typedef void (*PVRFreeDemuxPacket)(void *addonData, DemuxPacket* pPacket);
typedef DemuxPacket* (*PVRAllocateDemuxPacket)(void *addonData, int iDataSize);
@@ -80,7 +80,7 @@ CPVRClient *CAddonCallbacksPVR::GetPVRClient(void *addonData)
return dynamic_cast<CPVRClient *>(addon->GetHelperPVR()->m_addon);
}
-void CAddonCallbacksPVR::PVRTransferChannelGroup(void *addonData, const PVR_HANDLE handle, const PVR_CHANNEL_GROUP *group)
+void CAddonCallbacksPVR::PVRTransferChannelGroup(void *addonData, const ADDON_HANDLE handle, const PVR_CHANNEL_GROUP *group)
{
CPVRChannelGroups *xbmcGroups = static_cast<CPVRChannelGroups *>(handle->dataAddress);
if (!handle || !group || !xbmcGroups)
@@ -99,7 +99,7 @@ void CAddonCallbacksPVR::PVRTransferChannelGroup(void *addonData, const PVR_HAND
xbmcGroups->UpdateFromClient(CPVRChannelGroup(*group));
}
-void CAddonCallbacksPVR::PVRTransferChannelGroupMember(void *addonData, const PVR_HANDLE handle, const PVR_CHANNEL_GROUP_MEMBER *member)
+void CAddonCallbacksPVR::PVRTransferChannelGroupMember(void *addonData, const ADDON_HANDLE handle, const PVR_CHANNEL_GROUP_MEMBER *member)
{
CPVRClient *client = GetPVRClient(addonData);
CPVRChannelGroup *group = static_cast<CPVRChannelGroup *>(handle->dataAddress);
@@ -121,7 +121,7 @@ void CAddonCallbacksPVR::PVRTransferChannelGroupMember(void *addonData, const PV
}
}
-void CAddonCallbacksPVR::PVRTransferEpgEntry(void *addonData, const PVR_HANDLE handle, const EPG_TAG *epgentry)
+void CAddonCallbacksPVR::PVRTransferEpgEntry(void *addonData, const ADDON_HANDLE handle, const EPG_TAG *epgentry)
{
CEpg *xbmcEpg = static_cast<CEpg *>(handle->dataAddress);
if (!handle || !xbmcEpg)
@@ -134,7 +134,7 @@ void CAddonCallbacksPVR::PVRTransferEpgEntry(void *addonData, const PVR_HANDLE h
xbmcEpg->UpdateEntry(epgentry, handle->dataIdentifier == 1 /* update db */);
}
-void CAddonCallbacksPVR::PVRTransferChannelEntry(void *addonData, const PVR_HANDLE handle, const PVR_CHANNEL *channel)
+void CAddonCallbacksPVR::PVRTransferChannelEntry(void *addonData, const ADDON_HANDLE handle, const PVR_CHANNEL *channel)
{
CPVRClient *client = GetPVRClient(addonData);
CPVRChannelGroupInternal *xbmcChannels = static_cast<CPVRChannelGroupInternal *>(handle->dataAddress);
@@ -148,7 +148,7 @@ void CAddonCallbacksPVR::PVRTransferChannelEntry(void *addonData, const PVR_HAND
xbmcChannels->UpdateFromClient(CPVRChannel(*channel, client->GetClientID()));
}
-void CAddonCallbacksPVR::PVRTransferRecordingEntry(void *addonData, const PVR_HANDLE handle, const PVR_RECORDING *recording)
+void CAddonCallbacksPVR::PVRTransferRecordingEntry(void *addonData, const ADDON_HANDLE handle, const PVR_RECORDING *recording)
{
CPVRClient *client = GetPVRClient(addonData);
CPVRRecordings *xbmcRecordings = static_cast<CPVRRecordings *>(handle->dataAddress);
@@ -162,7 +162,7 @@ void CAddonCallbacksPVR::PVRTransferRecordingEntry(void *addonData, const PVR_HA
xbmcRecordings->UpdateFromClient(CPVRRecording(*recording, client->GetClientID()));
}
-void CAddonCallbacksPVR::PVRTransferTimerEntry(void *addonData, const PVR_HANDLE handle, const PVR_TIMER *timer)
+void CAddonCallbacksPVR::PVRTransferTimerEntry(void *addonData, const ADDON_HANDLE handle, const PVR_TIMER *timer)
{
CPVRClient *client = GetPVRClient(addonData);
CPVRTimers *xbmcTimers = static_cast<CPVRTimers *>(handle->dataAddress);
@@ -53,47 +53,47 @@ class CAddonCallbacksPVR
* @param handle The handle containing a pointer to the CPVRChannelGroups instance that this group needs to be added to.
* @param group The entry to transfer.
*/
- static void PVRTransferChannelGroup(void *addonData, const PVR_HANDLE handle, const PVR_CHANNEL_GROUP *group);
+ static void PVRTransferChannelGroup(void *addonData, const ADDON_HANDLE handle, const PVR_CHANNEL_GROUP *group);
/*!
* @brief Transfer a channel group member from the add-on to XBMC. The channel will be added to the group if the group can be found.
* @param addonData A pointer to the add-on.
* @param handle The handle that initiated this action.
* @param member The entry to transfer.
*/
- static void PVRTransferChannelGroupMember(void *addonData, const PVR_HANDLE handle, const PVR_CHANNEL_GROUP_MEMBER *member);
+ static void PVRTransferChannelGroupMember(void *addonData, const ADDON_HANDLE handle, const PVR_CHANNEL_GROUP_MEMBER *member);
/*!
* @brief Transfer an EPG entry from the add-on to XBMC.
* @param addonData A pointer to the add-on.
* @param handle The handle that initiated this action.
* @param epgentry The entry to transfer.
*/
- static void PVRTransferEpgEntry(void *addonData, const PVR_HANDLE handle, const EPG_TAG *epgentry);
+ static void PVRTransferEpgEntry(void *addonData, const ADDON_HANDLE handle, const EPG_TAG *epgentry);
/*!
* @brief Transfer a channel entry from the add-on to XBMC.
* @param addonData A pointer to the add-on.
* @param handle The handle that initiated this action.
* @param channel The entry to transfer.
*/
- static void PVRTransferChannelEntry(void *addonData, const PVR_HANDLE handle, const PVR_CHANNEL *channel);
+ static void PVRTransferChannelEntry(void *addonData, const ADDON_HANDLE handle, const PVR_CHANNEL *channel);
/*!
* @brief Transfer a timer entry from the add-on to XBMC.
* @param addonData A pointer to the add-on.
* @param handle The handle that initiated this action.
* @param timer The entry to transfer.
*/
- static void PVRTransferTimerEntry(void *addonData, const PVR_HANDLE handle, const PVR_TIMER *timer);
+ static void PVRTransferTimerEntry(void *addonData, const ADDON_HANDLE handle, const PVR_TIMER *timer);
/*!
* @brief Transfer a recording entry from the add-on to XBMC.
* @param addonData A pointer to the add-on.
* @param handle The handle that initiated this action.
* @param recording The entry to transfer.
*/
- static void PVRTransferRecordingEntry(void *addonData, const PVR_HANDLE handle, const PVR_RECORDING *recording);
+ static void PVRTransferRecordingEntry(void *addonData, const ADDON_HANDLE handle, const PVR_RECORDING *recording);
/*!
* @brief Add a menu hook to this add-on table.
@@ -46,6 +46,17 @@ typedef struct
unsigned int entry_elements;
} ADDON_StructSetting;
+/*!
+ * @brief Handle used to return data from the PVR add-on to CPVRClient
+ */
+struct ADDON_HANDLE_STRUCT
+{
+ void *callerAddress; /*!< address of the caller */
+ void *dataAddress; /*!< address to store data in */
+ int dataIdentifier; /*!< parameter to pass back when calling the callback */
+};
+typedef ADDON_HANDLE_STRUCT *ADDON_HANDLE;
+
#ifdef __cplusplus
};
#endif
@@ -94,7 +94,7 @@ extern "C"
* @param iEnd The end time to use.
* @return PVR_ERROR_NO_ERROR if the table has been fetched successfully.
*/
- PVR_ERROR GetEPGForChannel(PVR_HANDLE handle, const PVR_CHANNEL &channel, time_t iStart, time_t iEnd);
+ PVR_ERROR GetEPGForChannel(ADDON_HANDLE handle, const PVR_CHANNEL &channel, time_t iStart, time_t iEnd);
//@}
/** @name PVR channel group methods */
@@ -110,15 +110,15 @@ extern "C"
* @param bRadio True to get the radio channel groups, false to get the TV channel groups.
* @return PVR_ERROR_NO_ERROR if the list has been fetched successfully.
*/
- PVR_ERROR GetChannelGroups(PVR_HANDLE handle, bool bRadio);
+ PVR_ERROR GetChannelGroups(ADDON_HANDLE handle, bool bRadio);
/*!
* @brief Request the list of all group members of a group.
* @param handle Callback.
* @param group The group to get the members for.
* @return PVR_ERROR_NO_ERROR if the list has been fetched successfully.
*/
- PVR_ERROR GetChannelGroupMembers(PVR_HANDLE handle, const PVR_CHANNEL_GROUP &group);
+ PVR_ERROR GetChannelGroupMembers(ADDON_HANDLE handle, const PVR_CHANNEL_GROUP &group);
//@}
/** @name PVR channel methods */
@@ -134,7 +134,7 @@ extern "C"
* @param bRadio True to get the radio channels, false to get the TV channels.
* @return PVR_ERROR_NO_ERROR if the list has been fetched successfully.
*/
- PVR_ERROR GetChannels(PVR_HANDLE handle, bool bRadio);
+ PVR_ERROR GetChannels(ADDON_HANDLE handle, bool bRadio);
/*!
* @brief Delete a channel.
@@ -185,7 +185,7 @@ extern "C"
* @param handle The callback handle.
* @return PVR_ERROR_NO_ERROR if the recordings have been fetched successfully.
*/
- PVR_ERROR GetRecordings(PVR_HANDLE handle);
+ PVR_ERROR GetRecordings(ADDON_HANDLE handle);
/*!
* @brief Delete a recording on the backend.
@@ -215,7 +215,7 @@ extern "C"
* @param handle The callback handle.
* @return PVR_ERROR_NO_ERROR if the list has been fetched successfully.
*/
- PVR_ERROR GetTimers(PVR_HANDLE handle);
+ PVR_ERROR GetTimers(ADDON_HANDLE handle);
/*!
* @brief Add a timer on the backend.
@@ -35,6 +35,8 @@
#endif
#include <string.h>
+#include "xbmc_addon_types.h"
+
/*! @note Define "USE_DEMUX" on compile time if demuxing inside pvr
* addon is used. Also XBMC's "DVDDemuxPacket.h" file must be inside
* the include path of the pvr addon.
@@ -90,17 +92,6 @@ struct DemuxPacket;
extern "C" {
#endif
- /*!
- * @brief Handle used to return data from the PVR add-on to CPVRClient
- */
- struct PVR_HANDLE_STRUCT
- {
- void *callerAddress; /*!< address of the caller */
- void *dataAddress; /*!< address to store data in */
- int dataIdentifier; /*!< parameter to pass back when calling the callback */
- };
- typedef PVR_HANDLE_STRUCT *PVR_HANDLE;
-
/*! \brief PVR Client Error Codes
*/
typedef enum
@@ -331,20 +322,20 @@ extern "C" {
/** @name PVR EPG methods */
//@{
- PVR_ERROR (__cdecl* GetEpg)(PVR_HANDLE handle, const PVR_CHANNEL &channel, time_t iStart, time_t iEnd);
+ PVR_ERROR (__cdecl* GetEpg)(ADDON_HANDLE handle, const PVR_CHANNEL &channel, time_t iStart, time_t iEnd);
//@}
/** @name PVR channel group methods */
//@{
int (__cdecl* GetChannelGroupsAmount)(void);
- PVR_ERROR (__cdecl* GetChannelGroups)(PVR_HANDLE handle, bool bRadio);
- PVR_ERROR (__cdecl* GetChannelGroupMembers)(PVR_HANDLE handle, const PVR_CHANNEL_GROUP &group);
+ PVR_ERROR (__cdecl* GetChannelGroups)(ADDON_HANDLE handle, bool bRadio);
+ PVR_ERROR (__cdecl* GetChannelGroupMembers)(ADDON_HANDLE handle, const PVR_CHANNEL_GROUP &group);
//@}
/** @name PVR channel methods */
//@{
int (__cdecl* GetChannelsAmount)(void);
- PVR_ERROR (__cdecl* GetChannels)(PVR_HANDLE handle, bool bRadio);
+ PVR_ERROR (__cdecl* GetChannels)(ADDON_HANDLE handle, bool bRadio);
PVR_ERROR (__cdecl* DeleteChannel)(const PVR_CHANNEL &channel);
PVR_ERROR (__cdecl* RenameChannel)(const PVR_CHANNEL &channel);
PVR_ERROR (__cdecl* MoveChannel)(const PVR_CHANNEL &channel);
@@ -355,15 +346,15 @@ extern "C" {
/** @name PVR recording methods */
//@{
int (__cdecl* GetRecordingsAmount)(void);
- PVR_ERROR (__cdecl* GetRecordings)(PVR_HANDLE handle);
+ PVR_ERROR (__cdecl* GetRecordings)(ADDON_HANDLE handle);
PVR_ERROR (__cdecl* DeleteRecording)(const PVR_RECORDING &recording);
PVR_ERROR (__cdecl* RenameRecording)(const PVR_RECORDING &recording);
//@}
/** @name PVR timer methods */
//@{
int (__cdecl* GetTimersAmount)(void);
- PVR_ERROR (__cdecl* GetTimers)(PVR_HANDLE handle);
+ PVR_ERROR (__cdecl* GetTimers)(ADDON_HANDLE handle);
PVR_ERROR (__cdecl* AddTimer)(const PVR_TIMER &timer);
PVR_ERROR (__cdecl* DeleteTimer)(const PVR_TIMER &timer, bool bForceDelete);
PVR_ERROR (__cdecl* UpdateTimer)(const PVR_TIMER &timer);
Oops, something went wrong.

0 comments on commit 608d5e0

Please sign in to comment.