Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
|
#include <PVRClients.h>
Public Member Functions | |
CPVRClients () | |
~CPVRClients () override | |
void | Start () |
Start all clients. | |
void | Stop () |
Stop all clients. | |
void | Continue () |
Continue all clients. | |
void | UpdateClients (const std::string &changedAddonId="", ADDON::AddonInstanceId changedInstanceId=ADDON::ADDON_SINGLETON_INSTANCE_ID) |
Update all clients, sync with Addon Manager state (start, restart, shutdown clients). | |
bool | RequestRestart (const std::string &addonId, ADDON::AddonInstanceId instanceId, bool bDataChanged) override |
Restart a single client add-on. | |
bool | StopClient (int clientId, bool restart) |
Stop a client. | |
void | OnAddonEvent (const ADDON::AddonEvent &event) |
Handle addon events (enable, disable, ...). | |
size_t | CreatedClientAmount () const |
Get the number of created clients. | |
bool | HasCreatedClients () const |
Check whether there are any created clients. | |
bool | IsCreatedClient (int iClientId) const |
Check whether a given client ID points to a created client. | |
std::shared_ptr< CPVRClient > | GetCreatedClient (int clientId) const |
Get the the client for the given client id, if it is created. | |
CPVRClientMap | GetCreatedClients () const |
Get all created clients. | |
int | GetFirstCreatedClientID () const |
Get the ID of the first created client. | |
bool | HasIgnoredClients () const |
Check whether there are any created, but not (yet) connected clients. | |
size_t | EnabledClientAmount () const |
Get the number of enabled clients. | |
bool | IsEnabledClient (int clientId) const |
Check whether a given client ID points to an enabled client. | |
std::vector< CVariant > | GetEnabledClientInfos () const |
Get a list of the enabled client infos. | |
std::vector< CVariant > | GetClientProviderInfos () const |
Get info required for providers. Include both enabled and disabled PVR add-ons. | |
general methods | |
std::vector< SBackend > | GetBackendProperties () const |
Returns properties about all created clients. | |
Timer methods | |
bool | GetTimers (const std::vector< std::shared_ptr< CPVRClient > > &clients, CPVRTimersContainer *timers, std::vector< int > &failedClients) const |
Get all timers from the given clients. | |
PVR_ERROR | UpdateTimerTypes (const std::vector< std::shared_ptr< CPVRClient > > &clients, std::vector< int > &failedClients) |
Update all timer types from the given clients. | |
const std::vector< std::shared_ptr< CPVRTimerType > > | GetTimerTypes () const |
Get all timer types supported by the backends, without updating them from the backends. | |
Recording methods | |
PVR_ERROR | GetRecordings (const std::vector< std::shared_ptr< CPVRClient > > &clients, CPVRRecordings *recordings, bool deleted, std::vector< int > &failedClients) const |
Get all recordings from the given clients. | |
PVR_ERROR | DeleteAllRecordingsFromTrash () |
Delete all "soft" deleted recordings permanently on the backend. | |
EPG methods | |
PVR_ERROR | SetEPGMaxPastDays (int iPastDays) |
Tell all clients the past time frame to use when notifying epg events back to Kodi. | |
PVR_ERROR | SetEPGMaxFutureDays (int iFutureDays) |
Tell all clients the future time frame to use when notifying epg events back to Kodi. | |
Channel methods | |
PVR_ERROR | GetChannels (const std::vector< std::shared_ptr< CPVRClient > > &clients, bool bRadio, std::vector< std::shared_ptr< CPVRChannel > > &channels, std::vector< int > &failedClients) const |
Get all channels from the given clients. | |
PVR_ERROR | GetProviders (const std::vector< std::shared_ptr< CPVRClient > > &clients, CPVRProvidersContainer *providers, std::vector< int > &failedClients) const |
Get all providers from backends. | |
PVR_ERROR | GetChannelGroups (const std::vector< std::shared_ptr< CPVRClient > > &clients, CPVRChannelGroups *groups, std::vector< int > &failedClients) const |
Get all channel groups from the given clients. | |
PVR_ERROR | GetChannelGroupMembers (const std::vector< std::shared_ptr< CPVRClient > > &clients, CPVRChannelGroup *group, std::vector< std::shared_ptr< CPVRChannelGroupMember > > &groupMembers, std::vector< int > &failedClients) const |
Get all group members of a channel group from the given clients. | |
std::vector< std::shared_ptr< CPVRClient > > | GetClientsSupportingChannelScan () const |
Get a list of clients providing a channel scan dialog. | |
std::vector< std::shared_ptr< CPVRClient > > | GetClientsSupportingChannelSettings (bool bRadio) const |
Get a list of clients providing a channel settings dialog. | |
bool | AnyClientSupportingRecordingsSize () const |
Get whether or not any client supports recording size. | |
bool | AnyClientSupportingEPG () const |
Get whether or not any client supports EPG. | |
bool | AnyClientSupportingRecordings () const |
Get whether or not any client supports recordings. | |
bool | AnyClientSupportingRecordingsDelete () const |
Get whether or not any client supports recordings delete. | |
Public Member Functions inherited from ADDON::IAddonMgrCallback | |
virtual | ~IAddonMgrCallback ()=default |
Power management methods | |
void | OnSystemSleep () |
Propagate "system sleep" event to clients. | |
void | OnSystemWake () |
Propagate "system wakeup" event to clients. | |
void | OnPowerSavingActivated () |
Propagate "power saving activated" event to clients. | |
void | OnPowerSavingDeactivated () |
Propagate "power saving deactivated" event to clients. | |
void | ConnectionStateChange (CPVRClient *client, const std::string &strConnectionString, PVR_CONNECTION_STATE newState, const std::string &strMessage) |
Notify a change of an addon connection state. | |
CPVRClients::CPVRClients | ( | ) |
|
override |
bool CPVRClients::AnyClientSupportingEPG | ( | ) | const |
Get whether or not any client supports EPG.
bool CPVRClients::AnyClientSupportingRecordings | ( | ) | const |
Get whether or not any client supports recordings.
bool CPVRClients::AnyClientSupportingRecordingsDelete | ( | ) | const |
Get whether or not any client supports recordings delete.
bool CPVRClients::AnyClientSupportingRecordingsSize | ( | ) | const |
Get whether or not any client supports recording size.
void CPVRClients::ConnectionStateChange | ( | CPVRClient * | client, |
const std::string & | strConnectionString, | ||
PVR_CONNECTION_STATE | newState, | ||
const std::string & | strMessage ) |
Notify a change of an addon connection state.
client | The changed client. |
strConnectionString | A human-readable string providing additional information. |
newState | The new connection state. |
strMessage | A human readable string replacing default state message. |
void CPVRClients::Continue | ( | ) |
Continue all clients.
size_t CPVRClients::CreatedClientAmount | ( | ) | const |
Get the number of created clients.
PVR_ERROR CPVRClients::DeleteAllRecordingsFromTrash | ( | ) |
Delete all "soft" deleted recordings permanently on the backend.
size_t CPVRClients::EnabledClientAmount | ( | ) | const |
Get the number of enabled clients.
std::vector< SBackend > CPVRClients::GetBackendProperties | ( | ) | const |
Returns properties about all created clients.
PVR_ERROR CPVRClients::GetChannelGroupMembers | ( | const std::vector< std::shared_ptr< CPVRClient > > & | clients, |
CPVRChannelGroup * | group, | ||
std::vector< std::shared_ptr< CPVRChannelGroupMember > > & | groupMembers, | ||
std::vector< int > & | failedClients ) const |
Get all group members of a channel group from the given clients.
clients | The clients to fetch data from. Leave empty to fetch data from all created clients. |
group | The group to get the member for. |
groupMembers | The container for the group members. |
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 | ( | const std::vector< std::shared_ptr< CPVRClient > > & | clients, |
CPVRChannelGroups * | groups, | ||
std::vector< int > & | failedClients ) const |
Get all channel groups from the given clients.
clients | The clients to fetch data from. Leave empty to fetch data from all created clients. |
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 | ( | const std::vector< std::shared_ptr< CPVRClient > > & | clients, |
bool | bRadio, | ||
std::vector< std::shared_ptr< CPVRChannel > > & | channels, | ||
std::vector< int > & | failedClients ) const |
Get all channels from the given clients.
clients | The clients to fetch data from. Leave empty to fetch data from all created clients. |
bRadio | Whether to fetch radio or TV channels. |
channels | The container to store the channels. |
failedClients | in case of errors will contain the ids of the clients for which the channels could not be obtained. |
std::vector< CVariant > CPVRClients::GetClientProviderInfos | ( | ) | const |
Get info required for providers. Include both enabled and disabled PVR add-ons.
std::vector< std::shared_ptr< CPVRClient > > CPVRClients::GetClientsSupportingChannelScan | ( | ) | const |
Get a list of clients providing a channel scan dialog.
std::vector< std::shared_ptr< CPVRClient > > CPVRClients::GetClientsSupportingChannelSettings | ( | bool | bRadio | ) | const |
Get a list of clients providing a channel settings dialog.
std::shared_ptr< CPVRClient > CPVRClients::GetCreatedClient | ( | int | clientId | ) | const |
Get the the client for the given client id, if it is created.
clientId | The ID of the client to get. |
CPVRClientMap CPVRClients::GetCreatedClients | ( | ) | const |
Get all created clients.
std::vector< CVariant > CPVRClients::GetEnabledClientInfos | ( | ) | const |
Get a list of the enabled client infos.
int CPVRClients::GetFirstCreatedClientID | ( | ) | const |
Get the ID of the first created client.
PVR_ERROR CPVRClients::GetProviders | ( | const std::vector< std::shared_ptr< CPVRClient > > & | clients, |
CPVRProvidersContainer * | providers, | ||
std::vector< int > & | failedClients ) const |
Get all providers from backends.
clients | The clients to fetch data from. Leave empty to fetch data from all created clients. |
group | The container to store the providers in. |
failedClients | in case of errors will contain the ids of the clients for which the providers could not be obtained. |
PVR_ERROR CPVRClients::GetRecordings | ( | const std::vector< std::shared_ptr< CPVRClient > > & | clients, |
CPVRRecordings * | recordings, | ||
bool | deleted, | ||
std::vector< int > & | failedClients ) const |
Get all recordings from the given clients.
clients | The clients to fetch data from. Leave empty to fetch data from all created clients. |
recordings | Store the recordings in this container. |
deleted | If true, return deleted recordings, return not deleted recordings otherwise. |
failedClients | in case of errors will contain the ids of the clients for which the recordings could not be obtained. |
bool CPVRClients::GetTimers | ( | const std::vector< std::shared_ptr< CPVRClient > > & | clients, |
CPVRTimersContainer * | timers, | ||
std::vector< int > & | failedClients ) const |
Get all timers from the given clients.
clients | The clients to fetch data from. Leave empty to fetch data 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. |
const std::vector< std::shared_ptr< CPVRTimerType > > CPVRClients::GetTimerTypes | ( | ) | const |
Get all timer types supported by the backends, without updating them from the backends.
bool CPVRClients::HasCreatedClients | ( | ) | const |
Check whether there are any created clients.
bool CPVRClients::HasIgnoredClients | ( | ) | const |
Check whether there are any created, but not (yet) connected clients.
Check whether a given client ID points to a created client.
iClientId | The client ID. |
Check whether a given client ID points to an enabled client.
clientId | 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 wakeup" event to clients.
|
overridevirtual |
Restart a single client add-on.
addonId | The add-on to restart. |
instanceId | Instance identifier to use |
bDataChanged | True if the client's data changed, false otherwise (unused). |
Implements ADDON::IAddonMgrCallback.
Tell all clients the future 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 future epg time frame Kodi uses.
[in] | iFutureDays | number of days from "now". EPG_TIMEFRAME_UNLIMITED means that Kodi is interested in all epg events, regardless of event times. |
Tell all clients the past 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 future epg time frame Kodi uses.
[in] | iPastDays | number of days before "now". EPG_TIMEFRAME_UNLIMITED means that Kodi is interested in all epg events, regardless of event times. |
void CPVRClients::Start | ( | ) |
Start all clients.
void CPVRClients::Stop | ( | ) |
Stop all clients.
Stop a client.
clientId | The id of the client to stop. |
restart | If true, restart the client. |
void CPVRClients::UpdateClients | ( | const std::string & | changedAddonId = "", |
ADDON::AddonInstanceId | changedInstanceId = ADDON::ADDON_SINGLETON_INSTANCE_ID ) |
Update all clients, sync with Addon Manager state (start, restart, shutdown clients).
changedAddonId | The id of the changed addon, empty string denotes 'any addon'. |
changedInstanceId | The Identifier of the changed add-on instance |
PVR_ERROR CPVRClients::UpdateTimerTypes | ( | const std::vector< std::shared_ptr< CPVRClient > > & | clients, |
std::vector< int > & | failedClients ) |
Update all timer types from the given clients.
clients | The clients to fetch data from. Leave empty to fetch data from all created clients. |
failedClients | in case of errors will contain the ids of the clients for which the timer types could not be obtained. |