xbmc
Public Member Functions | List of all members
KODI::GAME::CGUIGameControllerProvider Class Reference

Controller list provider for the IAgentList control in the Player Viewer (GameAgents) window. More...

#include <GUIGameControllerProvider.h>

Inheritance diagram for KODI::GAME::CGUIGameControllerProvider:
Inheritance graph
[legend]
Collaboration diagram for KODI::GAME::CGUIGameControllerProvider:
Collaboration graph
[legend]

Public Member Functions

 CGUIGameControllerProvider (unsigned int portCount, int portIndex, const std::string &peripheralLocation, uint32_t alignment, int parentID)
 Construct a game controller provider for the player's controller list in the Player Viewer dialog. More...
 
 CGUIGameControllerProvider (const CGUIGameControllerProvider &other)
 
std::unique_ptr< IListProviderClone () override
 Create an instance of the derived class. Allows for polymorphic copies.
 
bool Update (bool forceRefresh) override
 Update the list content. More...
 
void Fetch (std::vector< CGUIListItemPtr > &items) override
 Fetch the current list of items. More...
 
bool OnClick (const CGUIListItemPtr &item) override
 Click event on an item. More...
 
bool OnInfo (const CGUIListItemPtr &item) override
 Open the info dialog for an item provided by this IListProvider. More...
 
bool OnContextMenu (const CGUIListItemPtr &item) override
 Open the context menu for an item provided by this IListProvider. More...
 
void SetDefaultItem (int item, bool always) override
 Set the default item to focus. For backwards compatibility. More...
 
int GetDefaultItem () const override
 The default item to focus. More...
 
bool AlwaysFocusDefaultItem () const override
 Whether to always focus the default item. More...
 
ControllerPtr GetControllerProfile () const
 
void SetControllerProfile (ControllerPtr controllerProfile)
 
unsigned int GetPortCount () const
 
void SetPortCount (unsigned int portCount)
 
int GetPortIndex () const
 
void SetPortIndex (int portIndex)
 
const std::string & GetPeripheralLocation () const
 
void SetPeripheralLocation (const std::string &peripheralLocation)
 
- Public Member Functions inherited from IListProvider
 IListProvider (int parentID)
 
 IListProvider (const IListProvider &other)=default
 
virtual bool IsUpdating () const
 Check whether the list provider is updating content. More...
 
virtual void Reset ()
 Reset the current list of items. Derived classes may choose to ignore this.
 
virtual void FreeResources (bool immediately)
 Free all GUI resources allocated by the items. More...
 
virtual bool OnPlay (const CGUIListItemPtr &item)
 Play event on an item. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from IListProvider
static std::unique_ptr< IListProviderCreate (const TiXmlNode *parent, int parentID)
 Factory to create list providers. More...
 
static std::unique_ptr< IListProviderCreateSingle (const TiXmlNode *content, int parentID)
 Factory to create list providers. Cannot create a multi-provider. More...
 
- Protected Attributes inherited from IListProvider
int m_parentID
 

Detailed Description

Controller list provider for the IAgentList control in the Player Viewer (GameAgents) window.

This list provider populates a game controller list with items that show which emulator port a player's controller is connected to. Most items are empty to pad the controller to its correct position in the list.

The number of list items is determined by MAX_PORT_COUNT, plus an item for the "disconnected" icon. The list items are updated when the port count or port index changes.

An alignment can be specified to align the available ports to the left or right side of the list.

Constructor & Destructor Documentation

◆ CGUIGameControllerProvider()

CGUIGameControllerProvider::CGUIGameControllerProvider ( unsigned int  portCount,
int  portIndex,
const std::string &  peripheralLocation,
uint32_t  alignment,
int  parentID 
)

Construct a game controller provider for the player's controller list in the Player Viewer dialog.

Parameters
portCountThe number of open ports for the emulator
portIndexThe index of the port the controller is connected to
peripheralLocationThe location of the underlying peripheral providing input
alignmentThe alignment of the list items (XBFONT_LEFT or XBFONT_RIGHT)
parentIDThe ID of the parent window

Member Function Documentation

◆ AlwaysFocusDefaultItem()

bool KODI::GAME::CGUIGameControllerProvider::AlwaysFocusDefaultItem ( ) const
inlineoverridevirtual

Whether to always focus the default item.

Returns
true if the default item should always be the one to receive focus.
See also
GetDefaultItem, SetDefaultItem

Reimplemented from IListProvider.

◆ Fetch()

void CGUIGameControllerProvider::Fetch ( std::vector< CGUIListItemPtr > &  items)
overridevirtual

Fetch the current list of items.

Parameters
items[out] the list to be filled.

Implements IListProvider.

◆ GetDefaultItem()

int KODI::GAME::CGUIGameControllerProvider::GetDefaultItem ( ) const
inlineoverridevirtual

The default item to focus.

Returns
the item to focus by default. -1 for none.
See also
SetDefaultItem, AlwaysFocusDefaultItem

Reimplemented from IListProvider.

◆ OnClick()

bool KODI::GAME::CGUIGameControllerProvider::OnClick ( const CGUIListItemPtr &  item)
inlineoverridevirtual

Click event on an item.

Parameters
itemthe item that was clicked.
Returns
true if the click was handled, false otherwise.

Implements IListProvider.

◆ OnContextMenu()

bool KODI::GAME::CGUIGameControllerProvider::OnContextMenu ( const CGUIListItemPtr &  item)
inlineoverridevirtual

Open the context menu for an item provided by this IListProvider.

Parameters
itemthe item that was clicked.
Returns
true if the click was handled, false otherwise.

Implements IListProvider.

◆ OnInfo()

bool KODI::GAME::CGUIGameControllerProvider::OnInfo ( const CGUIListItemPtr &  item)
inlineoverridevirtual

Open the info dialog for an item provided by this IListProvider.

Parameters
itemthe item that was clicked.
Returns
true if the dialog was shown, false otherwise.

Implements IListProvider.

◆ SetDefaultItem()

void KODI::GAME::CGUIGameControllerProvider::SetDefaultItem ( int  item,
bool  always 
)
inlineoverridevirtual

Set the default item to focus. For backwards compatibility.

Parameters
itemthe item to focus.
alwayswhether this item should always be used on first focus.
See also
GetDefaultItem, AlwaysFocusDefaultItem

Reimplemented from IListProvider.

◆ Update()

bool CGUIGameControllerProvider::Update ( bool  forceRefresh)
overridevirtual

Update the list content.

Returns
true if the content has changed, false otherwise.

Implements IListProvider.


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