diff options
author | Lars Op den Kamp <lars@opdenkamp.eu> | 2012-10-01 00:42:33 +0200 |
---|---|---|
committer | Lars Op den Kamp <lars@opdenkamp.eu> | 2012-10-01 00:42:41 +0200 |
commit | d57a93e54774dd226a18bc8a0a89231bef715bc1 (patch) | |
tree | 7112db581eaad200da4b0e391b6da56c8e57a8fe /lib | |
parent | b38ef436e1e139d26cda89afb8b6997708e47497 (diff) | |
parent | 20bd8cdb2ebef079b6876c48f946fe53a382c6e2 (diff) |
Merge pull request #1472 from 'fetzerch/bugfix-multiple-addons'.
[pvr] Fix problems with multiple PVR Addons running at the same time
Diffstat (limited to 'lib')
6 files changed, 269 insertions, 234 deletions
diff --git a/lib/addons/library.xbmc.addon/libXBMC_addon.cpp b/lib/addons/library.xbmc.addon/libXBMC_addon.cpp index b941be1e4e..a9308e5638 100644 --- a/lib/addons/library.xbmc.addon/libXBMC_addon.cpp +++ b/lib/addons/library.xbmc.addon/libXBMC_addon.cpp @@ -37,196 +37,229 @@ using namespace std; using namespace ADDON; -AddonCB *m_Handle = NULL; -CB_AddOnLib *m_cb = NULL; - extern "C" { -DLLEXPORT int XBMC_register_me(void *hdl) +DLLEXPORT void* XBMC_register_me(void *hdl) { + CB_AddOnLib *cb = NULL; if (!hdl) fprintf(stderr, "libXBMC_addon-ERROR: XBMC_register_me is called with NULL handle !!!\n"); else { - m_Handle = (AddonCB*) hdl; - m_cb = m_Handle->AddOnLib_RegisterMe(m_Handle->addonData); - if (!m_cb) + cb = ((AddonCB*)hdl)->AddOnLib_RegisterMe(((AddonCB*)hdl)->addonData); + if (!cb) fprintf(stderr, "libXBMC_addon-ERROR: XBMC_register_me can't get callback table from XBMC !!!\n"); - else - return 1; } - return 0; + return cb; } -DLLEXPORT void XBMC_unregister_me() +DLLEXPORT void XBMC_unregister_me(void *hdl, void* cb) { - if (m_Handle && m_cb) - m_Handle->AddOnLib_UnRegisterMe(m_Handle->addonData, m_cb); + if (hdl && cb) + ((AddonCB*)hdl)->AddOnLib_UnRegisterMe(((AddonCB*)hdl)->addonData, ((CB_AddOnLib*)cb)); } -DLLEXPORT void XBMC_log(const addon_log_t loglevel, const char *format, ... ) +DLLEXPORT void XBMC_log(void *hdl, void* cb, const addon_log_t loglevel, const char *msg) { - if (m_cb == NULL) + if (cb == NULL) return; - char buffer[16384]; - va_list args; - va_start (args, format); - vsprintf (buffer, format, args); - va_end (args); - m_cb->Log(m_Handle->addonData, loglevel, buffer); + ((CB_AddOnLib*)cb)->Log(((AddonCB*)hdl)->addonData, loglevel, msg); } -DLLEXPORT bool XBMC_get_setting(const char* settingName, void *settingValue) +DLLEXPORT bool XBMC_get_setting(void *hdl, void* cb, const char* settingName, void *settingValue) { - if (m_cb == NULL) + if (cb == NULL) return false; - return m_cb->GetSetting(m_Handle->addonData, settingName, settingValue); + return ((CB_AddOnLib*)cb)->GetSetting(((AddonCB*)hdl)->addonData, settingName, settingValue); } -DLLEXPORT void XBMC_queue_notification(const queue_msg_t type, const char *format, ... ) +DLLEXPORT void XBMC_queue_notification(void *hdl, void* cb, const queue_msg_t type, const char *msg) { - if (m_cb == NULL) + if (cb == NULL) return; - char buffer[16384]; - va_list args; - va_start (args, format); - vsprintf (buffer, format, args); - va_end (args); - m_cb->QueueNotification(m_Handle->addonData, type, buffer); + ((CB_AddOnLib*)cb)->QueueNotification(((AddonCB*)hdl)->addonData, type, msg); } -DLLEXPORT void XBMC_unknown_to_utf8(string &str) +DLLEXPORT void XBMC_unknown_to_utf8(void *hdl, void* cb, string &str) { - if (m_cb == NULL) + if (cb == NULL) return; - string buffer = m_cb->UnknownToUTF8(str.c_str()); + string buffer = ((CB_AddOnLib*)cb)->UnknownToUTF8(str.c_str()); str = buffer; } -DLLEXPORT const char* XBMC_get_localized_string(int dwCode) +DLLEXPORT const char* XBMC_get_localized_string(void *hdl, void* cb, int dwCode) { - if (m_cb == NULL) + if (cb == NULL) return ""; - return m_cb->GetLocalizedString(m_Handle->addonData, dwCode); + return ((CB_AddOnLib*)cb)->GetLocalizedString(((AddonCB*)hdl)->addonData, dwCode); } -DLLEXPORT const char* XBMC_get_dvd_menu_language() +DLLEXPORT const char* XBMC_get_dvd_menu_language(void *hdl, void* cb) { - if (m_cb == NULL) + if (cb == NULL) return ""; - string buffer = m_cb->GetDVDMenuLanguage(m_Handle->addonData); + string buffer = ((CB_AddOnLib*)cb)->GetDVDMenuLanguage(((AddonCB*)hdl)->addonData); return strdup(buffer.c_str()); } -DLLEXPORT void* XBMC_open_file(const char* strFileName, unsigned int flags) +DLLEXPORT void* XBMC_open_file(void *hdl, void* cb, const char* strFileName, unsigned int flags) { - if (m_cb == NULL) + if (cb == NULL) return NULL; - return m_cb->OpenFile(m_Handle->addonData, strFileName, flags); + return ((CB_AddOnLib*)cb)->OpenFile(((AddonCB*)hdl)->addonData, strFileName, flags); } -DLLEXPORT void* XBMC_open_file_for_write(const char* strFileName, bool bOverWrite) +DLLEXPORT void* XBMC_open_file_for_write(void *hdl, void* cb, const char* strFileName, bool bOverWrite) { - if (m_cb == NULL) + if (cb == NULL) return NULL; - return m_cb->OpenFileForWrite(m_Handle->addonData, strFileName, bOverWrite); + return ((CB_AddOnLib*)cb)->OpenFileForWrite(((AddonCB*)hdl)->addonData, strFileName, bOverWrite); } -DLLEXPORT unsigned int XBMC_read_file(void* file, void* lpBuf, int64_t uiBufSize) +DLLEXPORT unsigned int XBMC_read_file(void *hdl, void* cb, void* file, void* lpBuf, int64_t uiBufSize) { - if (m_cb == NULL) + if (cb == NULL) return 0; - return m_cb->ReadFile(m_Handle->addonData, file, lpBuf, uiBufSize); + return ((CB_AddOnLib*)cb)->ReadFile(((AddonCB*)hdl)->addonData, file, lpBuf, uiBufSize); } -DLLEXPORT bool XBMC_read_file_string(void* file, char *szLine, int iLineLength) +DLLEXPORT bool XBMC_read_file_string(void *hdl, void* cb, void* file, char *szLine, int iLineLength) { - if (m_cb == NULL) + if (cb == NULL) return false; - return m_cb->ReadFileString(m_Handle->addonData, file, szLine, iLineLength); + return ((CB_AddOnLib*)cb)->ReadFileString(((AddonCB*)hdl)->addonData, file, szLine, iLineLength); } -DLLEXPORT int XBMC_write_file(void* file, const void* lpBuf, int64_t uiBufSize) +DLLEXPORT int XBMC_write_file(void *hdl, void* cb, void* file, const void* lpBuf, int64_t uiBufSize) { - if (m_cb == NULL) + if (cb == NULL) return false; - return m_cb->WriteFile(m_Handle->addonData, file, lpBuf, uiBufSize); + return ((CB_AddOnLib*)cb)->WriteFile(((AddonCB*)hdl)->addonData, file, lpBuf, uiBufSize); } -DLLEXPORT void XBMC_flush_file(void* file) +DLLEXPORT void XBMC_flush_file(void *hdl, void* cb, void* file) { - if (m_cb == NULL) + if (cb == NULL) return; - m_cb->FlushFile(m_Handle->addonData, file); + ((CB_AddOnLib*)cb)->FlushFile(((AddonCB*)hdl)->addonData, file); } -DLLEXPORT int64_t XBMC_seek_file(void* file, int64_t iFilePosition, int iWhence) +DLLEXPORT int64_t XBMC_seek_file(void *hdl, void* cb, void* file, int64_t iFilePosition, int iWhence) { - if (m_cb == NULL) + if (cb == NULL) return 0; - return m_cb->SeekFile(m_Handle->addonData, file, iFilePosition, iWhence); + return ((CB_AddOnLib*)cb)->SeekFile(((AddonCB*)hdl)->addonData, file, iFilePosition, iWhence); } -DLLEXPORT int XBMC_truncate_file(void* file, int64_t iSize) +DLLEXPORT int XBMC_truncate_file(void *hdl, void* cb, void* file, int64_t iSize) { - if (m_cb == NULL) + if (cb == NULL) return 0; - return m_cb->TruncateFile(m_Handle->addonData, file, iSize); + return ((CB_AddOnLib*)cb)->TruncateFile(((AddonCB*)hdl)->addonData, file, iSize); } -DLLEXPORT int64_t XBMC_get_file_position(void* file) +DLLEXPORT int64_t XBMC_get_file_position(void *hdl, void* cb, void* file) { - if (m_cb == NULL) + if (cb == NULL) return 0; - return m_cb->GetFilePosition(m_Handle->addonData, file); + return ((CB_AddOnLib*)cb)->GetFilePosition(((AddonCB*)hdl)->addonData, file); } -DLLEXPORT int64_t XBMC_get_file_length(void* file) +DLLEXPORT int64_t XBMC_get_file_length(void *hdl, void* cb, void* file) { - if (m_cb == NULL) + if (cb == NULL) return 0; - return m_cb->GetFileLength(m_Handle->addonData, file); + return ((CB_AddOnLib*)cb)->GetFileLength(((AddonCB*)hdl)->addonData, file); } -DLLEXPORT void XBMC_close_file(void* file) +DLLEXPORT void XBMC_close_file(void *hdl, void* cb, void* file) { - if (m_cb == NULL) + if (cb == NULL) return; - m_cb->CloseFile(m_Handle->addonData, file); + ((CB_AddOnLib*)cb)->CloseFile(((AddonCB*)hdl)->addonData, file); } -DLLEXPORT int64_t XBMC_get_file_chunk_size(void* file) +DLLEXPORT int XBMC_get_file_chunk_size(void *hdl, void* cb, void* file) { - if (m_cb == NULL) + if (cb == NULL) return 0; - return m_cb->GetFileChunkSize(m_Handle->addonData, file); + return ((CB_AddOnLib*)cb)->GetFileChunkSize(((AddonCB*)hdl)->addonData, file); +} + +DLLEXPORT bool XBMC_file_exists(void *hdl, void* cb, const char *strFileName, bool bUseCache) +{ + if (cb == NULL) + return false; + + return ((CB_AddOnLib*)cb)->FileExists(((AddonCB*)hdl)->addonData, strFileName, bUseCache); +} + +DLLEXPORT int XBMC_stat_file(void *hdl, void* cb, const char *strFileName, struct ::__stat64* buffer) +{ + if (cb == NULL) + return -1; + + return ((CB_AddOnLib*)cb)->StatFile(((AddonCB*)hdl)->addonData, strFileName, buffer); +} + +DLLEXPORT bool XBMC_delete_file(void *hdl, void* cb, const char *strFileName) +{ + if (cb == NULL) + return false; + + return ((CB_AddOnLib*)cb)->DeleteFile(((AddonCB*)hdl)->addonData, strFileName); } -DLLEXPORT bool XBMC_can_open_directory(const char* strURL) +DLLEXPORT bool XBMC_can_open_directory(void *hdl, void* cb, const char* strURL) { - if (m_cb == NULL) + if (cb == NULL) return 0; - return m_cb->CanOpenDirectory(m_Handle->addonData, strURL); + return ((CB_AddOnLib*)cb)->CanOpenDirectory(((AddonCB*)hdl)->addonData, strURL); +} + +DLLEXPORT bool XBMC_create_directory(void *hdl, void* cb, const char *strPath) +{ + if (cb == NULL) + return false; + + return ((CB_AddOnLib*)cb)->CreateDirectory(((AddonCB*)hdl)->addonData, strPath); +} + +DLLEXPORT bool XBMC_directory_exists(void *hdl, void* cb, const char *strPath) +{ + if (cb == NULL) + return false; + + return ((CB_AddOnLib*)cb)->DirectoryExists(((AddonCB*)hdl)->addonData, strPath); +} + +DLLEXPORT bool XBMC_remove_directory(void *hdl, void* cb, const char *strPath) +{ + if (cb == NULL) + return false; + + return ((CB_AddOnLib*)cb)->RemoveDirectory(((AddonCB*)hdl)->addonData, strPath); } }; diff --git a/lib/addons/library.xbmc.addon/project/VS2010Express/libXBMC_addon.vcxproj b/lib/addons/library.xbmc.addon/project/VS2010Express/libXBMC_addon.vcxproj index af5c26fc7a..e4339a557a 100644 --- a/lib/addons/library.xbmc.addon/project/VS2010Express/libXBMC_addon.vcxproj +++ b/lib/addons/library.xbmc.addon/project/VS2010Express/libXBMC_addon.vcxproj @@ -59,6 +59,7 @@ </ClCompile> <Link> <OutputFile>..\..\..\..\..\addons\library.xbmc.addon\$(ProjectName).dll</OutputFile> + <GenerateDebugInformation>true</GenerateDebugInformation> </Link> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> diff --git a/lib/addons/library.xbmc.gui/libXBMC_gui.cpp b/lib/addons/library.xbmc.gui/libXBMC_gui.cpp index 752c2483cb..fc30305568 100644 --- a/lib/addons/library.xbmc.gui/libXBMC_gui.cpp +++ b/lib/addons/library.xbmc.gui/libXBMC_gui.cpp @@ -21,7 +21,6 @@ #include <stdio.h> #include <stdlib.h> -#include <stdarg.h> #include <string> #include "../../../addons/library.xbmc.gui/libXBMC_gui.h" #include "addons/AddonCallbacks.h" @@ -35,65 +34,60 @@ using namespace std; -AddonCB *m_Handle = NULL; -CB_GUILib *m_cb = NULL; - extern "C" { -DLLEXPORT int GUI_register_me(void *hdl) +DLLEXPORT void* GUI_register_me(void *hdl) { + CB_GUILib *cb = NULL; if (!hdl) fprintf(stderr, "libXBMC_gui-ERROR: GUILib_register_me is called with NULL handle !!!\n"); else { - m_Handle = (AddonCB*) hdl; - m_cb = m_Handle->GUILib_RegisterMe(m_Handle->addonData); - if (!m_cb) + cb = ((AddonCB*)hdl)->GUILib_RegisterMe(((AddonCB*)hdl)->addonData); + if (!cb) fprintf(stderr, "libXBMC_gui-ERROR: GUILib_register_me can't get callback table from XBMC !!!\n"); - else - return 1; } - return 0; + return cb; } -DLLEXPORT void GUI_unregister_me() +DLLEXPORT void GUI_unregister_me(void *hdl, void *cb) { - if (m_Handle && m_cb) - m_Handle->GUILib_UnRegisterMe(m_Handle->addonData, m_cb); + if (hdl && cb) + ((AddonCB*)hdl)->GUILib_UnRegisterMe(((AddonCB*)hdl)->addonData, (CB_GUILib*)cb); } -DLLEXPORT void GUI_lock() +DLLEXPORT void GUI_lock(void *hdl, void *cb) { - m_cb->Lock(); + ((CB_GUILib*)cb)->Lock(); } -DLLEXPORT void GUI_unlock() +DLLEXPORT void GUI_unlock(void *hdl, void *cb) { - m_cb->Unlock(); + ((CB_GUILib*)cb)->Unlock(); } -DLLEXPORT int GUI_get_screen_height() +DLLEXPORT int GUI_get_screen_height(void *hdl, void *cb) { - return m_cb->GetScreenHeight(); + return ((CB_GUILib*)cb)->GetScreenHeight(); } -DLLEXPORT int GUI_get_screen_width() +DLLEXPORT int GUI_get_screen_width(void *hdl, void *cb) { - return m_cb->GetScreenWidth(); + return ((CB_GUILib*)cb)->GetScreenWidth(); } -DLLEXPORT int GUI_get_video_resolution() +DLLEXPORT int GUI_get_video_resolution(void *hdl, void *cb) { - return m_cb->GetVideoResolution(); + return ((CB_GUILib*)cb)->GetVideoResolution(); } -DLLEXPORT CAddonGUIWindow* GUI_Window_create(const char *xmlFilename, const char *defaultSkin, bool forceFallback, bool asDialog) +DLLEXPORT CAddonGUIWindow* GUI_Window_create(void *hdl, void *cb, const char *xmlFilename, const char *defaultSkin, bool forceFallback, bool asDialog) { - return new CAddonGUIWindow(xmlFilename, defaultSkin, forceFallback, asDialog); + return new CAddonGUIWindow(hdl, cb, xmlFilename, defaultSkin, forceFallback, asDialog); } -DLLEXPORT void GUI_Window_destroy(CAddonGUIWindow* p) +DLLEXPORT void GUI_Window_destroy(void *hdl, void* cb, CAddonGUIWindow* p) { delete p; } @@ -123,18 +117,20 @@ DLLEXPORT bool GUI_Window_OnAction(GUIHANDLE handle, int actionId) } -CAddonGUIWindow::CAddonGUIWindow(const char *xmlFilename, const char *defaultSkin, bool forceFallback, bool asDialog) +CAddonGUIWindow::CAddonGUIWindow(void *hdl, void *cb, const char *xmlFilename, const char *defaultSkin, bool forceFallback, bool asDialog) + : m_Handle(hdl) + , m_cb(cb) { CBOnInit = NULL; CBOnClick = NULL; CBOnFocus = NULL; - if (m_Handle && m_cb) + if (hdl && cb) { - m_WindowHandle = m_cb->Window_New(m_Handle->addonData, xmlFilename, defaultSkin, forceFallback, asDialog); + m_WindowHandle = ((CB_GUILib*)m_cb)->Window_New(((AddonCB*)m_Handle)->addonData, xmlFilename, defaultSkin, forceFallback, asDialog); if (!m_WindowHandle) fprintf(stderr, "libXBMC_gui-ERROR: cGUIWindow can't create window class from XBMC !!!\n"); - m_cb->Window_SetCallbacks(m_Handle->addonData, m_WindowHandle, this, GUI_Window_OnInit, GUI_Window_OnClick, GUI_Window_OnFocus, GUI_Window_OnAction); + ((CB_GUILib*)m_cb)->Window_SetCallbacks(((AddonCB*)m_Handle)->addonData, m_WindowHandle, this, GUI_Window_OnInit, GUI_Window_OnClick, GUI_Window_OnFocus, GUI_Window_OnAction); } } @@ -142,24 +138,24 @@ CAddonGUIWindow::~CAddonGUIWindow() { if (m_Handle && m_cb && m_WindowHandle) { - m_cb->Window_Delete(m_Handle->addonData, m_WindowHandle); + ((CB_GUILib*)m_cb)->Window_Delete(((AddonCB*)m_Handle)->addonData, m_WindowHandle); m_WindowHandle = NULL; } } bool CAddonGUIWindow::Show() { - return m_cb->Window_Show(m_Handle->addonData, m_WindowHandle); + return ((CB_GUILib*)m_cb)->Window_Show(((AddonCB*)m_Handle)->addonData, m_WindowHandle); } void CAddonGUIWindow::Close() { - m_cb->Window_Close(m_Handle->addonData, m_WindowHandle); + ((CB_GUILib*)m_cb)->Window_Close(((AddonCB*)m_Handle)->addonData, m_WindowHandle); } void CAddonGUIWindow::DoModal() { - m_cb->Window_DoModal(m_Handle->addonData, m_WindowHandle); + ((CB_GUILib*)m_cb)->Window_DoModal(((AddonCB*)m_Handle)->addonData, m_WindowHandle); } bool CAddonGUIWindow::OnInit() @@ -196,120 +192,120 @@ bool CAddonGUIWindow::OnAction(int actionId) bool CAddonGUIWindow::SetFocusId(int iControlId) { - return m_cb->Window_SetFocusId(m_Handle->addonData, m_WindowHandle, iControlId); + return ((CB_GUILib*)m_cb)->Window_SetFocusId(((AddonCB*)m_Handle)->addonData, m_WindowHandle, iControlId); } int CAddonGUIWindow::GetFocusId() { - return m_cb->Window_GetFocusId(m_Handle->addonData, m_WindowHandle); + return ((CB_GUILib*)m_cb)->Window_GetFocusId(((AddonCB*)m_Handle)->addonData, m_WindowHandle); } bool CAddonGUIWindow::SetCoordinateResolution(int res) { - return m_cb->Window_SetCoordinateResolution(m_Handle->addonData, m_WindowHandle, res); + return ((CB_GUILib*)m_cb)->Window_SetCoordinateResolution(((AddonCB*)m_Handle)->addonData, m_WindowHandle, res); } void CAddonGUIWindow::SetProperty(const char *key, const char *value) { - m_cb->Window_SetProperty(m_Handle->addonData, m_WindowHandle, key, value); + ((CB_GUILib*)m_cb)->Window_SetProperty(((AddonCB*)m_Handle)->addonData, m_WindowHandle, key, value); } void CAddonGUIWindow::SetPropertyInt(const char *key, int value) { - m_cb->Window_SetPropertyInt(m_Handle->addonData, m_WindowHandle, key, value); + ((CB_GUILib*)m_cb)->Window_SetPropertyInt(((AddonCB*)m_Handle)->addonData, m_WindowHandle, key, value); } void CAddonGUIWindow::SetPropertyBool(const char *key, bool value) { - m_cb->Window_SetPropertyBool(m_Handle->addonData, m_WindowHandle, key, value); + ((CB_GUILib*)m_cb)->Window_SetPropertyBool(((AddonCB*)m_Handle)->addonData, m_WindowHandle, key, value); } void CAddonGUIWindow::SetPropertyDouble(const char *key, double value) { - m_cb->Window_SetPropertyDouble(m_Handle->addonData, m_WindowHandle, key, value); + ((CB_GUILib*)m_cb)->Window_SetPropertyDouble(((AddonCB*)m_Handle)->addonData, m_WindowHandle, key, value); } const char *CAddonGUIWindow::GetProperty(const char *key) const { - return m_cb->Window_GetProperty(m_Handle->addonData, m_WindowHandle, key); + return ((CB_GUILib*)m_cb)->Window_GetProperty(((AddonCB*)m_Handle)->addonData, m_WindowHandle, key); } int CAddonGUIWindow::GetPropertyInt(const char *key) const { - return m_cb->Window_GetPropertyInt(m_Handle->addonData, m_WindowHandle, key); + return ((CB_GUILib*)m_cb)->Window_GetPropertyInt(((AddonCB*)m_Handle)->addonData, m_WindowHandle, key); } bool CAddonGUIWindow::GetPropertyBool(const char *key) const { - return m_cb->Window_GetPropertyBool(m_Handle->addonData, m_WindowHandle, key); + return ((CB_GUILib*)m_cb)->Window_GetPropertyBool(((AddonCB*)m_Handle)->addonData, m_WindowHandle, key); } double CAddonGUIWindow::GetPropertyDouble(const char *key) const { - return m_cb->Window_GetPropertyDouble(m_Handle->addonData, m_WindowHandle, key); + return ((CB_GUILib*)m_cb)->Window_GetPropertyDouble(((AddonCB*)m_Handle)->addonData, m_WindowHandle, key); } void CAddonGUIWindow::ClearProperties() { - m_cb->Window_ClearProperties(m_Handle->addonData, m_WindowHandle); + ((CB_GUILib*)m_cb)->Window_ClearProperties(((AddonCB*)m_Handle)->addonData, m_WindowHandle); } int CAddonGUIWindow::GetListSize() { - return m_cb->Window_GetListSize(m_Handle->addonData, m_WindowHandle); + return ((CB_GUILib*)m_cb)->Window_GetListSize(((AddonCB*)m_Handle)->addonData, m_WindowHandle); } void CAddonGUIWindow::ClearList() { - m_cb->Window_ClearList(m_Handle->addonData, m_WindowHandle); + ((CB_GUILib*)m_cb)->Window_ClearList(((AddonCB*)m_Handle)->addonData, m_WindowHandle); } GUIHANDLE CAddonGUIWindow::AddStringItem(const char *name, int itemPosition) { - return m_cb->Window_AddStringItem(m_Handle->addonData, m_WindowHandle, name, itemPosition); + return ((CB_GUILib*)m_cb)->Window_AddStringItem(((AddonCB*)m_Handle)->addonData, m_WindowHandle, name, itemPosition); } void CAddonGUIWindow::AddItem(GUIHANDLE item, int itemPosition) { - m_cb->Window_AddItem(m_Handle->addonData, m_WindowHandle, item, itemPosition); + ((CB_GUILib*)m_cb)->Window_AddItem(((AddonCB*)m_Handle)->addonData, m_WindowHandle, item, itemPosition); } void CAddonGUIWindow::AddItem(CAddonListItem *item, int itemPosition) { - m_cb->Window_AddItem(m_Handle->addonData, m_WindowHandle, item->m_ListItemHandle, itemPosition); + ((CB_GUILib*)m_cb)->Window_AddItem(((AddonCB*)m_Handle)->addonData, m_WindowHandle, item->m_ListItemHandle, itemPosition); } void CAddonGUIWindow::RemoveItem(int itemPosition) { - m_cb->Window_RemoveItem(m_Handle->addonData, m_WindowHandle, itemPosition); + ((CB_GUILib*)m_cb)->Window_RemoveItem(((AddonCB*)m_Handle)->addonData, m_WindowHandle, itemPosition); } GUIHANDLE CAddonGUIWindow::GetListItem(int listPos) { - return m_cb->Window_GetListItem(m_Handle->addonData, m_WindowHandle, listPos); + return ((CB_GUILib*)m_cb)->Window_GetListItem(((AddonCB*)m_Handle)->addonData, m_WindowHandle, listPos); } void CAddonGUIWindow::SetCurrentListPosition(int listPos) { - m_cb->Window_SetCurrentListPosition(m_Handle->addonData, m_WindowHandle, listPos); + ((CB_GUILib*)m_cb)->Window_SetCurrentListPosition(((AddonCB*)m_Handle)->addonData, m_WindowHandle, listPos); } int CAddonGUIWindow::GetCurrentListPosition() { - return m_cb->Window_GetCurrentListPosition(m_Handle->addonData, m_WindowHandle); + return ((CB_GUILib*)m_cb)->Window_GetCurrentListPosition(((AddonCB*)m_Handle)->addonData, m_WindowHandle); } void CAddonGUIWindow::SetControlLabel(int controlId, const char *label) { - m_cb->Window_SetControlLabel(m_Handle->addonData, m_WindowHandle, controlId, label); + ((CB_GUILib*)m_cb)->Window_SetControlLabel(((AddonCB*)m_Handle)->addonData, m_WindowHandle, controlId, label); } ///------------------------------------- /// cGUISpinControl -DLLEXPORT CAddonGUISpinControl* GUI_control_get_spin(CAddonGUIWindow *window, int controlId) +DLLEXPORT CAddonGUISpinControl* GUI_control_get_spin(void *hdl, void *cb, CAddonGUIWindow *window, int controlId) { - return new CAddonGUISpinControl(window, controlId); + return new CAddonGUISpinControl(hdl, cb, window, controlId); } DLLEXPORT void GUI_control_release_spin(CAddonGUISpinControl* p) @@ -317,35 +313,37 @@ DLLEXPORT void GUI_control_release_spin(CAddonGUISpinControl* p) delete p; } -CAddonGUISpinControl::CAddonGUISpinControl(CAddonGUIWindow *window, int controlId) +CAddonGUISpinControl::CAddonGUISpinControl(void *hdl, void *cb, CAddonGUIWindow *window, int controlId) : m_Window(window) , m_ControlId(controlId) { - m_SpinHandle = m_cb->Window_GetControl_Spin(m_Handle->addonData, m_Window->m_WindowHandle, controlId); + m_Handle = hdl; + m_cb = cb; + m_SpinHandle = ((CB_GUILib*)m_cb)->Window_GetControl_Spin(((AddonCB*)m_Handle)->addonData, m_Window->m_WindowHandle, controlId); } void CAddonGUISpinControl::SetVisible(bool yesNo) { if (m_SpinHandle) - m_cb->Control_Spin_SetVisible(m_Handle->addonData, m_SpinHandle, yesNo); + ((CB_GUILib*)m_cb)->Control_Spin_SetVisible(((AddonCB*)m_Handle)->addonData, m_SpinHandle, yesNo); } void CAddonGUISpinControl::SetText(const char *label) { if (m_SpinHandle) - m_cb->Control_Spin_SetText(m_Handle->addonData, m_SpinHandle, label); + ((CB_GUILib*)m_cb)->Control_Spin_SetText(((AddonCB*)m_Handle)->addonData, m_SpinHandle, label); } void CAddonGUISpinControl::Clear() { if (m_SpinHandle) - m_cb->Control_Spin_Clear(m_Handle->addonData, m_SpinHandle); + ((CB_GUILib*)m_cb)->Control_Spin_Clear(((AddonCB*)m_Handle)->addonData, m_SpinHandle); } void CAddonGUISpinControl::AddLabel(const char *label, int iValue) { if (m_SpinHandle) - m_cb->Control_Spin_AddLabel(m_Handle->addonData, m_SpinHandle, label, iValue); + ((CB_GUILib*)m_cb)->Control_Spin_AddLabel(((AddonCB*)m_Handle)->addonData, m_SpinHandle, label, iValue); } int CAddonGUISpinControl::GetValue() @@ -353,21 +351,21 @@ int CAddonGUISpinControl::GetValue() if (!m_SpinHandle) return -1; - return m_cb->Control_Spin_GetValue(m_Handle->addonData, m_SpinHandle); + return ((CB_GUILib*)m_cb)->Control_Spin_GetValue(((AddonCB*)m_Handle)->addonData, m_SpinHandle); } void CAddonGUISpinControl::SetValue(int iValue) { if (m_SpinHandle) - m_cb->Control_Spin_SetValue(m_Handle->addonData, m_SpinHandle, iValue); + ((CB_GUILib*)m_cb)->Control_Spin_SetValue(((AddonCB*)m_Handle)->addonData, m_SpinHandle, iValue); } -///------------------------------------- +///--m_cb----------------------------------- /// cGUIRadioButton -DLLEXPORT CAddonGUIRadioButton* GUI_control_get_radiobutton(CAddonGUIWindow *window, int controlId) +DLLEXPORT CAddonGUIRadioButton* GUI_control_get_radiobutton(void *hdl, void *cb, CAddonGUIWindow *window, int controlId) { - return new CAddonGUIRadioButton(window, controlId); + return new CAddonGUIRadioButton(hdl, cb, window, controlId); } DLLEXPORT void GUI_control_release_radiobutton(CAddonGUIRadioButton* p) @@ -375,29 +373,31 @@ DLLEXPORT void GUI_control_release_radiobutton(CAddonGUIRadioButton* p) delete p; } -CAddonGUIRadioButton::CAddonGUIRadioButton(CAddonGUIWindow *window, int controlId) +CAddonGUIRadioButton::CAddonGUIRadioButton(void *hdl, void *cb, CAddonGUIWindow *window, int controlId) : m_Window(window) , m_ControlId(controlId) + , m_Handle(hdl) + , m_cb(cb) { - m_ButtonHandle = m_cb->Window_GetControl_RadioButton(m_Handle->addonData, m_Window->m_WindowHandle, controlId); + m_ButtonHandle = ((CB_GUILib*)m_cb)->Window_GetControl_RadioButton(((AddonCB*)m_Handle)->addonData, m_Window->m_WindowHandle, controlId); } void CAddonGUIRadioButton::SetVisible(bool yesNo) { if (m_ButtonHandle) - m_cb->Control_RadioButton_SetVisible(m_Handle->addonData, m_ButtonHandle, yesNo); + ((CB_GUILib*)m_cb)->Control_RadioButton_SetVisible(((AddonCB*)m_Handle)->addonData, m_ButtonHandle, yesNo); } void CAddonGUIRadioButton::SetText(const char *label) { if (m_ButtonHandle) - m_cb->Control_RadioButton_SetText(m_Handle->addonData, m_ButtonHandle, label); + ((CB_GUILib*)m_cb)->Control_RadioButton_SetText(((AddonCB*)m_Handle)->addonData, m_ButtonHandle, label); } void CAddonGUIRadioButton::SetSelected(bool yesNo) { if (m_ButtonHandle) - m_cb->Control_RadioButton_SetSelected(m_Handle->addonData, m_ButtonHandle, yesNo); + ((CB_GUILib*)m_cb)->Control_RadioButton_SetSelected(((AddonCB*)m_Handle)->addonData, m_ButtonHandle, yesNo); } bool CAddonGUIRadioButton::IsSelected() @@ -405,16 +405,16 @@ bool CAddonGUIRadioButton::IsSelected() if (!m_ButtonHandle) return false; - return m_cb->Control_RadioButton_IsSelected(m_Handle->addonData, m_ButtonHandle); + return ((CB_GUILib*)m_cb)->Control_RadioButton_IsSelected(((AddonCB*)m_Handle)->addonData, m_ButtonHandle); } ///------------------------------------- /// cGUIProgressControl -DLLEXPORT CAddonGUIProgressControl* GUI_control_get_progress(CAddonGUIWindow *window, int controlId) +DLLEXPORT CAddonGUIProgressControl* GUI_control_get_progress(void *hdl, void *cb, CAddonGUIWindow *window, int controlId) { - return new CAddonGUIProgressControl(window, controlId); + return new CAddonGUIProgressControl(hdl, cb, window, controlId); } DLLEXPORT void GUI_control_release_progress(CAddonGUIProgressControl* p) @@ -422,17 +422,19 @@ DLLEXPORT void GUI_control_release_progress(CAddonGUIProgressControl* p) delete p; } -CAddonGUIProgressControl::CAddonGUIProgressControl(CAddonGUIWindow *window, int controlId) +CAddonGUIProgressControl::CAddonGUIProgressControl(void *hdl, void *cb, CAddonGUIWindow *window, int controlId) : m_Window(window) , m_ControlId(controlId) + , m_Handle(hdl) + , m_cb(cb) { - m_ProgressHandle = m_cb->Window_GetControl_Progress(m_Handle->addonData, m_Window->m_WindowHandle, controlId); + m_ProgressHandle = ((CB_GUILib*)m_cb)->Window_GetControl_Progress(((AddonCB*)m_Handle)->addonData, m_Window->m_WindowHandle, controlId); } void CAddonGUIProgressControl::SetPercentage(float fPercent) { if (m_ProgressHandle) - m_cb->Control_Progress_SetPercentage(m_Handle->addonData, m_ProgressHandle, fPercent); + ((CB_GUILib*)m_cb)->Control_Progress_SetPercentage(((AddonCB*)m_Handle)->addonData, m_ProgressHandle, fPercent); } float CAddonGUIProgressControl::GetPercentage() const @@ -440,13 +442,13 @@ float CAddonGUIProgressControl::GetPercentage() const if (!m_ProgressHandle) return 0.0; - return m_cb->Control_Progress_GetPercentage(m_Handle->addonData, m_ProgressHandle); + return ((CB_GUILib*)m_cb)->Control_Progress_GetPercentage(((AddonCB*)m_Handle)->addonData, m_ProgressHandle); } void CAddonGUIProgressControl::SetInfo(int iInfo) { if (m_ProgressHandle) - m_cb->Control_Progress_SetInfo(m_Handle->addonData, m_ProgressHandle, iInfo); + ((CB_GUILib*)m_cb)->Control_Progress_SetInfo(((AddonCB*)m_Handle)->addonData, m_ProgressHandle, iInfo); } int CAddonGUIProgressControl::GetInfo() const @@ -454,7 +456,7 @@ int CAddonGUIProgressControl::GetInfo() const if (!m_ProgressHandle) return -1; - return m_cb->Control_Progress_GetInfo(m_Handle->addonData, m_ProgressHandle); + return ((CB_GUILib*)m_cb)->Control_Progress_GetInfo(((AddonCB*)m_Handle)->addonData, m_ProgressHandle); } string CAddonGUIProgressControl::GetDescription() const @@ -462,16 +464,16 @@ string CAddonGUIProgressControl::GetDescription() const if (!m_ProgressHandle) return ""; - return m_cb->Control_Progress_GetDescription(m_Handle->addonData, m_ProgressHandle); + return ((CB_GUILib*)m_cb)->Control_Progress_GetDescription(((AddonCB*)m_Handle)->addonData, m_ProgressHandle); } ///------------------------------------- /// cListItem -DLLEXPORT CAddonListItem* GUI_ListItem_create(const char *label, const char *label2, const char *iconImage, const char *thumbnailImage, const char *path) +DLLEXPORT CAddonListItem* GUI_ListItem_create(void *hdl, void *cb, const char *label, const char *label2, const char *iconImage, const char *thumbnailImage, const char *path) { - return new CAddonListItem(label, label2, iconImage, thumbnailImage, path); + return new CAddonListItem(hdl, cb, label, label2, iconImage, thumbnailImage, path); } DLLEXPORT void GUI_ListItem_destroy(CAddonListItem* p) @@ -480,9 +482,11 @@ DLLEXPORT void GUI_ListItem_destroy(CAddonListItem* p) } -CAddonListItem::CAddonListItem(const char *label, const char *label2, const char *iconImage, const char *thumbnailImage, const char *path) +CAddonListItem::CAddonListItem(void *hdl, void *cb, const char *label, const char *label2, const char *iconImage, const char *thumbnailImage, const char *path) + : m_Handle(hdl) + , m_cb(cb) { - m_ListItemHandle = m_cb->ListItem_Create(m_Handle->addonData, label, label2, iconImage, thumbnailImage, path); + m_ListItemHandle = ((CB_GUILib*)m_cb)->ListItem_Create(((AddonCB*)m_Handle)->addonData, label, label2, iconImage, thumbnailImage, path); } const char *CAddonListItem::GetLabel() @@ -490,13 +494,13 @@ const char *CAddonListItem::GetLabel() if (!m_ListItemHandle) return ""; - return m_cb->ListItem_GetLabel(m_Handle->addonData, m_ListItemHandle); + return ((CB_GUILib*)m_cb)->ListItem_GetLabel(((AddonCB*)m_Handle)->addonData, m_ListItemHandle); } void CAddonListItem::SetLabel(const char *label) { if (m_ListItemHandle) - m_cb->ListItem_SetLabel(m_Handle->addonData, m_ListItemHandle, label); + ((CB_GUILib*)m_cb)->ListItem_SetLabel(((AddonCB*)m_Handle)->addonData, m_ListItemHandle, label); } const char *CAddonListItem::GetLabel2() @@ -504,37 +508,37 @@ const char *CAddonListItem::GetLabel2() if (!m_ListItemHandle) return ""; - return m_cb->ListItem_GetLabel2(m_Handle->addonData, m_ListItemHandle); + return ((CB_GUILib*)m_cb)->ListItem_GetLabel2(((AddonCB*)m_Handle)->addonData, m_ListItemHandle); } void CAddonListItem::SetLabel2(const char *label) { if (m_ListItemHandle) - m_cb->ListItem_SetLabel2(m_Handle->addonData, m_ListItemHandle, label); + ((CB_GUILib*)m_cb)->ListItem_SetLabel2(((AddonCB*)m_Handle)->addonData, m_ListItemHandle, label); } void CAddonListItem::SetIconImage(const char *image) { if (m_ListItemHandle) - m_cb->ListItem_SetIconImage(m_Handle->addonData, m_ListItemHandle, image); + ((CB_GUILib*)m_cb)->ListItem_SetIconImage(((AddonCB*)m_Handle)->addonData, m_ListItemHandle, image); } void CAddonListItem::SetThumbnailImage(const char *image) { if (m_ListItemHandle) - m_cb->ListItem_SetThumbnailImage(m_Handle->addonData, m_ListItemHandle, image); + ((CB_GUILib*)m_cb)->ListItem_SetThumbnailImage(((AddonCB*)m_Handle)->addonData, m_ListItemHandle, image); } void CAddonListItem::SetInfo(const char *Info) { if (m_ListItemHandle) - m_cb->ListItem_SetInfo(m_Handle->addonData, m_ListItemHandle, Info); + ((CB_GUILib*)m_cb)->ListItem_SetInfo(((AddonCB*)m_Handle)->addonData, m_ListItemHandle, Info); } void CAddonListItem::SetProperty(const char *key, const char *value) { if (m_ListItemHandle) - m_cb->ListItem_SetProperty(m_Handle->addonData, m_ListItemHandle, key, value); + ((CB_GUILib*)m_cb)->ListItem_SetProperty(((AddonCB*)m_Handle)->addonData, m_ListItemHandle, key, value); } const char *CAddonListItem::GetProperty(const char *key) const @@ -542,13 +546,13 @@ const char *CAddonListItem::GetProperty(const char *key) const if (!m_ListItemHandle) return ""; - return m_cb->ListItem_GetProperty(m_Handle->addonData, m_ListItemHandle, key); + return ((CB_GUILib*)m_cb)->ListItem_GetProperty(((AddonCB*)m_Handle)->addonData, m_ListItemHandle, key); } void CAddonListItem::SetPath(const char *Path) { if (m_ListItemHandle) - m_cb->ListItem_SetPath(m_Handle->addonData, m_ListItemHandle, Path); + ((CB_GUILib*)m_cb)->ListItem_SetPath(((AddonCB*)m_Handle)->addonData, m_ListItemHandle, Path); } diff --git a/lib/addons/library.xbmc.gui/project/VS2010Express/libXBMC_gui.vcxproj b/lib/addons/library.xbmc.gui/project/VS2010Express/libXBMC_gui.vcxproj index 1a09551b92..4d13861979 100644 --- a/lib/addons/library.xbmc.gui/project/VS2010Express/libXBMC_gui.vcxproj +++ b/lib/addons/library.xbmc.gui/project/VS2010Express/libXBMC_gui.vcxproj @@ -59,6 +59,7 @@ </ClCompile> <Link> <OutputFile>..\..\..\..\..\addons\library.xbmc.gui\$(ProjectName).dll</OutputFile> + <GenerateDebugInformation>true</GenerateDebugInformation> </Link> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> diff --git a/lib/addons/library.xbmc.pvr/libXBMC_pvr.cpp b/lib/addons/library.xbmc.pvr/libXBMC_pvr.cpp index 8ef4b595f3..3c2db2f998 100644 --- a/lib/addons/library.xbmc.pvr/libXBMC_pvr.cpp +++ b/lib/addons/library.xbmc.pvr/libXBMC_pvr.cpp @@ -38,144 +38,139 @@ using namespace std; -AddonCB *m_Handle = NULL; -CB_PVRLib *m_cb = NULL; - extern "C" { -DLLEXPORT int PVR_register_me(void *hdl) +DLLEXPORT void* PVR_register_me(void *hdl) { + CB_PVRLib *cb = NULL; if (!hdl) fprintf(stderr, "libXBMC_pvr-ERROR: PVRLib_register_me is called with NULL handle !!!\n"); else { - m_Handle = (AddonCB*) hdl; - m_cb = m_Handle->PVRLib_RegisterMe(m_Handle->addonData); - if (!m_cb) + cb = ((AddonCB*)hdl)->PVRLib_RegisterMe(((AddonCB*)hdl)->addonData); + if (!cb) fprintf(stderr, "libXBMC_pvr-ERROR: PVRLib_register_me can't get callback table from XBMC !!!\n"); - else - return 1; } - return 0; + return cb; } -DLLEXPORT void PVR_unregister_me() +DLLEXPORT void PVR_unregister_me(void *hdl, void* cb) { - if (m_Handle && m_cb) - m_Handle->PVRLib_UnRegisterMe(m_Handle->addonData, m_cb); + if (hdl && cb) + ((AddonCB*)hdl)->PVRLib_UnRegisterMe(((AddonCB*)hdl)->addonData, (CB_PVRLib*)cb); } -DLLEXPORT void PVR_transfer_epg_entry(const ADDON_HANDLE handle, const EPG_TAG *epgentry) +DLLEXPORT void PVR_transfer_epg_entry(void *hdl, void* cb, const ADDON_HANDLE handle, const EPG_TAG *epgentry) { - if (m_cb == NULL) + if (cb == NULL) return; - m_cb->TransferEpgEntry(m_Handle->addonData, handle, epgentry); + ((CB_PVRLib*)cb)->TransferEpgEntry(((AddonCB*)hdl)->addonData, handle, epgentry); } -DLLEXPORT void PVR_transfer_channel_entry(const ADDON_HANDLE handle, const PVR_CHANNEL *chan) +DLLEXPORT void PVR_transfer_channel_entry(void *hdl, void* cb, const ADDON_HANDLE handle, const PVR_CHANNEL *chan) { - if (m_cb == NULL) + if (cb == NULL) return; - m_cb->TransferChannelEntry(m_Handle->addonData, handle, chan); + ((CB_PVRLib*)cb)->TransferChannelEntry(((AddonCB*)hdl)->addonData, handle, chan); } -DLLEXPORT void PVR_transfer_timer_entry(const ADDON_HANDLE handle, const PVR_TIMER *timer) +DLLEXPORT void PVR_transfer_timer_entry(void *hdl, void* cb, const ADDON_HANDLE handle, const PVR_TIMER *timer) { - if (m_cb == NULL) + if (cb == NULL) return; - m_cb->TransferTimerEntry(m_Handle->addonData, handle, timer); + ((CB_PVRLib*)cb)->TransferTimerEntry(((AddonCB*)hdl)->addonData, handle, timer); } -DLLEXPORT void PVR_transfer_recording_entry(const ADDON_HANDLE handle, const PVR_RECORDING *recording) +DLLEXPORT void PVR_transfer_recording_entry(void *hdl, void* cb, const ADDON_HANDLE handle, const PVR_RECORDING *recording) { - if (m_cb == NULL) + if (cb == NULL) return; - m_cb->TransferRecordingEntry(m_Handle->addonData, handle, recording); + ((CB_PVRLib*)cb)->TransferRecordingEntry(((AddonCB*)hdl)->addonData, handle, recording); } -DLLEXPORT void PVR_add_menu_hook(PVR_MENUHOOK *hook) +DLLEXPORT void PVR_add_menu_hook(void *hdl, void* cb, PVR_MENUHOOK *hook) { - if (m_cb == NULL) + if (cb == NULL) return; - m_cb->AddMenuHook(m_Handle->addonData, hook); + ((CB_PVRLib*)cb)->AddMenuHook(((AddonCB*)hdl)->addonData, hook); } -DLLEXPORT void PVR_recording(const char *Name, const char *FileName, bool On) +DLLEXPORT void PVR_recording(void *hdl, void* cb, const char *Name, const char *FileName, bool On) { - if (m_cb == NULL) + if (cb == NULL) return; - m_cb->Recording(m_Handle->addonData, Name, FileName, On); + ((CB_PVRLib*)cb)->Recording(((AddonCB*)hdl)->addonData, Name, FileName, On); } -DLLEXPORT void PVR_trigger_channel_update() +DLLEXPORT void PVR_trigger_channel_update(void *hdl, void* cb) { - if (m_cb == NULL) + if (cb == NULL) return; - m_cb->TriggerChannelUpdate(m_Handle->addonData); + ((CB_PVRLib*)cb)->TriggerChannelUpdate(((AddonCB*)hdl)->addonData); } -DLLEXPORT void PVR_trigger_channel_groups_update() +DLLEXPORT void PVR_trigger_channel_groups_update(void *hdl, void* cb) { - if (m_cb == NULL) + if (cb == NULL) return; - m_cb->TriggerChannelGroupsUpdate(m_Handle->addonData); + ((CB_PVRLib*)cb)->TriggerChannelGroupsUpdate(((AddonCB*)hdl)->addonData); } -DLLEXPORT void PVR_trigger_timer_update() +DLLEXPORT void PVR_trigger_timer_update(void *hdl, void* cb) { - if (m_cb == NULL) + if (cb == NULL) return; - m_cb->TriggerTimerUpdate(m_Handle->addonData); + ((CB_PVRLib*)cb)->TriggerTimerUpdate(((AddonCB*)hdl)->addonData); } -DLLEXPORT void PVR_trigger_recording_update() +DLLEXPORT void PVR_trigger_recording_update(void *hdl, void* cb) { - if (m_cb == NULL) + if (cb == NULL) return; - m_cb->TriggerRecordingUpdate(m_Handle->addonData); + ((CB_PVRLib*)cb)->TriggerRecordingUpdate(((AddonCB*)hdl)->addonData); } -DLLEXPORT void PVR_free_demux_packet(DemuxPacket* pPacket) +DLLEXPORT void PVR_free_demux_packet(void *hdl, void* cb, DemuxPacket* pPacket) { - if (m_cb == NULL) + if (cb == NULL) return; - m_cb->FreeDemuxPacket(m_Handle->addonData, pPacket); + ((CB_PVRLib*)cb)->FreeDemuxPacket(((AddonCB*)hdl)->addonData, pPacket); } -DLLEXPORT DemuxPacket* PVR_allocate_demux_packet(int iDataSize) +DLLEXPORT DemuxPacket* PVR_allocate_demux_packet(void *hdl, void* cb, int iDataSize) { - if (m_cb == NULL) + if (cb == NULL) return NULL; - return m_cb->AllocateDemuxPacket(m_Handle->addonData, iDataSize); + return ((CB_PVRLib*)cb)->AllocateDemuxPacket(((AddonCB*)hdl)->addonData, iDataSize); } -DLLEXPORT void PVR_transfer_channel_group(const ADDON_HANDLE handle, const PVR_CHANNEL_GROUP *group) +DLLEXPORT void PVR_transfer_channel_group(void *hdl, void* cb, const ADDON_HANDLE handle, const PVR_CHANNEL_GROUP *group) { - if (m_cb == NULL) + if (cb == NULL) return; - m_cb->TransferChannelGroup(m_Handle->addonData, handle, group); + ((CB_PVRLib*)cb)->TransferChannelGroup(((AddonCB*)hdl)->addonData, handle, group); } -DLLEXPORT void PVR_transfer_channel_group_member(const ADDON_HANDLE handle, const PVR_CHANNEL_GROUP_MEMBER *member) +DLLEXPORT void PVR_transfer_channel_group_member(void *hdl, void* cb, const ADDON_HANDLE handle, const PVR_CHANNEL_GROUP_MEMBER *member) { - if (m_cb == NULL) + if (cb == NULL) return; - m_cb->TransferChannelGroupMember(m_Handle->addonData, handle, member); + ((CB_PVRLib*)cb)->TransferChannelGroupMember(((AddonCB*)hdl)->addonData, handle, member); } }; diff --git a/lib/addons/library.xbmc.pvr/project/VS2010Express/libXBMC_pvr.vcxproj b/lib/addons/library.xbmc.pvr/project/VS2010Express/libXBMC_pvr.vcxproj index 3e386a06e4..0d9986a4b5 100644 --- a/lib/addons/library.xbmc.pvr/project/VS2010Express/libXBMC_pvr.vcxproj +++ b/lib/addons/library.xbmc.pvr/project/VS2010Express/libXBMC_pvr.vcxproj @@ -59,6 +59,7 @@ </ClCompile> <Link> <OutputFile>..\..\..\..\..\addons\library.xbmc.pvr\$(ProjectName).dll</OutputFile> + <GenerateDebugInformation>true</GenerateDebugInformation> </Link> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> |