Addon creation macro
This export the three mandatory "C" functions to have available for Kodi.
- Note
- Only this macro can be used on a C++ addon, everything else is done automatically.
- Parameters
-
[in] | AddonClass | Used addon class to be exported with CAddonBase as parent. |
Example:
#include <kodi/AddonBash.h>
{
public:
CMyAddon() = default;
};
{
}
ADDONCREATOR(CMyAddon)
Definition: AddonBase.h:322
ADDON_STATUS
Definition: addon_base.h:128
@ ADDON_STATUS_OK
For everything OK and no error.
Definition: addon_base.h:130
virtual ADDON_STATUS Create()
Main addon creation function.
Definition: AddonBase.h:360
As information, the following functions are exported using this macro:
Function | Use | Description |
ADDON_Create(KODI_HANDLE addonInterface, const char* globalApiVersion, void* unused) | required | Addon creation call.
Like an int main() is this the first on addon called place on his start and create within C++ API related class inside addon.
- Parameters
-
[in] | addonInterface | Handle pointer to get Kodi's given table. There have addon needed values and functions to Kodi and addon must set his functions there for Kodi. |
[in] | globalApiVersion | This give the main version ADDON_GLOBAL_VERSION_MAIN where currently on Kodi's side.
This is unsued on addon as there also other special callback functions for.
Only thought for future use if needed earlier. |
[in] | unused | This is a not used value, only there to have in case of need no Major API version increase where break current. |
- Returns
- ADDON_STATUS_OK if correct, for possible errors see ADDON_STATUS.
|
const char* ADDON_GetTypeVersion(int type) | required | Ask addon about version of given type.
This is used to query its associated version in the addon before work is carried out in it and the Kodi can adapt to it.
- Parameters
-
- Returns
- Version as string of asked type.
|
const char* ADDON_GetTypeMinVersion(int type) | optional | Ask addon about minimal version of given type.
This is used to query its associated min version in the addon before work is carried out in it and the Kodi can adapt to it.
- Note
- The minimum version is optional, if it were not available, the major version is used instead.
- Parameters
-
- Returns
- Min version as string of asked type.
|