options

package
v0.9.8 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2019 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 []libretro.Variable) (*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
}

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]

Jump to

Keyboard shortcuts

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