|
void ATTR_DLL_LOCAL | kodi::Log (const ADDON_LOG loglevel, const char *format,...) |
| Add a message to Kodi's log.
|
|
bool ATTR_DLL_LOCAL | kodi::UnknownToUTF8 (const std::string &stringSrc, std::string &utf8StringDst, bool failOnBadChar=false) |
| Translate a string with an unknown encoding to UTF8.
|
|
std::string ATTR_DLL_LOCAL | kodi::GetLanguage (LangFormats format=LANG_FMT_ENGLISH_NAME, bool region=false) |
| Returns the active language as a string.
|
|
void ATTR_DLL_LOCAL | 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.
|
|
void ATTR_DLL_LOCAL | 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.
|
|
std::string ATTR_DLL_LOCAL | kodi::GetMD5 (const std::string &text) |
| Get the MD5 digest of the given text.
|
|
std::string ATTR_DLL_LOCAL | kodi::GetRegion (const std::string &id) |
| Returns your regions setting as a string for the specified id.
|
|
void ATTR_DLL_LOCAL | kodi::GetFreeMem (long &free, long &total, bool asBytes=false) |
| Returns the amount of free memory in MByte (or as bytes) as an long integer.
|
|
int ATTR_DLL_LOCAL | kodi::GetGlobalIdleTime () |
| Returns the elapsed idle time in seconds as an integer.
|
|
std::string ATTR_DLL_LOCAL | kodi::GetCurrentSkinId () |
| Get the currently used skin identification name from Kodi.
|
|
bool ATTR_DLL_LOCAL | kodi::IsAddonAvailable (const std::string &id, std::string &version, bool &enabled) |
| To check another addon is available and usable inside Kodi.
|
|
void ATTR_DLL_LOCAL | kodi::KodiVersion (kodi_version_t &version) |
| Get current Kodi information and versions, returned data from the following kodi_version_t version; kodi::KodiVersion(version); is e.g.:
|
|
bool ATTR_DLL_LOCAL | kodi::GetKeyboardLayout (int modifierKey, std::string &layout_name, std::vector< std::vector< std::string > > &layout) |
| To get keyboard layout characters.
|
|
bool ATTR_DLL_LOCAL | kodi::ChangeKeyboardLayout (std::string &layout_name) |
| To change keyboard layout characters.
|
|
To check another addon is available and usable inside Kodi.
- Parameters
-
[in] | id | The wanted addon identification string to check |
[out] | version | Version string of addon if installed inside Kodi |
[out] | enabled | Set to true true* </b> if addon is enabled / @return Returns <b> true* if addon is installed |
Example: ~~~~~~~~~~~~~{.cpp} #include <kodi/General.h>
bool enabled = false; std::string version; bool ret = kodi::IsAddonAvailable("inputstream.adaptive", version, enabled); fprintf(stderr, "Available inputstream.adaptive version '%s' and enabled '%s'\n", ret ? version.c_str() : "not installed", enabled ? "yes" : "no"); ~~~~~~~~~~~~~
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.
- Parameters
-
[in] | type | The message type.
enum code: | Description: |
QUEUE_INFO | Show info notification message |
QUEUE_WARNING | Show warning notification message |
QUEUE_ERROR | Show error notification message |
|
[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.
specifier | Output | Example |
d or i | Signed decimal integer | 392 |
u | Unsigned decimal integer | 7235 |
o | Unsigned octal | 610 |
x | Unsigned hexadecimal integer | 7fa |
X | Unsigned hexadecimal integer (uppercase) | 7FA |
f | Decimal floating point, lowercase | 392.65 |
F | Decimal floating point, uppercase | 392.65 |
e | Scientific notation (mantissa/exponent), lowercase | 3.9265e+2 |
E | Scientific notation (mantissa/exponent), uppercase | 3.9265E+2 |
g | Use the shortest representation: e or f | 392.65 |
G | Use the shortest representation: E or F | 392.65 |
a | Hexadecimal floating point, lowercase | -0xc.90fep-2 |
A | Hexadecimal floating point, uppercase | -0XC.90FEP-2 |
c | Character | a |
s | String of characters | sample |
p | Pointer address | b8000000 |
% | A % followed by another % character will write a single % to the stream. | % |
|
The length sub-specifier modifies the length of the data type. This is a chart showing the types used to interpret the corresponding arguments with and without length specifier (if a different type is used, the proper type promotion or conversion is performed, if allowed):
length | d i | u o x X | f F e E g G a A | c | s | p | n |
(none) | int | unsigned int | double | int | char* | void* | int* |
hh | signed char | unsigned char | | | | | signed char* |
h | short int | unsigned short int | | | | | short int* |
l | long int | unsigned long int | | wint_t | wchar_t* | | long int* |
ll | long long int | unsigned long long int | | | | | long long int* |
j | intmax_t | uintmax_t | | | | | intmax_t* |
z | size_t | size_t | | | | | size_t* |
t | ptrdiff_t | ptrdiff_t | | | | | ptrdiff_t* |
L | | | long double | | | | |
Note: that the c specifier takes an int (or wint_t) as argument, but performs the proper conversion to a char value (or a wchar_t) before formatting it for output.
- Parameters
-
[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:
...
kodi::QueueFormattedNotification(
QUEUE_WARNING,
"I'm want to inform you, here with a test call to show '%s'",
"this");
...
@ QUEUE_WARNING
Show warning notification message.
Definition kodi-dev-kit/include/kodi/c-api/General.h:47