tracker

package
v2.23.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: GPL-3.0 Imports: 26 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	VideoLauncherID   = "GenericVideo"
	ScummVMLauncherID = "ScummVM"
)

Launcher IDs of the console launchers whose media is a Linux process Core owns. They never write ACTIVEGAME, so an empty ACTIVEGAME says nothing about them; the process exit and Core's own stop are what end their media.

View Source
const (
	ArcadeSystem = "Arcade"
)

Variables

This section is empty.

Functions

func ResolveArcadeSetName added in v2.17.0

func ResolveArcadeSetName(
	ctx context.Context, mediaDB database.MediaDBI, setName, arcadeName string,
) (path string, ok bool)

ResolveArcadeSetName maps a MiSTer arcade core's set name (as reported by /tmp/CORENAME) to the single indexed .mra file that owns it. arcadeName is the pretty name from ArcadeDatabase.csv, used to narrow the MediaDB search before each candidate is confirmed by parsing its own <setname>. Ambiguous or unconfirmable set names report ok=false rather than guessing - callers keep today's set-name-only behaviour in that case.

func ResolvePath

func ResolvePath(path string) string

Convert a launchable path to an absolute path.

func RunArcadeHistoryBackfill added in v2.17.0

func RunArcadeHistoryBackfill(ctx context.Context, db *database.Database, tr *Tracker)

RunArcadeHistoryBackfill resolves every legacy MediaHistory row recorded under a bare arcade set name (MediaPath = "pooyan", not a path - from a launch the tracker detected externally, before ResolveArcadeSetName existed) to its canonical .mra path and identity, then never runs again. Intended to run once as an idle-scheduler task for the life of the platform; blocks until fully done or ctx is cancelled.

func StartFileWatch

func StartFileWatch(tr *Tracker) (*fsnotify.Watcher, error)

StartFileWatch Start thread for monitoring changes to all files relating to core/game launches.

Types

type NameMapping

type NameMapping struct {
	CoreName   string
	System     string
	Name       string
	ArcadeName string
}

type Tracker

type Tracker struct {
	ActiveSystemName string
	ActiveSystem     string
	ActiveGameID     string
	ActiveGameName   string
	ActiveGamePath   string
	ActiveCore       string
	NameMap          []NameMapping
	// contains filtered or unexported fields
}

func NewTracker

func NewTracker(
	ctx context.Context,
	pl platforms.Platform,
	cfg *config.Instance,
	activeMedia func() *models.ActiveMedia,
	setActiveMedia func(*models.ActiveMedia),
	db *database.Database,
) (*Tracker, error)

func StartTracker

func StartTracker(
	ctx context.Context,
	cfg *config.Instance,
	pl platforms.Platform,
	activeMedia func() *models.ActiveMedia,
	setActiveMedia func(*models.ActiveMedia),
	db *database.Database,
) (*Tracker, func() error, error)

func (*Tracker) ClearActiveGame added in v2.17.0

func (tr *Tracker) ClearActiveGame() error

ClearActiveGame synchronously retires tracker state and clears the shared ACTIVEGAME signal so a bare core or menu transition cannot inherit it.

func (*Tracker) LoadCore

func (tr *Tracker) LoadCore()

LoadCore loads the current running core and set it as active.

func (*Tracker) LookupCoreName

func (tr *Tracker) LookupCoreName(name string) *NameMapping

func (*Tracker) ReloadNameMap

func (tr *Tracker) ReloadNameMap()

func (*Tracker) ResolveExternalMediaPath added in v2.17.0

func (tr *Tracker) ResolveExternalMediaPath(ctx context.Context, systemID, value string) (string, bool)

ResolveExternalMediaPath maps a legacy MediaHistory row's set-name-only MediaPath back to its canonical indexed .mra path, for the arcade history backfill task (arcade_history_backfill.go).

func (*Tracker) StopAll

func (tr *Tracker) StopAll()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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