recorder

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2020 License: GPL-3.0, GPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

Package recorder handles recording and playback of user input. The Recorder type implements the riot.input.EventRecorder() interface. Once added as a transcriber to the VCS port, it will record all user input to the specified file.

Currently, a recorder and playback is attached to all ports of the VCS, including the panel.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsPlaybackFile

func IsPlaybackFile(filename string) bool

IsPlaybackFile returns true if the specified file appears to be a playback file. It does not care about the nature of any errors that may be generated or if the file appears to be a playback file but is of an unsupported version.

Types

type Playback

type Playback struct {
	CartLoad cartridgeloader.Loader
	TVSpec   string
	// contains filtered or unexported fields
}

Playback is used to reperform the user input recorded in a previously transcribed file. It implements the input.Playback interface.

func NewPlayback

func NewPlayback(transcript string) (*Playback, error)

NewPlayback is the preferred method of implementation for the Playback type.

func (*Playback) AttachToVCS

func (plb *Playback) AttachToVCS(vcs *hardware.VCS) error

AttachToVCS attaches the playback instance (an implementation of the playback interface) to all the ports of the VCS, including the panel.

func (*Playback) CheckInput

func (plb *Playback) CheckInput(id input.ID) (input.Event, input.EventData, error)

CheckInput implements the input.Playback interface.

func (Playback) EndFrame

func (plb Playback) EndFrame() (bool, error)

EndFrame returns true if emulation has gone past the last frame of the playback.

func (Playback) String

func (plb Playback) String() string

type Recorder

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

Recorder transcribes user input to a file. The transcribed file is intended for future playback. The Recorder type implements the riot.input.EventRecorder interface.

func NewRecorder

func NewRecorder(transcript string, vcs *hardware.VCS) (*Recorder, error)

NewRecorder is the preferred method of implementation for the FileRecorder type. Note that attaching of the Recorder to all the ports of the VCS (including the panel) is implicit in this function call.

func (*Recorder) End

func (rec *Recorder) End() error

End flushes all remaining transcription to the output file and closes it.

func (*Recorder) RecordEvent

func (rec *Recorder) RecordEvent(id input.ID, event input.Event, value input.EventData) error

RecordEvent implements the input.EventRecorder interface

Jump to

Keyboard shortcuts

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