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

#include <RetroPlayer.h>

Inheritance diagram for KODI::RETRO::CRetroPlayer:
IPlayer IRenderLoop KODI::RETRO::IGameCallback KODI::RETRO::IPlaybackCallback KODI::RETRO::IAutoSaveCallback

Public Member Functions

 CRetroPlayer (IPlayerCallback &callback)
 
 ~CRetroPlayer () override
 
bool OpenFile (const CFileItem &file, const CPlayerOptions &options) override
 
bool CloseFile (bool reopen=false) override
 
bool IsPlaying () const override
 
bool CanPause () const override
 
void Pause () override
 
bool HasVideo () const override
 
bool HasAudio () const override
 
bool HasGame () const override
 
bool CanSeek () const override
 
void Seek (bool bPlus=true, bool bLargeStep=false, bool bChapterOverride=false) override
 
void SeekPercentage (float fPercent=0) override
 
float GetCachePercentage () const override
 
void SetMute (bool bOnOff) override
 
void SeekTime (int64_t iTime=0) override
 
bool SeekTimeRelative (int64_t iTime) override
 
void SetSpeed (float speed) override
 
bool OnAction (const CAction &action) override
 
std::string GetPlayerState () override
 
bool SetPlayerState (const std::string &state) override
 
void FrameMove () override
 
void Render (bool clear, uint32_t alpha=255, bool gui=true) override
 hook into render loop of render thread
 
bool IsRenderingVideo () const override
 
bool HasGameAgent () const override
 Check if any players are playing a game.
 
std::string GameClientID () const override
 Get the game client being used to play the game.
 
std::string GetPlayingGame () const override
 Get the game that is being played.
 
std::string CreateSavestate (bool autosave) override
 Creates a savestate.
 
bool UpdateSavestate (const std::string &savestatePath) override
 Updates a savestate with the current game being played.
 
bool LoadSavestate (const std::string &savestatePath) override
 Loads a savestate.
 
void FreeSavestateResources (const std::string &savestatePath) override
 Frees resources allocated to the savestate, such as its video thumbnail.
 
void CloseOSDCallback () override
 Closes the OSD.
 
void SetPlaybackSpeed (double speed) override
 Set the playback speed.
 
void EnableInput (bool bEnable) override
 Enable/disable game input.
 
bool IsAutoSaveEnabled () const override
 
std::string CreateAutosave () override
 
- Public Member Functions inherited from IPlayer
 IPlayer (IPlayerCallback &callback)
 
virtual ~IPlayer ()=default
 
virtual bool Initialize (TiXmlElement *pConfig)
 
virtual bool QueueNextFile (const CFileItem &file)
 
virtual void OnNothingToQueueNotify ()
 
virtual bool HasRDS () const
 
virtual bool HasID3 () const
 
virtual bool IsPassthrough () const
 
virtual bool SeekScene (bool bPlus=true)
 
virtual void SetVolume (float volume)
 
virtual void SetDynamicRangeCompression (long drc)
 
virtual void SetAVDelay (float fValue=0.0f)
 
virtual float GetAVDelay ()
 
virtual void SetSubTitleDelay (float fValue=0.0f)
 
virtual float GetSubTitleDelay ()
 
virtual int GetSubtitleCount () const
 
virtual int GetSubtitle ()
 
virtual void GetSubtitleStreamInfo (int index, SubtitleStreamInfo &info) const
 
virtual void SetSubtitle (int iStream)
 
virtual bool GetSubtitleVisible () const
 
virtual void SetSubtitleVisible (bool bVisible)
 
virtual void SetSubtitleVerticalPosition (int value, bool save)
 Set the subtitle vertical position, it depends on current screen resolution.
 
virtual void AddSubtitle (const std::string &strSubPath)
 Adds the subtitle(s) provided by the given file to the available player streams and actives the first of the added stream(s). E.g., vob subs can contain multiple streams.
 
virtual int GetAudioStreamCount () const
 
virtual int GetAudioStream ()
 
virtual void SetAudioStream (int iStream)
 
virtual void GetAudioStreamInfo (int index, AudioStreamInfo &info) const
 
virtual int GetVideoStream () const
 
virtual int GetVideoStreamCount () const
 
virtual void GetVideoStreamInfo (int streamId, VideoStreamInfo &info) const
 
virtual void SetVideoStream (int iStream)
 
virtual int GetPrograms (std::vector< ProgramInfo > &programs)
 
virtual void SetProgram (int progId)
 
virtual int GetProgramsCount () const
 
virtual bool HasTeletextCache () const
 
virtual std::shared_ptr< TextCacheStruct_tGetTeletextCache ()
 
virtual void LoadPage (int p, int sp, unsigned char *buffer)
 
virtual int GetChapterCount () const
 
virtual int GetChapter () const
 
virtual void GetChapterName (std::string &strChapterName, int chapterIdx=-1) const
 
virtual int64_t GetChapterPos (int chapterIdx=-1) const
 
virtual int SeekChapter (int iChapter)
 
virtual void SetTime (int64_t time)
 Sets the current time. This can be used for injecting the current time. This is not to be confused with a seek. It just can be used if endless streams contain multiple tracks in reality (like with airtunes)
 
virtual void SetTotalTime (int64_t time)
 Set the total time in milliseconds this can be used for injecting the duration in case its not available in the underlaying decoder (airtunes for example)
 
virtual void SetTempo (float tempo)
 
virtual bool SupportsTempo () const
 
virtual void FrameAdvance (int frames)
 
virtual bool IsCaching () const
 
virtual int GetCacheLevel () const
 
virtual bool IsInMenu () const
 
virtual MenuType GetSupportedMenuType () const
 Get the supported menu type.
 
virtual void GetAudioCapabilities (std::vector< int > &audioCaps) const
 
virtual void GetSubtitleCapabilities (std::vector< int > &subCaps) const
 define the subtitle capabilities of the player
 
virtual void FlushRenderer ()
 
virtual void SetRenderViewMode (int mode, float zoom, float par, float shift, bool stretch)
 
virtual float GetRenderAspectRatio () const
 
virtual void TriggerUpdateResolution ()
 
virtual void GetRects (CRect &source, CRect &dest, CRect &view) const
 
virtual unsigned int GetOrientation () const
 
virtual bool Supports (EINTERLACEMETHOD method) const
 
virtual EINTERLACEMETHOD GetDeinterlacingMethodDefault () const
 
virtual bool Supports (ESCALINGMETHOD method) const
 
virtual bool Supports (ERENDERFEATURE feature) const
 
virtual unsigned int RenderCaptureAlloc ()
 
virtual void RenderCaptureRelease (unsigned int captureId)
 
virtual void RenderCapture (unsigned int captureId, unsigned int width, unsigned int height, int flags)
 
virtual bool RenderCaptureGetPixels (unsigned int captureId, unsigned int millis, uint8_t *buffer, unsigned int size)
 
virtual CVideoSettings GetVideoSettings () const
 
virtual void SetVideoSettings (CVideoSettings &settings)
 
- Public Member Functions inherited from IRenderLoop
virtual ~IRenderLoop ()=default
 
- Public Member Functions inherited from KODI::RETRO::IGameCallback
virtual ~IGameCallback ()=default
 
- Public Member Functions inherited from KODI::RETRO::IPlaybackCallback
virtual ~IPlaybackCallback ()=default
 
- Public Member Functions inherited from KODI::RETRO::IAutoSaveCallback
virtual ~IAutoSaveCallback ()=default
 

Additional Inherited Members

- Public Attributes inherited from IPlayer
std::string m_name
 
std::string m_type
 
- Protected Attributes inherited from IPlayer
IPlayerCallbackm_callback
 

Constructor & Destructor Documentation

◆ CRetroPlayer()

CRetroPlayer::CRetroPlayer ( IPlayerCallback & callback)
explicit

◆ ~CRetroPlayer()

CRetroPlayer::~CRetroPlayer ( )
override

Member Function Documentation

◆ CanPause()

bool CRetroPlayer::CanPause ( ) const
overridevirtual

Reimplemented from IPlayer.

◆ CanSeek()

bool CRetroPlayer::CanSeek ( ) const
overridevirtual

Reimplemented from IPlayer.

◆ CloseFile()

bool CRetroPlayer::CloseFile ( bool reopen = false)
overridevirtual

Implements IPlayer.

◆ CloseOSDCallback()

void CRetroPlayer::CloseOSDCallback ( )
overridevirtual

Closes the OSD.

Implements KODI::RETRO::IGameCallback.

◆ CreateAutosave()

std::string CRetroPlayer::CreateAutosave ( )
overridevirtual

◆ CreateSavestate()

std::string CRetroPlayer::CreateSavestate ( bool autosave)
overridevirtual

Creates a savestate.

Parameters
autosaveWhether the save type is auto
Returns
The path to the created savestate, or empty on error

Implements KODI::RETRO::IGameCallback.

◆ EnableInput()

void CRetroPlayer::EnableInput ( bool bEnable)
overridevirtual

Enable/disable game input.

Parameters
bEnableTrue to enable input, false to disable input

Implements KODI::RETRO::IPlaybackCallback.

◆ FrameMove()

void CRetroPlayer::FrameMove ( )
overridevirtual

Implements IRenderLoop.

◆ FreeSavestateResources()

void CRetroPlayer::FreeSavestateResources ( const std::string & savestatePath)
overridevirtual

Frees resources allocated to the savestate, such as its video thumbnail.

Parameters
savestatePathThe path to the savestate

Implements KODI::RETRO::IGameCallback.

◆ GameClientID()

std::string CRetroPlayer::GameClientID ( ) const
overridevirtual

Get the game client being used to play the game.

Returns
The game client's ID, or empty if no game is being played

Implements KODI::RETRO::IGameCallback.

◆ GetCachePercentage()

float CRetroPlayer::GetCachePercentage ( ) const
overridevirtual

Reimplemented from IPlayer.

◆ GetPlayerState()

std::string CRetroPlayer::GetPlayerState ( )
overridevirtual

Reimplemented from IPlayer.

◆ GetPlayingGame()

std::string CRetroPlayer::GetPlayingGame ( ) const
overridevirtual

Get the game that is being played.

Returns
The path to the game, or empty if no game is being played

Implements KODI::RETRO::IGameCallback.

◆ HasAudio()

bool KODI::RETRO::CRetroPlayer::HasAudio ( ) const
inlineoverridevirtual

Implements IPlayer.

◆ HasGame()

bool KODI::RETRO::CRetroPlayer::HasGame ( ) const
inlineoverridevirtual

Reimplemented from IPlayer.

◆ HasGameAgent()

bool CRetroPlayer::HasGameAgent ( ) const
overridevirtual

Check if any players are playing a game.

Returns
True if at least one player has an input device attached to the game, false otherwise

Reimplemented from IPlayer.

◆ HasVideo()

bool KODI::RETRO::CRetroPlayer::HasVideo ( ) const
inlineoverridevirtual

Implements IPlayer.

◆ IsAutoSaveEnabled()

bool CRetroPlayer::IsAutoSaveEnabled ( ) const
overridevirtual

◆ IsPlaying()

bool CRetroPlayer::IsPlaying ( ) const
overridevirtual

Reimplemented from IPlayer.

◆ IsRenderingVideo()

bool CRetroPlayer::IsRenderingVideo ( ) const
overridevirtual

Reimplemented from IPlayer.

◆ LoadSavestate()

bool CRetroPlayer::LoadSavestate ( const std::string & savestatePath)
overridevirtual

Loads a savestate.

Parameters
savestatePathThe path to the savestate
Returns
True if the savestate was loaded, false on error

Implements KODI::RETRO::IGameCallback.

◆ OnAction()

bool CRetroPlayer::OnAction ( const CAction & action)
overridevirtual

Reimplemented from IPlayer.

◆ OpenFile()

bool CRetroPlayer::OpenFile ( const CFileItem & file,
const CPlayerOptions & options )
overridevirtual

Reimplemented from IPlayer.

◆ Pause()

void CRetroPlayer::Pause ( )
overridevirtual

Implements IPlayer.

◆ Render()

void CRetroPlayer::Render ( bool clear,
uint32_t alpha = 255,
bool gui = true )
overridevirtual

hook into render loop of render thread

Reimplemented from IPlayer.

◆ Seek()

void CRetroPlayer::Seek ( bool bPlus = true,
bool bLargeStep = false,
bool bChapterOverride = false )
overridevirtual
Todo

Implements IPlayer.

◆ SeekPercentage()

void CRetroPlayer::SeekPercentage ( float fPercent = 0)
overridevirtual

Reimplemented from IPlayer.

◆ SeekTime()

void CRetroPlayer::SeekTime ( int64_t iTime = 0)
overridevirtual

Reimplemented from IPlayer.

◆ SeekTimeRelative()

bool CRetroPlayer::SeekTimeRelative ( int64_t iTime)
overridevirtual

Reimplemented from IPlayer.

◆ SetMute()

void CRetroPlayer::SetMute ( bool bOnOff)
overridevirtual

Reimplemented from IPlayer.

◆ SetPlaybackSpeed()

void CRetroPlayer::SetPlaybackSpeed ( double speed)
overridevirtual

Set the playback speed.

Parameters
speedThe new speed

Implements KODI::RETRO::IPlaybackCallback.

◆ SetPlayerState()

bool CRetroPlayer::SetPlayerState ( const std::string & state)
overridevirtual

Reimplemented from IPlayer.

◆ SetSpeed()

void CRetroPlayer::SetSpeed ( float speed)
overridevirtual

Implements IPlayer.

◆ UpdateSavestate()

bool CRetroPlayer::UpdateSavestate ( const std::string & savestatePath)
overridevirtual

Updates a savestate with the current game being played.

Parameters
savestatePathThe path to the savestate
Returns
True if the savestate was updated, false on error

Implements KODI::RETRO::IGameCallback.


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