Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
|
#include <Application.h>
Public Member Functions | |
CApplication (void) | |
~CApplication (void) override | |
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 () |
CFileItem & | CurrentFileItem () |
std::shared_ptr< CFileItem > | CurrentFileItemPtr () |
const CFileItem & | CurrentUnstackedItem () |
bool | OnMessage (CGUIMessage &message) override |
std::string | GetCurrentPlayer () |
int | GetMessageMask () override |
Should return the message mask that it wishes to receive messages for. | |
void | OnApplicationMessage (KODI::MESSAGING::ThreadMessage *pMsg) override |
This gets called whenever a message matching the registered message mask is processed. | |
bool | PlayMedia (CFileItem &item, const std::string &player, KODI::PLAYLIST::Id playlistId) |
bool | ProcessAndStartPlaylist (const std::string &strPlayList, KODI::PLAYLIST::CPlayList &playlist, KODI::PLAYLIST::Id playlistId, int track=0) |
bool | PlayFile (CFileItem item, const std::string &player, bool bRestart=false, bool forceSelection=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. | |
double | GetTime () const |
Returns the current time in fractional seconds of the currently playing media. | |
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 IWindowManagerCallback | |
IWindowManagerCallback (void) | |
virtual | ~IWindowManagerCallback (void) |
Public Member Functions inherited from IMsgTargetCallback | |
virtual | ~IMsgTargetCallback ()=default |
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 | |
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 IPlayerCallback | |
virtual | ~IPlayerCallback ()=default |
Public Member Functions inherited from ISettingCallback | |
virtual | ~ISettingCallback ()=default |
virtual bool | OnSettingChanging (const std::shared_ptr< const CSetting > &setting) |
The value of the given setting is being changed. | |
virtual void | OnSettingPropertyChanged (const std::shared_ptr< const CSetting > &setting, const char *propertyName) |
The given property of the given setting has changed. | |
Public Member Functions inherited from ISettingsHandler | |
virtual | ~ISettingsHandler ()=default |
virtual bool | OnSettingsLoading () |
Settings loading has been initiated. | |
virtual void | OnSettingsLoaded () |
Settings have been loaded. | |
virtual void | OnSettingsSaved () const |
Settings have been saved. | |
virtual void | OnSettingsUnloaded () |
Setting values have been unloaded. | |
virtual void | OnSettingsCleared () |
Settings have been cleared. | |
Public Member Functions inherited from ISubSettings | |
virtual | ~ISubSettings ()=default |
virtual void | Clear () |
Clear any loaded setting values. | |
Public Attributes | |
std::string | m_strPlayListFile |
std::unique_ptr< CServiceManager > | m_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. | |
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. | |
bool | Save (TiXmlNode *settings) const override |
Save settings to the given XML node. | |
void | OnSettingChanged (const std::shared_ptr< const CSetting > &setting) override |
The value of the given setting has changed. | |
void | OnSettingAction (const std::shared_ptr< const CSetting > &setting) override |
The given setting has been activated. | |
bool | OnSettingUpdate (const std::shared_ptr< CSetting > &setting, const char *oldSettingId, const TiXmlNode *oldSettingNode) override |
The given setting needs to be updated. | |
Protected Attributes | |
std::shared_ptr< ANNOUNCEMENT::CAnnouncementManager > | m_pAnnouncementManager |
std::unique_ptr< CGUIComponent > | m_pGUI |
std::unique_ptr< CWinSystemBase > | m_pWinSystem |
std::unique_ptr< ActiveAE::CActiveAE > | m_pActiveAE |
std::shared_ptr< CAppInboundProtocol > | m_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::CMusicInfoScanner > | m_musicInfoScanner |
std::unique_ptr< CInertialScrollingHandler > | m_pInertialScrollingHandler |
std::vector< std::shared_ptr< ADDON::CAddonInfo > > | m_incompatibleAddons |
CApplication::CApplication | ( | void | ) |
|
override |
void CApplication::CheckDelayedPlayerRestart | ( | ) |
bool CApplication::Cleanup | ( | ) |
void CApplication::CloseNetworkShares | ( | ) |
void CApplication::ConfigureAndEnableAddons | ( | ) |
< Installed addons, but not auto-enabled via manifest
bool CApplication::CreateGUI | ( | ) |
const std::string & CApplication::CurrentFile | ( | ) |
CFileItem & CApplication::CurrentFileItem | ( | ) |
std::shared_ptr< CFileItem > CApplication::CurrentFileItemPtr | ( | ) |
const CFileItem & CApplication::CurrentUnstackedItem | ( | ) |
void CApplication::DelayedPlayerRestart | ( | ) |
bool CApplication::ExecuteXBMCAction | ( | std::string | action, |
const std::shared_ptr< CGUIListItem > & | item = NULL ) |
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.
float CApplication::GetCachePercentage | ( | ) | const |
std::string CApplication::GetCurrentPlayer | ( | ) |
|
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.
float CApplication::GetPercentage | ( | ) | const |
|
overridevirtual |
Reimplemented from IWindowManagerCallback.
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.
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.
bool CApplication::Initialize | ( | ) |
bool CApplication::InitWindow | ( | RESOLUTION | res = RES_INVALID | ) |
|
inline |
bool CApplication::IsFullScreen | ( | ) |
|
inline |
bool CApplication::IsPlayingFullScreenVideo | ( | ) | const |
|
inline |
void CApplication::LockFrameMoveGuard | ( | ) |
Locks calls from outside kodi (e.g. python) until framemove is processed.
|
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
Implements KODI::MESSAGING::IMessageTarget.
|
overridevirtual |
Implements IMsgTargetCallback.
|
overrideprotectedvirtual |
Settings saving has been initiated.
Reimplemented from ISettingsHandler.
|
protected |
bool CApplication::PlayFile | ( | CFileItem | item, |
const std::string & | player, | ||
bool | bRestart = false, | ||
bool | forceSelection = false ) |
bool CApplication::PlayMedia | ( | CFileItem & | item, |
const std::string & | player, | ||
KODI::PLAYLIST::Id | playlistId ) |
|
overridevirtual |
Implements IWindowManagerCallback.
bool CApplication::ProcessAndStartPlaylist | ( | const std::string & | strPlayList, |
KODI::PLAYLIST::CPlayList & | playlist, | ||
KODI::PLAYLIST::Id | playlistId, | ||
int | track = 0 ) |
void CApplication::ProcessSlow | ( | ) |
|
overridevirtual |
Implements IWindowManagerCallback.
int CApplication::Run | ( | ) |
void CApplication::SeekPercentage | ( | float | percent | ) |
void CApplication::SeekTime | ( | double | dTime = 0.0 | ) |
bool CApplication::SetLanguage | ( | const std::string & | strLanguage | ) |
void CApplication::ShowAppMigrationMessage | ( | ) |
void CApplication::StopPlaying | ( | ) |
void CApplication::UnlockFrameMoveGuard | ( | ) |
Unlocks calls from outside kodi (e.g. python).
void CApplication::UpdateCurrentPlayArt | ( | ) |
void CApplication::UpdateLibraries | ( | ) |
|
static |
bool CApplication::m_AppFocused {true} |
|
protected |
bool CApplication::m_bStop {false} |
|
protected |
|
protected |
|
protected |
Result of addon migration (incompatible addon infos)
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
std::unique_ptr<CServiceManager> CApplication::m_ServiceManager |
|
protected |
|
protected |
std::string CApplication::m_strPlayListFile |