engine

package
v0.0.24 Latest Latest
Warning

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

Go to latest
Published: May 16, 2026 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidLogLine = errors.New("invalid log line")
View Source
var ErrNoEngineFound = errors.New("no supported engine found")

Functions

func FilterDedupe added in v0.0.22

func FilterDedupe() func(*Line) *Line

func InstallLogExe added in v0.0.22

func InstallLogExe(ctx context.Context, gameRoot string) error

Types

type Engine

type Engine interface {
	Name() string
	InstallGame(dir string) (*game.Game, error)
	IsDirEngine(dir string) bool
	InstallTextHook(game *game.Game) error
	IsEngine(dir string) bool
	SetCustomPlugin(data string) error
	GetDefaultPlugin() string
	GetFile(g *game.Game, file string) (*EngineFileInfo, error)
}

type EngineFileInfo added in v0.0.12

type EngineFileInfo struct {
	Name       string
	Data       []byte
	MediaType  string // audio/ogg, audio/wav, audio/mpeg
	Ext        string // .ogg, .wav, .mp3
	SampleRate int
	Channels   int
	BitDepth   int
}

func NewEngineFileInfo added in v0.0.12

func NewEngineFileInfo(path string, data []byte) *EngineFileInfo

type EngineV2 added in v0.0.14

type EngineV2 interface {
	Name() string

	IsEngine(dir string) bool
	//AddGame Will only work on games that have already been installed/ not the launcher
	// WIll need to set game fields based off the gr runner so we know what to run when we call run game
	AddGame(ctx context.Context, filepath string) (*game.Game, error)
	InstallHook(ctx context.Context, game *game.Game) error
	RunGame(ctx context.Context, game *game.Game) (*gr.Process, error)

	StopGame(ctx context.Context, proc *gr.Process) (*gr.Process, error)
	// GetFile will not be supported on TR
	GetFile(g *game.Game, file string) (*EngineFileInfo, error)

	FollowGameText(ctx context.Context, game *game.Game, opts ...FollowGameOptions) (chan Line, error)

	Shutdown() error
	ManagedGames() []*game.Game
	GetTextractor(game *game.Game) *textractor.Client // or nil for other engines
}

type FollowGameOptions added in v0.0.14

type FollowGameOptions struct {
	MaxLines int
	History  bool
	Filters  []func(l *Line) *Line
}

type Line added in v0.0.14

type Line struct {
	Raw     string
	Hook    string
	Text    string
	Speaker string
	Time    time.Time
	RawTime string
	Voice   string
}

func FilterJapaneseOnly added in v0.0.22

func FilterJapaneseOnly(l *Line) *Line

func FilterNonEmpty added in v0.0.22

func FilterNonEmpty(l *Line) *Line

func ParseLogLine added in v0.0.16

func ParseLogLine(line string) (*Line, error)

Directories

Path Synopsis
pkg/engines/kirikiri2/detect.go
pkg/engines/kirikiri2/detect.go

Jump to

Keyboard shortcuts

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