Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
|
Controller list provider for the IAgentList control in the Player Viewer (GameAgents
) window.
More...
#include <GUIGameControllerProvider.h>
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. | |
CGUIGameControllerProvider (const CGUIGameControllerProvider &other) | |
~CGUIGameControllerProvider () override | |
std::unique_ptr< IListProvider > | Clone () override |
Create an instance of the derived class. Allows for polymorphic copies. | |
bool | Update (bool forceRefresh) override |
Update the list content. | |
void | Fetch (std::vector< std::shared_ptr< CGUIListItem > > &items) override |
Fetch the current list of items. | |
bool | OnClick (const std::shared_ptr< CGUIListItem > &item) override |
Click event on an item. | |
bool | OnInfo (const std::shared_ptr< CGUIListItem > &item) override |
Open the info dialog for an item provided by this IListProvider. | |
bool | OnContextMenu (const std::shared_ptr< CGUIListItem > &item) override |
Open the context menu for an item provided by this IListProvider. | |
void | SetDefaultItem (int item, bool always) override |
Set the default item to focus. For backwards compatibility. | |
int | GetDefaultItem () const override |
The default item to focus. | |
bool | AlwaysFocusDefaultItem () const override |
Whether to always focus the default item. | |
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 | ~IListProvider ()=default |
virtual bool | IsUpdating () const |
Check whether the list provider is updating content. | |
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. | |
virtual bool | OnPlay (const std::shared_ptr< CGUIListItem > &item) |
Play event on an item. | |
Additional Inherited Members | |
Static Public Member Functions inherited from IListProvider | |
static std::unique_ptr< IListProvider > | Create (const TiXmlNode *parent, int parentID) |
Factory to create list providers. | |
static std::unique_ptr< IListProvider > | CreateSingle (const TiXmlNode *content, int parentID) |
Factory to create list providers. Cannot create a multi-provider. | |
Protected Attributes inherited from IListProvider | |
int | m_parentID |
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.
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.
portCount | The number of open ports for the emulator |
portIndex | The index of the port the controller is connected to |
peripheralLocation | The location of the underlying peripheral providing input |
alignment | The alignment of the list items (XBFONT_LEFT or XBFONT_RIGHT ) |
parentID | The ID of the parent window |
|
explicit |
|
overridedefault |
|
inlineoverridevirtual |
Whether to always focus the default item.
Reimplemented from IListProvider.
|
overridevirtual |
Create an instance of the derived class. Allows for polymorphic copies.
Implements IListProvider.
|
overridevirtual |
Fetch the current list of items.
items | [out] the list to be filled. |
Implements IListProvider.
|
inline |
|
inlineoverridevirtual |
The default item to focus.
Reimplemented from IListProvider.
|
inline |
|
inline |
|
inline |
|
inlineoverridevirtual |
Click event on an item.
item | the item that was clicked. |
Implements IListProvider.
|
inlineoverridevirtual |
Open the context menu for an item provided by this IListProvider.
item | the item that was clicked. |
Implements IListProvider.
|
inlineoverridevirtual |
Open the info dialog for an item provided by this IListProvider.
item | the item that was clicked. |
Implements IListProvider.
void CGUIGameControllerProvider::SetControllerProfile | ( | ControllerPtr | controllerProfile | ) |
|
inlineoverridevirtual |
Set the default item to focus. For backwards compatibility.
item | the item to focus. |
always | whether this item should always be used on first focus. |
Reimplemented from IListProvider.
void CGUIGameControllerProvider::SetPeripheralLocation | ( | const std::string & | peripheralLocation | ) |
Update the list content.
Implements IListProvider.