Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
CGUIMediaWindow Class Reference

#include <GUIMediaWindow.h>

Inheritance diagram for CGUIMediaWindow:
CGUIWindow CGUIControlGroup CGUIControlLookup CGUIControl XBMCAddon::xbmcgui::Interceptor< CGUIMediaWindow > ADDON::CGUIAddonWindow CGUIWindowAddonBrowser CGUIWindowEventLog CGUIWindowFavourites CGUIWindowMusicBase CGUIWindowPictures CGUIWindowPrograms CGUIWindowVideoBase KODI::GAME::CGUIWindowGames PVR::CGUIWindowPVRBase

Classes

class  CUpdateGuard
 

Public Member Functions

 CGUIMediaWindow (int id, const char *xmlFile)
 
 ~CGUIMediaWindow (void) override
 
bool OnAction (const CAction &action) override
 
bool OnBack (int actionID) override
 
bool OnMessage (CGUIMessage &message) override
 
void OnWindowLoaded () override
 
void OnWindowUnload () override
 
void OnInitWindow () override
 Called on window open.
 
bool IsMediaWindow () const override
 
int GetViewContainerID () const override
 
int GetViewCount () const override
 
bool HasListItems () const override
 
CFileItemPtr GetCurrentListItem (int offset=0) override
 
virtual bool CanFilterAdvanced ()
 
virtual bool IsFiltered ()
 
virtual bool IsSameStartFolder (const std::string &dir)
 
virtual std::string GetRootPath () const
 
const CFileItemListCurrentDirectory () const
 
const CGUIViewStateGetViewState () const
 
virtual bool UseFileDirectories ()
 
- Public Member Functions inherited from CGUIWindow
 CGUIWindow (int id, const std::string &xmlFile)
 
 ~CGUIWindow (void) override
 
bool Initialize ()
 
bool Load (const std::string &strFileName, bool bContainsPath=false)
 
void CenterWindow ()
 
void DoProcess (unsigned int currentTime, CDirtyRegionList &dirtyregions) override
 
void DoRender () override
 Main render function, called every frame. Window classes should override this only if they need to alter how something is rendered. General updating on a per-frame basis should be handled in FrameMove instead, as DoRender is not necessarily re-entrant.
 
void AfterRender ()
 Do any post render activities. Check if window closing animation is finished and finalize window closing.
 
virtual void FrameMove ()
 Main update function, called every frame prior to rendering Any window that requires updating on a frame by frame basis (such as to maintain timers and the like) should override this function.
 
void Close (bool forceClose=false, int nextWindowID=0, bool enableSound=true, bool bWait=true)
 
bool OnAction (const CAction &action) override
 
virtual bool OnInfo (int actionID)
 
virtual void ClearBackground ()
 Clear the background (if necessary) prior to rendering the window.
 
bool OnMove (int fromControl, int moveAction)
 
bool OnMessage (CGUIMessage &message) override
 
bool ControlGroupHasFocus (int groupID, int controlID)
 
void SetID (int id) override
 
virtual bool HasID (int controlID) const
 
const std::vector< int > & GetIDRange () const
 
int GetPreviousWindow ()
 
CRect GetScaledBounds () const
 
void ClearAll () override
 
virtual void AllocResources (bool forceLoad=false)
 
void FreeResources (bool forceUnLoad=false) override
 
void DynamicResourceAlloc (bool bOnOff) override
 
virtual bool IsDialog () const
 
virtual bool IsDialogRunning () const
 
virtual bool IsModalDialog () const
 
virtual bool IsSoundEnabled () const
 
virtual bool CanBeActivated () const
 
virtual bool IsActive () const
 
void SetCoordsRes (const RESOLUTION_INFO &res)
 
const RESOLUTION_INFOGetCoordsRes () const
 
void SetLoadType (LOAD_TYPE loadType)
 
LOAD_TYPE GetLoadType ()
 
int GetRenderOrder ()
 
void SetInitialVisibility () override
 
bool IsVisible () const override
 
virtual bool HasVisibleControls ()
 
bool IsAnimating (ANIMATION_TYPE animType) override
 
bool IsCustom () const
 Return if the window is a custom window.
 
void SetCustom (bool custom)
 Mark this window as custom window.
 
void DisableAnimations ()
 
virtual void ResetControlStates ()
 
void UpdateControlStats () override
 
void SetRunActionsManually ()
 
void RunLoadActions () const
 
void RunUnloadActions () const
 
void SetProperty (const std::string &key, const CVariant &value)
 Set a property Sets the value of a property referenced by a key.
 
CVariant GetProperty (const std::string &key) const
 Retrieve a property.
 
void ClearProperties ()
 Clear a all the window's properties.
 
bool HasSaveLastControl () const
 
virtual void OnDeinitWindow (int nextWindowID)
 
void AllocResources () override
 
- Public Member Functions inherited from CGUIControlGroup
 CGUIControlGroup ()
 
 CGUIControlGroup (int parentID, int controlID, float posX, float posY, float width, float height)
 
 CGUIControlGroup (const CGUIControlGroup &from)
 
 ~CGUIControlGroup (void) override
 
CGUIControlGroupClone () const override
 
void Process (unsigned int currentTime, CDirtyRegionList &dirtyregions) override
 
void Render () override
 
void RenderEx () override
 
virtual bool SendControlMessage (CGUIMessage &message)
 
bool HasFocus () const override
 
bool CanFocus () const override
 
void AssignDepth () override
 
EVENT_RESULT SendMouseEvent (const CPoint &point, const KODI::MOUSE::CMouseEvent &event) override
 React to a mouse event.
 
void UnfocusFromPoint (const CPoint &point) override
 Unfocus the control if the given point on screen is not within it's boundary.
 
bool HasAnimation (ANIMATION_TYPE anim) override
 
void QueueAnimation (ANIMATION_TYPE anim) override
 
void ResetAnimation (ANIMATION_TYPE anim) override
 
void ResetAnimations () override
 
int GetFocusedControlID () const
 
CGUIControlGetFocusedControl () const
 
virtual void AddControl (CGUIControl *control, int position=-1)
 
bool InsertControl (CGUIControl *control, const CGUIControl *insertPoint)
 
virtual bool RemoveControl (const CGUIControl *control)
 
void SetDefaultControl (int id, bool always)
 
void SetRenderFocusedLast (bool renderLast)
 
void SaveStates (std::vector< CControlState > &states) override
 
bool IsGroup () const override
 
- Public Member Functions inherited from CGUIControlLookup
 CGUIControlLookup ()=default
 
 CGUIControlLookup (int parentID, int controlID, float posX, float posY, float width, float height)
 
 CGUIControlLookup (const CGUIControlLookup &from)
 
 ~CGUIControlLookup (void) override=default
 
CGUIControlGetControl (int id, std::vector< CGUIControl * > *idCollector=nullptr) override
 
- Public Member Functions inherited from CGUIControl
 CGUIControl ()
 
 CGUIControl (int parentID, int controlID, float posX, float posY, float width, float height)
 
 CGUIControl (const CGUIControl &)
 
virtual ~CGUIControl (void)
 
bool HasProcessed () const
 Returns whether or not we have processed.
 
virtual void OnUp ()
 
virtual void OnDown ()
 
virtual void OnLeft ()
 
virtual void OnRight ()
 
virtual bool OnBack ()
 
virtual bool OnInfo ()
 
virtual void OnNextControl ()
 
virtual void OnPrevControl ()
 
virtual void OnFocus ()
 
virtual void OnUnFocus ()
 
virtual bool HitTest (const CPoint &point) const
 Used to test whether the point is inside a control.
 
virtual int GetID (void) const
 
int GetParentID () const
 
virtual bool IsDynamicallyAllocated ()
 
bool IsVisibleFromSkin () const
 
virtual bool IsDisabled () const
 
virtual void SetPosition (float posX, float posY)
 
virtual void SetHitRect (const CRect &rect, const UTILS::COLOR::Color &color)
 
virtual void SetCamera (const CPoint &camera)
 
virtual void SetStereoFactor (const float &factor)
 
bool SetColorDiffuse (const KODI::GUILIB::GUIINFO::CGUIInfoColor &color)
 
CPoint GetRenderPosition () const
 
virtual float GetXPosition () const
 
virtual float GetYPosition () const
 
virtual float GetWidth () const
 
virtual float GetHeight () const
 
void MarkDirtyRegion (const unsigned int dirtyState=DIRTY_STATE_CONTROL)
 
bool IsControlDirty () const
 
const CRectGetRenderRegion () const
 return the render region in screen coordinates of this control
 
virtual CRect CalcRenderRegion () const
 calculate the render region in parentcontrol coordinates of this control Called during process to update m_renderRegion
 
void SetActions (const ActionMap &actions)
 
void SetAction (int actionID, const CGUIAction &action, bool replace=true)
 Set actions to perform on navigation Navigations are set if replace is true or if there is no previously set action.
 
CGUIAction GetAction (int actionID) const
 Get an action the control can be perform.
 
bool Navigate (int direction) const
 Start navigating in given direction.
 
virtual void SetFocus (bool focus)
 
virtual void SetWidth (float width)
 
virtual void SetHeight (float height)
 
virtual void SetVisible (bool bVisible, bool setVisState=false)
 
void SetVisibleCondition (const std::string &expression, const std::string &allowHiddenFocus="")
 
bool HasVisibleCondition () const
 
void SetEnableCondition (const std::string &expression)
 
virtual void UpdateVisibility (const CGUIListItem *item)
 
virtual void SetEnabled (bool bEnable)
 
virtual void SetInvalid ()
 
virtual void SetPulseOnSelect (bool pulse)
 
virtual std::string GetDescription () const
 
virtual std::string GetDescriptionByIndex (int index) const
 
void SetAnimations (const std::vector< CAnimation > &animations)
 
const std::vector< CAnimation > & GetAnimations () const
 
CAnimationGetAnimation (ANIMATION_TYPE type, bool checkConditions=true)
 
virtual void UpdateInfo (const CGUIListItem *item=NULL)
 
virtual void SetPushUpdates (bool pushUpdates)
 
virtual bool IsContainer () const
 
virtual bool GetCondition (int condition, int data) const
 
void SetParentControl (CGUIControl *control)
 
CGUIControlGetParentControl (void) const
 
void SetControlStats (GUICONTROLSTATS *controlStats)
 
GUICONTROLTYPES GetControlType () const
 
bool IsControlRenderable ()
 Test whether the control is "drawable" (not a group or similar)
 

Protected Member Functions

CGUIControlGetFirstFocusableControl (int id) override
 
bool Load (TiXmlElement *pRootElement) override
 Loads the window from the given XML element.
 
virtual void SetupShares ()
 
virtual bool GoParentFolder ()
 Go one directory up on list items.
 
virtual bool OnClick (int iItem, const std::string &player="")
 On click.
 
virtual bool OnSelect (int item)
 
virtual bool OnPopupMenu (int iItem)
 
virtual void GetContextButtons (int itemNumber, CContextButtons &buttons)
 
virtual bool OnContextButton (int itemNumber, CONTEXT_BUTTON button)
 
virtual bool OnAddMediaSource ()
 
virtual void FormatItemLabels (CFileItemList &items, const LABEL_MASKS &labelMasks)
 Formats item labels.
 
virtual void UpdateButtons ()
 Updates the states.
 
void SaveControlStates () override
 
void RestoreControlStates () override
 
virtual bool GetDirectory (const std::string &strDirectory, CFileItemList &items)
 Overwrite to fill fileitems from a source.
 
virtual bool Update (const std::string &strDirectory, bool updateFilterPath=true)
 Retrieves the items from the given path and updates the list.
 
virtual bool Refresh (bool clearCache=false)
 Refreshes the current list by retrieving the lists's path.
 
virtual void FormatAndSort (CFileItemList &items)
 Format and sort file items.
 
virtual void OnPrepareFileItems (CFileItemList &items)
 On prepare file items.
 
virtual void OnCacheFileItems (CFileItemList &items)
 On cache file items.
 
virtual void GetGroupedItems (CFileItemList &items)
 
void ClearFileItems ()
 
virtual void SortItems (CFileItemList &items)
 Sort file items.
 
virtual bool CheckFilterAdvanced (CFileItemList &items) const
 Check if the given list can be advance filtered or not.
 
virtual bool CanContainFilter (const std::string &strDirectory) const
 Check if the given path can contain a "filter" parameter.
 
virtual void UpdateFilterPath (const std::string &strDirector, const CFileItemList &items, bool updateFilterPath)
 
virtual bool Filter (bool advanced=true)
 
void OnFilterItems (const std::string &filter)
 
virtual bool GetFilteredItems (const std::string &filter, CFileItemList &items)
 
virtual bool GetAdvanceFilteredItems (CFileItemList &items)
 
virtual bool HaveDiscOrConnection (const std::string &strPath, int iDriveType)
 Check disc or connection present.
 
void ShowShareErrorMessage (CFileItem *pItem) const
 Shows a standard error message for a given pItem.
 
void SaveSelectedItemInHistory ()
 
void RestoreSelectedItemFromHistory ()
 
void GetDirectoryHistoryString (const CFileItem *pItem, std::string &strHistoryString) const
 Get history string for given file item.
 
void SetHistoryForPath (const std::string &strDirectory)
 Set history for path.
 
virtual void LoadPlayList (const std::string &strFileName)
 
virtual bool OnPlayMedia (int iItem, const std::string &player="")
 On media play.
 
virtual bool OnPlayAndQueueMedia (const CFileItemPtr &item, const std::string &player="")
 On play and media queue.
 
void UpdateFileList ()
 Update file list.
 
virtual void OnDeleteItem (int iItem)
 
void OnRenameItem (int iItem)
 
bool WaitForNetwork () const
 
bool GetDirectoryItems (CURL &url, CFileItemList &items, bool useDir)
 
bool WaitGetDirectoryItems (CGetDirectoryItems &items)
 
void CancelUpdateItems ()
 
virtual std::string GetStartFolder (const std::string &url)
 Translate the folder to start in from the given quick path.
 
bool ProcessRenderLoop (bool renderOnly)
 
- Protected Member Functions inherited from CGUIWindow
EVENT_RESULT OnMouseEvent (const CPoint &point, const KODI::MOUSE::CMouseEvent &event) override
 Perform a mouse action.
 
virtual bool LoadXML (const std::string &strPath, const std::string &strLowerPath)
 Load the window XML from the given path.
 
virtual std::unique_ptr< TiXmlElement > Prepare (const std::unique_ptr< TiXmlElement > &rootElement)
 Prepare the XML for load.
 
bool NeedLoad () const
 Check if window needs a (re)load. The window need to be (re)loaded when window is not loaded or include conditions values were changed.
 
virtual void SetDefaults ()
 
void Close_Internal (bool forceClose=false, int nextWindowID=0, bool enableSound=true)
 
EVENT_RESULT OnMouseAction (const CAction &action)
 
bool Animate (unsigned int currentTime) override
 
bool CheckAnimation (ANIMATION_TYPE animType) override
 
void OnEditChanged (int id, std::string &text)
 
bool SendMessage (int message, int id, int param1=0, int param2=0)
 
void LoadControl (TiXmlElement *pControl, CGUIControlGroup *pGroup, const CRect &rect)
 
CPoint GetPosition () const override
 Grabs the window's top,left position in skin coordinates The window origin may change based on <origin> tag conditions in the skin.
 
- Protected Member Functions inherited from CGUIControlLookup
bool IsValidControl (const CGUIControl *control) const
 Check whether a given control is valid Runs through controls and returns whether this control is valid. Only functional for controls with non-zero id.
 
std::pair< LookupMap::const_iterator, LookupMap::const_iterator > GetLookupControls (int controlId) const
 
void AddLookup (CGUIControl *control)
 
void RemoveLookup (CGUIControl *control)
 
void RemoveLookup ()
 
const LookupMapGetLookup () const
 
void ClearLookup ()
 
- Protected Member Functions inherited from CGUIControl
virtual bool OnMouseOver (const CPoint &point)
 Called when the mouse is over the control. Default implementation selects the control.
 
virtual bool CanFocusFromPoint (const CPoint &point) const
 Test whether we can focus a control from a point on screen.
 
virtual bool UpdateColors (const CGUIListItem *item)
 
void UpdateStates (ANIMATION_TYPE type, ANIMATION_PROCESS currentProcess, ANIMATION_STATE currentState)
 
bool SendWindowMessage (CGUIMessage &message) const
 

Static Protected Member Functions

static std::string RemoveParameterFromPath (const std::string &strDirectory, const std::string &strParameter)
 Utility method to remove the given parameter from a path/URL.
 

Protected Attributes

XFILE::CVirtualDirectory m_rootDir
 
CGUIViewControl m_viewControl
 
CFileItemListm_vecItems
 
CFileItemListm_unfilteredItems
 items prior to filtering using FilterItems()
 
CDirectoryHistory m_history
 
std::unique_ptr< CGUIViewStatem_guiState
 
std::atomic_bool m_vecItemsUpdating = {false}
 
CEvent m_updateEvent
 
std::atomic_bool m_updateAborted = {false}
 
std::atomic_bool m_updateJobActive = {false}
 
int m_iLastControl
 
std::string m_startDirectory
 
KODI::PLAYLIST::CSmartPlaylist m_filter
 
bool m_canFilterAdvanced
 
std::string m_strFilterPath
 Contains the path used for filtering (including any active filter)
 
bool m_backgroundLoad = false
 
- Protected Attributes inherited from CGUIWindow
std::vector< intm_idRange
 
RESOLUTION_INFO m_coordsRes
 
bool m_needsScaling
 
bool m_windowLoaded
 
LOAD_TYPE m_loadType
 
bool m_dynamicResourceAlloc
 
bool m_closing
 
bool m_active
 
KODI::GUILIB::GUIINFO::CGUIInfoColor m_clearBackground
 
int m_renderOrder
 
std::vector< COriginm_origins
 
int m_lastControlID
 
std::vector< CControlStatem_controlStates
 
int m_previousWindow
 
bool m_animationsEnabled
 
CGUIAction m_loadActions
 
CGUIAction m_unloadActions
 
std::unique_ptr< TiXmlElement > m_windowXMLRootElement
 window root xml definition after resolving any skin includes. Stored to avoid parsing the XML every time the window is loaded.
 
bool m_manualRunActions
 
int m_exclusiveMouseControl
 id of child control that wishes to receive all mouse events
 
int m_menuControlID
 
int m_menuLastFocusedControlID
 
bool m_custom
 
- Protected Attributes inherited from CGUIControlGroup
std::vector< CGUIControl * > m_children
 
int m_defaultControl
 
bool m_defaultAlways
 
int m_focusedControl
 
bool m_renderFocusedLast
 
- Protected Attributes inherited from CGUIControl
ActionMap m_actions
 
float m_posX
 
float m_posY
 
float m_height
 
float m_width
 
CRect m_hitRect
 
UTILS::COLOR::Color m_hitColor = 0xffffffff
 
KODI::GUILIB::GUIINFO::CGUIInfoColor m_diffuseColor
 
int m_controlID
 
int m_parentID
 
bool m_bHasFocus
 
bool m_bInvalidated
 
bool m_bAllocated
 
bool m_pulseOnSelect
 
GUICONTROLTYPES ControlType
 
GUICONTROLSTATSm_controlStats
 
CGUIControlm_parentControl
 
INFO::InfoPtr m_visibleCondition
 
GUIVISIBLE m_visible
 
bool m_visibleFromSkinCondition
 
bool m_forceHidden
 
KODI::GUILIB::GUIINFO::CGUIInfoBool m_allowHiddenFocus
 
bool m_hasProcessed
 
INFO::InfoPtr m_enableCondition
 
bool m_enabled
 
bool m_pushedUpdates
 
std::vector< CAnimationm_animations
 
CPoint m_camera
 
bool m_hasCamera
 
float m_stereo
 
TransformMatrix m_transform
 
TransformMatrix m_cachedTransform
 
bool m_isCulled {true}
 
unsigned int m_controlDirtyState
 
CRect m_renderRegion
 

Additional Inherited Members

- Public Types inherited from CGUIWindow
enum  LOAD_TYPE { LOAD_EVERY_TIME , LOAD_ON_GUI_INIT , KEEP_IN_MEMORY }
 
- Public Types inherited from CGUIControl
enum  GUICONTROLTYPES {
  GUICONTROL_UNKNOWN , GUICONTAINER_EPGGRID , GUICONTAINER_FIXEDLIST , GUICONTAINER_LIST ,
  GUICONTAINER_PANEL , GUICONTAINER_WRAPLIST , GUICONTROL_BORDEREDIMAGE , GUICONTROL_BUTTON ,
  GUICONTROL_COLORBUTTON , GUICONTROL_EDIT , GUICONTROL_FADELABEL , GUICONTROL_GAME ,
  GUICONTROL_GAMECONTROLLER , GUICONTROL_GAMECONTROLLERLIST , GUICONTROL_GROUP , GUICONTROL_GROUPLIST ,
  GUICONTROL_IMAGE , GUICONTROL_LABEL , GUICONTROL_LISTGROUP , GUICONTROL_LISTLABEL ,
  GUICONTROL_MOVER , GUICONTROL_MULTI_IMAGE , GUICONTROL_PROGRESS , GUICONTROL_RADIO ,
  GUICONTROL_RANGES , GUICONTROL_RENDERADDON , GUICONTROL_RESIZE , GUICONTROL_RSS ,
  GUICONTROL_SCROLLBAR , GUICONTROL_SETTINGS_SLIDER , GUICONTROL_SLIDER , GUICONTROL_SPIN ,
  GUICONTROL_SPINEX , GUICONTROL_TEXTBOX , GUICONTROL_TOGGLEBUTTON , GUICONTROL_VIDEO ,
  GUICONTROL_VISUALISATION
}
 
enum  GUIVISIBLE { HIDDEN = 0 , DELAYED , VISIBLE }
 
enum  GUISCROLLVALUE { FOCUS = 0 , NEVER , ALWAYS }
 
typedef std::map< int, CGUIActionActionMap
 Set actions to perform on navigation.
 
- Protected Types inherited from CGUIControlGroup
typedef std::vector< CGUIControl * >::iterator iControls
 
typedef std::vector< CGUIControl * >::const_iterator ciControls
 
typedef std::vector< CGUIControl * >::reverse_iterator rControls
 
typedef std::vector< CGUIControl * >::const_reverse_iterator crControls
 
- Protected Types inherited from CGUIControlLookup
typedef std::multimap< int, CGUIControl * > LookupMap
 
- Static Protected Attributes inherited from CGUIControl
static const unsigned int DIRTY_STATE_CONTROL = 1
 
static const unsigned int DIRTY_STATE_CHILD = 2
 

Constructor & Destructor Documentation

◆ CGUIMediaWindow()

CGUIMediaWindow::CGUIMediaWindow ( int id,
const char * xmlFile )

◆ ~CGUIMediaWindow()

CGUIMediaWindow::~CGUIMediaWindow ( void )
override

Member Function Documentation

◆ CancelUpdateItems()

void CGUIMediaWindow::CancelUpdateItems ( )
protected

◆ CanContainFilter()

virtual bool CGUIMediaWindow::CanContainFilter ( const std::string & strDirectory) const
inlineprotectedvirtual

Check if the given path can contain a "filter" parameter.

Parameters
strDirectoryPath to check
Returns
true if the given path can contain a "filter" parameter otherwise false

Reimplemented in CGUIWindowMusicBase, and CGUIWindowVideoBase.

◆ CanFilterAdvanced()

virtual bool CGUIMediaWindow::CanFilterAdvanced ( )
inlinevirtual

◆ CheckFilterAdvanced()

virtual bool CGUIMediaWindow::CheckFilterAdvanced ( CFileItemList & items) const
inlineprotectedvirtual

Check if the given list can be advance filtered or not.

Parameters
itemsList of items to check
Returns
true if the list can be advance filtered otherwise false

Reimplemented in CGUIWindowMusicBase, and CGUIWindowVideoBase.

◆ ClearFileItems()

void CGUIMediaWindow::ClearFileItems ( )
protected

◆ CurrentDirectory()

const CFileItemList & CGUIMediaWindow::CurrentDirectory ( ) const

◆ Filter()

bool CGUIMediaWindow::Filter ( bool advanced = true)
protectedvirtual

◆ FormatAndSort()

void CGUIMediaWindow::FormatAndSort ( CFileItemList & items)
protectedvirtual

Format and sort file items.

Prepares and adds the fileitems to list/thumb panel

Reimplemented in PVR::CGUIWindowPVRGuideBase.

◆ FormatItemLabels()

void CGUIMediaWindow::FormatItemLabels ( CFileItemList & items,
const LABEL_MASKS & labelMasks )
protectedvirtual

Formats item labels.

This is based on the formatting provided by guiViewState.

◆ GetAdvanceFilteredItems()

bool CGUIMediaWindow::GetAdvanceFilteredItems ( CFileItemList & items)
protectedvirtual

◆ GetContextButtons()

◆ GetCurrentListItem()

CFileItemPtr CGUIMediaWindow::GetCurrentListItem ( int offset = 0)
overridevirtual

Reimplemented from CGUIWindow.

Reimplemented in PVR::CGUIWindowPVRGuideBase.

◆ GetDirectory()

bool CGUIMediaWindow::GetDirectory ( const std::string & strDirectory,
CFileItemList & items )
protectedvirtual

Overwrite to fill fileitems from a source.

Parameters
[in]strDirectoryPath to read
[out]itemsFill with items specified in strDirectory
Returns
false if given directory not present
Todo
Do we want to limit the directories we apply the video ones to?

Reimplemented in CGUIWindowAddonBrowser, CGUIWindowEventLog, KODI::GAME::CGUIWindowGames, CGUIWindowMusicBase, CGUIWindowMusicNav, CGUIWindowMusicPlaylistEditor, CGUIWindowPictures, PVR::CGUIWindowPVRGuideBase, CGUIWindowVideoBase, and CGUIWindowVideoNav.

◆ GetDirectoryHistoryString()

void CGUIMediaWindow::GetDirectoryHistoryString ( const CFileItem * pItem,
std::string & strHistoryString ) const
protected

Get history string for given file item.

Note
Override the function to change the default behavior on how a selected item history should look like

◆ GetDirectoryItems()

bool CGUIMediaWindow::GetDirectoryItems ( CURL & url,
CFileItemList & items,
bool useDir )
protected

◆ GetFilteredItems()

bool CGUIMediaWindow::GetFilteredItems ( const std::string & filter,
CFileItemList & items )
protectedvirtual
Todo
Need to update this to get all labels, ideally out of the displayed info (ie from m_layout and m_focusedLayout) though that isn't practical. Perhaps a better idea would be to just grab the info that we should filter on based on where we are in the library tree. Another idea is tying the filter string to the current level of the tree, so that going deeper disables the filter, but it's re-enabled on the way back out.

Reimplemented in PVR::CGUIWindowPVRRecordingsBase, and CGUIWindowVideoNav.

◆ GetFirstFocusableControl()

CGUIControl * CGUIMediaWindow::GetFirstFocusableControl ( int id)
overrideprotectedvirtual

Reimplemented from CGUIControlGroup.

◆ GetGroupedItems()

virtual void CGUIMediaWindow::GetGroupedItems ( CFileItemList & items)
inlineprotectedvirtual

Reimplemented in CGUIWindowVideoBase.

◆ GetRootPath()

◆ GetStartFolder()

std::string CGUIMediaWindow::GetStartFolder ( const std::string & url)
protectedvirtual

Translate the folder to start in from the given quick path.

Parameters
urlthe folder the user wants
Returns
the resulting path
Todo
This ifdef block probably belongs somewhere else. Move it to a better place!

Reimplemented in CGUIWindowAddonBrowser, KODI::GAME::CGUIWindowGames, CGUIWindowMusicBase, CGUIWindowMusicPlaylistEditor, CGUIWindowPictures, CGUIWindowPrograms, PVR::CGUIWindowPVRTVSearch, PVR::CGUIWindowPVRRadioSearch, CGUIWindowVideoBase, CGUIWindowVideoNav, and CGUIWindowMusicNav.

◆ GetViewContainerID()

int CGUIMediaWindow::GetViewContainerID ( ) const
inlineoverridevirtual

Reimplemented from CGUIWindow.

◆ GetViewCount()

int CGUIMediaWindow::GetViewCount ( ) const
inlineoverridevirtual

Reimplemented from CGUIWindow.

◆ GetViewState()

const CGUIViewState * CGUIMediaWindow::GetViewState ( ) const

◆ GoParentFolder()

bool CGUIMediaWindow::GoParentFolder ( )
protectedvirtual

Go one directory up on list items.

The function goes up one level in the directory tree

Reimplemented in CGUIWindowMusicPlayList.

◆ HasListItems()

bool CGUIMediaWindow::HasListItems ( ) const
inlineoverridevirtual

Reimplemented from CGUIWindow.

◆ HaveDiscOrConnection()

bool CGUIMediaWindow::HaveDiscOrConnection ( const std::string & strPath,
int iDriveType )
protectedvirtual

Check disc or connection present.

Checks if there is a disc in the dvd drive and whether the network is connected or not.

Todo
Handle not connected to a remote share

◆ IsFiltered()

bool CGUIMediaWindow::IsFiltered ( )
virtual

◆ IsMediaWindow()

bool CGUIMediaWindow::IsMediaWindow ( ) const
inlineoverridevirtual

Reimplemented from CGUIWindow.

Reimplemented in XBMCAddon::xbmcgui::Interceptor< CGUIMediaWindow >.

◆ IsSameStartFolder()

bool CGUIMediaWindow::IsSameStartFolder ( const std::string & dir)
virtual

◆ Load()

bool CGUIMediaWindow::Load ( TiXmlElement * pRootElement)
overrideprotectedvirtual

Loads the window from the given XML element.

Parameters
pRootElementthe XML element
Returns
true if the window is loaded from the given XML otherwise false.

Reimplemented from CGUIWindow.

◆ LoadPlayList()

virtual void CGUIMediaWindow::LoadPlayList ( const std::string & strFileName)
inlineprotectedvirtual

◆ OnAction()

◆ OnAddMediaSource()

virtual bool CGUIMediaWindow::OnAddMediaSource ( )
inlineprotectedvirtual

◆ OnBack()

◆ OnCacheFileItems()

void CGUIMediaWindow::OnCacheFileItems ( CFileItemList & items)
protectedvirtual

On cache file items.

This function will be called by Update() before any additional formatting, filtering or sorting is applied.

Note
Override this function to define a custom caching behaviour.

◆ OnClick()

bool CGUIMediaWindow::OnClick ( int iItem,
const std::string & player = "" )
protectedvirtual

On click.

With this function you can react on a users click in the list/thumb panel. It returns true, if the click is handled. This function calls OnPlayMedia()

Reimplemented in CGUIWindowAddonBrowser, KODI::GAME::CGUIWindowGames, CGUIWindowMusicNav, CGUIWindowMusicPlaylistEditor, CGUIWindowPictures, and CGUIWindowVideoNav.

◆ OnContextButton()

◆ OnDeleteItem()

void CGUIMediaWindow::OnDeleteItem ( int iItem)
protectedvirtual

Reimplemented in CGUIWindowVideoBase.

◆ OnFilterItems()

void CGUIMediaWindow::OnFilterItems ( const std::string & filter)
protected

◆ OnInitWindow()

void CGUIMediaWindow::OnInitWindow ( void )
overridevirtual

Called on window open.

  • Restores the control state(s)
  • Sets initial visibility of controls
  • Queue WindowOpen animation
  • Set overlay state Override this function and do any window-specific initialisation such as filling control contents and setting control focus before calling the base method.

Reimplemented from CGUIWindow.

Reimplemented in CGUIWindowMusicBase, CGUIWindowPictures, PVR::CGUIWindowPVRBase, and PVR::CGUIWindowPVRGuideBase.

◆ OnMessage()

◆ OnPlayAndQueueMedia()

bool CGUIMediaWindow::OnPlayAndQueueMedia ( const CFileItemPtr & item,
const std::string & player = "" )
protectedvirtual

On play and media queue.

Note
Override if you want to change the default behavior of what is done when the user clicks on a file in a "folder" with similar files.

This function is called by OnClick()

Reimplemented in CGUIWindowVideoBase.

◆ OnPlayMedia()

bool CGUIMediaWindow::OnPlayMedia ( int iItem,
const std::string & player = "" )
protectedvirtual

On media play.

Note
Override if you want to change the default behavior, what is done when the user clicks on a file.

This function is called by OnClick()

Reimplemented in CGUIWindowPrograms, CGUIWindowMusicBase, CGUIWindowMusicPlayList, CGUIWindowPictures, CGUIWindowVideoBase, and CGUIWindowVideoPlaylist.

◆ OnPopupMenu()

bool CGUIMediaWindow::OnPopupMenu ( int iItem)
protectedvirtual

◆ OnPrepareFileItems()

void CGUIMediaWindow::OnPrepareFileItems ( CFileItemList & items)
protectedvirtual

On prepare file items.

This function will be called by Update() before the labels of the fileitems are formatted.

Note
Override this function to set custom thumbs or load additional media info.

It's used to load tag info for music.

Reimplemented in CGUIWindowMusicBase, CGUIWindowMusicPlaylistEditor, CGUIWindowPictures, PVR::CGUIWindowPVRRecordingsBase, PVR::CGUIWindowPVRSearchBase, PVR::CGUIWindowPVRTimersBase, and CGUIWindowVideoPlaylist.

◆ OnRenameItem()

void CGUIMediaWindow::OnRenameItem ( int iItem)
protected

◆ OnSelect()

bool CGUIMediaWindow::OnSelect ( int item)
protectedvirtual

◆ OnWindowLoaded()

void CGUIMediaWindow::OnWindowLoaded ( )
overridevirtual

Reimplemented from CGUIWindow.

Reimplemented in CGUIWindowMusicNav, and PVR::CGUIWindowPVRRecordingsBase.

◆ OnWindowUnload()

void CGUIMediaWindow::OnWindowUnload ( )
overridevirtual

Reimplemented from CGUIWindow.

◆ ProcessRenderLoop()

bool CGUIMediaWindow::ProcessRenderLoop ( bool renderOnly)
protected

◆ Refresh()

bool CGUIMediaWindow::Refresh ( bool clearCache = false)
protectedvirtual

Refreshes the current list by retrieving the lists's path.

Returns
true if the list was successfully refreshed otherwise false
See also
Update
GetDirectory

◆ RemoveParameterFromPath()

std::string CGUIMediaWindow::RemoveParameterFromPath ( const std::string & strDirectory,
const std::string & strParameter )
staticprotected

Utility method to remove the given parameter from a path/URL.

Parameters
strDirectoryPath/URL from which to remove the given parameter
strParameterParameter to remove from the given path/URL
Returns
Path/URL without the given parameter

◆ RestoreControlStates()

void CGUIMediaWindow::RestoreControlStates ( )
overrideprotectedvirtual

Reimplemented from CGUIWindow.

◆ RestoreSelectedItemFromHistory()

void CGUIMediaWindow::RestoreSelectedItemFromHistory ( )
protected

◆ SaveControlStates()

void CGUIMediaWindow::SaveControlStates ( )
overrideprotectedvirtual

Reimplemented from CGUIWindow.

◆ SaveSelectedItemInHistory()

void CGUIMediaWindow::SaveSelectedItemInHistory ( )
protected

◆ SetHistoryForPath()

void CGUIMediaWindow::SetHistoryForPath ( const std::string & strDirectory)
protected

Set history for path.

Call this function to create a directory history for the path given by strDirectory.

◆ SetupShares()

void CGUIMediaWindow::SetupShares ( )
protectedvirtual

◆ ShowShareErrorMessage()

void CGUIMediaWindow::ShowShareErrorMessage ( CFileItem * pItem) const
protected

Shows a standard error message for a given pItem.

◆ SortItems()

void CGUIMediaWindow::SortItems ( CFileItemList & items)
protectedvirtual

Sort file items.

This sorts file items based on the sort method and sort order provided by guiViewState.

◆ Update()

bool CGUIMediaWindow::Update ( const std::string & strDirectory,
bool updateFilterPath = true )
protectedvirtual

Retrieves the items from the given path and updates the list.

Parameters
strDirectoryThe path to the directory to get the items from
updateFilterPathWhether to update the filter path in m_strFilterPath or not
Returns
true if the list was successfully updated otherwise false
See also
GetDirectory
m_vecItems
m_strFilterPath
Todo
OnInitWindow calls Update() before window path has been set properly.

Reimplemented in CGUIWindowAddonBrowser, CGUIWindowFavourites, CGUIWindowMusicNav, CGUIWindowMusicPlayList, CGUIWindowMusicPlaylistEditor, CGUIWindowPictures, CGUIWindowPrograms, PVR::CGUIWindowPVRBase, PVR::CGUIWindowPVRChannelsBase, PVR::CGUIWindowPVRGuideBase, PVR::CGUIWindowPVRRecordingsBase, PVR::CGUIWindowPVRSearchBase, PVR::CGUIWindowPVRTimersBase, CGUIWindowVideoBase, and CGUIWindowVideoNav.

◆ UpdateButtons()

void CGUIMediaWindow::UpdateButtons ( )
protectedvirtual

◆ UpdateFileList()

void CGUIMediaWindow::UpdateFileList ( )
protected

Update file list.

Synchronize the fileitems with the playlistplayer also recreates the playlist of the playlistplayer based on the fileitems of the window

◆ UpdateFilterPath()

void CGUIMediaWindow::UpdateFilterPath ( const std::string & strDirector,
const CFileItemList & items,
bool updateFilterPath )
protectedvirtual

◆ UseFileDirectories()

virtual bool CGUIMediaWindow::UseFileDirectories ( )
inlinevirtual

◆ WaitForNetwork()

bool CGUIMediaWindow::WaitForNetwork ( ) const
protected

◆ WaitGetDirectoryItems()

bool CGUIMediaWindow::WaitGetDirectoryItems ( CGetDirectoryItems & items)
protected

Member Data Documentation

◆ m_backgroundLoad

bool CGUIMediaWindow::m_backgroundLoad = false
protected

◆ m_canFilterAdvanced

bool CGUIMediaWindow::m_canFilterAdvanced
protected

◆ m_filter

KODI::PLAYLIST::CSmartPlaylist CGUIMediaWindow::m_filter
protected

◆ m_guiState

std::unique_ptr<CGUIViewState> CGUIMediaWindow::m_guiState
protected

◆ m_history

CDirectoryHistory CGUIMediaWindow::m_history
protected

◆ m_iLastControl

int CGUIMediaWindow::m_iLastControl
protected

◆ m_rootDir

XFILE::CVirtualDirectory CGUIMediaWindow::m_rootDir
protected

◆ m_startDirectory

std::string CGUIMediaWindow::m_startDirectory
protected

◆ m_strFilterPath

std::string CGUIMediaWindow::m_strFilterPath
protected

Contains the path used for filtering (including any active filter)

When Update() is called with a path to e.g. a smartplaylist or a library node filter, that "original" path will be stored in m_vecItems->m_strPath. But the path used by XBMC to retrieve those items from the database (Videodb:// or musicdb://) is stored in this member variable to still have access to it because it is used for filtering by appending the currently active filter as a "filter" parameter to the filter path/URL.

See also
Update

◆ m_unfilteredItems

CFileItemList* CGUIMediaWindow::m_unfilteredItems
protected

items prior to filtering using FilterItems()

◆ m_updateAborted

std::atomic_bool CGUIMediaWindow::m_updateAborted = {false}
protected

◆ m_updateEvent

CEvent CGUIMediaWindow::m_updateEvent
protected

◆ m_updateJobActive

std::atomic_bool CGUIMediaWindow::m_updateJobActive = {false}
protected

◆ m_vecItems

CFileItemList* CGUIMediaWindow::m_vecItems
protected

◆ m_vecItemsUpdating

std::atomic_bool CGUIMediaWindow::m_vecItemsUpdating = {false}
protected

◆ m_viewControl

CGUIViewControl CGUIMediaWindow::m_viewControl
protected

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