RetroArch
Static Public Member Functions | Private Member Functions | Static Private Member Functions | Static Private Attributes | List of all members
com.retroarch.browser.preferences.util.UserPreferences Class Reference

Static Public Member Functions

static String getDefaultConfigPath (Context ctx)
 
static void updateConfigFile (Context ctx)
 
static SharedPreferences getPreferences (Context ctx)
 

Private Member Functions

 UserPreferences ()
 

Static Private Member Functions

static void readbackString (ConfigFile cfg, SharedPreferences.Editor edit, String key)
 
static void readbackBool (ConfigFile cfg, SharedPreferences.Editor edit, String key)
 
static void readbackDouble (ConfigFile cfg, SharedPreferences.Editor edit, String key)
 
static String sanitizeLibretroPath (String path)
 
static int getLowLatencyOptimalSamplingRate (Context ctx)
 
static int getLowLatencyBufferSize (Context ctx)
 
static int getOptimalSamplingRate (Context ctx)
 

Static Private Attributes

static final String TAG = "UserPreferences"
 

Detailed Description

Utility class for retrieving, saving, or loading preferences.

Constructor & Destructor Documentation

◆ UserPreferences()

com.retroarch.browser.preferences.util.UserPreferences.UserPreferences ( )
inlineprivate

Member Function Documentation

◆ getDefaultConfigPath()

static String com.retroarch.browser.preferences.util.UserPreferences.getDefaultConfigPath ( Context  ctx)
inlinestatic

Retrieves the path to the default location of the libretro config.

Parameters
ctxthe current Context
Returns
the path to the default location of the libretro config.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getLowLatencyBufferSize()

static int com.retroarch.browser.preferences.util.UserPreferences.getLowLatencyBufferSize ( Context  ctx)
inlinestaticprivate

Gets the optimal buffer size for low-latency audio playback.

Parameters
ctxthe current Context.
Returns
the optimal output buffer size in decimal PCM frames.
Here is the caller graph for this function:

◆ getLowLatencyOptimalSamplingRate()

static int com.retroarch.browser.preferences.util.UserPreferences.getLowLatencyOptimalSamplingRate ( Context  ctx)
inlinestaticprivate

Gets the optimal sampling rate for low-latency audio playback.

Parameters
ctxthe current Context.
Returns
the optimal sampling rate for low-latency audio playback in Hz.
Here is the caller graph for this function:

◆ getOptimalSamplingRate()

static int com.retroarch.browser.preferences.util.UserPreferences.getOptimalSamplingRate ( Context  ctx)
inlinestaticprivate

Gets the optimal audio sampling rate.

On Android 4.2+ devices this will retrieve the optimal low-latency sampling rate, since Android 4.2 adds support for low latency audio in general.

On other devices, it simply returns the regular optimal sampling rate as returned by the hardware.

Parameters
ctxThe current Context.
Returns
the optimal audio sampling rate in Hz.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getPreferences()

static SharedPreferences com.retroarch.browser.preferences.util.UserPreferences.getPreferences ( Context  ctx)
inlinestatic

Gets a SharedPreferences instance containing current settings.

Parameters
ctxthe current Context.
Returns
A SharedPreference instance containing current settings.
Here is the caller graph for this function:

◆ readbackBool()

static void com.retroarch.browser.preferences.util.UserPreferences.readbackBool ( ConfigFile  cfg,
SharedPreferences.Editor  edit,
String  key 
)
inlinestaticprivate
Here is the call graph for this function:

◆ readbackDouble()

static void com.retroarch.browser.preferences.util.UserPreferences.readbackDouble ( ConfigFile  cfg,
SharedPreferences.Editor  edit,
String  key 
)
inlinestaticprivate
Here is the call graph for this function:

◆ readbackString()

static void com.retroarch.browser.preferences.util.UserPreferences.readbackString ( ConfigFile  cfg,
SharedPreferences.Editor  edit,
String  key 
)
inlinestaticprivate
Here is the call graph for this function:

◆ sanitizeLibretroPath()

static String com.retroarch.browser.preferences.util.UserPreferences.sanitizeLibretroPath ( String  path)
inlinestaticprivate

private static void readbackInt(ConfigFile cfg, SharedPreferences.Editor edit, String key) { if (cfg.keyExists(key)) edit.putInt(key, cfg.getInt(key)); else edit.remove(key); }Sanitizes a libretro core path.

Parameters
pathThe path to the libretro core.
Returns
the sanitized libretro path.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateConfigFile()

static void com.retroarch.browser.preferences.util.UserPreferences.updateConfigFile ( Context  ctx)
inlinestatic

Updates the libretro configuration file with new values if settings have changed.

Parameters
ctxthe current Context.
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ TAG

final String com.retroarch.browser.preferences.util.UserPreferences.TAG = "UserPreferences"
staticprivate

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