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

#include <PVRClient.h>

Inheritance diagram for PVR::CPVRClient:
ADDON::CAddonDll ADDON::CAddon ADDON::IAddon

Public Member Functions

 CPVRClient (ADDON::CAddonInfo addonInfo)
 
 ~CPVRClient (void) override
 
void OnPreInstall () override
 
void OnPreUnInstall () override
 
ADDON::AddonPtr GetRunningInstance () const override
 retrieve the running instance of an add-on if it persists while running. More...
 
PVR add-on methods
ADDON_STATUS Create (int iClientId)
 Initialise the instance of this add-on. More...
 
bool DllLoaded (void) const
 
void Stop ()
 Stop this add-on instance. No more client add-on access after this call. More...
 
void Continue ()
 Continue this add-on instance. Client add-on access is okay again after this call. More...
 
void Destroy (void)
 Destroy the instance of this add-on. More...
 
void ReCreate (void)
 Destroy and recreate this add-on. More...
 
bool ReadyToUse (void) const
 
PVR_CONNECTION_STATE GetConnectionState (void) const
 Gets the backend connection state. More...
 
void SetConnectionState (PVR_CONNECTION_STATE state)
 Sets the backend connection state. More...
 
PVR_CONNECTION_STATE GetPreviousConnectionState (void) const
 Gets the backend's previous connection state. More...
 
bool IgnoreClient (void) const
 signal to PVRManager this client should be ignored More...
 
int GetID (void) const
 
PVR server methods
const CPVRClientCapabilitiesGetClientCapabilities (void) const
 Query this add-on's capabilities. More...
 
PVR_ERROR GetStreamProperties (PVR_STREAM_PROPERTIES *pProperties)
 Get the stream properties of the stream that's currently being read. More...
 
const std::string & GetBackendName (void) const
 
const std::string & GetBackendVersion (void) const
 
const std::string & GetBackendHostname (void) const
 the ip address or alias of the pvr backend server More...
 
const std::string & GetConnectionString (void) const
 
const std::string & GetFriendlyName (void) const
 
PVR_ERROR GetDriveSpace (long long &iTotal, long long &iUsed)
 Get the disk space reported by the server. More...
 
PVR_ERROR StartChannelScan (void)
 Start a channel scan on the server. More...
 
PVR_ERROR OpenDialogChannelAdd (const CPVRChannelPtr &channel)
 Request the client to open dialog about given channel to add. More...
 
PVR_ERROR OpenDialogChannelSettings (const CPVRChannelPtr &channel)
 Request the client to open dialog about given channel settings. More...
 
PVR_ERROR DeleteChannel (const CPVRChannelPtr &channel)
 Request the client to delete given channel. More...
 
PVR_ERROR RenameChannel (const CPVRChannelPtr &channel)
 Request the client to rename given channel. More...
 
PVR_ERROR IsRecordable (const CConstPVREpgInfoTagPtr &tag, bool &bIsRecordable) const
 
PVR_ERROR IsPlayable (const CConstPVREpgInfoTagPtr &tag, bool &bIsPlayable) const
 
PVR_ERROR FillEpgTagStreamFileItem (CFileItem &fileItem)
 Fill the file item for an epg tag with the properties required for playback. Values are obtained from the PVR backend. More...
 
bool HasMenuHooks (PVR_MENUHOOK_CAT cat) const
 
PVR_MENUHOOKSGetMenuHooks ()
 
PVR_ERROR CallMenuHook (const PVR_MENUHOOK &hook, const CFileItemPtr item)
 Call one of the menu hooks of this client. More...
 
PVR EPG methods
PVR_ERROR GetEPGForChannel (const CPVRChannelPtr &channel, CPVREpg *epg, time_t start=0, time_t end=0, bool bSaveInDb=false)
 Request an EPG table for a channel from the client. More...
 
PVR_ERROR SetEPGTimeFrame (int iDays)
 
PVR channel group methods
PVR_ERROR GetChannelGroupsAmount (int &iGroups)
 Get the total amount of channel groups from the backend. More...
 
PVR_ERROR GetChannelGroups (CPVRChannelGroups *groups)
 Request the list of all channel groups from the backend. More...
 
PVR_ERROR GetChannelGroupMembers (CPVRChannelGroup *group)
 Request the list of all group members from the backend. More...
 
PVR channel methods
PVR_ERROR GetChannelsAmount (int &iChannels)
 Get the total amount of channels from the backend. More...
 
PVR_ERROR GetChannels (CPVRChannelGroup &channels, bool bRadio)
 Request the list of all channels from the backend. More...
 
PVR recording methods
PVR_ERROR GetRecordingsAmount (bool deleted, int &iRecordings)
 Get the total amount of recordings from the backend. More...
 
PVR_ERROR GetRecordings (CPVRRecordings *results, bool deleted)
 Request the list of all recordings from the backend. More...
 
PVR_ERROR DeleteRecording (const CPVRRecording &recording)
 Delete a recording on the backend. More...
 
PVR_ERROR UndeleteRecording (const CPVRRecording &recording)
 Undelete a recording on the backend. More...
 
PVR_ERROR DeleteAllRecordingsFromTrash ()
 Delete all recordings permanent which in the deleted folder on the backend. More...
 
PVR_ERROR RenameRecording (const CPVRRecording &recording)
 Rename a recording on the backend. More...
 
PVR_ERROR SetRecordingLifetime (const CPVRRecording &recording)
 Set the lifetime of a recording on the backend. More...
 
PVR_ERROR SetRecordingPlayCount (const CPVRRecording &recording, int count)
 Set the play count of a recording on the backend. More...
 
PVR_ERROR SetRecordingLastPlayedPosition (const CPVRRecording &recording, int lastplayedposition)
 Set the last watched position of a recording on the backend. More...
 
PVR_ERROR GetRecordingLastPlayedPosition (const CPVRRecording &recording, int &iPosition)
 Retrieve the last watched position of a recording on the backend. More...
 
PVR_ERROR GetRecordingEdl (const CPVRRecording &recording, std::vector< PVR_EDL_ENTRY > &edls)
 Retrieve the edit decision list (EDL) from the backend. More...
 
PVR_ERROR GetEpgTagEdl (const CConstPVREpgInfoTagPtr &epgTag, std::vector< PVR_EDL_ENTRY > &edls)
 Retrieve the edit decision list (EDL) from the backend. More...
 
PVR timer methods
PVR_ERROR GetTimersAmount (int &iTimers)
 Get the total amount of timers from the backend. More...
 
PVR_ERROR GetTimers (CPVRTimersContainer *results)
 Request the list of all timers from the backend. More...
 
PVR_ERROR AddTimer (const CPVRTimerInfoTag &timer)
 Add a timer on the backend. More...
 
PVR_ERROR DeleteTimer (const CPVRTimerInfoTag &timer, bool bForce=false)
 Delete a timer on the backend. More...
 
PVR_ERROR UpdateTimer (const CPVRTimerInfoTag &timer)
 Update the timer information on the server. More...
 
PVR_ERROR GetTimerTypes (CPVRTimerTypes &results) const
 Get all timer types supported by the backend. More...
 
PVR live stream methods
PVR_ERROR OpenLiveStream (const CPVRChannelPtr &channel)
 Open a live stream on the server. More...
 
PVR_ERROR CloseLiveStream ()
 Close an open live stream. More...
 
PVR_ERROR ReadLiveStream (void *lpBuf, int64_t uiBufSize, int &iRead)
 Read from an open live stream. More...
 
PVR_ERROR SeekLiveStream (int64_t iFilePosition, int iWhence, int64_t &iPosition)
 Seek in a live stream on a backend. More...
 
PVR_ERROR GetLiveStreamLength (int64_t &iLength)
 Get the lenght of the currently playing live stream, if any. More...
 
PVR_ERROR PauseStream (bool bPaused)
 (Un)Pause a stream. More...
 
PVR_ERROR SignalQuality (PVR_SIGNAL_STATUS &qualityinfo)
 Get the signal quality of the stream that's currently open. More...
 
PVR_ERROR GetDescrambleInfo (PVR_DESCRAMBLE_INFO &descrambleinfo) const
 Get the descramble information of the stream that's currently open. More...
 
PVR_ERROR FillChannelStreamFileItem (CFileItem &fileItem)
 Fill the file item for a channel with the properties required for playback. Values are obtained from the PVR backend. More...
 
PVR_ERROR CanPauseStream (bool &bCanPause) const
 Check whether PVR backend supports pausing the currently playing stream. More...
 
PVR_ERROR CanSeekStream (bool &bCanSeek) const
 Check whether PVR backend supports seeking for the currently playing stream. More...
 
PVR_ERROR SeekTime (double time, bool backwards, double *startpts)
 Notify the pvr addon/demuxer that Kodi wishes to seek the stream by time. More...
 
PVR_ERROR SetSpeed (int speed)
 Notify the pvr addon/demuxer that Kodi wishes to change playback speed. More...
 
PVR recording stream methods
PVR_ERROR OpenRecordedStream (const CPVRRecordingPtr &recording)
 Open a recording on the server. More...
 
PVR_ERROR CloseRecordedStream ()
 Close an open recording stream. More...
 
PVR_ERROR ReadRecordedStream (void *lpBuf, int64_t uiBufSize, int &iRead)
 Read from an open recording stream. More...
 
PVR_ERROR SeekRecordedStream (int64_t iFilePosition, int iWhence, int64_t &iPosition)
 Seek in a recording stream on a backend. More...
 
PVR_ERROR GetRecordedStreamLength (int64_t &iLength)
 Get the lenght of the currently playing recording stream, if any. More...
 
PVR_ERROR FillRecordingStreamFileItem (CFileItem &fileItem)
 Fill the file item for a recording with the properties required for playback. Values are obtained from the PVR backend. More...
 
- Public Member Functions inherited from ADDON::CAddonDll
 CAddonDll (CAddonInfo addonInfo, BinaryAddonBasePtr addonBase)
 
 CAddonDll (CAddonInfo addonInfo)
 
 ~CAddonDll () override
 
virtual ADDON_STATUS GetStatus ()
 
std::string LibPath () const override
 
void SaveSettings () override
 Save any user configured settings. More...
 
std::string GetSetting (const std::string &key) override
 Retrieve a particular settings value If a previously configured user setting is available, we return it's value, else we return the default (if available) More...
 
ADDON_STATUS Create (ADDON_TYPE type, void *funcTable, void *info)
 
void Destroy ()
 
bool DllLoaded (void) const
 
ADDON_STATUS CreateInstance (ADDON_TYPE instanceType, const std::string &instanceID, KODI_HANDLE instance, KODI_HANDLE parentInstance=nullptr)
 Function to create a addon instance class. More...
 
void DestroyInstance (const std::string &instanceID)
 Function to destroy a on addon created instance class. More...
 
bool Initialized () const
 
- Public Member Functions inherited from ADDON::CAddon
 CAddon (CAddonInfo addonInfo)
 
 ~CAddon () override=default
 
TYPE Type () const override
 
TYPE FullType () const override
 
bool IsType (TYPE type) const override
 
std::string ID () const override
 
std::string Name () const override
 
bool IsInUse () const override
 
AddonVersion Version () const override
 
AddonVersion MinVersion () const override
 
std::string Summary () const override
 
std::string Description () const override
 
std::string Path () const override
 
std::string Profile () const override
 
std::string Author () const override
 
std::string ChangeLog () const override
 
std::string Icon () const override
 
ArtMap Art () const override
 
std::vector< std::string > Screenshots () const override
 
std::string Disclaimer () const override
 
std::string Broken () const override
 
CDateTime InstallDate () const override
 
CDateTime LastUpdated () const override
 
CDateTime LastUsed () const override
 
std::string Origin () const override
 
uint64_t PackageSize () const override
 
const InfoMapExtraInfo () const override
 
const std::vector< DependencyInfo > & GetDependencies () const override
 
std::string FanArt () const override
 
bool HasSettings () override
 Check whether the this addon can be configured or not. More...
 
virtual bool HasUserSettings ()
 Check whether the user has configured this addon or not. More...
 
void UpdateSetting (const std::string &key, const std::string &value) override
 Update a user-configured setting with a new value. More...
 
bool UpdateSettingBool (const std::string &key, bool value) override
 Update a user-configured setting with a new boolean value. More...
 
bool UpdateSettingInt (const std::string &key, int value) override
 Update a user-configured setting with a new integer value. More...
 
bool UpdateSettingNumber (const std::string &key, double value) override
 Update a user-configured setting with a new number value. More...
 
bool UpdateSettingString (const std::string &key, const std::string &value) override
 Update a user-configured setting with a new string value. More...
 
bool GetSettingBool (const std::string &key, bool &value) override
 Retrieve a particular settings value as boolean If a previously configured user setting is available, we return it's value, else we return the default (if available) More...
 
bool GetSettingInt (const std::string &key, int &value) override
 Retrieve a particular settings value as integer If a previously configured user setting is available, we return it's value, else we return the default (if available) More...
 
bool GetSettingNumber (const std::string &key, double &value) override
 Retrieve a particular settings value as number If a previously configured user setting is available, we return it's value, else we return the default (if available) More...
 
bool GetSettingString (const std::string &key, std::string &value) override
 Retrieve a particular settings value as string If a previously configured user setting is available, we return it's value, else we return the default (if available) More...
 
CAddonSettingsGetSettings () const override
 
AddonVersion GetDependencyVersion (const std::string &dependencyID) const override
 get the required version of a dependency. More...
 
bool MeetsVersion (const AddonVersion &version) const override
 return whether or not this addon satisfies the given version requirements More...
 
bool ReloadSettings () override
 
void OnPostInstall (bool update, bool modal) override
 
void OnPostUnInstall () override
 
- Public Member Functions inherited from ADDON::IAddon
virtual ~IAddon ()=default
 

PVR demultiplexer methods

PVR_ERROR DemuxReset ()
 Reset the demultiplexer in the add-on. More...
 
PVR_ERROR DemuxAbort ()
 Abort the demultiplexer thread in the add-on. More...
 
PVR_ERROR DemuxFlush ()
 Flush all data that's currently in the demultiplexer buffer in the add-on. More...
 
PVR_ERROR DemuxRead (DemuxPacket *&packet)
 Read a packet from the demultiplexer. More...
 
PVR_ERROR IsRealTimeStream (bool &bRealTime) const
 Check whether the currently playing stream, if any, is a real-time stream. More...
 
PVR_ERROR GetStreamTimes (PVR_STREAM_TIMES *times)
 Get Stream times for the currently playing stream, if any (will be moved to inputstream). More...
 
bool GetAddonProperties (void)
 reads the client's properties. More...
 
PVR_ERROR OnSystemSleep ()
 Propagate power management events to this add-on. More...
 
PVR_ERROR OnSystemWake ()
 
PVR_ERROR OnPowerSavingActivated ()
 
PVR_ERROR OnPowerSavingDeactivated ()
 
int GetPriority () const
 Get the priority of this client. Larger value means higher priority. More...
 
void SetPriority (int iPriority)
 Set a new priority for this client. More...
 
PVR_ERROR GetStreamReadChunkSize (int &iChunkSize)
 Obtain the chunk size to use when reading streams. More...
 
AddonInstance_PVRGetInstanceInterface ()
 Get the interface table used between addon and Kodi. More...
 
static const char * ToString (const PVR_ERROR error)
 

Additional Inherited Members

- Static Public Member Functions inherited from ADDON::CAddonDll
static void RegisterInterface (ADDON_GET_INTERFACE_FN fn)
 
- Protected Member Functions inherited from ADDON::CAddon
virtual bool SettingsInitialized () const
 Whether or not the settings have been initialized. More...
 
virtual bool SettingsLoaded () const
 Whether or not the settings have been loaded. More...
 
bool LoadSettings (bool bForce, bool loadUserSettings=true)
 Load the default settings and override these with any previously configured user settings. More...
 
virtual bool LoadUserSettings ()
 Load the user settings. More...
 
virtual bool HasSettingsToSave () const
 
virtual bool SettingsFromXML (const CXBMCTinyXML &doc, bool loadDefaults=false)
 Parse settings from an XML document. More...
 
virtual bool SettingsToXML (CXBMCTinyXML &doc) const
 Write settings into an XML document. More...
 
- Static Protected Member Functions inherited from ADDON::CAddonDll
static std::string GetDllPath (const std::string &strFileName)
 
- Protected Attributes inherited from ADDON::CAddonDll
CAddonInterfacesm_pHelpers
 
std::string m_parentLib
 
- Protected Attributes inherited from ADDON::CAddon
const CAddonInfo m_addonInfo
 
std::string m_userSettingsPath
 

Detailed Description

Interface from Kodi to a PVR add-on.

Also translates Kodi's C++ structures to the add-on's C structures.

Constructor & Destructor Documentation

§ CPVRClient()

PVR::CPVRClient::CPVRClient ( ADDON::CAddonInfo  addonInfo)
explicit

§ ~CPVRClient()

PVR::CPVRClient::~CPVRClient ( void  )
override

Member Function Documentation

§ AddTimer()

PVR_ERROR PVR::CPVRClient::AddTimer ( const CPVRTimerInfoTag timer)

Add a timer on the backend.

Parameters
timerThe timer to add.
Returns
PVR_ERROR_NO_ERROR if the timer has been added successfully.

§ CallMenuHook()

PVR_ERROR PVR::CPVRClient::CallMenuHook ( const PVR_MENUHOOK hook,
const CFileItemPtr  item 
)

Call one of the menu hooks of this client.

Parameters
hookThe hook to call.
itemThe selected file item for which the hook was called.
Returns
PVR_ERROR_NO_ERROR on success, respective error code otherwise.

§ CanPauseStream()

PVR_ERROR PVR::CPVRClient::CanPauseStream ( bool &  bCanPause) const

Check whether PVR backend supports pausing the currently playing stream.

Parameters
bCanPauseTrue if the stream can be paused, false otherwise.
Returns
PVR_ERROR_NO_ERROR on success, respective error code otherwise.

§ CanSeekStream()

PVR_ERROR PVR::CPVRClient::CanSeekStream ( bool &  bCanSeek) const

Check whether PVR backend supports seeking for the currently playing stream.

Parameters
bCanSeekTrue if the stream can be seeked, false otherwise.
Returns
PVR_ERROR_NO_ERROR on success, respective error code otherwise.

§ CloseLiveStream()

PVR_ERROR PVR::CPVRClient::CloseLiveStream ( )

Close an open live stream.

Returns
PVR_ERROR_NO_ERROR on success, respective error code otherwise.

§ CloseRecordedStream()

PVR_ERROR PVR::CPVRClient::CloseRecordedStream ( )

Close an open recording stream.

Returns
PVR_ERROR_NO_ERROR on success, respective error code otherwise.

§ Continue()

void PVR::CPVRClient::Continue ( )

Continue this add-on instance. Client add-on access is okay again after this call.

§ Create()

ADDON_STATUS PVR::CPVRClient::Create ( int  iClientId)

Initialise the instance of this add-on.

Parameters
iClientIdThe ID of this add-on.

§ DeleteAllRecordingsFromTrash()

PVR_ERROR PVR::CPVRClient::DeleteAllRecordingsFromTrash ( )

Delete all recordings permanent which in the deleted folder on the backend.

Returns
PVR_ERROR_NO_ERROR if the recordings has been deleted successfully.

§ DeleteChannel()

PVR_ERROR PVR::CPVRClient::DeleteChannel ( const CPVRChannelPtr channel)

Request the client to delete given channel.

Parameters
channelThe channel to delete
Returns
PVR_ERROR_NO_ERROR if the delete has been fetched successfully.

§ DeleteRecording()

PVR_ERROR PVR::CPVRClient::DeleteRecording ( const CPVRRecording recording)

Delete a recording on the backend.

Parameters
recordingThe recording to delete.
Returns
PVR_ERROR_NO_ERROR if the recording has been deleted successfully.

§ DeleteTimer()

PVR_ERROR PVR::CPVRClient::DeleteTimer ( const CPVRTimerInfoTag timer,
bool  bForce = false 
)

Delete a timer on the backend.

Parameters
timerThe timer to delete.
bForceSet to true to delete a timer that is currently recording a program.
Returns
PVR_ERROR_NO_ERROR if the timer has been deleted successfully.

§ DemuxAbort()

PVR_ERROR PVR::CPVRClient::DemuxAbort ( )

Abort the demultiplexer thread in the add-on.

Returns
PVR_ERROR_NO_ERROR on success, respective error code otherwise.

§ DemuxFlush()

PVR_ERROR PVR::CPVRClient::DemuxFlush ( )

Flush all data that's currently in the demultiplexer buffer in the add-on.

Returns
PVR_ERROR_NO_ERROR on success, respective error code otherwise.

§ DemuxRead()

PVR_ERROR PVR::CPVRClient::DemuxRead ( DemuxPacket *&  packet)

Read a packet from the demultiplexer.

Parameters
packetThe packet read.
Returns
PVR_ERROR_NO_ERROR on success, respective error code otherwise.

§ DemuxReset()

PVR_ERROR PVR::CPVRClient::DemuxReset ( )

Reset the demultiplexer in the add-on.

Returns
PVR_ERROR_NO_ERROR on success, respective error code otherwise.

§ Destroy()

void PVR::CPVRClient::Destroy ( void  )

Destroy the instance of this add-on.

§ DllLoaded()

bool PVR::CPVRClient::DllLoaded ( void  ) const
Returns
True when the dll for this add-on was loaded, false otherwise (e.g. unresolved symbols)

§ FillChannelStreamFileItem()

PVR_ERROR PVR::CPVRClient::FillChannelStreamFileItem ( CFileItem fileItem)

Fill the file item for a channel with the properties required for playback. Values are obtained from the PVR backend.

Parameters
fileItemThe file item to be filled.
Returns
PVR_ERROR_NO_ERROR on success, respective error code otherwise.

§ FillEpgTagStreamFileItem()

PVR_ERROR PVR::CPVRClient::FillEpgTagStreamFileItem ( CFileItem fileItem)

Fill the file item for an epg tag with the properties required for playback. Values are obtained from the PVR backend.

Parameters
fileItemThe file item to be filled.
Returns
PVR_ERROR_NO_ERROR on success, respective error code otherwise.

§ FillRecordingStreamFileItem()

PVR_ERROR PVR::CPVRClient::FillRecordingStreamFileItem ( CFileItem fileItem)

Fill the file item for a recording with the properties required for playback. Values are obtained from the PVR backend.

Parameters
fileItemThe file item to be filled.
Returns
PVR_ERROR_NO_ERROR on success, respective error code otherwise.

§ GetAddonProperties()

bool PVR::CPVRClient::GetAddonProperties ( void  )

reads the client's properties.

Returns
True on success, false otherwise.

§ GetBackendHostname()

const std::string & PVR::CPVRClient::GetBackendHostname ( void  ) const

the ip address or alias of the pvr backend server

§ GetBackendName()

const std::string & PVR::CPVRClient::GetBackendName ( void  ) const
Returns
The name reported by the backend.

§ GetBackendVersion()

const std::string & PVR::CPVRClient::GetBackendVersion ( void  ) const
Returns
The version string reported by the backend.

§ GetChannelGroupMembers()

PVR_ERROR PVR::CPVRClient::GetChannelGroupMembers ( CPVRChannelGroup group)

Request the list of all group members from the backend.

Parameters
groupsThe group to get the members for.
Returns
PVR_ERROR_NO_ERROR if the list has been fetched successfully.

§ GetChannelGroups()

PVR_ERROR PVR::CPVRClient::GetChannelGroups ( CPVRChannelGroups groups)

Request the list of all channel groups from the backend.

Parameters
groupsThe groups container to get the groups for.
Returns
PVR_ERROR_NO_ERROR if the list has been fetched successfully.

§ GetChannelGroupsAmount()

PVR_ERROR PVR::CPVRClient::GetChannelGroupsAmount ( int &  iGroups)

Get the total amount of channel groups from the backend.

Parameters
iGroupsThe total amount of channel groups on the server or -1 on error.
Returns
PVR_ERROR_NO_ERROR on success, respective error code otherwise.

§ GetChannels()

PVR_ERROR PVR::CPVRClient::GetChannels ( CPVRChannelGroup channels,
bool  bRadio 
)

Request the list of all channels from the backend.

Parameters
channelsThe channel group to add the channels to.
bRadioTrue to get the radio channels, false to get the TV channels.
Returns
PVR_ERROR_NO_ERROR if the list has been fetched successfully.

§ GetChannelsAmount()

PVR_ERROR PVR::CPVRClient::GetChannelsAmount ( int &  iChannels)

Get the total amount of channels from the backend.

Parameters
iChannelsThe total amount of channels on the server or -1 on error.
Returns
PVR_ERROR_NO_ERROR on success, respective error code otherwise.

§ GetClientCapabilities()

const CPVRClientCapabilities& PVR::CPVRClient::GetClientCapabilities ( void  ) const
inline

Query this add-on's capabilities.

Returns
The add-on's capabilities.

§ GetConnectionState()

PVR_CONNECTION_STATE PVR::CPVRClient::GetConnectionState ( void  ) const

Gets the backend connection state.

Returns
the backend connection state.

§ GetConnectionString()

const std::string & PVR::CPVRClient::GetConnectionString ( void  ) const
Returns
The connection string reported by the backend.

§ GetDescrambleInfo()

PVR_ERROR PVR::CPVRClient::GetDescrambleInfo ( PVR_DESCRAMBLE_INFO descrambleinfo) const

Get the descramble information of the stream that's currently open.

Parameters
qualityinfoThe descramble information.
Returns
PVR_ERROR_NO_ERROR on success, respective error code otherwise.

§ GetDriveSpace()

PVR_ERROR PVR::CPVRClient::GetDriveSpace ( long long &  iTotal,
long long &  iUsed 
)

Get the disk space reported by the server.

Parameters
iTotalThe total disk space.
iUsedThe used disk space.
Returns
PVR_ERROR_NO_ERROR if the drive space has been fetched successfully.

§ GetEPGForChannel()

PVR_ERROR PVR::CPVRClient::GetEPGForChannel ( const CPVRChannelPtr channel,
CPVREpg epg,
time_t  start = 0,
time_t  end = 0,
bool  bSaveInDb = false 
)

Request an EPG table for a channel from the client.

Parameters
channelThe channel to get the EPG table for.
epgThe table to write the data to.
startThe start time to use.
endThe end time to use.
bSaveInDbIf true, tell the callback method to save any new entry in the database or not. see CAddonCallbacksPVR::PVRTransferEpgEntry()
Returns
PVR_ERROR_NO_ERROR if the table has been fetched successfully.

§ GetEpgTagEdl()

PVR_ERROR PVR::CPVRClient::GetEpgTagEdl ( const CConstPVREpgInfoTagPtr epgTag,
std::vector< PVR_EDL_ENTRY > &  edls 
)

Retrieve the edit decision list (EDL) from the backend.

Parameters
epgTagThe EPG tag.
edlsThe edit decision list (empty on error).
Returns
PVR_ERROR_NO_ERROR on success, respective error code otherwise.

§ GetFriendlyName()

const std::string & PVR::CPVRClient::GetFriendlyName ( void  ) const
Returns
A friendly name for this add-on that can be used in log messages.

§ GetID()

int PVR::CPVRClient::GetID ( void  ) const
Returns
The ID of this instance.

§ GetInstanceInterface()

AddonInstance_PVR* PVR::CPVRClient::GetInstanceInterface ( )
inline

Get the interface table used between addon and Kodi.

Todo:
This function will be removed after old callback library system is removed.

§ GetLiveStreamLength()

PVR_ERROR PVR::CPVRClient::GetLiveStreamLength ( int64_t &  iLength)

Get the lenght of the currently playing live stream, if any.

Parameters
iLengthThe total length of the stream that's currently being read or -1 on error.
Returns
PVR_ERROR_NO_ERROR on success, respective error code otherwise.

§ GetMenuHooks()

PVR_MENUHOOKS & PVR::CPVRClient::GetMenuHooks ( void  )
Returns
The menu hooks for this add-on.

§ GetPreviousConnectionState()

PVR_CONNECTION_STATE PVR::CPVRClient::GetPreviousConnectionState ( void  ) const

Gets the backend's previous connection state.

Returns
the backend's previous connection state.

§ GetPriority()

int PVR::CPVRClient::GetPriority ( ) const

Get the priority of this client. Larger value means higher priority.

Returns
The priority.

§ GetRecordedStreamLength()

PVR_ERROR PVR::CPVRClient::GetRecordedStreamLength ( int64_t &  iLength)

Get the lenght of the currently playing recording stream, if any.

Parameters
iLengthThe total length of the stream that's currently being read or -1 on error.
Returns
PVR_ERROR_NO_ERROR on success, respective error code otherwise.

§ GetRecordingEdl()

PVR_ERROR PVR::CPVRClient::GetRecordingEdl ( const CPVRRecording recording,
std::vector< PVR_EDL_ENTRY > &  edls 
)

Retrieve the edit decision list (EDL) from the backend.

Parameters
recordingThe recording.
edlsThe edit decision list (empty on error).
Returns
PVR_ERROR_NO_ERROR on success, respective error code otherwise.

§ GetRecordingLastPlayedPosition()

PVR_ERROR PVR::CPVRClient::GetRecordingLastPlayedPosition ( const CPVRRecording recording,
int &  iPosition 
)

Retrieve the last watched position of a recording on the backend.

Parameters
recordingThe recording.
iPositionThe last watched position in seconds or -1 on error
Returns
PVR_ERROR_NO_ERROR on success, respective error code otherwise.

§ GetRecordings()

PVR_ERROR PVR::CPVRClient::GetRecordings ( CPVRRecordings results,
bool  deleted 
)

Request the list of all recordings from the backend.

Parameters
resultsThe container to add the recordings to.
deletedTrue to return deleted recordings.
Returns
PVR_ERROR_NO_ERROR if the list has been fetched successfully.

§ GetRecordingsAmount()

PVR_ERROR PVR::CPVRClient::GetRecordingsAmount ( bool  deleted,
int &  iRecordings 
)

Get the total amount of recordings from the backend.

Parameters
deletedTrue to return deleted recordings.
iRecordingsThe total amount of recordings on the server or -1 on error.
Returns
PVR_ERROR_NO_ERROR on success, respective error code otherwise.

§ GetRunningInstance()

ADDON::AddonPtr PVR::CPVRClient::GetRunningInstance ( ) const
overridevirtual

retrieve the running instance of an add-on if it persists while running.

Reimplemented from ADDON::CAddonDll.

§ GetStreamProperties()

PVR_ERROR PVR::CPVRClient::GetStreamProperties ( PVR_STREAM_PROPERTIES pProperties)

Get the stream properties of the stream that's currently being read.

Parameters
pPropertiesThe properties.
Returns
PVR_ERROR_NO_ERROR if the properties have been fetched successfully.

§ GetStreamReadChunkSize()

PVR_ERROR PVR::CPVRClient::GetStreamReadChunkSize ( int &  iChunkSize)

Obtain the chunk size to use when reading streams.

Parameters
iChunkSizethe chunk size in bytes.
Returns
PVR_ERROR_NO_ERROR on success, respective error code otherwise.

§ GetStreamTimes()

PVR_ERROR PVR::CPVRClient::GetStreamTimes ( PVR_STREAM_TIMES times)

Get Stream times for the currently playing stream, if any (will be moved to inputstream).

Parameters
timesThe stream times.
Returns
PVR_ERROR_NO_ERROR on success, respective error code otherwise.

§ GetTimers()

PVR_ERROR PVR::CPVRClient::GetTimers ( CPVRTimersContainer results)

Request the list of all timers from the backend.

Parameters
resultsThe container to store the result in.
Returns
PVR_ERROR_NO_ERROR if the list has been fetched successfully.

§ GetTimersAmount()

PVR_ERROR PVR::CPVRClient::GetTimersAmount ( int &  iTimers)

Get the total amount of timers from the backend.

Parameters
iTimersThe total amount of timers on the backend or -1 on error.
Returns
PVR_ERROR_NO_ERROR on success, respective error code otherwise.

§ GetTimerTypes()

PVR_ERROR PVR::CPVRClient::GetTimerTypes ( CPVRTimerTypes results) const

Get all timer types supported by the backend.

Parameters
resultsThe container to store the result in.
Returns
PVR_ERROR_NO_ERROR if the list has been fetched successfully.

§ HasMenuHooks()

bool PVR::CPVRClient::HasMenuHooks ( PVR_MENUHOOK_CAT  cat) const
Returns
True if this add-on has menu hooks, false otherwise.

§ IgnoreClient()

bool PVR::CPVRClient::IgnoreClient ( void  ) const

signal to PVRManager this client should be ignored

Returns
true if this client should be ignored

§ IsPlayable()

PVR_ERROR PVR::CPVRClient::IsPlayable ( const CConstPVREpgInfoTagPtr tag,
bool &  bIsPlayable 
) const

§ IsRealTimeStream()

PVR_ERROR PVR::CPVRClient::IsRealTimeStream ( bool &  bRealTime) const

Check whether the currently playing stream, if any, is a real-time stream.

Parameters
bRealTimeTrue if real-time, false otherwise.
Returns
PVR_ERROR_NO_ERROR on success, respective error code otherwise.

§ IsRecordable()

PVR_ERROR PVR::CPVRClient::IsRecordable ( const CConstPVREpgInfoTagPtr tag,
bool &  bIsRecordable 
) const

§ OnPowerSavingActivated()

PVR_ERROR PVR::CPVRClient::OnPowerSavingActivated ( )

§ OnPowerSavingDeactivated()

PVR_ERROR PVR::CPVRClient::OnPowerSavingDeactivated ( )

§ OnPreInstall()

void PVR::CPVRClient::OnPreInstall ( )
overridevirtual

Reimplemented from ADDON::CAddon.

§ OnPreUnInstall()

void PVR::CPVRClient::OnPreUnInstall ( )
overridevirtual

Reimplemented from ADDON::CAddon.

§ OnSystemSleep()

PVR_ERROR PVR::CPVRClient::OnSystemSleep ( )

Propagate power management events to this add-on.

Returns
PVR_ERROR_NO_ERROR on success, respective error code otherwise.

§ OnSystemWake()

PVR_ERROR PVR::CPVRClient::OnSystemWake ( )

§ OpenDialogChannelAdd()

PVR_ERROR PVR::CPVRClient::OpenDialogChannelAdd ( const CPVRChannelPtr channel)

Request the client to open dialog about given channel to add.

Parameters
channelThe channel to add
Returns
PVR_ERROR_NO_ERROR if the add has been fetched successfully.

§ OpenDialogChannelSettings()

PVR_ERROR PVR::CPVRClient::OpenDialogChannelSettings ( const CPVRChannelPtr channel)

Request the client to open dialog about given channel settings.

Parameters
channelThe channel to edit
Returns
PVR_ERROR_NO_ERROR if the edit has been fetched successfully.

§ OpenLiveStream()

PVR_ERROR PVR::CPVRClient::OpenLiveStream ( const CPVRChannelPtr channel)

Open a live stream on the server.

Parameters
channelThe channel to stream.
Returns
PVR_ERROR_NO_ERROR on success, respective error code otherwise.

§ OpenRecordedStream()

PVR_ERROR PVR::CPVRClient::OpenRecordedStream ( const CPVRRecordingPtr recording)

Open a recording on the server.

Parameters
recordingThe recording to open.
Returns
PVR_ERROR_NO_ERROR on success, respective error code otherwise.

§ PauseStream()

PVR_ERROR PVR::CPVRClient::PauseStream ( bool  bPaused)

(Un)Pause a stream.

Parameters
bPausedTrue to pause the stream, false to unpause.
Returns
PVR_ERROR_NO_ERROR on success, respective error code otherwise.

§ ReadLiveStream()

PVR_ERROR PVR::CPVRClient::ReadLiveStream ( void lpBuf,
int64_t  uiBufSize,
int &  iRead 
)

Read from an open live stream.

Parameters
lpBufThe buffer to store the data in.
uiBufSizeThe amount of bytes to read.
iReadThe amount of bytes that were actually read from the stream.
Returns
PVR_ERROR_NO_ERROR on success, respective error code otherwise.

§ ReadRecordedStream()

PVR_ERROR PVR::CPVRClient::ReadRecordedStream ( void lpBuf,
int64_t  uiBufSize,
int &  iRead 
)

Read from an open recording stream.

Parameters
lpBufThe buffer to store the data in.
uiBufSizeThe amount of bytes to read.
iReadThe amount of bytes that were actually read from the stream.
Returns
PVR_ERROR_NO_ERROR on success, respective error code otherwise.

§ ReadyToUse()

bool PVR::CPVRClient::ReadyToUse ( void  ) const
Returns
True if this instance is initialised (ADDON_Create returned true), false otherwise.

§ ReCreate()

void PVR::CPVRClient::ReCreate ( void  )

Destroy and recreate this add-on.

§ RenameChannel()

PVR_ERROR PVR::CPVRClient::RenameChannel ( const CPVRChannelPtr channel)

Request the client to rename given channel.

Parameters
channelThe channel to rename
Returns
PVR_ERROR_NO_ERROR if the rename has been fetched successfully.

§ RenameRecording()

PVR_ERROR PVR::CPVRClient::RenameRecording ( const CPVRRecording recording)

Rename a recording on the backend.

Parameters
recordingThe recording to rename.
Returns
PVR_ERROR_NO_ERROR if the recording has been renamed successfully.

§ SeekLiveStream()

PVR_ERROR PVR::CPVRClient::SeekLiveStream ( int64_t  iFilePosition,
int  iWhence,
int64_t &  iPosition 
)

Seek in a live stream on a backend.

Parameters
iFilePositionThe position to seek to.
iWhence?
iPositionThe new position or -1 on error.
Returns
PVR_ERROR_NO_ERROR on success, respective error code otherwise.

§ SeekRecordedStream()

PVR_ERROR PVR::CPVRClient::SeekRecordedStream ( int64_t  iFilePosition,
int  iWhence,
int64_t &  iPosition 
)

Seek in a recording stream on a backend.

Parameters
iFilePositionThe position to seek to.
iWhence?
iPositionThe new position or -1 on error.
Returns
PVR_ERROR_NO_ERROR on success, respective error code otherwise.

§ SeekTime()

PVR_ERROR PVR::CPVRClient::SeekTime ( double  time,
bool  backwards,
double *  startpts 
)

Notify the pvr addon/demuxer that Kodi wishes to seek the stream by time.

Parameters
timeThe absolute time since stream start
backwardsTrue to seek to keyframe BEFORE time, else AFTER
startptscan be updated to point to where display should start
Returns
PVR_ERROR_NO_ERROR on success, respective error code otherwise.
Remarks
Optional, and only used if addon has its own demuxer.

§ SetConnectionState()

void PVR::CPVRClient::SetConnectionState ( PVR_CONNECTION_STATE  state)

Sets the backend connection state.

Parameters
statethe new backend connection state.

§ SetEPGTimeFrame()

PVR_ERROR PVR::CPVRClient::SetEPGTimeFrame ( int  iDays)

Tell the client the time frame to use when notifying epg events back to Kodi. The client 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, client needs 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 new value was successfully set.

§ SetPriority()

void PVR::CPVRClient::SetPriority ( int  iPriority)

Set a new priority for this client.

Parameters
iPriorityThe new priority.

§ SetRecordingLastPlayedPosition()

PVR_ERROR PVR::CPVRClient::SetRecordingLastPlayedPosition ( const CPVRRecording recording,
int  lastplayedposition 
)

Set the last watched position of a recording on the backend.

Parameters
recordingThe recording.
positionThe last watched position in seconds
Returns
PVR_ERROR_NO_ERROR if the position has been stored successfully.

§ SetRecordingLifetime()

PVR_ERROR PVR::CPVRClient::SetRecordingLifetime ( const CPVRRecording recording)

Set the lifetime of a recording on the backend.

Parameters
recordingThe recording to set the lifetime for. recording.m_iLifetime contains the new lifetime value.
Returns
PVR_ERROR_NO_ERROR if the recording's lifetime has been set successfully.

§ SetRecordingPlayCount()

PVR_ERROR PVR::CPVRClient::SetRecordingPlayCount ( const CPVRRecording recording,
int  count 
)

Set the play count of a recording on the backend.

Parameters
recordingThe recording to set the play count.
countPlay count.
Returns
PVR_ERROR_NO_ERROR if the recording's play count has been set successfully.

§ SetSpeed()

PVR_ERROR PVR::CPVRClient::SetSpeed ( int  speed)

Notify the pvr addon/demuxer that Kodi wishes to change playback speed.

Parameters
speedThe requested playback speed
Returns
PVR_ERROR_NO_ERROR on success, respective error code otherwise.
Remarks
Optional, and only used if addon has its own demuxer.

§ SignalQuality()

PVR_ERROR PVR::CPVRClient::SignalQuality ( PVR_SIGNAL_STATUS qualityinfo)

Get the signal quality of the stream that's currently open.

Parameters
qualityinfoThe signal quality.
Returns
PVR_ERROR_NO_ERROR on success, respective error code otherwise.

§ StartChannelScan()

PVR_ERROR PVR::CPVRClient::StartChannelScan ( void  )

Start a channel scan on the server.

Returns
PVR_ERROR_NO_ERROR if the channel scan has been started successfully.

§ Stop()

void PVR::CPVRClient::Stop ( )

Stop this add-on instance. No more client add-on access after this call.

§ ToString()

const char * PVR::CPVRClient::ToString ( const PVR_ERROR  error)
static

§ UndeleteRecording()

PVR_ERROR PVR::CPVRClient::UndeleteRecording ( const CPVRRecording recording)

Undelete a recording on the backend.

Parameters
recordingThe recording to undelete.
Returns
PVR_ERROR_NO_ERROR if the recording has been undeleted successfully.

§ UpdateTimer()

PVR_ERROR PVR::CPVRClient::UpdateTimer ( const CPVRTimerInfoTag timer)

Update the timer information on the server.

Parameters
timerThe timer to update.
Returns
PVR_ERROR_NO_ERROR if the timer has been updated successfully.

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