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

#include <ApplicationStackHelper.h>

Inheritance diagram for CApplicationStackHelper:
IApplicationComponent

Public Member Functions

void Clear ()
 
void OnPlayBackStarted ()
 
bool InitializeStack (const CFileItem &item)
 Initialize stack and times for each part.
 
void GetStackPartAndOptions (CFileItem &item, CPlayerOptions &options, bool restart)
 Initialize stack times for each part, start & end, total time, and current part number if resume offset is specified.
 
bool UpdateDiscStackAndTimes (const CFileItem &playedFile)
 Updates the stack, fileItem and database stacktimes with new times. The stack should have already been updated with the new dynpath.
 
void SetNextPartBookmark (const std::string &path)
 If a disc stack is stopped between parts when the next part has not been determined (ie. playlist not selected), then we need to save the bookmark for the next part before exiting playback.
 
int GetCurrentPartNumber () const
 returns the current part number
 
int GetTotalPartNumbers () const
 returns the total number of parts
 
bool IsPlayingStack () const
 Returns true if Application is currently playing any stack.
 
bool IsPlayingDiscStack () const
 Returns true if Application is currently playing a disc (ISO/BMDV/VIDEO_TS) stack.
 
bool IsPlayingRegularStack () const
 Returns true if Application is currently playing a regular (non-disc) stack.
 
bool IsPlayingResolvedDiscStack () const
 Returns true if Application is currently playing a disc stack where all parts up to the current one have been resolved.
 
bool HasNextStackPartFileItem () const
 Returns true if there is another stack part available.
 
bool IsPlayingLastStackPart () const
 Returns true if playing the last part of the stack.
 
CFileItemSetNextStackPartAsCurrent ()
 Sets the next stack part as the current and returns a reference to it.
 
CFileItemSetStackPartAsCurrent (int partNumber)
 Sets a given stack part as the current and returns a reference to it.
 
CFileItemGetCurrentStackPart () const
 Returns the FileItem currently playing back as part of a stack playback.
 
std::chrono::milliseconds GetStackPartEndTime (int partNumber) const
 Returns the end time of a FileItem part of a stack playback.
 
std::chrono::milliseconds GetStackPartStartTime (int partNumber) const
 Returns the start time of a FileItem part of a stack playback.
 
std::chrono::milliseconds GetCurrentStackPartStartTime () const
 Returns the start time of the current FileItem part of a stack playback.
 
std::chrono::milliseconds GetStackTotalTime () const
 Returns the total time of a stack playback.
 
int GetStackPartNumberAtTime (std::chrono::milliseconds msecs) const
 Returns the stack part number corresponding to the given timestamp in a stack playback.
 
std::shared_ptr< const CFileItemGetStack (const CFileItem &item) const
 Returns a smart pointer to the stack CFileItem.
 
bool IsInStack (const CFileItem &item) const
 Returns true if there is a stack for the given CFileItem part.
 
int GetStackPartNumber (const CFileItem &item) const
 Returns the part number of the part in the parameter.
 
std::chrono::milliseconds GetStackPartStartTime (const CFileItem &item) const
 Returns the start time of the part in the parameter.
 
void SetStackPartStartTime (const CFileItem &item, std::chrono::milliseconds startTime) const
 Stores the part start time in the item-stack map.
 
void SetStackFileIds (int fileId)
 Sets the file id of the VideoInfoTag of each part in the stack.
 
void SetStackPartStreamDetails (const CFileItem &item)
 Sets the stream details of the VideoInfoTag of the given part of the stack.
 
void SetStackDynPaths (const std::string &newPath) const
 Updates the DynPath (which contains the entire stack://) of each part in the stack.
 
void SetStackPartPath (const CFileItem &item)
 Updates the stack:// with the DynPath of the given item and then updates all parts in the stack.
 
std::string GetStackDynPath () const
 Returns the stack:// path of the stack.
 
std::string GetOldStackDynPath () const
 Returns the stack:// path of the stack prior to the last resolved part being updated.
 
void SetStackTotalTime (std::chrono::milliseconds totalTime)
 Sets the total time of the stack in each stack part.
 
void SetStackPartOffsets (const CFileItem &item, const std::chrono::milliseconds startOffset, const std::chrono::milliseconds endOffset) const
 Sets the starting and ending offsets of a stack part.
 
int GetKnownStackParts () const
 Returns the number of parts in the stack that are currently resolved (ie. a playlist has been selected and path is bluray://)
 
void IncreaseKnownStackParts ()
 Increases the number of known (resolved) stack parts by one.
 
bool HasDiscParts () const
 Returns true if any part of the stack are disc parts (ISO/BMDV/VIDEO_TS)
 
bool WasPlayingDiscStack () const
 Returns true if any part of the stack was a disc part (ISO/BMDV/VIDEO_TS) \ (prior to being resolved to a playlist bluray:// path)
 
bool IsCurrentPartFinished () const
 Returns true if the current part has finished playing.
 
void SetCurrentPartFinished (bool finished)
 Set the status of the current playing part.
 
bool IsSeekingParts () const
 Returns true if currently seeking between parts.
 
void SetSeekingParts (bool seeking)
 Flag if currently seeking between parts.
 
- Public Member Functions inherited from IApplicationComponent
virtual ~IApplicationComponent ()=default
 

Member Function Documentation

◆ Clear()

void CApplicationStackHelper::Clear ( )

◆ GetCurrentPartNumber()

int CApplicationStackHelper::GetCurrentPartNumber ( ) const
inline

returns the current part number

◆ GetCurrentStackPart()

CFileItem & CApplicationStackHelper::GetCurrentStackPart ( ) const

Returns the FileItem currently playing back as part of a stack playback.

◆ GetCurrentStackPartStartTime()

std::chrono::milliseconds CApplicationStackHelper::GetCurrentStackPartStartTime ( ) const

Returns the start time of the current FileItem part of a stack playback.

◆ GetKnownStackParts()

int CApplicationStackHelper::GetKnownStackParts ( ) const
inline

Returns the number of parts in the stack that are currently resolved (ie. a playlist has been selected and path is bluray://)

◆ GetOldStackDynPath()

std::string CApplicationStackHelper::GetOldStackDynPath ( ) const

Returns the stack:// path of the stack prior to the last resolved part being updated.

◆ GetStack()

std::shared_ptr< const CFileItem > CApplicationStackHelper::GetStack ( const CFileItem & item) const

Returns a smart pointer to the stack CFileItem.

◆ GetStackDynPath()

std::string CApplicationStackHelper::GetStackDynPath ( ) const

Returns the stack:// path of the stack.

◆ GetStackPartAndOptions()

void CApplicationStackHelper::GetStackPartAndOptions ( CFileItem & item,
CPlayerOptions & options,
bool restart )

Initialize stack times for each part, start & end, total time, and current part number if resume offset is specified.

Parameters
itemthe FileItem object that is the stack
optionsplayer options to update
restarttrue if playback is a restart, false otherwise

◆ GetStackPartEndTime()

std::chrono::milliseconds CApplicationStackHelper::GetStackPartEndTime ( int partNumber) const

Returns the end time of a FileItem part of a stack playback.

Parameters
partNumberthe requested part number in the stack

◆ GetStackPartNumber()

int CApplicationStackHelper::GetStackPartNumber ( const CFileItem & item) const

Returns the part number of the part in the parameter.

Parameters
itemthe reference to the item that is part of a stack

◆ GetStackPartNumberAtTime()

int CApplicationStackHelper::GetStackPartNumberAtTime ( std::chrono::milliseconds msecs) const

Returns the stack part number corresponding to the given timestamp in a stack playback.

Parameters
msecsthe requested timestamp in the stack (in milliseconds)

◆ GetStackPartStartTime() [1/2]

std::chrono::milliseconds CApplicationStackHelper::GetStackPartStartTime ( const CFileItem & item) const

Returns the start time of the part in the parameter.

Parameters
itemthe reference to the item that is part of a stack

◆ GetStackPartStartTime() [2/2]

std::chrono::milliseconds CApplicationStackHelper::GetStackPartStartTime ( int partNumber) const

Returns the start time of a FileItem part of a stack playback.

Parameters
partNumberthe requested part number in the stack

◆ GetStackTotalTime()

std::chrono::milliseconds CApplicationStackHelper::GetStackTotalTime ( ) const

Returns the total time of a stack playback.

◆ GetTotalPartNumbers()

int CApplicationStackHelper::GetTotalPartNumbers ( ) const
inline

returns the total number of parts

◆ HasDiscParts()

bool CApplicationStackHelper::HasDiscParts ( ) const

Returns true if any part of the stack are disc parts (ISO/BMDV/VIDEO_TS)

◆ HasNextStackPartFileItem()

bool CApplicationStackHelper::HasNextStackPartFileItem ( ) const

Returns true if there is another stack part available.

◆ IncreaseKnownStackParts()

void CApplicationStackHelper::IncreaseKnownStackParts ( )

Increases the number of known (resolved) stack parts by one.

◆ InitializeStack()

bool CApplicationStackHelper::InitializeStack ( const CFileItem & item)

Initialize stack and times for each part.

Parameters
itemthe FileItem object that is the stack

◆ IsCurrentPartFinished()

bool CApplicationStackHelper::IsCurrentPartFinished ( ) const
inline

Returns true if the current part has finished playing.

◆ IsInStack()

bool CApplicationStackHelper::IsInStack ( const CFileItem & item) const

Returns true if there is a stack for the given CFileItem part.

Parameters
itemthe reference to the item that is part of a stack

◆ IsPlayingDiscStack()

bool CApplicationStackHelper::IsPlayingDiscStack ( ) const

Returns true if Application is currently playing a disc (ISO/BMDV/VIDEO_TS) stack.

◆ IsPlayingLastStackPart()

bool CApplicationStackHelper::IsPlayingLastStackPart ( ) const

Returns true if playing the last part of the stack.

◆ IsPlayingRegularStack()

bool CApplicationStackHelper::IsPlayingRegularStack ( ) const

Returns true if Application is currently playing a regular (non-disc) stack.

◆ IsPlayingResolvedDiscStack()

bool CApplicationStackHelper::IsPlayingResolvedDiscStack ( ) const

Returns true if Application is currently playing a disc stack where all parts up to the current one have been resolved.

◆ IsPlayingStack()

bool CApplicationStackHelper::IsPlayingStack ( ) const

Returns true if Application is currently playing any stack.

◆ IsSeekingParts()

bool CApplicationStackHelper::IsSeekingParts ( ) const
inline

Returns true if currently seeking between parts.

◆ OnPlayBackStarted()

void CApplicationStackHelper::OnPlayBackStarted ( )

◆ SetCurrentPartFinished()

void CApplicationStackHelper::SetCurrentPartFinished ( bool finished)
inline

Set the status of the current playing part.

Parameters
finishedtrue if the current part has finished playing, false otherwise

◆ SetNextPartBookmark()

void CApplicationStackHelper::SetNextPartBookmark ( const std::string & path)

If a disc stack is stopped between parts when the next part has not been determined (ie. playlist not selected), then we need to save the bookmark for the next part before exiting playback.

Parameters
paththe stack:// path

◆ SetNextStackPartAsCurrent()

CFileItem & CApplicationStackHelper::SetNextStackPartAsCurrent ( )

Sets the next stack part as the current and returns a reference to it.

◆ SetSeekingParts()

void CApplicationStackHelper::SetSeekingParts ( bool seeking)
inline

Flag if currently seeking between parts.

Parameters
seekingtrue if currently seeking between parts, false if not

◆ SetStackDynPaths()

void CApplicationStackHelper::SetStackDynPaths ( const std::string & newPath) const

Updates the DynPath (which contains the entire stack://) of each part in the stack.

Parameters
newPaththe updated stack:// path

◆ SetStackFileIds()

void CApplicationStackHelper::SetStackFileIds ( int fileId)

Sets the file id of the VideoInfoTag of each part in the stack.

Parameters
fileIdthe file id

◆ SetStackPartAsCurrent()

CFileItem & CApplicationStackHelper::SetStackPartAsCurrent ( int partNumber)

Sets a given stack part as the current and returns a reference to it.

Parameters
partNumberthe number of the part that needs to become the current one

◆ SetStackPartOffsets()

void CApplicationStackHelper::SetStackPartOffsets ( const CFileItem & item,
const std::chrono::milliseconds startOffset,
const std::chrono::milliseconds endOffset ) const

Sets the starting and ending offsets of a stack part.

Parameters
itemthe FileItem in the stack that has an updated DynPath (eg. bluray://)
startOffsetthe start offset in ms
endOffsetthe end offset in ms

◆ SetStackPartPath()

void CApplicationStackHelper::SetStackPartPath ( const CFileItem & item)

Updates the stack:// with the DynPath of the given item and then updates all parts in the stack.

Parameters
itemthe FileItem in the stack that has an updated DynPath (eg. bluray://)
See also
SetStackDynPaths

◆ SetStackPartStartTime()

void CApplicationStackHelper::SetStackPartStartTime ( const CFileItem & item,
std::chrono::milliseconds startTime ) const

Stores the part start time in the item-stack map.

Parameters
itemthe reference to the item that is part of a stack
startTimethe start time of the part in other parameter

◆ SetStackPartStreamDetails()

void CApplicationStackHelper::SetStackPartStreamDetails ( const CFileItem & item)

Sets the stream details of the VideoInfoTag of the given part of the stack.

Parameters
itemthe reference to the item that is part of a stack

◆ SetStackTotalTime()

void CApplicationStackHelper::SetStackTotalTime ( std::chrono::milliseconds totalTime)

Sets the total time of the stack in each stack part.

Parameters
totalTimethe total time of the stack (in ms)

◆ UpdateDiscStackAndTimes()

bool CApplicationStackHelper::UpdateDiscStackAndTimes ( const CFileItem & playedFile)

Updates the stack, fileItem and database stacktimes with new times. The stack should have already been updated with the new dynpath.

Parameters
playedFileThe FileItem of the actual file played (updated in InputStream).
Returns
true if successful, false otherwise.

◆ WasPlayingDiscStack()

bool CApplicationStackHelper::WasPlayingDiscStack ( ) const
inline

Returns true if any part of the stack was a disc part (ISO/BMDV/VIDEO_TS) \ (prior to being resolved to a playlist bluray:// path)


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