reset

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2023 License: GPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Mux

func Mux(readers []LogReader) (<-chan stateUpdate, <-chan error)

Mux takes a slice of LogReaders as input and multiplexes their outputs onto one single channel, which can be selected on. Whenever an error is received over the returned error channel, resetti should terminate.

Types

type Counter

type Counter struct {
	// contains filtered or unexported fields
}

Counter keeps track of the number of resets performed and writes them to a file on disk.

func NewCounter

func NewCounter(ctx context.Context, wg *sync.WaitGroup, conf cfg.Profile) (Counter, error)

NewCounter creates a new reset counter from the user's configuration profile. If CountResets is disabled, then the Counter will do nothing.

func (*Counter) Increment

func (c *Counter) Increment()

Increment increments the reset count if CountResets is enabled in the user's configuration, otherwise it is a no-op.

type FullView

type FullView struct {
	// contains filtered or unexported fields
}

type LoadingView

type LoadingView struct {
	// contains filtered or unexported fields
}

type LockedView

type LockedView struct {
	// contains filtered or unexported fields
}

type LogReader

type LogReader struct {
	Errors <-chan error
	Events <-chan mc.InstanceState
	// contains filtered or unexported fields
}

func NewLogReader

func NewLogReader(ctx context.Context, wg *sync.WaitGroup, info mc.InstanceInfo) (LogReader, error)

type MovingWall

type MovingWall struct {
	// contains filtered or unexported fields
}

func DefaultMovingWall

func DefaultMovingWall(obs *obs.Client, conf cfg.Profile) MovingWall

func (*MovingWall) SetupWallScene

func (m *MovingWall) SetupWallScene(conf cfg.Profile, instances []mc.Instance) error

type Multi

type Multi struct {
	// contains filtered or unexported fields
}

Multi implements a traditional multi-instance resetting setup, where the user plays one instance before resetting and switching to the next instance.

func NewMulti

func NewMulti(conf cfg.Profile, infos []mc.InstanceInfo, x *x11.Client) Multi

NewMulti creates a new Multi for multi-instance resetting.

func (*Multi) Run

func (m *Multi) Run() error

Run attempts to run the multi-instance resetter. If an error occurs during setup, it will be returned.

type Wall

type Wall struct {
	// contains filtered or unexported fields
}

Wall provides an implementation of the famous "wall" resetting style, where all of the user's instances are shown on a grid on an OBS projector and they can choose which to play.

func NewWall

func NewWall(conf cfg.Profile, infos []mc.InstanceInfo, x *x11.Client) Wall

NewWall creates a new Wall for wall resetting.

func (*Wall) CreateSleepbgLock

func (m *Wall) CreateSleepbgLock()

CreateSleepbgLock creates the sleepbg.lock file if the user has enabled it in their configuration profile.

func (*Wall) DeleteSleepbgLock

func (m *Wall) DeleteSleepbgLock()

DeleteSleepbgLock deletes the sleepbg.lock file if the user has disabled it in their configuration profile.

func (*Wall) FocusProjector

func (m *Wall) FocusProjector() error

FocusProjector focuses the OBS projector.

func (*Wall) GotoWall

func (m *Wall) GotoWall()

GotoWall returns to the wall scene.

func (*Wall) GrabWallKeys

func (m *Wall) GrabWallKeys() error

GrabWallKeys attempts to grab wall-only keys from the X server.

func (*Wall) HandleInput

func (m *Wall) HandleInput(id int, mod x11.Keymod, timestamp xproto.Timestamp) error

HandleInput handles an instance-specific input on the wall.

func (*Wall) HandleLockLoaded

func (m *Wall) HandleLockLoaded(timestamp xproto.Timestamp) error

Handles the locking of the first loaded instance.

func (*Wall) HandlePlayLoaded

func (m *Wall) HandlePlayLoaded(timestamp xproto.Timestamp) error

Handles playing the first loaded instance.

func (*Wall) HandlePlayLocked

func (m *Wall) HandlePlayLocked(timestamp xproto.Timestamp) error

Handles playing the first locked instance.

func (*Wall) HandleResetInput

func (m *Wall) HandleResetInput(timestamp xproto.Timestamp)

HandleResetInput handles the user pressing the Reset keybind.

func (*Wall) HandleResetLoading

func (m *Wall) HandleResetLoading(timestamp xproto.Timestamp) error

Handles resetting the first instance of the loading view.

func (*Wall) HandleUnlockLocked

func (m *Wall) HandleUnlockLocked(timestamp xproto.Timestamp) error

Handles the unlocking of the first locked instance.

func (*Wall) Run

func (m *Wall) Run() error

Run attempts to run the wall resetter. If an error occurs during setup, it will be returned.

func (*Wall) SetAffinities

func (m *Wall) SetAffinities()

SetAffinities sets the CPU affinity of each instance to the correct value. This should be called whenever the user switches to or from the wall scene to switch instances between mid/high affinities.

func (*Wall) SetAffinity

func (m *Wall) SetAffinity(id int, affinity int)

SetAffinity sets the CPU affinity of a specific instance.

func (*Wall) SetLocked

func (m *Wall) SetLocked(id int, locked bool)

SetLocked sets the lock state of the given instance.

func (*Wall) UngrabWallKeys

func (m *Wall) UngrabWallKeys() error

UngrabWallKeys releases wall-only key grabs.

func (*Wall) UpdateAffinity

func (m *Wall) UpdateAffinity(id int)

UpdateAffinity updates the affinity of an instance based on its state.

func (*Wall) WallLock

func (m *Wall) WallLock(id int, timestamp xproto.Timestamp) error

WallLock locks the given instance.

func (*Wall) WallPlay

func (m *Wall) WallPlay(id int, timestamp xproto.Timestamp) error

WallPlay plays the given instance.

func (*Wall) WallReset

func (m *Wall) WallReset(id int, timestamp xproto.Timestamp) error

WallReset resets the given instance.

func (*Wall) WallResetOthers

func (m *Wall) WallResetOthers(id int, timestamp xproto.Timestamp)

WallResetOthers plays the given instance and resets all other unlocked instances.

Jump to

Keyboard shortcuts

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