Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
PVR::CPVRPlaybackState Class Reference

#include <PVRPlaybackState.h>

Classes

class  CLastWatchedUpdateTimer
 

Public Member Functions

 CPVRPlaybackState ()
 ctor.
 
virtual ~CPVRPlaybackState ()
 dtor.
 
void Clear ()
 clear instances, keep stored UIDs.
 
void ReInit ()
 re-init using stored UIDs.
 
void OnPlaybackStarted (const CFileItem &item)
 Inform that playback of an item just started.
 
bool OnPlaybackStopped (const CFileItem &item)
 Inform that playback of an item was stopped due to user interaction.
 
bool OnPlaybackEnded (const CFileItem &item)
 Inform that playback of an item has stopped without user interaction.
 
void StartPlayback (CFileItem *item, ContentUtils::PlayMode mode=ContentUtils::PlayMode::CHECK_AUTO_PLAY_NEXT_ITEM) const
 Start playback of the given item.
 
bool IsPlaying () const
 Check if a TV channel, radio channel or recording is playing.
 
bool IsPlayingTV () const
 Check if a TV channel is playing.
 
bool IsPlayingRadio () const
 Check if a radio channel is playing.
 
bool IsPlayingEncryptedChannel () const
 Check if a an encrypted TV or radio channel is playing.
 
bool IsPlayingRecording () const
 Check if a recording is playing.
 
bool IsPlayingEpgTag () const
 Check if an epg tag is playing.
 
bool IsPlayingChannel (int iClientID, int iUniqueChannelID) const
 Check whether playing channel matches given uids.
 
bool IsPlayingChannel (const std::shared_ptr< const CPVRChannel > &channel) const
 Check if the given channel is playing.
 
bool IsPlayingRecording (const std::shared_ptr< const CPVRRecording > &recording) const
 Check if the given recording is playing.
 
bool IsPlayingEpgTag (const std::shared_ptr< const CPVREpgInfoTag > &epgTag) const
 Check if the given epg tag is playing.
 
std::shared_ptr< CPVRChannelGetPlayingChannel () const
 Return the channel that is currently playing.
 
std::shared_ptr< CPVRChannelGroupMemberGetPlayingChannelGroupMember () const
 Return the channel group member that is currently playing.
 
std::shared_ptr< CPVRRecordingGetPlayingRecording () const
 Return the recording that is currently playing.
 
std::shared_ptr< CPVREpgInfoTagGetPlayingEpgTag () const
 Return the epg tag that is currently playing.
 
int GetPlayingChannelUniqueID () const
 Return playing channel unique identifier.
 
std::string GetPlayingClientName () const
 Get the name of the playing client, if there is one.
 
int GetPlayingClientID () const
 Get the ID of the playing client, if there is one.
 
bool IsRecording () const
 Check whether there are active recordings.
 
bool IsRecordingOnPlayingChannel () const
 Check whether there is an active recording on the currenlyt playing channel.
 
bool IsPlayingActiveRecording () const
 Check if an active recording is playing.
 
bool CanRecordOnPlayingChannel () const
 Check whether the currently playing channel can be recorded.
 
void SetActiveChannelGroup (const std::shared_ptr< CPVRChannelGroup > &group)
 Set the active channel group.
 
std::shared_ptr< CPVRChannelGroupGetActiveChannelGroup (bool bRadio) const
 Get the active channel group.
 
std::shared_ptr< CPVRChannelGroupMemberGetLastPlayedChannelGroupMember (bool bRadio) const
 Get the last played channel group member.
 
std::shared_ptr< CPVRChannelGroupMemberGetPreviousToLastPlayedChannelGroupMember (bool bRadio) const
 Get the channel group member that was played before the last played member.
 
CDateTime GetPlaybackTime (int iClientID, int iUniqueChannelID) const
 Get current playback time for the given channel, taking timeshifting and playing epg tags into account.
 
CDateTime GetChannelPlaybackTime (int iClientID, int iUniqueChannelID) const
 Get current playback time for the given channel, taking timeshifting into account.
 

Constructor & Destructor Documentation

◆ CPVRPlaybackState()

CPVRPlaybackState::CPVRPlaybackState ( )
default

ctor.

◆ ~CPVRPlaybackState()

CPVRPlaybackState::~CPVRPlaybackState ( )
virtualdefault

dtor.

Member Function Documentation

◆ CanRecordOnPlayingChannel()

bool CPVRPlaybackState::CanRecordOnPlayingChannel ( ) const

Check whether the currently playing channel can be recorded.

Returns
True if there is a playing channel that can be recorded, false otherwise.

◆ Clear()

void CPVRPlaybackState::Clear ( )

clear instances, keep stored UIDs.

◆ GetActiveChannelGroup()

std::shared_ptr< CPVRChannelGroup > CPVRPlaybackState::GetActiveChannelGroup ( bool bRadio) const

Get the active channel group.

Parameters
bRadioTrue to get the active radio group, false to get the active TV group.
Returns
The current group or the group containing all channels if it's not set.

◆ GetChannelPlaybackTime()

CDateTime CPVRPlaybackState::GetChannelPlaybackTime ( int iClientID,
int iUniqueChannelID ) const

Get current playback time for the given channel, taking timeshifting into account.

Parameters
iClientIDThe client id.
iUniqueChannelIDThe channel uid.
Returns
The playback time or 'now' if not playing.

◆ GetLastPlayedChannelGroupMember()

std::shared_ptr< CPVRChannelGroupMember > CPVRPlaybackState::GetLastPlayedChannelGroupMember ( bool bRadio) const

Get the last played channel group member.

Parameters
bRadioTrue to get the radio group member, false to get the TV group member.
Returns
The last played group member or nullptr if it's not available.

◆ GetPlaybackTime()

CDateTime CPVRPlaybackState::GetPlaybackTime ( int iClientID,
int iUniqueChannelID ) const

Get current playback time for the given channel, taking timeshifting and playing epg tags into account.

Parameters
iClientIDThe client id.
iUniqueChannelIDThe channel uid.
Returns
The playback time or 'now' if not playing.

◆ GetPlayingChannel()

std::shared_ptr< CPVRChannel > CPVRPlaybackState::GetPlayingChannel ( ) const

Return the channel that is currently playing.

Returns
The channel or nullptr if none is playing.

◆ GetPlayingChannelGroupMember()

std::shared_ptr< CPVRChannelGroupMember > CPVRPlaybackState::GetPlayingChannelGroupMember ( ) const

Return the channel group member that is currently playing.

Returns
The channel group member or nullptr if none is playing.

◆ GetPlayingChannelUniqueID()

int CPVRPlaybackState::GetPlayingChannelUniqueID ( ) const

Return playing channel unique identifier.

Returns
The channel id or -1 if not present

◆ GetPlayingClientID()

int CPVRPlaybackState::GetPlayingClientID ( ) const

Get the ID of the playing client, if there is one.

Returns
The ID or -1 if no client is playing.

◆ GetPlayingClientName()

std::string CPVRPlaybackState::GetPlayingClientName ( ) const

Get the name of the playing client, if there is one.

Returns
The name of the client or an empty string if nothing is playing.

◆ GetPlayingEpgTag()

std::shared_ptr< CPVREpgInfoTag > CPVRPlaybackState::GetPlayingEpgTag ( ) const

Return the epg tag that is currently playing.

Returns
The tag or nullptr if none is playing.

◆ GetPlayingRecording()

std::shared_ptr< CPVRRecording > CPVRPlaybackState::GetPlayingRecording ( ) const

Return the recording that is currently playing.

Returns
The recording or nullptr if none is playing.

◆ GetPreviousToLastPlayedChannelGroupMember()

std::shared_ptr< CPVRChannelGroupMember > CPVRPlaybackState::GetPreviousToLastPlayedChannelGroupMember ( bool bRadio) const

Get the channel group member that was played before the last played member.

Parameters
bRadioTrue to get the radio group member, false to get the TV group member.
Returns
The previous played group member or nullptr if it's not available.

◆ IsPlaying()

bool CPVRPlaybackState::IsPlaying ( ) const

Check if a TV channel, radio channel or recording is playing.

Returns
True if it's playing, false otherwise.

◆ IsPlayingActiveRecording()

bool CPVRPlaybackState::IsPlayingActiveRecording ( ) const

Check if an active recording is playing.

Returns
True if an in-progress (active) recording is playing, false otherwise.

◆ IsPlayingChannel() [1/2]

bool CPVRPlaybackState::IsPlayingChannel ( const std::shared_ptr< const CPVRChannel > & channel) const

Check if the given channel is playing.

Parameters
channelThe channel to check.
Returns
True if it's playing, false otherwise.

◆ IsPlayingChannel() [2/2]

bool CPVRPlaybackState::IsPlayingChannel ( int iClientID,
int iUniqueChannelID ) const

Check whether playing channel matches given uids.

Parameters
iClientIDThe client id.
iUniqueChannelIDThe channel uid.
Returns
True on match, false if there is no match or no channel is playing.

◆ IsPlayingEncryptedChannel()

bool CPVRPlaybackState::IsPlayingEncryptedChannel ( ) const

Check if a an encrypted TV or radio channel is playing.

Returns
True if it's playing, false otherwise.

◆ IsPlayingEpgTag() [1/2]

bool CPVRPlaybackState::IsPlayingEpgTag ( ) const

Check if an epg tag is playing.

Returns
True if it's playing, false otherwise.

◆ IsPlayingEpgTag() [2/2]

bool CPVRPlaybackState::IsPlayingEpgTag ( const std::shared_ptr< const CPVREpgInfoTag > & epgTag) const

Check if the given epg tag is playing.

Parameters
epgTagThe tag to check.
Returns
True if it's playing, false otherwise.

◆ IsPlayingRadio()

bool CPVRPlaybackState::IsPlayingRadio ( ) const

Check if a radio channel is playing.

Returns
True if it's playing, false otherwise.

◆ IsPlayingRecording() [1/2]

bool CPVRPlaybackState::IsPlayingRecording ( ) const

Check if a recording is playing.

Returns
True if it's playing, false otherwise.

◆ IsPlayingRecording() [2/2]

bool CPVRPlaybackState::IsPlayingRecording ( const std::shared_ptr< const CPVRRecording > & recording) const

Check if the given recording is playing.

Parameters
recordingThe recording to check.
Returns
True if it's playing, false otherwise.

◆ IsPlayingTV()

bool CPVRPlaybackState::IsPlayingTV ( ) const

Check if a TV channel is playing.

Returns
True if it's playing, false otherwise.

◆ IsRecording()

bool CPVRPlaybackState::IsRecording ( ) const

Check whether there are active recordings.

Returns
True if there are active recordings, false otherwise.

◆ IsRecordingOnPlayingChannel()

bool CPVRPlaybackState::IsRecordingOnPlayingChannel ( ) const

Check whether there is an active recording on the currenlyt playing channel.

Returns
True if there is a playing channel and there is an active recording on that channel, false otherwise.

◆ OnPlaybackEnded()

bool CPVRPlaybackState::OnPlaybackEnded ( const CFileItem & item)

Inform that playback of an item has stopped without user interaction.

Parameters
itemThe item that ended to play.
Returns
True, if the state has changed, false otherwise

◆ OnPlaybackStarted()

void CPVRPlaybackState::OnPlaybackStarted ( const CFileItem & item)

Inform that playback of an item just started.

Parameters
itemThe item that started to play.

◆ OnPlaybackStopped()

bool CPVRPlaybackState::OnPlaybackStopped ( const CFileItem & item)

Inform that playback of an item was stopped due to user interaction.

Parameters
itemThe item that stopped to play.
Returns
True, if the state has changed, false otherwise

◆ ReInit()

void CPVRPlaybackState::ReInit ( )

re-init using stored UIDs.

◆ SetActiveChannelGroup()

void CPVRPlaybackState::SetActiveChannelGroup ( const std::shared_ptr< CPVRChannelGroup > & group)

Set the active channel group.

Parameters
groupThe new group.

◆ StartPlayback()

void CPVRPlaybackState::StartPlayback ( CFileItem * item,
ContentUtils::PlayMode mode = ContentUtils::PlayMode::CHECK_AUTO_PLAY_NEXT_ITEM ) const

Start playback of the given item.

Parameters
itemcontaining a channel, a recording or an epg tag.
modeplayback mode.

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