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

Classes

class  StackPartInformation
 

Public Member Functions

 CApplicationStackHelper (void)
 
 ~CApplicationStackHelper ()=default
 
void Clear ()
 
void OnPlayBackStarted (const CFileItem &item)
 
bool InitializeStack (const CFileItem &item)
 Initialize stack.
 
std::optional< int64_tInitializeStackStartPartAndOffset (const CFileItem &item)
 Initialize stack times for each part, start & end, total time, and current part number if resume offset is specified.
 
int GetCurrentPartNumber () const
 returns the current part number
 
bool IsPlayingISOStack () const
 Returns true if Application is currently playing an ISO stack.
 
bool IsPlayingRegularStack () const
 Returns true if Application is currently playing a Regular (non-ISO) stack.
 
bool HasNextStackPartFileItem () const
 returns true if there is a next part available
 
const CFileItemSetNextStackPartCurrentFileItem ()
 sets the next stack part as the current and returns a reference to it
 
const CFileItemSetStackPartCurrentFileItem (int partNumber)
 sets a given stack part as the current and returns a reference to it
 
const CFileItemGetCurrentStackPartFileItem () const
 Returns the FileItem currently playing back as part of a (non-ISO) stack playback.
 
uint64_t GetStackPartEndTimeMs (int partNumber) const
 Returns the end time of a FileItem part of a (non-ISO) stack playback.
 
uint64_t GetStackPartStartTimeMs (int partNumber) const
 Returns the start time of a FileItem part of a (non-ISO) stack playback.
 
uint64_t GetCurrentStackPartStartTimeMs () const
 Returns the start time of the current FileItem part of a (non-ISO) stack playback.
 
uint64_t GetStackTotalTimeMs () const
 Returns the total time of a (non-ISO) stack playback.
 
int GetStackPartNumberAtTimeMs (uint64_t msecs)
 Returns the stack part number corresponding to the given timestamp in a (non-ISO) stack playback.
 
void ClearAllRegisteredStackInformation ()
 Clear all entries in the item-stack map. To be called upon playback stopped.
 
std::shared_ptr< const CFileItemGetRegisteredStack (const CFileItem &item) const
 Returns a smart pointer to the stack CFileItem.
 
bool HasRegisteredStack (const CFileItem &item) const
 Returns true if there is a registered stack for the given CFileItem part.
 
void SetRegisteredStack (const CFileItem &item, std::shared_ptr< CFileItem > stackItem)
 Stores a smart pointer to the stack CFileItem in the item-stack map.
 
int GetRegisteredStackPartNumber (const CFileItem &item)
 Returns the part number of the part in the parameter.
 
void SetRegisteredStackPartNumber (const CFileItem &item, int partNumber)
 Stores the part number in the item-stack map.
 
uint64_t GetRegisteredStackPartStartTimeMs (const CFileItem &item) const
 Returns the start time of the part in the parameter.
 
void SetRegisteredStackPartStartTimeMs (const CFileItem &item, uint64_t startTimeMs)
 Stores the part start time in the item-stack map.
 
uint64_t GetRegisteredStackTotalTimeMs (const CFileItem &item) const
 Returns the total time of the stack associated to the part in the parameter.
 
void SetRegisteredStackTotalTimeMs (const CFileItem &item, uint64_t totalTimeMs)
 Stores the stack's total time associated to the part in the item-stack map.
 
- Public Member Functions inherited from IApplicationComponent
virtual ~IApplicationComponent ()=default
 

Public Attributes

CCriticalSection m_critSection
 

Protected Types

typedef std::shared_ptr< StackPartInformationStackPartInformationPtr
 
typedef std::map< std::string, StackPartInformationPtrStackmap
 

Protected Member Functions

CFileItemGetStackPartFileItem (int partNumber)
 Returns a FileItem part of a (non-ISO) stack playback.
 
const CFileItemGetStackPartFileItem (int partNumber) const
 
StackPartInformationPtr GetStackPartInformation (const std::string &key)
 
StackPartInformationPtr GetStackPartInformation (const std::string &key) const
 

Protected Attributes

Stackmap m_stackmap
 
std::unique_ptr< CFileItemListm_currentStack
 
int m_currentStackPosition = 0
 
bool m_currentStackIsDiscImageStack = false
 

Member Typedef Documentation

◆ Stackmap

typedef std::map<std::string, StackPartInformationPtr> CApplicationStackHelper::Stackmap
protected

◆ StackPartInformationPtr

Constructor & Destructor Documentation

◆ CApplicationStackHelper()

CApplicationStackHelper::CApplicationStackHelper ( void )

◆ ~CApplicationStackHelper()

CApplicationStackHelper::~CApplicationStackHelper ( )
default

Member Function Documentation

◆ Clear()

void CApplicationStackHelper::Clear ( )

◆ ClearAllRegisteredStackInformation()

void CApplicationStackHelper::ClearAllRegisteredStackInformation ( )

Clear all entries in the item-stack map. To be called upon playback stopped.

◆ GetCurrentPartNumber()

int CApplicationStackHelper::GetCurrentPartNumber ( ) const
inline

returns the current part number

◆ GetCurrentStackPartFileItem()

const CFileItem & CApplicationStackHelper::GetCurrentStackPartFileItem ( ) const
inline

Returns the FileItem currently playing back as part of a (non-ISO) stack playback.

◆ GetCurrentStackPartStartTimeMs()

uint64_t CApplicationStackHelper::GetCurrentStackPartStartTimeMs ( ) const
inline

Returns the start time of the current FileItem part of a (non-ISO) stack playback.

◆ GetRegisteredStack()

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

Returns a smart pointer to the stack CFileItem.

◆ GetRegisteredStackPartNumber()

int CApplicationStackHelper::GetRegisteredStackPartNumber ( const CFileItem & item)

Returns the part number of the part in the parameter.

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

◆ GetRegisteredStackPartStartTimeMs()

uint64_t CApplicationStackHelper::GetRegisteredStackPartStartTimeMs ( 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

◆ GetRegisteredStackTotalTimeMs()

uint64_t CApplicationStackHelper::GetRegisteredStackTotalTimeMs ( const CFileItem & item) const

Returns the total time of the stack associated to the part in the parameter.

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

◆ GetStackPartEndTimeMs()

uint64_t CApplicationStackHelper::GetStackPartEndTimeMs ( int partNumber) const

Returns the end time of a FileItem part of a (non-ISO) stack playback.

Parameters
partNumberthe requested part number in the stack

◆ GetStackPartFileItem() [1/2]

CFileItem & CApplicationStackHelper::GetStackPartFileItem ( int partNumber)
protected

Returns a FileItem part of a (non-ISO) stack playback.

Parameters
partNumberthe requested part number in the stack

◆ GetStackPartFileItem() [2/2]

const CFileItem & CApplicationStackHelper::GetStackPartFileItem ( int partNumber) const
protected

◆ GetStackPartInformation() [1/2]

CApplicationStackHelper::StackPartInformationPtr CApplicationStackHelper::GetStackPartInformation ( const std::string & key)
protected

◆ GetStackPartInformation() [2/2]

CApplicationStackHelper::StackPartInformationPtr CApplicationStackHelper::GetStackPartInformation ( const std::string & key) const
protected

◆ GetStackPartNumberAtTimeMs()

int CApplicationStackHelper::GetStackPartNumberAtTimeMs ( uint64_t msecs)

Returns the stack part number corresponding to the given timestamp in a (non-ISO) stack playback.

Parameters
msecsthe requested timestamp in the stack (in milliseconds)

◆ GetStackPartStartTimeMs()

uint64_t CApplicationStackHelper::GetStackPartStartTimeMs ( int partNumber) const
inline

Returns the start time of a FileItem part of a (non-ISO) stack playback.

Parameters
partNumberthe requested part number in the stack

◆ GetStackTotalTimeMs()

uint64_t CApplicationStackHelper::GetStackTotalTimeMs ( ) const

Returns the total time of a (non-ISO) stack playback.

◆ HasNextStackPartFileItem()

bool CApplicationStackHelper::HasNextStackPartFileItem ( ) const

returns true if there is a next part available

◆ HasRegisteredStack()

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

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

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

◆ InitializeStack()

bool CApplicationStackHelper::InitializeStack ( const CFileItem & item)

Initialize stack.

Parameters
itemthe FileItem object that is the stack

◆ InitializeStackStartPartAndOffset()

std::optional< int64_t > CApplicationStackHelper::InitializeStackStartPartAndOffset ( const CFileItem & item)

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
Returns
the part offset if available, nullopt in case of errors
Todo
If user changes the time speed (FPS via framerate conversion stuff) then these times will be wrong. Also, this is really just a hack for the slow load up times we have A much better solution is a fast reader of FPS and fileLength that we can use on a file to get it's time.

◆ IsPlayingISOStack()

bool CApplicationStackHelper::IsPlayingISOStack ( ) const

Returns true if Application is currently playing an ISO stack.

◆ IsPlayingRegularStack()

bool CApplicationStackHelper::IsPlayingRegularStack ( ) const

Returns true if Application is currently playing a Regular (non-ISO) stack.

◆ OnPlayBackStarted()

void CApplicationStackHelper::OnPlayBackStarted ( const CFileItem & item)

◆ SetNextStackPartCurrentFileItem()

const CFileItem & CApplicationStackHelper::SetNextStackPartCurrentFileItem ( )
inline

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

◆ SetRegisteredStack()

void CApplicationStackHelper::SetRegisteredStack ( const CFileItem & item,
std::shared_ptr< CFileItem > stackItem )

Stores a smart pointer to the stack CFileItem in the item-stack map.

Parameters
itemthe reference to the item that is part of a stack
stackItemthe smart pointer to the stack CFileItem

◆ SetRegisteredStackPartNumber()

void CApplicationStackHelper::SetRegisteredStackPartNumber ( const CFileItem & item,
int partNumber )

Stores the part number in the item-stack map.

Parameters
itemthe reference to the item that is part of a stack
partNumberthe part number of the part in other parameter

◆ SetRegisteredStackPartStartTimeMs()

void CApplicationStackHelper::SetRegisteredStackPartStartTimeMs ( const CFileItem & item,
uint64_t startTimeMs )

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

◆ SetRegisteredStackTotalTimeMs()

void CApplicationStackHelper::SetRegisteredStackTotalTimeMs ( const CFileItem & item,
uint64_t totalTimeMs )

Stores the stack's total time associated to the part in the item-stack map.

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

◆ SetStackPartCurrentFileItem()

const CFileItem & CApplicationStackHelper::SetStackPartCurrentFileItem ( int partNumber)
inline

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

Member Data Documentation

◆ m_critSection

CCriticalSection CApplicationStackHelper::m_critSection

◆ m_currentStack

std::unique_ptr<CFileItemList> CApplicationStackHelper::m_currentStack
protected

◆ m_currentStackIsDiscImageStack

bool CApplicationStackHelper::m_currentStackIsDiscImageStack = false
protected

◆ m_currentStackPosition

int CApplicationStackHelper::m_currentStackPosition = 0
protected

◆ m_stackmap

Stackmap CApplicationStackHelper::m_stackmap
protected

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