Documentation
¶
Overview ¶
Package cntl contains all methods required to streamline a song and render the single frames to output channels.
Index ¶
- Constants
- type BarChange
- type BarParams
- type Command
- type DMXAnimation
- type DMXAnimationFrame
- type DMXChannel
- type DMXColorVariable
- type DMXCommand
- type DMXCommands
- type DMXDevice
- type DMXDeviceGroup
- type DMXDeviceParams
- type DMXDeviceSelector
- type DMXDeviceType
- type DMXParams
- type DMXPreset
- type DMXScene
- type DMXScenePosition
- type DMXSubScene
- type DMXTransition
- type DMXTransitionParams
- type DMXUniverse
- type DMXValue
- func (v *DMXValue) Byte() byte
- func (v *DMXValue) Equals(v2 *DMXValue) bool
- func (v *DMXValue) MarshalJSON() ([]byte, error)
- func (v *DMXValue) MarshalYAML() (interface{}, error)
- func (v *DMXValue) Uint8() uint8
- func (v *DMXValue) UnmarshalJSON(b []byte) error
- func (v *DMXValue) UnmarshalYAML(unmarshal func(interface{}) error) error
- type DataStore
- type EaseFunc
- type FrameState
- type LED
- type MIDICommand
- type MIDICommands
- type SetList
- type Song
- type Tag
Constants ¶
const ( LoggerFieldTransport = "transport" LoggerFieldWaiter = "waiter" )
Logger fields
const RenderFrames uint8 = 64
RenderFrames defines the smallest render unit of a bar. Has to be multiplier of 4.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BarParams ¶
type BarParams struct {
NoteValue uint8 `json:"noteValue" yaml:"noteValue"`
NoteCount uint8 `json:"noteCount" yaml:"noteCount"`
Speed uint16 `json:"speed" yaml:"speed"`
}
BarParams are a reusable informational struct on how fast and in what scheme something should be played
type Command ¶
type Command struct {
FrameState
DMXCommands DMXCommands `json:"dmxCommands" yaml:"dmxCommands"`
MIDICommands MIDICommands `json:"midiCommands" yaml:"midiCommands"`
BarChange *BarChange `json:"barChange" yaml:"barChange"`
}
Command is a container to set settings
type DMXAnimation ¶
type DMXAnimation struct {
ID string `json:"id" yaml:"id"`
Name string `json:"name" yaml:"name"`
Frames []DMXAnimationFrame `json:"frames" yaml:"frames"`
}
DMXAnimation is an animation of dmx params in relation to time
func (DMXAnimation) Equals ¶
func (v1 DMXAnimation) Equals(v2 DMXAnimation) bool
Equals returns whether the two given objects are equal
type DMXAnimationFrame ¶
type DMXAnimationFrame struct {
At uint8 `json:"at" yaml:"at"`
Params DMXParams `json:"params" yaml:"params"`
}
DMXAnimationFrame is a single frame in an animation
func (DMXAnimationFrame) Equals ¶
func (v1 DMXAnimationFrame) Equals(v2 DMXAnimationFrame) bool
Equals returns whether the two given objects are equal
type DMXColorVariable ¶
type DMXColorVariable struct {
ID string `json:"id" yaml:"id"`
Name string `json:"name" yaml:"name"`
Red *DMXValue `json:"red" yaml:"red"`
Green *DMXValue `json:"green" yaml:"green"`
Blue *DMXValue `json:"blue" yaml:"blue"`
White *DMXValue `json:"white" yaml:"white"`
}
DMXColorVariable is a global variable for a DMX color
type DMXCommand ¶
type DMXCommand struct {
Universe DMXUniverse `json:"universe" yaml:"universe"`
Channel DMXChannel `json:"channel" yaml:"channel"`
Value DMXValue `json:"value" yaml:"value"`
}
DMXCommand tells a DMX controller to set a channel on a universe to a specific value
func (DMXCommand) Equals ¶
func (cmd DMXCommand) Equals(c DMXCommand) bool
Equals returns true if given DMXCommand is equal to the called one
func (DMXCommand) EqualsChannel ¶
func (cmd DMXCommand) EqualsChannel(c DMXCommand) bool
EqualsChannel returns true if given DMXCommand is equal to the called one in terms of channel and universe
type DMXCommands ¶
type DMXCommands []DMXCommand
DMXCommands is an array of DMXCommands
func (DMXCommands) Contains ¶
func (cmds DMXCommands) Contains(c DMXCommand) bool
Contains returns whether given DMXCommand is in the called collection
func (DMXCommands) ContainsChannel ¶
func (cmds DMXCommands) ContainsChannel(c DMXCommand) bool
ContainsChannel returns whether given DMXCommand's channel and universe is in the called collection
func (DMXCommands) Equals ¶
func (cmds DMXCommands) Equals(c DMXCommands) bool
Equals returns true when both the called and the given one have the same entries without caring for order
type DMXDevice ¶
type DMXDevice struct {
ID string `json:"id" yaml:"id"`
Name string `json:"name" yaml:"name"`
TypeID string `json:"typeId" yaml:"typeId"`
Universe DMXUniverse `json:"universe" yaml:"universe"`
StartChannel DMXChannel `json:"startChannel" yaml:"startChannel"`
Tags []Tag `json:"tags" yaml:"tags"`
}
DMXDevice is a DMX device
type DMXDeviceGroup ¶
type DMXDeviceGroup struct {
ID string `json:"id" yaml:"id"`
Name string `json:"name" yaml:"name"`
Devices []DMXDeviceSelector `json:"devices" yaml:"devices"`
}
DMXDeviceGroup is a DMX device group
func (*DMXDeviceGroup) Equals ¶
func (v1 *DMXDeviceGroup) Equals(v2 *DMXDeviceGroup) bool
Equals returns whether the two given objects are equal
type DMXDeviceParams ¶
type DMXDeviceParams struct {
Group *string `json:"group" yaml:"group"`
Device *string `json:"device" yaml:"device"`
Params []DMXParams `json:"params" yaml:"params"`
Animation *string `json:"animation" yaml:"animation"`
Transition *string `json:"transition" yaml:"transition"`
}
DMXDeviceParams is an object storing DMX parameters including the selection of either groups or devices
func (DMXDeviceParams) Equals ¶
func (v1 DMXDeviceParams) Equals(v2 DMXDeviceParams) bool
Equals returns whether the two given objects are equal
type DMXDeviceSelector ¶
type DMXDeviceSelector struct {
ID string `json:"id" yaml:"id"`
Tags []Tag `json:"tags" yaml:"tags"`
}
DMXDeviceSelector is a selector for DMX devices
func (DMXDeviceSelector) Equals ¶
func (v1 DMXDeviceSelector) Equals(v2 DMXDeviceSelector) bool
Equals returns whether the two given objects are equal
type DMXDeviceType ¶
type DMXDeviceType struct {
ID string `json:"id" yaml:"id"`
Name string `json:"name" yaml:"name"`
ChannelCount uint16 `json:"channelCount" yaml:"channelCount"`
ChannelsPerLED uint16 `json:"channelsPerLED" yaml:"channelsPerLED"`
StrobeEnabled bool `json:"strobeEnabled" yaml:"strobeEnabled"`
StrobeChannel DMXChannel `json:"strobeChannel" yaml:"strobeChannel"`
DimmerEnabled bool `json:"dimmerEnabled" yaml:"dimmerEnabled"`
DimmerChannel DMXChannel `json:"dimmerChannel" yaml:"dimmerChannel"`
ModeEnabled bool `json:"modeEnabled" yaml:"modeEnabled"`
ModeChannel DMXChannel `json:"modeChannel" yaml:"modeChannel"`
Moving bool `json:"moving" yaml:"moving"`
PanChannel DMXChannel `json:"panChannel" yaml:"panChannel"`
PanFineChannel DMXChannel `json:"panFineChannel" yaml:"panFineChannel"`
TiltChannel DMXChannel `json:"tiltChannel" yaml:"tiltChannel"`
TiltFineChannel DMXChannel `json:"tiltFineChannel" yaml:"tiltFineChannel"`
PanTiltSpeedChannel DMXChannel `json:"panTiltSpeedChannel" yaml:"panTiltSpeedChannel"`
LEDs []LED `json:"leds"`
}
DMXDeviceType is the type of a DMXDevice
func (*DMXDeviceType) Equals ¶
func (v1 *DMXDeviceType) Equals(v2 *DMXDeviceType) bool
Equals returns whether the two given objects are equal
type DMXParams ¶
type DMXParams struct {
LEDAll bool `json:"ledAll"`
LED uint16 `json:"led" yaml:"led"`
ColorVar *string `json:"$color" yaml:"$color"`
Red *DMXValue `json:"red" yaml:"red"`
Green *DMXValue `json:"green" yaml:"green"`
Blue *DMXValue `json:"blue" yaml:"blue"`
White *DMXValue `json:"white" yaml:"white"`
Pan *DMXValue `json:"pan" yaml:"pan"`
PanFine *DMXValue `json:"panFine" yaml:"panFine"`
Tilt *DMXValue `json:"tilt" yaml:"tilt"`
TiltFine *DMXValue `json:"tiltFine" yaml:"tiltFine"`
PanTiltSpeed *DMXValue `json:"panTiltSpeed" yaml:"panTiltSpeed"`
Strobe *DMXValue `json:"strobe" yaml:"strobe"`
Mode *DMXValue `json:"mode" yaml:"mode"`
Dimmer *DMXValue `json:"dimmer" yaml:"dimmer"`
}
DMXParams is a DMX parameter object
type DMXPreset ¶
type DMXPreset struct {
ID string `json:"id" yaml:"id"`
Name string `json:"name" yaml:"name"`
DeviceParams []DMXDeviceParams `json:"deviceParams" yaml:"deviceParams"`
}
DMXPreset is a DMX Preet for devices or device groups
type DMXScene ¶
type DMXScene struct {
ID string `json:"id" yaml:"id"`
Name string `json:"name" yaml:"name"`
NoteValue uint8 `json:"noteValue" yaml:"noteValue"`
NoteCount uint16 `json:"noteCount" yaml:"noteCount"`
SubScenes []DMXSubScene `json:"subScenes" yaml:"subScenes"`
}
DMXScene is a whole light scene
type DMXScenePosition ¶
type DMXScenePosition struct {
ID string `json:"id" yaml:"id"`
At uint64 `json:"at" yaml:"at"`
Repeat uint8 `json:"repeat" yaml:"repeat"`
Marker string `json:"marker" yaml:"marker"`
}
DMXScenePosition describes the position of a DMX scene within a song
func (DMXScenePosition) Equals ¶
func (v1 DMXScenePosition) Equals(v2 DMXScenePosition) bool
Equals returns whether the two given objects are equal
type DMXSubScene ¶
type DMXSubScene struct {
At []uint64 `json:"at" yaml:"at"`
DeviceParams []DMXDeviceParams `json:"deviceParams" yaml:"deviceParams"`
Preset *string `json:"preset" yaml:"preset"`
}
DMXSubScene is a sub scene of a light scene
func (DMXSubScene) Equals ¶
func (v1 DMXSubScene) Equals(v2 DMXSubScene) bool
Equals returns whether the two given objects are equal
type DMXTransition ¶
type DMXTransition struct {
ID string `json:"id" yaml:"id"`
Name string `json:"name" yaml:"name"`
Ease EaseFunc `json:"ease" yaml:"ease"`
Length uint16 `json:"length" yaml:"length"`
Params []DMXTransitionParams `json:"params" yaml:"params"`
}
DMXTransition is a transition from a given state to another one using an ease function
type DMXTransitionParams ¶
type DMXTransitionParams struct {
From DMXParams `json:"from" yaml:"from"`
To DMXParams `json:"to" yaml:"to"`
}
DMXTransitionParams hold the params for a transition
type DMXValue ¶
type DMXValue struct {
Value uint8
}
DMXValue is the value a DMX channel can represent (0-255)
func (*DMXValue) MarshalJSON ¶
MarshalJSON converts the value to a json byte array
func (*DMXValue) MarshalYAML ¶
MarshalYAML encodes the value to YAML
func (*DMXValue) UnmarshalJSON ¶
UnmarshalJSON sets the value from a json byte array
func (*DMXValue) UnmarshalYAML ¶
UnmarshalYAML takes the value from YAML
type DataStore ¶
type DataStore struct {
SetLists map[string]*SetList
Songs map[string]*Song
DMXScenes map[string]*DMXScene
DMXPresets map[string]*DMXPreset
DMXAnimations map[string]*DMXAnimation
DMXTransitions map[string]*DMXTransition
DMXDevices map[string]*DMXDevice
DMXDeviceTypes map[string]*DMXDeviceType
DMXDeviceGroups map[string]*DMXDeviceGroup
DMXColorVariables map[string]*DMXColorVariable
}
A DataStore holds the controllers data state during playback, or more specifically during the rendering of a song into DMX frames
type EaseFunc ¶
type EaseFunc string
EaseFunc names a function that is used to ease a transition
const ( EaseLinear EaseFunc = "Linear" EaseQuadIn EaseFunc = "InQuad" EaseQuadOut EaseFunc = "OutQuad" EaseQuadInOut EaseFunc = "InOutQuad" EaseCubicIn EaseFunc = "InCubic" EaseCubicOut EaseFunc = "OutCubic" EaseCubicInOut EaseFunc = "InOutCubic" EaseQuartIn EaseFunc = "InQuart" EaseQuartOut EaseFunc = "OutQuart" EaseQuartInOut EaseFunc = "InOutQuart" EaseQuintIn EaseFunc = "InQuint" EaseQuintOut EaseFunc = "OutQuint" EaseQuintInOut EaseFunc = "InOutQuint" EaseSineIn EaseFunc = "InSine" EaseSineOut EaseFunc = "OutSine" EaseSineInOut EaseFunc = "InOutSine" EaseCircularIn EaseFunc = "InCircular" EaseCircularOut EaseFunc = "OutCircular" EaseCircularInOut EaseFunc = "InOutCircular" EaseExpoIn EaseFunc = "InExpo" EaseExpoOut EaseFunc = "OutExpo" EaseExpoInOut EaseFunc = "InOutExpo" EaseElasticIn EaseFunc = "InElastic" EaseElasticOut EaseFunc = "OutElastic" EaseElasticInOut EaseFunc = "InOutElastic" EaseBackIn EaseFunc = "InBack" EaseBackOut EaseFunc = "OutBack" EaseBackInOut EaseFunc = "InOutBack" EaseBounceIn EaseFunc = "InBounce" EaseBounceOut EaseFunc = "OutBounce" EaseBounceInOut EaseFunc = "InOutBounce" )
easing function names
type FrameState ¶
type FrameState struct {
Frame uint64 `json:"frame" yaml:"frame"`
Bar uint16 `json:"bar" yaml:"bar"`
Note uint8 `json:"note" yaml:"note"`
}
FrameState stores information about which bar and note the command is in
type LED ¶
type LED struct {
Red DMXChannel `json:"red" yaml:"red"`
Green DMXChannel `json:"green" yaml:"green"`
Blue DMXChannel `json:"blue" yaml:"blue"`
White DMXChannel `json:"white" yaml:"white"`
}
LED maps a single LEDs DMX channels
type MIDICommand ¶
type MIDICommand struct {
At uint64 `json:"at" yaml:"at"`
Status uint8 `json:"status" yaml:"status"`
Data1 uint8 `json:"data1" yaml:"data1"`
Data2 uint8 `json:"data2" yaml:"data2"`
}
MIDICommand tells a MIDI controller to set a channel to a specific value
type SetList ¶
type SetList struct {
ID string `json:"id" yaml:"id"`
Name string `json:"name" yaml:"name"`
Songs []string `json:"songs" yaml:"songs"`
}
SetList is a set of songs in a specific order
type Song ¶
type Song struct {
ID string `json:"id" yaml:"id"`
Name string `json:"name" yaml:"name"`
BarChanges []BarChange `json:"barChanges" yaml:"barChanges"`
DMXScenes []DMXScenePosition `json:"dmxScenes" yaml:"dmxScenes"`
MIDICommands []MIDICommand `json:"midiCommands" yaml:"midiCommands"`
}
Song is the whole container for everything that needs to be controlled during a song.