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

#include <MediaSettings.h>

Inheritance diagram for CMediaSettings:
ISettingCallback ISettingsHandler ISubSettings

Public Member Functions

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 OnSettingAction (std::shared_ptr< const CSetting > setting) override
 The given setting has been activated. More...
 
void OnSettingChanged (std::shared_ptr< const CSetting > setting) override
 The value of the given setting has changed. More...
 
void OnSettingsLoaded () override
 Settings have been loaded. More...
 
const CVideoSettingsGetDefaultVideoSettings () const
 
CVideoSettingsGetDefaultVideoSettings ()
 
const CGameSettingsGetDefaultGameSettings () const
 
CGameSettingsGetDefaultGameSettings ()
 
const CGameSettingsGetCurrentGameSettings () const
 
CGameSettingsGetCurrentGameSettings ()
 
int GetWatchedMode (const std::string &content) const
 Retrieve the watched mode for the given content type. More...
 
void SetWatchedMode (const std::string &content, WatchedMode mode)
 Set the watched mode for the given content type. More...
 
void CycleWatchedMode (const std::string &content)
 Cycle the watched mode for the given content type. More...
 
void SetMusicPlaylistRepeat (bool repeats)
 
void SetMusicPlaylistShuffled (bool shuffled)
 
void SetVideoPlaylistRepeat (bool repeats)
 
void SetVideoPlaylistShuffled (bool shuffled)
 
bool DoesVideoStartWindowed () const
 
void SetVideoStartWindowed (bool windowed)
 
int GetAdditionalSubtitleDirectoryChecked () const
 
void SetAdditionalSubtitleDirectoryChecked (int checked)
 
int GetMusicNeedsUpdate () const
 
void SetMusicNeedsUpdate (int version)
 
int GetVideoNeedsUpdate () const
 
void SetVideoNeedsUpdate (int version)
 
- Public Member Functions inherited from ISettingCallback
virtual ~ISettingCallback ()=default
 
virtual bool OnSettingChanging (std::shared_ptr< const CSetting > setting)
 The value of the given setting is being changed. More...
 
virtual bool OnSettingUpdate (std::shared_ptr< CSetting > setting, const char *oldSettingId, const TiXmlNode *oldSettingNode)
 The given setting needs to be updated. More...
 
virtual void OnSettingPropertyChanged (std::shared_ptr< const CSetting > setting, const char *propertyName)
 The given property of the given setting has changed. More...
 
- Public Member Functions inherited from ISettingsHandler
virtual ~ISettingsHandler ()=default
 
virtual bool OnSettingsLoading ()
 Settings loading has been initiated. More...
 
virtual bool OnSettingsSaving () const
 Settings saving has been initiated. 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...
 
- Public Member Functions inherited from ISubSettings
virtual ~ISubSettings ()=default
 
virtual void Clear ()
 Clear any loaded setting values. More...
 

Static Public Member Functions

static CMediaSettingsGetInstance ()
 

Protected Member Functions

 CMediaSettings ()
 
 CMediaSettings (const CMediaSettings &)=delete
 
CMediaSettingsoperator= (CMediaSettings const &)=delete
 
 ~CMediaSettings () override
 

Static Protected Member Functions

static std::string GetWatchedContent (const std::string &content)
 

Constructor & Destructor Documentation

◆ CMediaSettings() [1/2]

CMediaSettings::CMediaSettings ( )
protected

◆ CMediaSettings() [2/2]

CMediaSettings::CMediaSettings ( const CMediaSettings )
protecteddelete

◆ ~CMediaSettings()

CMediaSettings::~CMediaSettings ( )
overrideprotecteddefault

Member Function Documentation

◆ CycleWatchedMode()

void CMediaSettings::CycleWatchedMode ( const std::string &  content)

Cycle the watched mode for the given content type.

Parameters
contentCurrent content type
See also
GetWatchMode, SetWatchMode

◆ DoesVideoStartWindowed()

bool CMediaSettings::DoesVideoStartWindowed ( ) const
inline

◆ GetAdditionalSubtitleDirectoryChecked()

int CMediaSettings::GetAdditionalSubtitleDirectoryChecked ( ) const
inline

◆ GetCurrentGameSettings() [1/2]

CGameSettings & CMediaSettings::GetCurrentGameSettings ( )
inline

◆ GetCurrentGameSettings() [2/2]

const CGameSettings & CMediaSettings::GetCurrentGameSettings ( ) const
inline

◆ GetDefaultGameSettings() [1/2]

CGameSettings & CMediaSettings::GetDefaultGameSettings ( )
inline

◆ GetDefaultGameSettings() [2/2]

const CGameSettings & CMediaSettings::GetDefaultGameSettings ( ) const
inline

◆ GetDefaultVideoSettings() [1/2]

CVideoSettings & CMediaSettings::GetDefaultVideoSettings ( )
inline

◆ GetDefaultVideoSettings() [2/2]

const CVideoSettings & CMediaSettings::GetDefaultVideoSettings ( ) const
inline

◆ GetInstance()

CMediaSettings & CMediaSettings::GetInstance ( )
static

◆ GetMusicNeedsUpdate()

int CMediaSettings::GetMusicNeedsUpdate ( ) const
inline

◆ GetVideoNeedsUpdate()

int CMediaSettings::GetVideoNeedsUpdate ( ) const
inline

◆ GetWatchedContent()

std::string CMediaSettings::GetWatchedContent ( const std::string &  content)
staticprotected

◆ GetWatchedMode()

int CMediaSettings::GetWatchedMode ( const std::string &  content) const

Retrieve the watched mode for the given content type.

Parameters
contentCurrent content type
Returns
the current watch mode for this content type, WATCH_MODE_ALL if the content type is unknown.
See also
SetWatchMode

◆ Load()

bool CMediaSettings::Load ( const TiXmlNode *  settings)
overridevirtual

Load settings from the given XML node.

Parameters
settingsXML node containing setting values
Returns
True if loading the settings was successful, false otherwise.

Reimplemented from ISubSettings.

◆ OnSettingAction()

void CMediaSettings::OnSettingAction ( std::shared_ptr< const CSetting setting)
overridevirtual

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.

Parameters
settingThe setting which has been activated.

Reimplemented from ISettingCallback.

◆ OnSettingChanged()

void CMediaSettings::OnSettingChanged ( std::shared_ptr< const CSetting setting)
overridevirtual

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.

Parameters
settingThe setting whose value has been changed

Reimplemented from ISettingCallback.

◆ OnSettingsLoaded()

void CMediaSettings::OnSettingsLoaded ( )
overridevirtual

Settings have been loaded.

This callback can be used to trigger loading other settings.

Reimplemented from ISettingsHandler.

◆ operator=()

CMediaSettings & CMediaSettings::operator= ( CMediaSettings const &  )
protecteddelete

◆ Save()

bool CMediaSettings::Save ( TiXmlNode *  settings) const
overridevirtual

Save settings to the given XML node.

Parameters
settingsXML node in which the settings will be saved
Returns
True if saving the settings was successful, false otherwise.

Reimplemented from ISubSettings.

◆ SetAdditionalSubtitleDirectoryChecked()

void CMediaSettings::SetAdditionalSubtitleDirectoryChecked ( int  checked)
inline

◆ SetMusicNeedsUpdate()

void CMediaSettings::SetMusicNeedsUpdate ( int  version)
inline

◆ SetMusicPlaylistRepeat()

void CMediaSettings::SetMusicPlaylistRepeat ( bool  repeats)
inline

◆ SetMusicPlaylistShuffled()

void CMediaSettings::SetMusicPlaylistShuffled ( bool  shuffled)
inline

◆ SetVideoNeedsUpdate()

void CMediaSettings::SetVideoNeedsUpdate ( int  version)
inline

◆ SetVideoPlaylistRepeat()

void CMediaSettings::SetVideoPlaylistRepeat ( bool  repeats)
inline

◆ SetVideoPlaylistShuffled()

void CMediaSettings::SetVideoPlaylistShuffled ( bool  shuffled)
inline

◆ SetVideoStartWindowed()

void CMediaSettings::SetVideoStartWindowed ( bool  windowed)
inline

◆ SetWatchedMode()

void CMediaSettings::SetWatchedMode ( const std::string &  content,
WatchedMode  mode 
)

Set the watched mode for the given content type.

Parameters
contentCurrent content type
valueWatched mode to set
See also
GetWatchMode

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