![]() |
Kodi Documentation 18.0
Kodi is an open source media player and entertainment hub.
|
#include <Application.h>
Public Types | |
enum | ESERVERS { ES_WEBSERVER = 1 , ES_AIRPLAYSERVER , ES_JSONRPCSERVER , ES_UPNPRENDERER , ES_UPNPSERVER , ES_EVENTSERVER , ES_ZEROCONF } |
Public Member Functions | |
CApplication (void) | |
~CApplication (void) override | |
bool | Initialize () override |
void | FrameMove (bool processEvents, bool processGUI=true) override |
void | Render () override |
virtual void | Preflight () |
bool | Create (const CAppParamParser ¶ms) |
bool | Cleanup () override |
bool | IsInitialized () |
bool | CreateGUI () |
bool | InitWindow (RESOLUTION res=RES_INVALID) |
void | StartServices () |
void | StopServices () |
bool | StartServer (enum ESERVERS eServer, bool bStart, bool bWait=false) |
bool | IsCurrentThread () const |
void | Stop (int exitCode) |
void | UnloadSkin (bool forReload=false) |
bool | LoadCustomWindows () |
void | ReloadSkin (bool confirm=false) |
const std::string & | CurrentFile () |
CFileItem & | CurrentFileItem () |
std::shared_ptr< CFileItem > | CurrentFileItemPtr () |
CFileItem & | CurrentUnstackedItem () |
bool | OnMessage (CGUIMessage &message) override |
CApplicationPlayer & | GetAppPlayer () |
std::string | GetCurrentPlayer () |
CApplicationStackHelper & | GetAppStackHelper () |
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, CVideoSettings vs) override |
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, int iPlaylist) |
bool | ProcessAndStartPlaylist (const std::string &strPlayList, PLAYLIST::CPlayList &playlist, int iPlaylist, 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 | CheckShutdown () |
void | InhibitIdleShutdown (bool inhibit) |
bool | IsIdleShutdownInhibited () const |
void | CheckScreenSaverAndDPMS () |
void | ActivateScreenSaver (bool forceType=false) |
void | CloseNetworkShares () |
void | ShowAppMigrationMessage () |
void | Process () override |
void | ProcessSlow () |
void | ResetScreenSaver () |
float | GetVolume (bool percentage=true) const |
void | SetVolume (float iValue, bool isPercentage=true) |
bool | IsMuted () const |
bool | IsMutedInternal () const |
void | ToggleMute (void) |
void | SetMute (bool mute) |
void | ShowVolumeBar (const CAction *action=NULL) |
int | GetSubtitleDelay () |
int | GetAudioDelay () |
void | ResetSystemIdleTimer () |
void | ResetScreenSaverTimer () |
void | StopScreenSaverTimer () |
bool | WakeUpScreenSaverAndDPMS (bool bPowerOffKeyPressed=false) |
bool | WakeUpScreenSaver (bool bPowerOffKeyPressed=false) |
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 | StopShutdownTimer () |
void | ResetShutdownTimers () |
void | StopVideoScan () |
void | StopMusicScan () |
bool | IsMusicScanning () const |
bool | IsVideoScanning () const |
void | StartVideoCleanup (bool userInitiated=true, const std::string &content="") |
Starts a video library cleanup. More... | |
void | StartVideoScan (const std::string &path, bool userInitiated=true, bool scanAll=false) |
Starts a video library update. More... | |
void | StartMusicCleanup (bool userInitiated=true) |
Starts a music library cleanup. More... | |
void | StartMusicScan (const std::string &path, bool userInitiated=true, int flags=0) |
Starts a music library update. More... | |
void | StartMusicAlbumScan (const std::string &strDirectory, bool refresh=false) |
void | StartMusicArtistScan (const std::string &strDirectory, bool refresh=false) |
void | UpdateLibraries () |
void | UpdateCurrentPlayArt () |
bool | ExecuteXBMCAction (std::string action, const CGUIListItemPtr &item=NULL) |
bool | IsInScreenSaver () |
std::string | ScreensaverIdInUse () |
bool | IsDPMSActive () |
int | GlobalIdleTime () |
bool | PlatformDirectoriesEnabled () |
bool | IsStandAlone () |
bool | IsEnableTestMode () |
bool | IsAppFocused () const |
void | Minimize () |
bool | ToggleDPMS (bool manual) |
bool | SwitchToFullScreen (bool force=false) |
bool | GetRenderGUI () const override |
bool | SetLanguage (const std::string &strLanguage) |
bool | LoadLanguage (bool reload) |
ReplayGainSettings & | GetReplayGainSettings () |
void | SetLoggingIn (bool switchingProfiles) |
void | RegisterActionListener (IActionListener *listener) |
Register an action listener. More... | |
void | UnregisterActionListener (IActionListener *listener) |
Unregister an action listener. More... | |
void | LockFrameMoveGuard () |
Locks calls from outside kodi (e.g. python) until framemove is processed. More... | |
void | UnlockFrameMoveGuard () |
Unlocks calls from outside kodi (e.g. python). More... | |
void | SetRenderGUI (bool renderGUI) |
![]() | |
CXBApplicationEx () | |
~CXBApplicationEx () override | |
int | Run (const CAppParamParser ¶ms) |
void | Destroy () |
![]() | |
IWindowManagerCallback (void) | |
virtual | ~IWindowManagerCallback (void) |
![]() | |
virtual | ~IPlayerCallback ()=default |
![]() | |
virtual | ~IMsgTargetCallback ()=default |
![]() | |
virtual | ~ISettingCallback ()=default |
virtual bool | OnSettingChanging (std::shared_ptr< const CSetting > setting) |
The value of the given setting is being changed. More... | |
virtual void | OnSettingPropertyChanged (std::shared_ptr< const CSetting > setting, const char *propertyName) |
The given property of the given setting has changed. More... | |
![]() | |
virtual | ~ISettingsHandler ()=default |
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... | |
![]() | |
virtual | ~ISubSettings ()=default |
virtual void | Clear () |
Clear any loaded setting values. More... | |
Public Attributes | |
int | m_iScreenSaveLock = 0 |
std::string | m_strPlayListFile |
std::unique_ptr< CServiceManager > | m_ServiceManager |
![]() | |
bool | m_bStop |
int | m_ExitCode |
bool | m_AppFocused |
bool | m_renderGUI |
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... | |
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 (std::shared_ptr< const CSetting > setting) override |
The value of the given setting has changed. More... | |
void | OnSettingAction (std::shared_ptr< const CSetting > setting) override |
The given setting has been activated. More... | |
bool | OnSettingUpdate (std::shared_ptr< CSetting > setting, const char *oldSettingId, const TiXmlNode *oldSettingNode) override |
The given setting needs to be updated. More... | |
bool | LoadSkin (const std::string &skinID) |
void | CheckOSScreenSaverInhibitionSetting () |
void | PlaybackCleanup () |
bool | OnEvent (XBMC_Event &newEvent) |
bool | NotifyActionListeners (const CAction &action) const |
Delegates the action to all registered action handlers. More... | |
void | Mute () |
void | UnMute () |
void | SetHardwareVolume (float hardwareVolume) |
void | VolumeChanged () |
bool | PlayStack (CFileItem &item, bool bRestart) |
float | NavigationIdleTime () |
void | HandlePortEvents () |
void | HandleShutdownMessage () |
Helper method to determine how to handle TMSG_SHUTDOWN. More... | |
Friends | |
class | CAppInboundProtocol |
CApplication::CApplication | ( | void | ) |
|
override |
void CApplication::ActivateScreenSaver | ( | bool | forceType = false | ) |
void CApplication::CheckDelayedPlayerRestart | ( | ) |
|
protected |
void CApplication::CheckScreenSaverAndDPMS | ( | ) |
void CApplication::CheckShutdown | ( | ) |
|
overridevirtual |
Reimplemented from CXBApplicationEx.
void CApplication::CloseNetworkShares | ( | ) |
bool CApplication::Create | ( | const CAppParamParser & | params | ) |
must create these here. Ideally this should be using special://home/ and be platform agnostic (i.e. unify the InitDirectories*() functions)
bool CApplication::CreateGUI | ( | ) |
const std::string & CApplication::CurrentFile | ( | ) |
CFileItem & CApplication::CurrentFileItem | ( | ) |
std::shared_ptr< CFileItem > CApplication::CurrentFileItemPtr | ( | ) |
CFileItem & CApplication::CurrentUnstackedItem | ( | ) |
void CApplication::DelayedPlayerRestart | ( | ) |
bool CApplication::ExecuteXBMCAction | ( | std::string | action, |
const CGUIListItemPtr & | item = NULL |
||
) |
|
overridevirtual |
Implements IWindowManagerCallback.
CApplicationPlayer & CApplication::GetAppPlayer | ( | ) |
CApplicationStackHelper & CApplication::GetAppStackHelper | ( | ) |
int CApplication::GetAudioDelay | ( | ) |
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 |
|
inlineoverridevirtual |
Reimplemented from IWindowManagerCallback.
|
inline |
int CApplication::GetSubtitleDelay | ( | ) |
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.
float CApplication::GetVolume | ( | bool | percentage = true | ) | const |
int CApplication::GlobalIdleTime | ( | ) |
|
protected |
|
protected |
Helper method to determine how to handle TMSG_SHUTDOWN.
void CApplication::InhibitIdleShutdown | ( | bool | inhibit | ) |
|
overridevirtual |
Reimplemented from CXBApplicationEx.
bool CApplication::InitWindow | ( | RESOLUTION | res = RES_INVALID | ) |
|
inline |
bool CApplication::IsCurrentThread | ( | ) | const |
|
inline |
|
inline |
bool CApplication::IsFullScreen | ( | ) |
bool CApplication::IsIdleShutdownInhibited | ( | ) | const |
|
inline |
|
inline |
bool CApplication::IsMusicScanning | ( | ) | const |
bool CApplication::IsMuted | ( | ) | const |
|
inline |
bool CApplication::IsPlayingFullScreenVideo | ( | ) | const |
|
inline |
bool CApplication::IsVideoScanning | ( | ) | const |
|
overrideprotectedvirtual |
Load settings from the given XML node.
settings | XML node containing setting values |
Reimplemented from ISubSettings.
bool CApplication::LoadCustomWindows | ( | ) |
bool CApplication::LoadLanguage | ( | bool | reload | ) |
|
protected |
void CApplication::LockFrameMoveGuard | ( | ) |
Locks calls from outside kodi (e.g. python) until framemove is processed.
void CApplication::Minimize | ( | ) |
|
protected |
|
protected |
|
protected |
Delegates the action to all registered action handlers.
action | The action |
bool CApplication::OnAction | ( | const CAction & | action | ) |
|
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 |
Reimplemented from IPlayerCallback.
Reimplemented from IPlayerCallback.
|
protected |
|
overridevirtual |
Implements IMsgTargetCallback.
|
overridevirtual |
Implements IPlayerCallback.
|
overridevirtual |
Implements IPlayerCallback.
|
overridevirtual |
Reimplemented from IPlayerCallback.
|
overridevirtual |
Reimplemented from IPlayerCallback.
|
overridevirtual |
Reimplemented from IPlayerCallback.
|
overridevirtual |
Reimplemented from IPlayerCallback.
|
overridevirtual |
Reimplemented from IPlayerCallback.
Implements IPlayerCallback.
|
overridevirtual |
Implements IPlayerCallback.
|
overridevirtual |
Reimplemented from IPlayerCallback.
|
overridevirtual |
Implements IPlayerCallback.
|
overrideprotectedvirtual |
The given setting has been activated.
This callback is triggered whenever the given setting has been activated. This callback is only fired for CSettingAction settings.
setting | The setting which has been activated. |
Reimplemented from ISettingCallback.
|
overrideprotectedvirtual |
The value of the given setting has changed.
This callback is triggered whenever the value of a setting has been successfully changed (i.e. none of the OnSettingChanging() handlers) has reverted the change.
setting | The setting whose value has been changed |
Reimplemented from ISettingCallback.
|
overrideprotectedvirtual |
Settings saving has been initiated.
Reimplemented from ISettingsHandler.
|
overrideprotectedvirtual |
The given setting needs to be updated.
This callback is triggered when a setting needs to be updated because its value is outdated. This only happens when initially loading the value of a setting and will not be triggered afterwards.
setting | The setting which needs to be updated. |
oldSettingId | The id of the previous setting. |
oldSettingNode | The old setting node |
Reimplemented from ISettingCallback.
|
inline |
|
protected |
bool CApplication::PlayFile | ( | CFileItem | item, |
const std::string & | player, | ||
bool | bRestart = false |
||
) |
bool CApplication::PlayMedia | ( | CFileItem & | item, |
const std::string & | player, | ||
int | iPlaylist | ||
) |
|
protected |
|
virtual |
Implements IWindowManagerCallback.
bool CApplication::ProcessAndStartPlaylist | ( | const std::string & | strPlayList, |
PLAYLIST::CPlayList & | playlist, | ||
int | iPlaylist, | ||
int | track = 0 |
||
) |
void CApplication::ProcessSlow | ( | ) |
void CApplication::RegisterActionListener | ( | IActionListener * | listener | ) |
Register an action listener.
listener | The listener to register |
void CApplication::ReloadSkin | ( | bool | confirm = false | ) |
Implements IWindowManagerCallback.
Reimplemented from IPlayerCallback.
void CApplication::ResetScreenSaver | ( | ) |
void CApplication::ResetScreenSaverTimer | ( | ) |
void CApplication::ResetShutdownTimers | ( | ) |
void CApplication::ResetSystemIdleTimer | ( | ) |
void CApplication::Restart | ( | bool | bSamePosition = true | ) |
|
overrideprotectedvirtual |
Save settings to the given XML node.
settings | XML node in which the settings will be saved |
Reimplemented from ISubSettings.
|
inline |
void CApplication::SeekPercentage | ( | float | percent | ) |
void CApplication::SeekTime | ( | double | dTime = 0.0 | ) |
|
protected |
bool CApplication::SetLanguage | ( | const std::string & | strLanguage | ) |
void CApplication::SetLoggingIn | ( | bool | switchingProfiles | ) |
void CApplication::SetMute | ( | bool | mute | ) |
void CApplication::SetRenderGUI | ( | bool | renderGUI | ) |
void CApplication::SetVolume | ( | float | iValue, |
bool | isPercentage = true |
||
) |
void CApplication::ShowAppMigrationMessage | ( | ) |
void CApplication::StartMusicAlbumScan | ( | const std::string & | strDirectory, |
bool | refresh = false |
||
) |
void CApplication::StartMusicArtistScan | ( | const std::string & | strDirectory, |
bool | refresh = false |
||
) |
void CApplication::StartMusicCleanup | ( | bool | userInitiated = true | ) |
Starts a music library cleanup.
userInitiated | Whether the action was initiated by the user (either via GUI or any other method) or not. It is meant to hide or show dialogs. |
void CApplication::StartMusicScan | ( | const std::string & | path, |
bool | userInitiated = true , |
||
int | flags = 0 |
||
) |
Starts a music library update.
path | The path to scan or "" (empty string) for a global scan. |
userInitiated | Whether the action was initiated by the user (either via GUI or any other method) or not. It is meant to hide or show dialogs. |
flags | Flags for controlling the scanning process. See xbmc/music/infoscanner/MusicInfoScanner.h for possible values. |
bool CApplication::StartServer | ( | enum ESERVERS | eServer, |
bool | bStart, | ||
bool | bWait = false |
||
) |
void CApplication::StartServices | ( | ) |
void CApplication::StartVideoCleanup | ( | bool | userInitiated = true , |
const std::string & | content = "" |
||
) |
Starts a video library cleanup.
userInitiated | Whether the action was initiated by the user (either via GUI or any other method) or not. It is meant to hide or show dialogs. |
content | Content type to clean, blank for everything |
void CApplication::StartVideoScan | ( | const std::string & | path, |
bool | userInitiated = true , |
||
bool | scanAll = false |
||
) |
Starts a video library update.
path | The path to scan or "" (empty string) for a global scan. |
userInitiated | Whether the action was initiated by the user (either via GUI or any other method) or not. It is meant to hide or show dialogs. |
scanAll | Whether to scan everything not already scanned (regardless of whether the user normally doesn't want a folder scanned). |
void CApplication::Stop | ( | int | exitCode | ) |
void CApplication::StopMusicScan | ( | ) |
void CApplication::StopPlaying | ( | ) |
void CApplication::StopScreenSaverTimer | ( | ) |
void CApplication::StopServices | ( | ) |
void CApplication::StopShutdownTimer | ( | ) |
void CApplication::StopVideoScan | ( | ) |
|
overridevirtual |
Reimplemented from IPlayerCallback.
bool CApplication::SwitchToFullScreen | ( | bool | force = false | ) |
bool CApplication::ToggleDPMS | ( | bool | manual | ) |
void CApplication::UnloadSkin | ( | bool | forReload = false | ) |
void CApplication::UnlockFrameMoveGuard | ( | ) |
Unlocks calls from outside kodi (e.g. python).
|
protected |
void CApplication::UnregisterActionListener | ( | IActionListener * | listener | ) |
Unregister an action listener.
listener | The listener to unregister |
void CApplication::UpdateCurrentPlayArt | ( | ) |
void CApplication::UpdateLibraries | ( | ) |
|
protected |
bool CApplication::WakeUpScreenSaver | ( | bool | bPowerOffKeyPressed = false | ) |
bool CApplication::WakeUpScreenSaverAndDPMS | ( | bool | bPowerOffKeyPressed = false | ) |
|
friend |
|
static |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Result of addon migration
int CApplication::m_iScreenSaveLock = 0 |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
std::unique_ptr<CServiceManager> CApplication::m_ServiceManager |
|
protected |
|
protected |
|
protected |
std::string CApplication::m_strPlayListFile |
|
protected |
|
protected |