settings

package
v0.17.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 26, 2024 License: GPL-3.0 Imports: 13 Imported by: 15

Documentation

Overview

Package settings defines the app settings and functions to save and load those.

Index

Constants

This section is empty.

Variables

View Source
var Defaults = defaultSettings()

Defaults stores default values for settings

Functions

func CoreForPlaylist

func CoreForPlaylist(playlist string) (string, error)

CoreForPlaylist returns the absolute path of the default libretro core for a given playlist

func Load

func Load() error

Load loads settings from the home directory. If the settings file doesn't exists, it will return an error and set all the settings to their default value.

func Save

func Save() error

Save saves the current configuration to the home directory

Types

type Settings

type Settings struct {
	VideoFullscreen   bool   `hide:"ludos" toml:"video_fullscreen" label:"Video Fullscreen" fmt:"%t" widget:"switch"`
	VideoMonitorIndex int    `toml:"video_monitor_index" label:"Video Monitor Index" fmt:"%d"`
	VideoFilter       string `toml:"video_filter" label:"Video Filter" fmt:"<%s>"`
	VideoDarkMode     bool   `toml:"video_dark_mode" label:"Video Dark Mode" fmt:"%t" widget:"switch"`

	AudioVolume float32 `toml:"audio_volume" label:"Audio Volume" fmt:"%.1f" widget:"range"`

	MenuAudioVolume float32 `toml:"menu_audio_volume" label:"Menu Audio Volume" fmt:"%.1f" widget:"range"`
	ShowHiddenFiles bool    `toml:"menu_showhiddenfiles" label:"Show Hidden Files" fmt:"%t" widget:"switch"`

	MapAxisToDPad bool `toml:"input_map_axis_to_dpad" label:"Map Sticks To DPad" fmt:"%t" widget:"switch"`

	CoreForPlaylist map[string]string `hide:"always" toml:"core_for_playlist"`

	FileDirectory        string `hide:"ludos" toml:"files_dir" label:"Files Directory" fmt:"%s" widget:"dir"`
	CoresDirectory       string `hide:"ludos" toml:"cores_dir" label:"Cores Directory" fmt:"%s" widget:"dir"`
	AssetsDirectory      string `hide:"ludos" toml:"assets_dir" label:"Assets Directory" fmt:"%s" widget:"dir"`
	DatabaseDirectory    string `hide:"ludos" toml:"database_dir" label:"Database Directory" fmt:"%s" widget:"dir"`
	SavestatesDirectory  string `hide:"ludos" toml:"savestates_dir" label:"Savestates Directory" fmt:"%s" widget:"dir"`
	SavefilesDirectory   string `hide:"ludos" toml:"savefiles_dir" label:"Savefiles Directory" fmt:"%s" widget:"dir"`
	ScreenshotsDirectory string `hide:"ludos" toml:"screenshots_dir" label:"Screenshots Directory" fmt:"%s" widget:"dir"`
	SystemDirectory      string `hide:"ludos" toml:"system_dir" label:"System Directory" fmt:"%s" widget:"dir"`
	PlaylistsDirectory   string `hide:"ludos" toml:"playlists_dir" label:"Playlists Directory" fmt:"%s" widget:"dir"`
	ThumbnailsDirectory  string `hide:"ludos" toml:"thumbnail_dir" label:"Thumbnails Directory" fmt:"%s" widget:"dir"`

	SSHService       bool `hide:"app" toml:"ssh_service" label:"SSH" widget:"switch" service:"sshd.service" path:"/storage/.cache/services/sshd.conf"`
	SambaService     bool `` /* 127-byte string literal not displayed */
	BluetoothService bool `` /* 140-byte string literal not displayed */
}

Settings is the list of available settings for the program. It serializes to TOML. Tags are used to set a human readable label and a format for the settings value. Widget sets the graphical representation of the value.

var Current Settings

Current stores the current settings at runtime

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL