diff options
author | Alwin Esch <alwin.esch@web.de> | 2016-03-09 12:23:59 +0100 |
---|---|---|
committer | Alwin Esch <alwin.esch@web.de> | 2016-03-09 12:23:59 +0100 |
commit | cc5100913c891e9b1dba2bcac75da09c7df6d43f (patch) | |
tree | 4232d886f08603c08e7deff103343168ab754ffe /lib | |
parent | 755c367a60d5afb8a096459c95c72ae2f1e60899 (diff) |
[addon] Move add-on library parts to independent folders (code rework)
Diffstat (limited to 'lib')
7 files changed, 26 insertions, 22 deletions
diff --git a/lib/addons/library.kodi.adsp/libKODI_adsp.cpp b/lib/addons/library.kodi.adsp/libKODI_adsp.cpp index ac78c73099..5101163b13 100644 --- a/lib/addons/library.kodi.adsp/libKODI_adsp.cpp +++ b/lib/addons/library.kodi.adsp/libKODI_adsp.cpp @@ -23,7 +23,7 @@ #include <stdarg.h> #include <string> #include "addons/kodi-addon-dev-kit/include/kodi/libKODI_adsp.h" -#include "addons/AddonCallbacks.h" +#include "addons/binary/interfaces/api1/AudioDSP/AddonCallbacksAudioDSP.h" #ifdef _WIN32 #include <windows.h> @@ -33,6 +33,7 @@ #endif using namespace std; +using namespace V1::KodiAPI::AudioDSP; extern "C" { @@ -44,7 +45,7 @@ DLLEXPORT void* ADSP_register_me(void *hdl) fprintf(stderr, "libKODI_adsp-ERROR: ADSPLib_register_me is called with NULL handle !!!\n"); else { - cb = ((AddonCB*)hdl)->ADSPLib_RegisterMe(((AddonCB*)hdl)->addonData); + cb = (CB_ADSPLib*)((AddonCB*)hdl)->ADSPLib_RegisterMe(((AddonCB*)hdl)->addonData); if (!cb) fprintf(stderr, "libKODI_adsp-ERROR: ADSPLib_register_me can't get callback table from KODI !!!\n"); } diff --git a/lib/addons/library.kodi.audioengine/libKODI_audioengine.cpp b/lib/addons/library.kodi.audioengine/libKODI_audioengine.cpp index fad7760f7a..0886bd6de3 100644 --- a/lib/addons/library.kodi.audioengine/libKODI_audioengine.cpp +++ b/lib/addons/library.kodi.audioengine/libKODI_audioengine.cpp @@ -23,7 +23,7 @@ #include <stdlib.h> #include <string> #include "addons/kodi-addon-dev-kit/include/kodi/libKODI_audioengine.h" -#include "addons/AddonCallbacks.h" +#include "addons/binary/interfaces/api1/AudioEngine/AddonCallbacksAudioEngine.h" #ifdef _WIN32 #include <windows.h> @@ -33,6 +33,7 @@ #endif using namespace std; +using namespace V1::KodiAPI::AudioEngine; #define LIBRARY_NAME "libKODI_audioengine" @@ -46,7 +47,7 @@ DLLEXPORT void* AudioEngine_register_me(void *hdl) fprintf(stderr, "%s-ERROR: AudioEngine_register_me is called with NULL handle !!!\n", LIBRARY_NAME); else { - cb = ((AddonCB*)hdl)->AudioEngineLib_RegisterMe(((AddonCB*)hdl)->addonData); + cb = (CB_AudioEngineLib*)((AddonCB*)hdl)->AudioEngineLib_RegisterMe(((AddonCB*)hdl)->addonData); if (!cb) fprintf(stderr, "%s-ERROR: AudioEngine_register_me can't get callback table from KODI !!!\n", LIBRARY_NAME); } @@ -224,8 +225,4 @@ void CAddonAEStream::SetResampleRatio(double Ratio) ((CB_AudioEngineLib*)m_Callbacks)->AEStream_SetResampleRatio(((AddonCB*)m_AddonHandle)->addonData, m_StreamHandle, Ratio); } -void CAddonAEStream::Discontinuity() -{ - return ((CB_AudioEngineLib*)m_Callbacks)->AEStream_Discontinuity(((AddonCB*)m_AddonHandle)->addonData, m_StreamHandle); -} }; diff --git a/lib/addons/library.kodi.guilib/libKODI_guilib.cpp b/lib/addons/library.kodi.guilib/libKODI_guilib.cpp index 3a3233fe4e..188562a8d0 100644 --- a/lib/addons/library.kodi.guilib/libKODI_guilib.cpp +++ b/lib/addons/library.kodi.guilib/libKODI_guilib.cpp @@ -23,7 +23,7 @@ #include <stdio.h> #include <stdlib.h> #include <string> -#include "addons/AddonCallbacks.h" +#include "addons/binary/interfaces/api1/GUI/AddonCallbacksGUI.h" #ifdef _WIN32 #include <windows.h> @@ -33,6 +33,7 @@ #endif using namespace std; +using namespace V1::KodiAPI::GUI; extern "C" { @@ -44,7 +45,7 @@ DLLEXPORT void* GUI_register_me(void *hdl) fprintf(stderr, "libXBMC_gui-ERROR: GUILib_register_me is called with NULL handle !!!\n"); else { - cb = ((AddonCB*)hdl)->GUILib_RegisterMe(((AddonCB*)hdl)->addonData); + cb = (CB_GUILib*)((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"); } diff --git a/lib/addons/library.kodi.inputstream/libKODI_inputstream.cpp b/lib/addons/library.kodi.inputstream/libKODI_inputstream.cpp index 3ec5bcbbae..be8f987869 100644 --- a/lib/addons/library.kodi.inputstream/libKODI_inputstream.cpp +++ b/lib/addons/library.kodi.inputstream/libKODI_inputstream.cpp @@ -24,7 +24,7 @@ #include <stdarg.h> #include <string> #include "addons/kodi-addon-dev-kit/include/kodi/libKODI_inputstream.h" -#include "addons/AddonCallbacks.h" +#include "addons/binary/interfaces/api1/InputStream/AddonCallbacksInputStream.h" #ifdef _WIN32 #include <windows.h> @@ -34,6 +34,7 @@ #endif using namespace std; +using namespace V1::KodiAPI::InputStream; extern "C" { @@ -45,7 +46,7 @@ DLLEXPORT void* INPUTSTREAM_register_me(void *hdl) fprintf(stderr, "libKODI_inputstream-ERROR: %s is called with NULL handle\n", __FUNCTION__); else { - cb = ((AddonCB*)hdl)->INPUTSTREAMLib_RegisterMe(((AddonCB*)hdl)->addonData); + cb = (CB_INPUTSTREAMLib*)((AddonCB*)hdl)->INPUTSTREAMLib_RegisterMe(((AddonCB*)hdl)->addonData); if (!cb) fprintf(stderr, "libKODI_inputstream--ERROR: %s can't get callback table from KODI\n", __FUNCTION__); } diff --git a/lib/addons/library.xbmc.addon/libXBMC_addon.cpp b/lib/addons/library.xbmc.addon/libXBMC_addon.cpp index 757cbc87b0..50738d9e09 100644 --- a/lib/addons/library.xbmc.addon/libXBMC_addon.cpp +++ b/lib/addons/library.xbmc.addon/libXBMC_addon.cpp @@ -22,9 +22,10 @@ #include <stdlib.h> #include <stdarg.h> #include <string> -#include "addons/AddonCallbacks.h" +#include <sys/stat.h> #include "addons/kodi-addon-dev-kit/include/kodi/xbmc_addon_types.h" #include "addons/kodi-addon-dev-kit/include/kodi/libXBMC_addon.h" +#include "addons/binary/interfaces/api1/Addon/AddonCallbacksAddon.h" #ifdef _WIN32 #include <windows.h> @@ -36,6 +37,7 @@ using namespace std; using namespace ADDON; +using namespace V1::KodiAPI::AddOn; extern "C" { @@ -47,7 +49,7 @@ DLLEXPORT void* XBMC_register_me(void *hdl) fprintf(stderr, "libXBMC_addon-ERROR: XBMC_register_me is called with NULL handle !!!\n"); else { - cb = ((AddonCB*)hdl)->AddOnLib_RegisterMe(((AddonCB*)hdl)->addonData); + cb = (CB_AddOnLib*)((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"); } @@ -236,7 +238,7 @@ DLLEXPORT bool XBMC_file_exists(void *hdl, void* cb, const char *strFileName, bo 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) +DLLEXPORT int XBMC_stat_file(void *hdl, void* cb, const char *strFileName, struct __stat64* buffer) { if (cb == NULL) return -1; diff --git a/lib/addons/library.xbmc.codec/libXBMC_codec.cpp b/lib/addons/library.xbmc.codec/libXBMC_codec.cpp index 8d1afac1b5..8f13c6805f 100644 --- a/lib/addons/library.xbmc.codec/libXBMC_codec.cpp +++ b/lib/addons/library.xbmc.codec/libXBMC_codec.cpp @@ -22,7 +22,7 @@ #include <stdlib.h> #include <stdarg.h> #include <string> -#include "addons/AddonCallbacks.h" +#include "addons/binary/interfaces/api1/Codec/AddonCallbacksCodec.h" #include "addons/kodi-addon-dev-kit/include/kodi/libXBMC_codec.h" #ifdef _WIN32 @@ -33,18 +33,19 @@ #endif using namespace std; +using namespace V1::KodiAPI::Codec; extern "C" { DLLEXPORT void* CODEC_register_me(void *hdl) { - CB_CODECLib *cb = NULL; + CB_CodecLib *cb = NULL; if (!hdl) fprintf(stderr, "libXBMC_codec-ERROR: %s is called with NULL handle\n", __FUNCTION__); else { - cb = ((AddonCB*)hdl)->CODECLib_RegisterMe(((AddonCB*)hdl)->addonData); + cb = (CB_CodecLib*)((AddonCB*)hdl)->CodecLib_RegisterMe(((AddonCB*)hdl)->addonData); if (!cb) fprintf(stderr, "libXBMC_codec-ERROR: %s can't get callback table from XBMC\n", __FUNCTION__); } @@ -54,7 +55,7 @@ DLLEXPORT void* CODEC_register_me(void *hdl) DLLEXPORT void CODEC_unregister_me(void *hdl, void* cb) { if (hdl && cb) - ((AddonCB*)hdl)->CODECLib_UnRegisterMe(((AddonCB*)hdl)->addonData, (CB_CODECLib*)cb); + ((AddonCB*)hdl)->CodecLib_UnRegisterMe(((AddonCB*)hdl)->addonData, (CB_CodecLib*)cb); } DLLEXPORT xbmc_codec_t CODEC_get_codec_by_name(void *hdl, void* cb, const char* strCodecName) @@ -64,7 +65,7 @@ DLLEXPORT xbmc_codec_t CODEC_get_codec_by_name(void *hdl, void* cb, const char* retVal.codec_type = XBMC_CODEC_TYPE_UNKNOWN; if (cb != NULL) - retVal = ((CB_CODECLib*)cb)->GetCodecByName(((AddonCB*)hdl)->addonData, strCodecName); + retVal = ((CB_CodecLib*)cb)->GetCodecByName(((AddonCB*)hdl)->addonData, strCodecName); return retVal; } diff --git a/lib/addons/library.xbmc.pvr/libXBMC_pvr.cpp b/lib/addons/library.xbmc.pvr/libXBMC_pvr.cpp index cc9f3c8635..c993c43d73 100644 --- a/lib/addons/library.xbmc.pvr/libXBMC_pvr.cpp +++ b/lib/addons/library.xbmc.pvr/libXBMC_pvr.cpp @@ -24,7 +24,7 @@ #include <stdlib.h> #include <stdarg.h> #include <string> -#include "addons/AddonCallbacks.h" +#include "addons/binary/interfaces/api1/PVR/AddonCallbacksPVR.h" #include "addons/kodi-addon-dev-kit/include/kodi/libXBMC_pvr.h" #include "cores/VideoPlayer/DVDDemuxers/DVDDemuxPacket.h" @@ -36,6 +36,7 @@ #endif using namespace std; +using namespace V1::KodiAPI::PVR; extern "C" { @@ -47,7 +48,7 @@ DLLEXPORT void* PVR_register_me(void *hdl) fprintf(stderr, "libXBMC_pvr-ERROR: PVRLib_register_me is called with NULL handle !!!\n"); else { - cb = ((AddonCB*)hdl)->PVRLib_RegisterMe(((AddonCB*)hdl)->addonData); + cb = (CB_PVRLib*)((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"); } |