![]() |
Kodi Documentation
18.0
Kodi is an open source media player and entertainment hub.
|
General addon interface functions More...
Modules | |
Definitions, structures and enumerators | |
General definition values | |
Functions | |
void * | kodi::GetInterface (const std::string &name, const std::string &version) |
Returns a function table to a named interface. More... | |
std::string | kodi::GetAddonInfo (const std::string &id) |
Returns the value of an addon property as a string. More... | |
bool | kodi::OpenSettings () |
Opens this Add-Ons settings dialog. More... | |
std::string | kodi::GetLocalizedString (uint32_t labelId, const std::string &defaultStr="") |
Returns an addon's localized 'unicode string'. More... | |
bool | kodi::UnknownToUTF8 (const std::string &stringSrc, std::string &utf8StringDst, bool failOnBadChar=false) |
Translate a string with an unknown encoding to UTF8. More... | |
std::string | kodi::GetLanguage (LangFormats format=LANG_FMT_ENGLISH_NAME, bool region=false) |
Returns the active language as a string. More... | |
void | kodi::QueueFormattedNotification (QueueMsg type, const char *format,...) |
Writes the C string pointed by format in the GUI. If format includes format specifiers (subsequences beginning with %), the additional arguments following format are formatted and inserted in the resulting string replacing their respective specifiers. More... | |
void | kodi::QueueNotification (QueueMsg type, const std::string &header, const std::string &message, const std::string &imageFile="", unsigned int displayTime=5000, bool withSound=true, unsigned int messageTime=1000) |
Queue a notification in the GUI. More... | |
std::string | kodi::GetMD5 (const std::string &text) |
Get the MD5 digest of the given text. More... | |
std::string | kodi::GetTempAddonPath (const std::string &append="") |
To get a temporary path for the addon. More... | |
std::string | kodi::GetRegion (const std::string &id) |
Returns your regions setting as a string for the specified id. More... | |
void | kodi::GetFreeMem (long &free, long &total, bool asBytes=false) |
Returns the amount of free memory in MByte (or as bytes) as an long integer. More... | |
int | kodi::GetGlobalIdleTime () |
Returns the elapsed idle time in seconds as an integer. More... | |
std::string | kodi::GetCurrentSkinId () |
Get the currently used skin identification name from KodiMore... | |
void | kodi::KodiVersion (kodi_version_t &version) |
Get current Kodi informations and versions, returned data from the following kodi_version_t version; kodi::KodiVersion(version); is e.g.: version.compile_name = Kodi version.major = 18 version.minor = 0 version.revision = 20170706-c6b22fe217-di version.tag = alpha version.tag_revision = 1 . More... | |
General addon interface functions
|
inline |
Returns the value of an addon property as a string.
[in] | id | id of the property that the module needs to access
|
Example:
|
inline |
Example:
|
inline |
Returns the amount of free memory in MByte (or as bytes) as an long integer.
[out] | free | free memory |
[out] | total | total memory |
[in] | asBytes | [opt] if set to true becomes returned as bytes, otherwise as mega bytes |
Example:
|
inline |
Returns the elapsed idle time in seconds as an integer.
Example:
|
inline |
Returns a function table to a named interface.
Example:
|
inline |
Returns the active language as a string.
[in] | format | Used format of the returned language string
| ||||||||
[in] | region | [opt] append the region delimited by "-" of the language (setting) to the returned language string (default is false ) |
Example:
|
inline |
Returns an addon's localized 'unicode string'.
[in] | labelId | string you want to localize |
[in] | defaultStr | [opt] The default message, also helps to identify the code that is used (default is empty ) |
Example:
|
inline |
Get the MD5 digest of the given text.
[in] | text | text to compute the MD5 for |
Example:
|
inline |
Returns your regions setting as a string for the specified id.
[in] | id | id of setting to return
|
Example:
|
inline |
To get a temporary path for the addon.
This gives a temporary path which the addon can use individually for its things.
The content of this folder will be deleted when Kodi is finished!
[in] | append | A string to append to returned temporary path |
|
inline |
Get current Kodi informations and versions, returned data from the following kodi_version_t version; kodi::KodiVersion(version);
is e.g.:
.
[out] | version | structure to store data from kodi |
Example:
|
inline |
Opens this Add-Ons settings dialog.
Example:
Writes the C string pointed by format in the GUI. If format includes format specifiers (subsequences beginning with %), the additional arguments following format are formatted and inserted in the resulting string replacing their respective specifiers.
After the format parameter, the function expects at least as many additional arguments as specified by format.
[in] | type | The message type.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[in] | format | The format of the message to pass to display in Kodi. C string that contains the text to be written to the stream. It can optionally contain embedded format specifiers that are replaced by the values specified in subsequent additional arguments and formatted as requested.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[in] | ... | (additional arguments) Depending on the format string, the function may expect a sequence of additional arguments, each containing a value to be used to replace a format specifier in the format string (or a pointer to a storage location, for n). There should be at least as many of these arguments as the number of values specified in the format specifiers. Additional arguments are ignored by the function. |
Example:
|
inline |
Queue a notification in the GUI.
[in] | type | The message type.
| ||||||||||
[in] | header | Header Name (if leaved empty becomes addon name used) | ||||||||||
[in] | message | Message to display on Kodi | ||||||||||
[in] | imageFile | [opt] The image file to show on message (to use must be type set to QUEUE_OWN_STYLE) | ||||||||||
[in] | displayTime | [opt] The time how long message is displayed (default 5 sec) (to use must be type set to QUEUE_OWN_STYLE) | ||||||||||
[in] | withSound | [opt] if true also warning sound becomes played (default with sound) (to use must be type set to QUEUE_OWN_STYLE) | ||||||||||
[in] | messageTime | [opt] how many milli seconds start show of notification (default 1 sec) (to use must be type set to QUEUE_OWN_STYLE) |
Example:
Example:
Example:
|
inline |
Translate a string with an unknown encoding to UTF8.
[in] | stringSrc | The string to translate. |
[out] | utf8StringDst | The translated string. |
[in] | failOnBadChar | [opt] returns failed if bad character is inside (default is false ) |
Example: