Kodi Documentation 18.0
Kodi is an open source media player and entertainment hub.
CGUIInfoManager Class Reference

#include <GUIInfoManager.h>

Inheritance diagram for CGUIInfoManager:
Observable KODI::MESSAGING::IMessageTarget

Public Member Functions

 CGUIInfoManager (void)
 
 ~CGUIInfoManager (void) override
 
void Initialize ()
 
void Clear ()
 
void ResetCache ()
 
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...
 
INFO::InfoPtr Register (const std::string &expression, int context=0)
 Register a boolean condition/expression This routine allows controls or other clients of the info manager to register to receive updates of particular expressions, in a particular context (currently windows). More...
 
bool ConditionsChangedValues (const std::map< INFO::InfoPtr, bool > &map)
 iterates through boolean conditions and compares their stored values to current values. Returns true if any condition changed value. More...
 
bool EvaluateBool (const std::string &expression, int context=0, const CGUIListItemPtr &item=nullptr)
 Evaluate a boolean expression. More...
 
int TranslateString (const std::string &strCondition)
 Translates a string as given by the skin into an int that we use for more efficient retrieval of data. Can handle combined strings on the form Player.Caching + VideoPlayer.IsFullscreen (Logical and) Player.HasVideo | Player.HasAudio (Logical or) More...
 
int TranslateSingleString (const std::string &strCondition, bool &listItemDependent)
 
std::string GetLabel (int info, int contextWindow=0, std::string *fallback=nullptr) const
 
std::string GetImage (int info, int contextWindow, std::string *fallback=nullptr)
 Obtains the filename of the image to show from whichever subsystem is needed. More...
 
bool GetInt (int &value, int info, int contextWindow=0, const CGUIListItem *item=nullptr) const
 
bool GetBool (int condition, int contextWindow=0, const CGUIListItem *item=nullptr)
 
std::string GetItemLabel (const CFileItem *item, int contextWindow, int info, std::string *fallback=nullptr) const
 
std::string GetItemImage (const CGUIListItem *item, int contextWindow, int info, std::string *fallback=nullptr) const
 
bool GetItemInt (int &value, const CGUIListItem *item, int contextWindow, int info) const
 Get integer value of info. More...
 
bool GetItemBool (const CGUIListItem *item, int contextWindow, int condition) const
 
void SetCurrentItem (const CFileItem &item)
 Set currently playing file item. More...
 
void ResetCurrentItem ()
 
void UpdateCurrentItem (const CFileItem &item)
 
void SetCurrentAlbumThumb (const std::string &thumbFileName)
 
const MUSIC_INFO::CMusicInfoTagGetCurrentSongTag () const
 
const CVideoInfoTagGetCurrentMovieTag () const
 
void UpdateAVInfo ()
 
int RegisterSkinVariableString (const INFO::CSkinVariableString *info)
 
int TranslateSkinVariableString (const std::string &name, int context)
 
void RegisterInfoProvider (KODI::GUILIB::GUIINFO::IGUIInfoProvider *provider)
 register a guiinfo provider More...
 
void UnregisterInfoProvider (KODI::GUILIB::GUIINFO::IGUIInfoProvider *provider)
 unregister a guiinfo provider More...
 
KODI::GUILIB::GUIINFO::CGUIInfoProvidersGetInfoProviders ()
 get access to the registered guiinfo providers More...
 
- Public Member Functions inherited from Observable
 Observable ()=default
 
virtual ~Observable ()=default
 
virtual Observableoperator= (const Observable &observable)
 
virtual void RegisterObserver (Observer *obs)
 Register an observer. More...
 
virtual void UnregisterObserver (Observer *obs)
 Unregister an observer. More...
 
virtual void NotifyObservers (const ObservableMessage message=ObservableMessageNone)
 Send a message to all observers when m_bObservableChanged is true. More...
 
virtual void SetChanged (bool bSetTo=true)
 Mark an observable changed. More...
 
virtual bool IsObserving (const Observer &obs) const
 Check whether this observable is being observed by an observer. More...
 
- Public Member Functions inherited from KODI::MESSAGING::IMessageTarget
virtual ~IMessageTarget ()=default
 

Additional Inherited Members

- Protected Member Functions inherited from Observable
void SendMessage (const ObservableMessage message)
 Send a message to all observer when m_bObservableChanged is true. More...
 
- Protected Attributes inherited from Observable
std::atomic< bool > m_bObservableChanged {false}
 
std::vector< Observer * > m_observers
 
CCriticalSection m_obsCritSection
 

Constructor & Destructor Documentation

◆ CGUIInfoManager()

CGUIInfoManager::CGUIInfoManager ( void  )

◆ ~CGUIInfoManager()

CGUIInfoManager::~CGUIInfoManager ( void  )
override

Member Function Documentation

◆ Clear()

void CGUIInfoManager::Clear ( )

◆ ConditionsChangedValues()

bool CGUIInfoManager::ConditionsChangedValues ( const std::map< INFO::InfoPtr, bool > &  map)

iterates through boolean conditions and compares their stored values to current values. Returns true if any condition changed value.

◆ EvaluateBool()

bool CGUIInfoManager::EvaluateBool ( const std::string &  expression,
int  context = 0,
const CGUIListItemPtr item = nullptr 
)

Evaluate a boolean expression.

Parameters
expressionthe expression to evaluate
contextthe context in which to evaluate the expression (currently windows)
Returns
the value of the evaluated expression.
See also
Register

◆ GetBool()

bool CGUIInfoManager::GetBool ( int  condition,
int  contextWindow = 0,
const CGUIListItem item = nullptr 
)

◆ GetCurrentMovieTag()

const CVideoInfoTag * CGUIInfoManager::GetCurrentMovieTag ( ) const

◆ GetCurrentSongTag()

const MUSIC_INFO::CMusicInfoTag * CGUIInfoManager::GetCurrentSongTag ( ) const

◆ GetImage()

std::string CGUIInfoManager::GetImage ( int  info,
int  contextWindow,
std::string *  fallback = nullptr 
)

Obtains the filename of the image to show from whichever subsystem is needed.

◆ GetInfoProviders()

KODI::GUILIB::GUIINFO::CGUIInfoProviders & CGUIInfoManager::GetInfoProviders ( )
inline

get access to the registered guiinfo providers

Returns
the guiinfo providers

◆ GetInt()

bool CGUIInfoManager::GetInt ( int &  value,
int  info,
int  contextWindow = 0,
const CGUIListItem item = nullptr 
) const

◆ GetItemBool()

bool CGUIInfoManager::GetItemBool ( const CGUIListItem item,
int  contextWindow,
int  condition 
) const

◆ GetItemImage()

std::string CGUIInfoManager::GetItemImage ( const CGUIListItem item,
int  contextWindow,
int  info,
std::string *  fallback = nullptr 
) const

◆ GetItemInt()

bool CGUIInfoManager::GetItemInt ( int &  value,
const CGUIListItem item,
int  contextWindow,
int  info 
) const

Get integer value of info.

Parameters
valueint reference to pass value of given info
infoid of info
contextthe context in which to evaluate the expression (currently windows)
itemoptional listitem if want to get listitem related int
Returns
true if given info was handled
See also
GetItemInt, GetMultiInfoInt

◆ GetItemLabel()

std::string CGUIInfoManager::GetItemLabel ( const CFileItem item,
int  contextWindow,
int  info,
std::string *  fallback = nullptr 
) const

◆ GetLabel()

std::string CGUIInfoManager::GetLabel ( int  info,
int  contextWindow = 0,
std::string *  fallback = nullptr 
) const

◆ GetMessageMask()

int CGUIInfoManager::GetMessageMask ( )
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.

◆ Initialize()

void CGUIInfoManager::Initialize ( void  )

◆ OnApplicationMessage()

void CGUIInfoManager::OnApplicationMessage ( KODI::MESSAGING::ThreadMessage msg)
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

See also
ThreadMessage can be used as it will be used as the return value for
CApplicationMessenger::SendMsg. It is up to the implementer to decide if this is to be used and it should be documented along with any new message implemented.

Implements KODI::MESSAGING::IMessageTarget.

◆ Register()

INFO::InfoPtr CGUIInfoManager::Register ( const std::string &  expression,
int  context = 0 
)

Register a boolean condition/expression This routine allows controls or other clients of the info manager to register to receive updates of particular expressions, in a particular context (currently windows).

In the future, it will allow clients to receive pushed callbacks when the expression changes.

Parameters
expressionthe boolean condition or expression
contextthe context window
Returns
an identifier used to reference this expression

◆ RegisterInfoProvider()

void CGUIInfoManager::RegisterInfoProvider ( KODI::GUILIB::GUIINFO::IGUIInfoProvider provider)

register a guiinfo provider

Parameters
theguiinfo provider to register

◆ RegisterSkinVariableString()

int CGUIInfoManager::RegisterSkinVariableString ( const INFO::CSkinVariableString info)

◆ ResetCache()

void CGUIInfoManager::ResetCache ( )

◆ ResetCurrentItem()

void CGUIInfoManager::ResetCurrentItem ( )

◆ SetCurrentAlbumThumb()

void CGUIInfoManager::SetCurrentAlbumThumb ( const std::string &  thumbFileName)

◆ SetCurrentItem()

void CGUIInfoManager::SetCurrentItem ( const CFileItem item)

Set currently playing file item.

◆ TranslateSingleString()

int CGUIInfoManager::TranslateSingleString ( const std::string &  strCondition,
bool &  listItemDependent 
)
Todo:
change to IsScanning(Video)
Todo:
remove these, they're repeats
Todo:
remove these, they're repeats
Todo:
this doesn't support foo.xml
Todo:
The parameter for these should really be on the first not the second property
Todo:
The parameter for these should really be on the first not the second property
Todo:
replace with a single system.platform
Todo:
these two don't allow duration(foo) and also don't allow more than this number of levels...
Todo:
The parameter for these should really be on the first not the second property

◆ TranslateSkinVariableString()

int CGUIInfoManager::TranslateSkinVariableString ( const std::string &  name,
int  context 
)

◆ TranslateString()

int CGUIInfoManager::TranslateString ( const std::string &  strCondition)

Translates a string as given by the skin into an int that we use for more efficient retrieval of data. Can handle combined strings on the form Player.Caching + VideoPlayer.IsFullscreen (Logical and) Player.HasVideo | Player.HasAudio (Logical or)

◆ UnregisterInfoProvider()

void CGUIInfoManager::UnregisterInfoProvider ( KODI::GUILIB::GUIINFO::IGUIInfoProvider provider)

unregister a guiinfo provider

Parameters
theguiinfo provider to unregister

◆ UpdateAVInfo()

void CGUIInfoManager::UpdateAVInfo ( )

◆ UpdateCurrentItem()

void CGUIInfoManager::UpdateCurrentItem ( const CFileItem item)

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