![]() |
Kodi Docs 20.0
Kodi is an open source media player and entertainment hub.
|
Add-on main instance class
This is the addon main class, similar to an int main()
in executable and carries out initial work and later management of it.
More...
Modules | |
Definitions, structures and enumerators | |
General definition values | |
Functions | |
kodi::addon::CAddonBase::CAddonBase () | |
Addon base class constructor. More... | |
virtual | kodi::addon::CAddonBase::~CAddonBase ()=default |
Destructor. More... | |
virtual ADDON_STATUS | kodi::addon::CAddonBase::Create () |
Main addon creation function. More... | |
virtual ADDON_STATUS | kodi::addon::CAddonBase::SetSetting (const std::string &settingName, const kodi::CSettingValue &settingValue) |
To inform addon about changed settings values. More... | |
virtual ADDON_STATUS | kodi::addon::CAddonBase::CreateInstance (int instanceType, const std::string &instanceID, KODI_HANDLE instance, const std::string &version, KODI_HANDLE &addonInstance) |
Instance created. More... | |
virtual void | kodi::addon::CAddonBase::DestroyInstance (int instanceType, const std::string &instanceID, KODI_HANDLE addonInstance) |
Instance destroy. More... | |
Add-on main instance class
This is the addon main class, similar to an int main()
in executable and carries out initial work and later management of it.
|
inline |
Addon base class constructor.
|
inlinevirtual |
Main addon creation function.
With this function addon can carry out necessary work which is required at later points or start necessary processes.
This function is optional and necessary work can also be carried out using CreateInstance (if it concerns any instance types).
|
inlinevirtual |
Instance created.
[in] | instanceType | The requested type of required instance, see ADDON_TYPE. |
[in] | instanceID | An individual identification key string given by Kodi. |
[in] | instance | The instance handler used by Kodi must be passed to the classes created here. See in the example. |
[in] | version | The from Kodi used version of instance. This can be used to allow compatibility to older versions of them. Further is this given to the parent instance that it can handle differences. |
[out] | addonInstance | The pointer to instance class created in addon. Needed to be able to identify them on calls. |
Here is a code example how this is used:
|
inlinevirtual |
Instance destroy.
This function is optional and intended to notify addon that the instance is terminating.
[in] | instanceType | The requested type of required instance, see ADDON_TYPE. |
[in] | instanceID | An individual identification key string given by Kodi. |
[in] | addonInstance | The pointer to instance class created in addon. |
|
inlinevirtual |
To inform addon about changed settings values.
This becomes called for every entry defined inside his settings.xml and as last call the one where last in xml (to identify end of calls).
The following table contains values that can be set with class CSettingValue :
Name | Type | Get call |
---|---|---|
Settings value as string | std::string | GetString |
Settings value as integer | int | GetInt |
Settings value as unsigned integer | unsigned int | GetUInt |
Settings value as boolean | bool | GetBoolean |
Settings value as floating point | float | GetFloat |
Settings value as enum | enum | GetEnum |
Here is a code example how this is used:
|
virtualdefault |
Destructor.