Documentation ¶
Overview ¶
Package device implements device managers.
Device managers handles the communication with devices (like the Launch.)
Index ¶
- Variables
- type LaunchManager
- func (m *LaunchManager) Dump() (protocol.TimedActions, error)
- func (m *LaunchManager) Pause() error
- func (m *LaunchManager) Play() error
- func (m *LaunchManager) Resume() error
- func (m *LaunchManager) SetScriptPlayer(p protocol.Player) error
- func (m *LaunchManager) Skip(p time.Duration) error
- func (m *LaunchManager) Stop() error
- func (m *LaunchManager) Trace() <-chan protocol.Action
- func (m *LaunchManager) WaitUntilStopped(done chan<- struct{})
Constants ¶
This section is empty.
Variables ¶
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") )
var ConnectionTimeout = time.Second * 10
ConnectionTimeout is the default timeout used per Launch connecting attempt.
Functions ¶
This section is empty.
Types ¶
type LaunchManager ¶
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 ¶
func (m *LaunchManager) Dump() (protocol.TimedActions, error)
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.