device

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2018 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Overview

Package device implements device managers.

Device managers handles the communication with devices (like the Launch.)

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNotSupported is returned when the request operation is not
	// supported by the active scriptplayer.
	ErrNotSupported = errors.New("operation is not supported")
	// ErrNotPlaying is returned when the operation is only supported while
	// a script is playing.
	ErrNotPlaying = errors.New("not playing")
)
View Source
var ConnectionTimeout = time.Second * 10

ConnectionTimeout is the default timeout used per Launch connecting attempt.

Functions

This section is empty.

Types

type LaunchManager

type LaunchManager struct {
	sync.Mutex
	// contains filtered or unexported fields
}

LaunchManager is responsible for connecting and communicating with the Launch.

func NewLaunchManager

func NewLaunchManager(l golaunch.Launch) *LaunchManager

NewLaunchManager creates a new manager for the given Launch.

func (*LaunchManager) Dump

Dump will return the full loaded script.

func (*LaunchManager) Pause

func (m *LaunchManager) Pause() error

Pause will halt playback but keep the current position.

func (*LaunchManager) Play

func (m *LaunchManager) Play() error

Play will start playback using the loaded scriptplayer to the connected Launch.

func (*LaunchManager) Resume

func (m *LaunchManager) Resume() error

Resume starts playback from the paused position.

func (*LaunchManager) SetScriptPlayer

func (m *LaunchManager) SetScriptPlayer(p protocol.Player) error

SetScriptPlayer switches the active ScriptPlayer. Any active script will be stopped.

func (*LaunchManager) Skip

func (m *LaunchManager) Skip(p time.Duration) error

Skip jumps playback position to the specified time.

func (*LaunchManager) Stop

func (m *LaunchManager) Stop() error

Stop will halt playback and reset the scriptplayer.

func (*LaunchManager) Trace

func (m *LaunchManager) Trace() <-chan protocol.Action

Trace returns a channel that receives the same actions as are send to the Launch.

func (*LaunchManager) WaitUntilStopped added in v0.1.2

func (m *LaunchManager) WaitUntilStopped(done chan<- struct{})

WaitUntilStopped will return a empty struct on the done channel when the player is stopped.

Jump to

Keyboard shortcuts

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