Kodi Development  20.0
for Binary and Script based Add-Ons

Detailed Description

To get info about the device, display and several other parts
These are functions to query any values or to transfer them to Kodi.

Function Documentation

◆ TransferPresets()

void TransferPresets ( const std::vector< std::string > &  presets)
inline

To transfer available presets on addon.

Used if GetPresets not possible to use, e.g. where available presets are only known during Start call.

Parameters
[in]presetsList to store available presets.
Note
The function should only be called once, if possible

◆ Device()

kodi::HardwareContext Device ( )
inline

Device that represents the display adapter.

Returns
A pointer to the used device with HardwareContext
Note
This is only available on DirectX, It us unused (nullptr) on OpenGL

Example:

#include <d3d11_1.h>
..
// Note: Device() there is used inside addon child class about
// kodi::addon::CInstanceVisualization
ID3D11DeviceContext1* context = static_cast<ID3D11DeviceContext1*>(kodi::addon::CInstanceVisualization::Device());
..
kodi::HardwareContext Device()
Device that represents the display adapter.
Definition: Visualization.h:750

◆ X()

int X ( )
inline

Returns the X position of the rendering window.

Returns
The X position, in pixels

◆ Y()

int Y ( )
inline

Returns the Y position of the rendering window.

Returns
The Y position, in pixels

◆ Width()

int Width ( )
inline

Returns the width of the rendering window.

Returns
The width, in pixels

◆ Height()

int Height ( )
inline

Returns the height of the rendering window.

Returns
The height, in pixels

◆ PixelRatio()

float PixelRatio ( )
inline

Pixel aspect ratio (often abbreviated PAR) is a ratio that describes how the width of a pixel compares to the height of that pixel.

Returns
The pixel aspect ratio used by the display

◆ Name()

std::string Name ( )
inline

Used to get the name of the add-on defined in addon.xml.

Returns
The add-on name

◆ Presets()

std::string Presets ( )
inline

Used to get the full path where the add-on is installed.

Returns
The add-on installation path

◆ Profile()

std::string Profile ( )
inline

Used to get the full path to the add-on's user profile.

Note
The trailing folder (consisting of the add-on's ID) is not created by default. If it is needed, you must call kodi::vfs::CreateDirectory() to create the folder.
Returns
Path to the user profile