kodi
Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
CApplication Class Reference
Inheritance diagram for CApplication:
Inheritance graph
[legend]
Collaboration diagram for CApplication:
Collaboration graph
[legend]

Public Member Functions

bool Create ()
 
bool Initialize ()
 
int Run ()
 
bool Cleanup ()
 
void FrameMove (bool processEvents, bool processGUI=true) override
 
void Render () override
 
bool IsInitialized () const
 
bool IsStopping () const
 
bool CreateGUI ()
 
bool InitWindow (RESOLUTION res=RES_INVALID)
 
bool Stop (int exitCode)
 
const std::string & CurrentFile ()
 
CFileItemCurrentFileItem ()
 
std::shared_ptr< CFileItemCurrentFileItemPtr ()
 
const CFileItemCurrentUnstackedItem ()
 
bool OnMessage (CGUIMessage &message) override
 
std::string GetCurrentPlayer ()
 
int GetMessageMask () override
 Should return the message mask that it wishes to receive messages for. More...
 
void OnApplicationMessage (KODI::MESSAGING::ThreadMessage *pMsg) override
 This gets called whenever a message matching the registered message mask is processed. More...
 
bool PlayMedia (CFileItem &item, const std::string &player, PLAYLIST::Id playlistId)
 
bool ProcessAndStartPlaylist (const std::string &strPlayList, PLAYLIST::CPlayList &playlist, PLAYLIST::Id playlistId, int track=0)
 
bool PlayFile (CFileItem item, const std::string &player, bool bRestart=false)
 
void StopPlaying ()
 
void Restart (bool bSamePosition=true)
 
void DelayedPlayerRestart ()
 
void CheckDelayedPlayerRestart ()
 
bool IsPlayingFullScreenVideo () const
 
bool IsFullScreen ()
 
bool OnAction (const CAction &action)
 
void CloseNetworkShares ()
 
void ConfigureAndEnableAddons ()
 
void ShowAppMigrationMessage ()
 
void Process () override
 
void ProcessSlow ()
 
double GetTotalTime () const
 Returns the total time in fractional seconds of the currently playing media. More...
 
double GetTime () const
 Returns the current time in fractional seconds of the currently playing media. More...
 
float GetPercentage () const
 
float GetCachePercentage () const
 
void SeekPercentage (float percent)
 
void SeekTime (double dTime=0.0)
 
void UpdateLibraries ()
 
void UpdateCurrentPlayArt ()
 
bool ExecuteXBMCAction (std::string action, const std::shared_ptr< CGUIListItem > &item=NULL)
 
bool IsAppFocused () const
 
bool GetRenderGUI () const override
 
bool SetLanguage (const std::string &strLanguage)
 
bool LoadLanguage (bool reload)
 
void SetLoggingIn (bool switchingProfiles)
 
void LockFrameMoveGuard ()
 Locks calls from outside kodi (e.g. python) until framemove is processed.
 
void UnlockFrameMoveGuard ()
 Unlocks calls from outside kodi (e.g. python).
 
- Public Member Functions inherited from CComponentContainer< BaseType >
template<class T >
std::shared_ptr< T > GetComponent ()
 Obtain a component.
 
template<class T >
std::shared_ptr< const T > GetComponent () const
 Obtain a component.
 
std::size_t size () const
 Returns number of registered components.
 
- Public Member Functions inherited from CApplicationPlayerCallback
void OnPlayBackEnded () override
 
void OnPlayBackStarted (const CFileItem &file) override
 
void OnPlayerCloseFile (const CFileItem &file, const CBookmark &bookmark) override
 
void OnPlayBackPaused () override
 
void OnPlayBackResumed () override
 
void OnPlayBackStopped () override
 
void OnPlayBackError () override
 
void OnQueueNextItem () override
 
void OnPlayBackSeek (int64_t iTime, int64_t seekOffset) override
 
void OnPlayBackSeekChapter (int iChapter) override
 
void OnPlayBackSpeedChanged (int iSpeed) override
 
void OnAVChange () override
 
void OnAVStarted (const CFileItem &file) override
 
void RequestVideoSettings (const CFileItem &fileItem) override
 
void StoreVideoSettings (const CFileItem &fileItem, const CVideoSettings &vs) override
 
- Public Member Functions inherited from ISettingCallback
virtual bool OnSettingChanging (const std::shared_ptr< const CSetting > &setting)
 The value of the given setting is being changed. More...
 
virtual void OnSettingPropertyChanged (const std::shared_ptr< const CSetting > &setting, const char *propertyName)
 The given property of the given setting has changed. More...
 
- Public Member Functions inherited from ISettingsHandler
virtual bool OnSettingsLoading ()
 Settings loading has been initiated. More...
 
virtual void OnSettingsLoaded ()
 Settings have been loaded. More...
 
virtual void OnSettingsSaved () const
 Settings have been saved. More...
 
virtual void OnSettingsUnloaded ()
 Setting values have been unloaded. More...
 
virtual void OnSettingsCleared ()
 Settings have been cleared. More...
 
- Public Member Functions inherited from ISubSettings
virtual void Clear ()
 Clear any loaded setting values.
 

Public Attributes

std::string m_strPlayListFile
 
std::unique_ptr< CServiceManagerm_ServiceManager
 
bool m_bStop {false}
 
bool m_AppFocused {true}
 

Static Public Attributes

static const unsigned int ACTION_PREV_ITEM_THRESHOLD = 3
 

Protected Member Functions

bool OnSettingsSaving () const override
 Settings saving has been initiated. More...
 
void PlaybackCleanup ()
 
bool PlayStack (CFileItem &item, bool bRestart)
 
- Protected Member Functions inherited from CComponentContainer< BaseType >
void RegisterComponent (const std::shared_ptr< BaseType > &component)
 Register a new component instance.
 
void DeregisterComponent (const std::type_info &typeInfo)
 Deregister a component.
 
- Protected Member Functions inherited from CApplicationSettingsHandling
void RegisterSettings ()
 
void UnregisterSettings ()
 
bool Load (const TiXmlNode *settings) override
 Load settings from the given XML node. More...
 
bool Save (TiXmlNode *settings) const override
 Save settings to the given XML node. More...
 
void OnSettingChanged (const std::shared_ptr< const CSetting > &setting) override
 The value of the given setting has changed. More...
 
void OnSettingAction (const std::shared_ptr< const CSetting > &setting) override
 The given setting has been activated. More...
 
bool OnSettingUpdate (const std::shared_ptr< CSetting > &setting, const char *oldSettingId, const TiXmlNode *oldSettingNode) override
 The given setting needs to be updated. More...
 

Protected Attributes

std::shared_ptr< ANNOUNCEMENT::CAnnouncementManagerm_pAnnouncementManager
 
std::unique_ptr< CGUIComponentm_pGUI
 
std::unique_ptr< CWinSystemBasem_pWinSystem
 
std::unique_ptr< ActiveAE::CActiveAEm_pActiveAE
 
std::shared_ptr< CAppInboundProtocolm_pAppPort
 
CStopWatch m_restartPlayerTimer
 
CStopWatch m_frameTime
 
CStopWatch m_slowTimer
 
XbmcThreads::EndTime m_guiRefreshTimer
 
std::string m_prevMedia
 
bool m_bInitializing = true
 
int m_nextPlaylistItem = -1
 
std::chrono::time_point< std::chrono::steady_clock > m_lastRenderTime
 
bool m_skipGuiRender = false
 
std::unique_ptr< MUSIC_INFO::CMusicInfoScannerm_musicInfoScanner
 
std::unique_ptr< CInertialScrollingHandlerm_pInertialScrollingHandler
 
std::vector< std::shared_ptr< ADDON::CAddonInfo > > m_incompatibleAddons
 

Member Function Documentation

◆ ConfigureAndEnableAddons()

void CApplication::ConfigureAndEnableAddons ( )

< Installed addons, but not auto-enabled via manifest

◆ Create()

bool CApplication::Create ( )
Todo:
Win32 has no special://home/ mapping by default, so we

◆ FrameMove()

void CApplication::FrameMove ( bool  processEvents,
bool  processGUI = true 
)
overridevirtual
Todo:
look into the possibility to use this for GBM int fps = 0;

This code reduces rendering fps of the GUI layer when playing videos in fullscreen mode it makes only sense on architectures with multiple layers if (CServiceBroker::GetWinSystem()->GetGfxContext().IsFullScreenVideo() && !m_appPlayer.IsPausedPlayback() && m_appPlayer.IsRenderingVideoLayer()) fps = CServiceBroker::GetSettingsComponent()->GetSettings()->GetInt(CSettings::SETTING_VIDEOPLAYER_LIMITGUIUPDATE);

auto now = std::chrono::steady_clock::now();

auto frameTime = std::chrono::duration_cast<std::chrono::milliseconds>(now - m_lastRenderTime).count(); if (fps > 0 && frameTime * fps < 1000) m_skipGuiRender = true;

Implements IWindowManagerCallback.

◆ GetMessageMask()

int CApplication::GetMessageMask ( )
overridevirtual

Should return the message mask that it wishes to receive messages for.

The message mask is defined in "messaging/ApplicationMessenger.h" pick the next one available when creating a new

Implements KODI::MESSAGING::IMessageTarget.

◆ GetTime()

double CApplication::GetTime ( ) const

Returns the current time in fractional seconds of the currently playing media.

Beware that this method returns fractional seconds whereas IPlayer::GetTime() returns milliseconds.

◆ GetTotalTime()

double CApplication::GetTotalTime ( ) const

Returns the total time in fractional seconds of the currently playing media.

Beware that this method returns fractional seconds whereas IPlayer::GetTotalTime() returns milliseconds.

◆ Initialize()

bool CApplication::Initialize ( )
Todo:
Move GUIFontManager into service broker and drop the global reference

◆ OnApplicationMessage()

void CApplication::OnApplicationMessage ( KODI::MESSAGING::ThreadMessage msg)
overridevirtual

This gets called whenever a message matching the registered message mask is processed.

There are no ordering guarantees here so implementations should never rely on a certain ordering of messages.

Cleaning up any pointers stored in the message payload is not specified and is decided by the implementer of the message. In general prefer to delete any data in this method to keep the callsites cleaner and simpler but if data is to be passed back it's perfectly valid to handle it any way that fits the situation as long as it's documented along with the message.

To return a simple value the result parameter of

See also
ThreadMessage can be used as it will be used as the return value for
CApplicationMessenger::SendMsg. It is up to the implementer to decide if this is to be used and it should be documented along with any new message implemented.

Implements KODI::MESSAGING::IMessageTarget.

◆ OnSettingsSaving()

bool CApplication::OnSettingsSaving ( ) const
overrideprotectedvirtual

Settings saving has been initiated.

Returns
True if the settings should be saved, false if the saving should be aborted.

Reimplemented from ISettingsHandler.

◆ PlayFile()

bool CApplication::PlayFile ( CFileItem  item,
const std::string &  player,
bool  bRestart = false 
)
Todo:
  • this will fail if user seeks back to first file in stack

Member Data Documentation

◆ m_incompatibleAddons

std::vector<std::shared_ptr<ADDON::CAddonInfo> > CApplication::m_incompatibleAddons
protected

Result of addon migration (incompatible addon infos)


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