options

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: 11 Imported by: 3

Documentation

Overview

Package options deals with configuration at the libretro core level. Each core exports a list of variables that can take different values. This package can list them, load them, and save them.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	Vars    []*Variable // the variables exposed by the core
	Updated bool        // notify the core that values have been updated

	sync.Mutex
}

Options is a container type for core options internals

func New

func New(vars []VariableInterface) (*Options, error)

New instantiate a core options manager

func (*Options) Save

func (o *Options) Save() error

Save core options to a file

type Variable added in v0.7.1

type Variable struct {
	Key     string   // unique id of the variable
	Desc    string   // human readable name of the variable
	Choices []string // available values
	Choice  int      // index of the current value
	Default string
}

Variable represents one core option. A variable can take a limited number of values. The possibilities are stored in v.Choices. The current value can be accessed with v.Choices[v.Choice]

type VariableInterface added in v0.12.3

type VariableInterface interface {
	Key() string
	Desc() string
	Choices() []string
	DefaultValue() string
}

VariableInterface is used as a compatibility layer for old v0 options and v1 options

Jump to

Keyboard shortcuts

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