Documentation
¶
Index ¶
- Constants
- Variables
- func CalcRenderSpeed(bc *cntl.BarChange) time.Duration
- func EnsureDefaultConfig(storage storage) error
- func Play(ctx context.Context, logger logging.Logger, writers []TransportWriter, ...) error
- func ToPlayable(bp cntl.BarParams, dmxCommands []cntl.DMXCommands) []cntl.Command
- type Config
- type Params
- type Player
- type Process
- type TransportWriter
- type Waiter
Constants ¶
const (
// ProcessName defines the name of the playback process
ProcessName = "playback"
)
Variables ¶
var ( ErrCancelled = errors.New("playback cancelled") ErrNoSongIDOrSetListIDGiven = errors.New("no songID or setListID given") )
Player errors
Functions ¶
func CalcRenderSpeed ¶
CalcRenderSpeed calculates the render speed of a BarChange to a time.Duration
func EnsureDefaultConfig ¶
func EnsureDefaultConfig(storage storage) error
EnsureDefaultConfig ensures that the default configuration exists in given storage
func Play ¶
func Play(ctx context.Context, logger logging.Logger, writers []TransportWriter, commands []cntl.Command) error
Play plays a given slice of commands and send it to the given writers
func ToPlayable ¶
ToPlayable takes a slice of DMXCommands and combines it with the given BarParams to a playable slice of Commands
Types ¶
type Config ¶
type Config struct {
Waiters struct {
Audio struct {
Enabled bool `json:"enabled"`
Threshold float32 `json:"threshold"`
} `json:"audio"`
} `json:"waiters"`
TransportWriters struct {
ArtNet struct {
Enabled bool `json:"enabled"`
} `json:"artNet"`
Visualizer struct {
Enabled bool `json:"enabled"`
} `json:"visualizer"`
MIDI struct {
Enabled bool `json:"enabled"`
OutputDeviceID int8 `json:"outputDeviceId"`
} `json:"midi"`
} `json:"transportWriters"`
}
Config stores the information on which waiters and/or transport writers are enabled and what their config is
type Params ¶
type Params struct {
Song struct {
ID string `json:"id"`
} `json:"song"`
SetList struct {
ID string `json:"id"`
} `json:"setList"`
}
Params specifies how to run a playback
type Player ¶
type Player struct {
// contains filtered or unexported fields
}
Player plays various things from a given data store, for example songs or a whole SetList.
func NewPlayer ¶
func NewPlayer(logger logging.Logger, ds *cntl.DataStore, writers []TransportWriter, waiters []Waiter) *Player
NewPlayer returns a new Player instance
func (*Player) PlaySetList ¶
PlaySetList plays a full SetList
type Process ¶
type Process struct {
// contains filtered or unexported fields
}
Process handles the playback of a single song
func NewProcess ¶
func NewProcess(loader loader, storage storage, controller artnet.Controller, visualizer *visualizer.Server) *Process
NewProcess returns a new playback process instance
func (*Process) Blocking ¶
Blocking returns true if calling Start() is a blocking operation and the process is stopped after start returned
func (*Process) SetParams ¶
SetParams tells the playback process whether to playback a song or set list and the corresponding ID
type TransportWriter ¶
TransportWriter is a writer to an output stream, for example a websocket or Stdout.