![]() |
Kodi Documentation
18.0
Kodi is an open source media player and entertainment hub.
|
#include <PVRClients.h>
Public Member Functions | |
CPVRClients (void) | |
~CPVRClients (void) override | |
void | Start (void) |
Start all clients. More... | |
void | Stop () |
Stop all clients. More... | |
void | Continue () |
Continue all clients. More... | |
void | UpdateAddons (const std::string &changedAddonId="") |
Update add-ons from the AddonManager. More... | |
bool | RequestRestart (ADDON::AddonPtr addon, bool bDataChanged) override |
Restart a single client add-on. More... | |
bool | StopClient (const ADDON::AddonPtr &addon, bool bRestart) |
Stop a client. More... | |
void | OnAddonEvent (const ADDON::AddonEvent &event) |
Handle addon events (enable, disable, ...). More... | |
bool | GetClient (const std::string &strId, ADDON::AddonPtr &addon) const |
Get a client given its ID. More... | |
int | GetClientId (const std::string &strId) const |
Get a client's numeric ID given its string ID. More... | |
int | CreatedClientAmount (void) const |
Get the number of created clients. More... | |
bool | HasCreatedClients (void) const |
Check whether there are any created clients. More... | |
bool | IsCreatedClient (int iClientId) const |
Check whether a given client ID points to a created client. More... | |
bool | GetCreatedClient (int iClientId, CPVRClientPtr &addon) const |
Get the instance of the client, if it's created. More... | |
int | GetCreatedClients (CPVRClientMap &clients) const |
Get all created clients. More... | |
int | GetFirstCreatedClientID (void) |
Get the ID of the first created client. More... | |
int | EnabledClientAmount (void) const |
Get the number of enabled clients. More... | |
void | ConnectionStateChange (CPVRClient *client, std::string &strConnectionString, PVR_CONNECTION_STATE newState, std::string &strMessage) |
Notify a change of an addon connection state. More... | |
general methods | |
std::vector< SBackend > | GetBackendProperties () const |
Returns properties about all created clients. More... | |
Timer methods | |
bool | SupportsTimers () const |
Check whether there is at least one created client supporting timers. More... | |
bool | GetTimers (CPVRTimersContainer *timers, std::vector< int > &failedClients) |
Get all timers from all created clients. More... | |
PVR_ERROR | GetTimerTypes (CPVRTimerTypes &results) const |
Get all supported timer types. More... | |
Recording methods | |
PVR_ERROR | GetRecordings (CPVRRecordings *recordings, bool deleted) |
Get all recordings from clients. More... | |
PVR_ERROR | DeleteAllRecordingsFromTrash () |
Delete all "soft" deleted recordings permanently on the backend. More... | |
EPG methods | |
PVR_ERROR | SetEPGTimeFrame (int iDays) |
Channel methods | |
PVR_ERROR | GetChannels (CPVRChannelGroupInternal *group, std::vector< int > &failedClients) |
Get all channels from backends. More... | |
PVR_ERROR | GetChannelGroups (CPVRChannelGroups *groups, std::vector< int > &failedClients) |
Get all channel groups from backends. More... | |
PVR_ERROR | GetChannelGroupMembers (CPVRChannelGroup *group, std::vector< int > &failedClients) |
Get all group members of a channel group. More... | |
std::vector< CPVRClientPtr > | GetClientsSupportingChannelScan (void) const |
Get a list of clients providing a channel scan dialog. More... | |
std::vector< CPVRClientPtr > | GetClientsSupportingChannelSettings (bool bRadio) const |
Get a list of clients providing a channel settings dialog. More... | |
Power management methods | |
void | OnSystemSleep () |
Propagate "system sleep" event to clients. More... | |
void | OnSystemWake () |
Propagate "system wakup" event to clients. More... | |
void | OnPowerSavingActivated () |
Propagate "power saving activated" event to clients. More... | |
void | OnPowerSavingDeactivated () |
Propagate "power saving deactivated" event to clients. More... | |
![]() | |
virtual | ~IAddonMgrCallback ()=default |
CPVRClients::CPVRClients | ( | void | ) |
|
override |
void CPVRClients::ConnectionStateChange | ( | CPVRClient * | client, |
std::string & | strConnectionString, | ||
PVR_CONNECTION_STATE | newState, | ||
std::string & | strMessage | ||
) |
Notify a change of an addon connection state.
client | The changed client. |
strConnectionString | A human-readable string identifiying the addon. |
newState | The new connection state. |
strMessage | A human readable message providing additional information. |
void CPVRClients::Continue | ( | ) |
Continue all clients.
int CPVRClients::CreatedClientAmount | ( | void | ) | const |
Get the number of created clients.
PVR_ERROR CPVRClients::DeleteAllRecordingsFromTrash | ( | ) |
Delete all "soft" deleted recordings permanently on the backend.
int CPVRClients::EnabledClientAmount | ( | void | ) | const |
Get the number of enabled clients.
std::vector< SBackend > CPVRClients::GetBackendProperties | ( | ) | const |
Returns properties about all created clients.
PVR_ERROR CPVRClients::GetChannelGroupMembers | ( | CPVRChannelGroup * | group, |
std::vector< int > & | failedClients | ||
) |
Get all group members of a channel group.
group | The group to get the member for. |
failedClients | in case of errors will contain the ids of the clients for which the channel group members could not be obtained. |
PVR_ERROR CPVRClients::GetChannelGroups | ( | CPVRChannelGroups * | groups, |
std::vector< int > & | failedClients | ||
) |
Get all channel groups from backends.
groups | Store the channel groups in this container. |
failedClients | in case of errors will contain the ids of the clients for which the channel groups could not be obtained. |
PVR_ERROR CPVRClients::GetChannels | ( | CPVRChannelGroupInternal * | group, |
std::vector< int > & | failedClients | ||
) |
Get all channels from backends.
group | The container to store the channels in. |
failedClients | in case of errors will contain the ids of the clients for which the channels could not be obtained. |
bool CPVRClients::GetClient | ( | const std::string & | strId, |
ADDON::AddonPtr & | addon | ||
) | const |
Get a client given its ID.
strId | The ID of the client. |
addon | On success, filled with the client matching the given ID, null otherwise. |
int CPVRClients::GetClientId | ( | const std::string & | strId | ) | const |
Get a client's numeric ID given its string ID.
strId | The string ID. |
std::vector< CPVRClientPtr > CPVRClients::GetClientsSupportingChannelScan | ( | void | ) | const |
Get a list of clients providing a channel scan dialog.
std::vector< CPVRClientPtr > CPVRClients::GetClientsSupportingChannelSettings | ( | bool | bRadio | ) | const |
Get a list of clients providing a channel settings dialog.
bool CPVRClients::GetCreatedClient | ( | int | iClientId, |
CPVRClientPtr & | addon | ||
) | const |
Get the instance of the client, if it's created.
iClientId | The ID of the client to get. |
addon | Will be filled with requested client on success, null otherwise. |
int CPVRClients::GetCreatedClients | ( | CPVRClientMap & | clients | ) | const |
Get all created clients.
clients | All created clients will be added to this map. |
int CPVRClients::GetFirstCreatedClientID | ( | void | ) |
Get the ID of the first created client.
PVR_ERROR CPVRClients::GetRecordings | ( | CPVRRecordings * | recordings, |
bool | deleted | ||
) |
Get all recordings from clients.
recordings | Store the recordings in this container. |
deleted | If true, return deleted recordings, return not deleted recordings otherwise. |
bool CPVRClients::GetTimers | ( | CPVRTimersContainer * | timers, |
std::vector< int > & | failedClients | ||
) |
Get all timers from all created clients.
timers | Store the timers in this container. |
failedClients | in case of errors will contain the ids of the clients for which the timers could not be obtained. |
PVR_ERROR CPVRClients::GetTimerTypes | ( | CPVRTimerTypes & | results | ) | const |
Get all supported timer types.
results | The container to store the result in. |
bool CPVRClients::HasCreatedClients | ( | void | ) | const |
Check whether there are any created clients.
bool CPVRClients::IsCreatedClient | ( | int | iClientId | ) | const |
Check whether a given client ID points to a created client.
iClientId | The client ID. |
void CPVRClients::OnAddonEvent | ( | const ADDON::AddonEvent & | event | ) |
Handle addon events (enable, disable, ...).
event | The addon event. |
void CPVRClients::OnPowerSavingActivated | ( | ) |
Propagate "power saving activated" event to clients.
void CPVRClients::OnPowerSavingDeactivated | ( | ) |
Propagate "power saving deactivated" event to clients.
void CPVRClients::OnSystemSleep | ( | ) |
Propagate "system sleep" event to clients.
void CPVRClients::OnSystemWake | ( | ) |
Propagate "system wakup" event to clients.
|
overridevirtual |
Restart a single client add-on.
addon | The add-on to restart. |
bDataChanged | True if the client's data changed, false otherwise (unused). |
Implements ADDON::IAddonMgrCallback.
PVR_ERROR CPVRClients::SetEPGTimeFrame | ( | int | iDays | ) |
Tell all clients the time frame to use when notifying epg events back to Kodi. The clients might push epg events asynchronously to Kodi using the callback function EpgEventStateChange. To be able to only push events that are actually of interest for Kodi, clients need to know about the epg time frame Kodi uses.
iDays | number of days from "now". EPG_TIMEFRAME_UNLIMITED means that Kodi is interested in all epg events, regardless of event times. |
void CPVRClients::Stop | ( | ) |
Stop all clients.
bool CPVRClients::StopClient | ( | const ADDON::AddonPtr & | addon, |
bool | bRestart | ||
) |
Stop a client.
addon | The client to stop. |
bRestart | If true, restart the client. |
bool CPVRClients::SupportsTimers | ( | ) | const |
Check whether there is at least one created client supporting timers.
void CPVRClients::UpdateAddons | ( | const std::string & | changedAddonId = "" | ) |
Update add-ons from the AddonManager.
changedAddonId | The id of the changed addon, empty string denotes 'any addon'. |