Kodi Documentation  18.0
Kodi is an open source media player and entertainment hub.
PVR::CPVRClients Class Reference

#include <PVRClients.h>

Inheritance diagram for PVR::CPVRClients:
ADDON::IAddonMgrCallback

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< SBackendGetBackendProperties () 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< CPVRClientPtrGetClientsSupportingChannelScan (void) const
 Get a list of clients providing a channel scan dialog. More...
 
std::vector< CPVRClientPtrGetClientsSupportingChannelSettings (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...
 
- Public Member Functions inherited from ADDON::IAddonMgrCallback
virtual ~IAddonMgrCallback ()=default
 

Constructor & Destructor Documentation

§ CPVRClients()

CPVRClients::CPVRClients ( void  )

§ ~CPVRClients()

CPVRClients::~CPVRClients ( void  )
override

Member Function Documentation

§ ConnectionStateChange()

void CPVRClients::ConnectionStateChange ( CPVRClient client,
std::string &  strConnectionString,
PVR_CONNECTION_STATE  newState,
std::string &  strMessage 
)

Notify a change of an addon connection state.

Parameters
clientThe changed client.
strConnectionStringA human-readable string identifiying the addon.
newStateThe new connection state.
strMessageA human readable message providing additional information.

§ Continue()

void CPVRClients::Continue ( )

Continue all clients.

§ CreatedClientAmount()

int CPVRClients::CreatedClientAmount ( void  ) const

Get the number of created clients.

Returns
The amount of created clients.

§ DeleteAllRecordingsFromTrash()

PVR_ERROR CPVRClients::DeleteAllRecordingsFromTrash ( )

Delete all "soft" deleted recordings permanently on the backend.

Returns
PVR_ERROR_NO_ERROR if the operation succeeded, the respective PVR_ERROR value otherwise.

§ EnabledClientAmount()

int CPVRClients::EnabledClientAmount ( void  ) const

Get the number of enabled clients.

Returns
The amount of enabled clients.

§ GetBackendProperties()

std::vector< SBackend > CPVRClients::GetBackendProperties ( ) const

Returns properties about all created clients.

Returns
the properties

§ GetChannelGroupMembers()

PVR_ERROR CPVRClients::GetChannelGroupMembers ( CPVRChannelGroup group,
std::vector< int > &  failedClients 
)

Get all group members of a channel group.

Parameters
groupThe group to get the member for.
failedClientsin case of errors will contain the ids of the clients for which the channel group members could not be obtained.
Returns
PVR_ERROR_NO_ERROR if the channel group members were fetched successfully, last error otherwise.

§ GetChannelGroups()

PVR_ERROR CPVRClients::GetChannelGroups ( CPVRChannelGroups groups,
std::vector< int > &  failedClients 
)

Get all channel groups from backends.

Parameters
groupsStore the channel groups in this container.
failedClientsin case of errors will contain the ids of the clients for which the channel groups could not be obtained.
Returns
PVR_ERROR_NO_ERROR if the channel groups were fetched successfully, last error otherwise.

§ GetChannels()

PVR_ERROR CPVRClients::GetChannels ( CPVRChannelGroupInternal group,
std::vector< int > &  failedClients 
)

Get all channels from backends.

Parameters
groupThe container to store the channels in.
failedClientsin case of errors will contain the ids of the clients for which the channels could not be obtained.
Returns
PVR_ERROR_NO_ERROR if the channels were fetched successfully, last error otherwise.

§ GetClient()

bool CPVRClients::GetClient ( const std::string &  strId,
ADDON::AddonPtr addon 
) const

Get a client given its ID.

Parameters
strIdThe ID of the client.
addonOn success, filled with the client matching the given ID, null otherwise.
Returns
True if the client was found, false otherwise.

§ GetClientId()

int CPVRClients::GetClientId ( const std::string &  strId) const

Get a client's numeric ID given its string ID.

Parameters
strIdThe string ID.
Returns
The numeric ID matching the given string ID, -1 on error.

§ GetClientsSupportingChannelScan()

std::vector< CPVRClientPtr > CPVRClients::GetClientsSupportingChannelScan ( void  ) const

Get a list of clients providing a channel scan dialog.

Returns
All clients supporting channel scan.

§ GetClientsSupportingChannelSettings()

std::vector< CPVRClientPtr > CPVRClients::GetClientsSupportingChannelSettings ( bool  bRadio) const

Get a list of clients providing a channel settings dialog.

Returns
All clients supporting channel settings.

§ GetCreatedClient()

bool CPVRClients::GetCreatedClient ( int  iClientId,
CPVRClientPtr addon 
) const

Get the instance of the client, if it's created.

Parameters
iClientIdThe ID of the client to get.
addonWill be filled with requested client on success, null otherwise.
Returns
True on success, false otherwise.

§ GetCreatedClients()

int CPVRClients::GetCreatedClients ( CPVRClientMap clients) const

Get all created clients.

Parameters
clientsAll created clients will be added to this map.
Returns
The amount of clients added to the map.

§ GetFirstCreatedClientID()

int CPVRClients::GetFirstCreatedClientID ( void  )

Get the ID of the first created client.

Returns
the ID or -1 if no clients are created;

§ GetRecordings()

PVR_ERROR CPVRClients::GetRecordings ( CPVRRecordings recordings,
bool  deleted 
)

Get all recordings from clients.

Parameters
recordingsStore the recordings in this container.
deletedIf true, return deleted recordings, return not deleted recordings otherwise.
Returns
PVR_ERROR_NO_ERROR if the operation succeeded, the respective PVR_ERROR value otherwise.

§ GetTimers()

bool CPVRClients::GetTimers ( CPVRTimersContainer timers,
std::vector< int > &  failedClients 
)

Get all timers from all created clients.

Parameters
timersStore the timers in this container.
failedClientsin case of errors will contain the ids of the clients for which the timers could not be obtained.
Returns
true on success for all clients, false in case of error for at least one client.

§ GetTimerTypes()

PVR_ERROR CPVRClients::GetTimerTypes ( CPVRTimerTypes results) const

Get all supported timer types.

Parameters
resultsThe container to store the result in.
Returns
PVR_ERROR_NO_ERROR if the operation succeeded, the respective PVR_ERROR value otherwise.

§ HasCreatedClients()

bool CPVRClients::HasCreatedClients ( void  ) const

Check whether there are any created clients.

Returns
True if at least one client is created.

§ IsCreatedClient()

bool CPVRClients::IsCreatedClient ( int  iClientId) const

Check whether a given client ID points to a created client.

Parameters
iClientIdThe client ID.
Returns
True if the the client ID represents a created client, false otherwise.

§ OnAddonEvent()

void CPVRClients::OnAddonEvent ( const ADDON::AddonEvent event)

Handle addon events (enable, disable, ...).

Parameters
eventThe addon event.

§ OnPowerSavingActivated()

void CPVRClients::OnPowerSavingActivated ( )

Propagate "power saving activated" event to clients.

§ OnPowerSavingDeactivated()

void CPVRClients::OnPowerSavingDeactivated ( )

Propagate "power saving deactivated" event to clients.

§ OnSystemSleep()

void CPVRClients::OnSystemSleep ( )

Propagate "system sleep" event to clients.

§ OnSystemWake()

void CPVRClients::OnSystemWake ( )

Propagate "system wakup" event to clients.

§ RequestRestart()

bool CPVRClients::RequestRestart ( ADDON::AddonPtr  addon,
bool  bDataChanged 
)
overridevirtual

Restart a single client add-on.

Parameters
addonThe add-on to restart.
bDataChangedTrue if the client's data changed, false otherwise (unused).
Returns
True if the client was found and restarted, false otherwise.

Implements ADDON::IAddonMgrCallback.

§ SetEPGTimeFrame()

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.

Parameters
iDaysnumber of days from "now". EPG_TIMEFRAME_UNLIMITED means that Kodi is interested in all epg events, regardless of event times.
Returns
PVR_ERROR_NO_ERROR if the operation succeeded, the respective PVR_ERROR value otherwise.

§ Start()

void CPVRClients::Start ( void  )

Start all clients.

§ Stop()

void CPVRClients::Stop ( )

Stop all clients.

§ StopClient()

bool CPVRClients::StopClient ( const ADDON::AddonPtr addon,
bool  bRestart 
)

Stop a client.

Parameters
addonThe client to stop.
bRestartIf true, restart the client.
Returns
True if the client was found, false otherwise.

§ SupportsTimers()

bool CPVRClients::SupportsTimers ( ) const

Check whether there is at least one created client supporting timers.

Returns
True if at least one created client supports timers, false otherwise.

§ UpdateAddons()

void CPVRClients::UpdateAddons ( const std::string &  changedAddonId = "")

Update add-ons from the AddonManager.

Parameters
changedAddonIdThe id of the changed addon, empty string denotes 'any addon'.

The documentation for this class was generated from the following files: