dmx

package
v0.0.0-...-c66ceb2 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ChannelRed cntl.DMXChannel = 1 + iota
	ChannelGreen
	ChannelBlue
	ChannelWhite
	ChannelStrobe
	ChannelMode
	ChannelDimmer
	ChannelTilt
	ChannelTiltFine
	ChannelPan
	ChannelPanFine
	ChannelPanTiltSpeed
)

DeviceTypes usable in this application

Variables

View Source
var (
	ErrDeviceHasDisabledModeChannel   = errors.New("device has disabled Mode channel")
	ErrDeviceHasDisabledStrobeChannel = errors.New("device has disabled Strobe channel")
	ErrDeviceHasDisabledDimmerChannel = errors.New("device has disabled Dimmer channel")
	ErrDeviceIsNotMoving              = errors.New("device is not moving, cannot use tilt and pan")

	ErrDeviceParamsDevicesInvalid          = errors.New("DMXDeviceParams must have either a group or a device")
	ErrDeviceParamsValuesInvalid           = errors.New("DMXDeviceParams must not have more the one of [Animation, Transition, Params]")
	ErrDeviceParamsNoDevices               = errors.New("DMXDeviceParams matches no device")
	ErrDeviceParamsColorVarMustBeExclusive = errors.New("DMXDeviceParams cannot have a $color var and one of [red, green, blue, white]")
	ErrTransitionDeviceParamsMustMatchLED  = errors.New("DMXTransition contains a param set where the LED is not the same")
	ErrDeviceSelectorMustHaveTagsOrID      = errors.New("DMXDeviceSelector must have either tags or an ID")
	ErrDeviceSelectorCannotHaveTagsAndID   = errors.New("DMXDeviceSelector cannot have tags and an ID")
)

Render Errors

Functions

func CalcSceneLength

func CalcSceneLength(sc *cntl.DMXScene) uint64

CalcSceneLength calculates the length of a given scene in render frames

func Merge

func Merge(cmds []cntl.DMXCommands, cs []cntl.DMXCommands) []cntl.DMXCommands

Merge merges two arrays of DMXCommands

func MergeAtOffset

func MergeAtOffset(cmds []cntl.DMXCommands, cs []cntl.DMXCommands, offset int) []cntl.DMXCommands

MergeAtOffset merges two arrays of DMXCommands after a given offset

func MergeWithFrameChange

func MergeWithFrameChange(cmds []cntl.DMXCommands, cs []cntl.DMXCommands, paramsNoteValue uint8) []cntl.DMXCommands

MergeWithFrameChange merges two given DMXCommand slices, respecting that the second one is not in the right renderFrames setting Like, cs is in 16th and RenderFrames ist 64th we have to add spacing while merging

func RenderAnimation

func RenderAnimation(ds *cntl.DataStore, dd []*cntl.DMXDevice, a *cntl.DMXAnimation) ([]cntl.DMXCommands, error)

RenderAnimation renders the given DMXAnimation to an array of DMXCommands to be sent to a DMX device

func RenderDeviceParams

func RenderDeviceParams(ds *cntl.DataStore, dp *cntl.DMXDeviceParams) ([]cntl.DMXCommands, error)

RenderDeviceParams renders the given DMXDeviceParams to an array of DMXCommands to be sent to a DMX device

func RenderParams

func RenderParams(ds *cntl.DataStore, dd []*cntl.DMXDevice, p cntl.DMXParams) (cmds cntl.DMXCommands, err error)

RenderParams renders the given DMXParams to an array of DMXCommands to be sent to a DMX device

func RenderPreset

func RenderPreset(ds *cntl.DataStore, p *cntl.DMXPreset) ([]cntl.DMXCommands, error)

RenderPreset renders a preset and returns an array of commands for every frame

func RenderScene

func RenderScene(ds *cntl.DataStore, sc *cntl.DMXScene) ([]cntl.DMXCommands, error)

RenderScene renders the given dmx scene to dmx commands and returns them. The first array dimension contains the render frames, the second dimension contains all dmx commands for a render frame.

func RenderTransition

func RenderTransition(ds *cntl.DataStore, dd []*cntl.DMXDevice, t *cntl.DMXTransition) ([]cntl.DMXCommands, error)

RenderTransition renders the given DMXTransition to an array of DMXCommands to be sent to a DMX device

func RenderTransitionParams

func RenderTransitionParams(ds *cntl.DataStore, dd []*cntl.DMXDevice, t *cntl.DMXTransition, p cntl.DMXTransitionParams) ([]cntl.DMXCommands, error)

RenderTransitionParams renders the params of given transition

func ResolveDeviceSelector

func ResolveDeviceSelector(ds *cntl.DataStore, sel *cntl.DMXDeviceSelector) ([]*cntl.DMXDevice, error)

ResolveDeviceSelector returns all DMXDevices that match the given selector

func ResolveDevicesByTag

func ResolveDevicesByTag(ds *cntl.DataStore, tag cntl.Tag) (dd []*cntl.DMXDevice)

ResolveDevicesByTag returns all DMXDevices that match the given tag

func ResolveDevicesByTags

func ResolveDevicesByTags(ds *cntl.DataStore, tags []cntl.Tag) (dd []*cntl.DMXDevice)

ResolveDevicesByTags returns all DMXDevices that match *all* of the given tags

func StreamlineScenes

func StreamlineScenes(ds *cntl.DataStore, s *cntl.Song) (map[uint64][]*cntl.DMXScene, error)

StreamlineScenes returns a map of frame -> scene that is easier to handle then a plain array

Types

This section is empty.

Jump to

Keyboard shortcuts

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