Documentation ¶
Index ¶
- Constants
- Variables
- func CalculateFadeValues(sequence *Sequence)
- func ClearLabelsSelectedRowOfButtons(selectedSequence int, guiButtons chan ALight)
- func ClearSelectedRowOfButtons(selectedSequence int, eventsForLauchpad chan ALight, guiButtons chan ALight)
- func ConvertRGBtoNRGBA(alight Color) color.NRGBA
- func FindSensitivity(soundGain float32) int
- func FlashLight(button Button, onColor Color, offColor Color, eventsForLauchpad chan ALight, ...)
- func FormatLabel(label string) string
- func GetColorNameByRGB(color Color) string
- func GetFadeOnValues(brightness int, fadeOnTime int) []int
- func GetFadeValues(noCoordinates int, size float64, fade int, reverse bool) (out []int)
- func GetIDfromCoordinates(X int, Y int) int
- func GetLaunchPadCodeByRGBColor(selectedColor Color) byte
- func HideAllSequences(commandChannels []chan Command)
- func HideSequence(targetSequence int, commandChannels []chan Command)
- func LabelButton(X int, Y int, label string, guiButtons chan ALight)
- func LightLamp(button Button, color Color, master int, eventsForLauchpad chan ALight, ...)
- func RevealSequence(targetSequence int, commandChannels []chan Command)
- func Reverse(in int) int
- func Reverse12(in int) int
- func ReverseDmx(n int) int
- func SendCommandToAllSequence(command Command, commandChannels []chan Command)
- func SendCommandToAllSequenceExcept(targetSequence int, command Command, commandChannels []chan Command)
- func SendCommandToAllSequenceOfType(sequences []*Sequence, command Command, commandChannels []chan Command, ...)
- func SendCommandToSequence(targetSequence int, command Command, commandChannels []chan Command)
- func ShowBottomButtons(tYpe string, eventsForLauchpad chan ALight, guiButtons chan ALight)
- func ShowRunningStatus(runningState bool, eventsForLaunchpad chan ALight, guiButtons chan ALight)
- func ShowStaticButtons(sequence *Sequence, staticFlashing bool, eventsForLaunchpad chan ALight, ...)
- func ShowStrobeButtonStatus(state bool, eventsForLaunchpad chan ALight, guiButtons chan ALight)
- func ShowTopButtons(tYpe string, eventsForLauchpad chan ALight, guiButtons chan ALight)
- func StartStaticSequences(sequences []*Sequence, commandChannels []chan Command)
- func UpdateBottomButtons(selectedType string, guiButtons chan ALight)
- func UpdateStatusBar(status string, which string, hide bool, guiButtons chan ALight)
- type ALight
- type Action
- type Arg
- type Button
- type ButtonPresets
- type Channels
- type Color
- func GetColorArrayByNames(names []string) ([]Color, error)
- func GetColorButtonsArray(color int) Color
- func GetRGBColorByName(color string) (Color, error)
- func HowManyColorsInPositions(positionsMap map[int]Position) (colors []Color)
- func HowManyColorsInSteps(steps []Step) (colors []Color)
- func HowManyScannerColors(positionsMap map[int]Position) (colors []Color)
- func HowManyStepColors(steps []Step) (colors []Color)
- func InvertColor(color Color) (out Color)
- type ColorPicker
- type Command
- type Event
- type Fixture
- type FixtureBuffer
- type FixtureCommand
- type FixtureState
- type Function
- type Gobo
- type Hit
- type LastColor
- type Pattern
- type Position
- type Sequence
- type Setting
- type State
- type StaticColorButton
- type Step
- type Switch
- type SwitchChannel
- type Trigger
- type Value
Constants ¶
View Source
const ( Actions int = iota Clear Reset UpdateStatic UpdateFlashAllStaticColorButtons UpdateBounce UpdateAllStaticColor UpdateStaticColor UpdateASingeSequenceColor UpdateSequenceColors PlayStaticOnce PlaySwitchOnce Reveal Hide Start StartChase Stop StopChase ReadConfig LoadConfig UpdateSpeed UpdatePattern UpdateRGBFadeSpeed UpdateRGBSize UpdateScannerSize Blackout Normal UpdateColor UpdateFunctions GetUpdatedSequence ResetAllSwitchPositions UpdateSwitch Inverted UpdateGobo Flood StopFlood Strobe StopStrobe UpdateAutoColor UpdateAutoPattern ToggleFixtureState UpdateRGBShift UpdateRGBInvert UpdateScannerShift UpdateScannerColor UpdateStrobeSpeed ClearSequenceColor ClearStaticColor SetStaticColorBar Static Master UpdateNumberCoordinates UpdateOffsetPan UpdateOffsetTilt UpdateScannerChase UpdateMusicTrigger UpdateScannerHasShutterChase UpdateFixturesConfig )
Valid Command Actions.
View Source
const ( Function1_Pattern = 0 // Set pattern mode. Function2_Auto_Color = 1 // Auto Color change. Function3_Auto_Pattern = 2 // Auto Pattern change Function4_Bounce = 3 // Sequence auto reverses. doesn't apply in scanner mode. Function5_Color = 4 // Set RGB chase color. or select the scanner color. Function6_Static_Gobo = 5 // Set static color / set scanner gobo. Function7_Invert_Chase = 6 // Invert the RGB colors / Set scanner chase mode. Function8_Music_Trigger = 7 // Music trigger on and off. Both RGB and scanners. )
Define the function keys.
View Source
const CENTER_DMX_BRIGHTNESS = 127
View Source
const DEFAULT_PATTERN = 0
View Source
const DEFAULT_RGB_FADE = 1
View Source
const DEFAULT_RGB_FADE_STEPS = 10
View Source
const DEFAULT_RGB_SHIFT = 0
View Source
const DEFAULT_RGB_SIZE = 0
View Source
const DEFAULT_SCANNER_COLOR = 0
View Source
const DEFAULT_SCANNER_COORDNIATES = 0
View Source
const DEFAULT_SCANNER_FADE = 10
View Source
const DEFAULT_SCANNER_GOBO = 0
View Source
const DEFAULT_SCANNER_SHIFT = 0
View Source
const DEFAULT_SCANNER_SIZE = 60
View Source
const DEFAULT_SPEED = 7
View Source
const DEFAULT_STROBE_SPEED = 255
View Source
const IS_RGB = false
View Source
const IS_SCANNER = true
View Source
const MAX_COLOR_BAR = 9 // Eight colors and a default color bar.
View Source
const MAX_DMX_ADDRESS = 512
View Source
const MAX_DMX_BRIGHTNESS = 255
View Source
const MAX_NUMBER_OF_CHANNELS = 8
View Source
const MAX_RGB_FADE = 10
View Source
const MAX_RGB_SHIFT = 10
View Source
const MAX_RGB_SIZE = 10
View Source
const MAX_SCANNER_SHIFT = 3
View Source
const MAX_SCANNER_SIZE = 127
View Source
const MAX_SPEED = 12
View Source
const MAX_TEXT_ENTRY_LENGTH = 35
View Source
const MIN_DMX_BRIGHTNESS = 0
View Source
const MIN_RGB_SHIFT = 1
View Source
const MIN_RGB_SIZE = 0
View Source
const MIN_SCANNER_SHIFT = 0
View Source
const MIN_SPEED = 0
View Source
const SCANNER_MID_POINT = 127
View Source
const StepSize = 39
A full step cycle is 39 ticks ie 39 values. 13 fade up values, 13 on values and 13 off values.
Variables ¶
View Source
var Aqua = Color{R: 127, G: 255, B: 212}
View Source
var BLACKOUT_BUTTON = Button{X: 8, Y: 7}
View Source
var BLUE_BUTTON = Button{X: 3, Y: -1}
View Source
var Black = Color{R: 0, G: 0, B: 0}
View Source
var Blue = Color{R: 0, G: 0, B: 255}
View Source
var Crimson = Color{R: 220, G: 20, B: 60}
View Source
var Cyan = Color{R: 0, G: 255, B: 255}
View Source
var DarkOrange = Color{R: 215, G: 50, B: 0}
View Source
var DarkPurple = Color{R: 50, G: 0, B: 255}
View Source
var DefaultSequenceColors = []Color{{R: 0, G: 255, B: 0}}
View Source
var EmptyColor = Color{}
View Source
var FLOOD_BUTTON = Button{X: 8, Y: 3}
View Source
var ForestGreen = Color{R: 0, G: 100, B: 0}
View Source
var GREEN_BUTTON = Button{X: 2, Y: -1}
View Source
var GlobalScannerSequenceNumber int
View Source
var Gold = Color{R: 255, G: 215, B: 0}
View Source
var Green = Color{R: 0, G: 255, B: 0}
View Source
var LawnGreen = Color{R: 124, G: 252, B: 0}
View Source
var LightBlue = Color{R: 100, G: 185, B: 255}
View Source
var LightOrange = Color{R: 255, G: 175, B: 0}
View Source
var Magenta = Color{R: 255, G: 0, B: 255}
View Source
var Olive = Color{R: 150, G: 150, B: 0}
View Source
var Orange = Color{R: 255, G: 111, B: 0}
View Source
var Pink = Color{R: 255, G: 192, B: 203}
View Source
var PresetYellow = Color{R: 150, G: 150, B: 0}
View Source
var Purple = Color{R: 100, G: 0, B: 255}
View Source
var QuarterBlue = Color{R: 0, G: 0, B: 50}
View Source
var QuarterGreen = Color{R: 0, G: 50, B: 0}
View Source
var QuarterRed = Color{R: 50, G: 0, B: 0}
View Source
var QuarterYellow = Color{R: 50, G: 50, B: 0}
View Source
var RED_BUTTON = Button{X: 1, Y: -1}
View Source
var RUNNING_BUTTON = Button{X: 8, Y: 5}
View Source
var Red = Color{R: 255, G: 0, B: 0}
View Source
var SAVE_BUTTON = Button{X: 8, Y: 4}
View Source
var STROBE_BUTTON = Button{X: 8, Y: 6}
View Source
var Salmon = Color{R: 250, G: 128, B: 114}
View Source
var SkyBlue = Color{R: 0, G: 191, B: 255}
View Source
var Teal = Color{R: 0, G: 128, B: 128}
View Source
var Violet = Color{R: 199, G: 21, B: 133}
View Source
var White = Color{R: 255, G: 255, B: 255}
View Source
var Yellow = Color{R: 255, G: 255, B: 0}
Functions ¶
func CalculateFadeValues ¶
func CalculateFadeValues(sequence *Sequence)
CalculateFadeValues - calculate fade curve values.
func ConvertRGBtoNRGBA ¶
Convert my common.Color RGB into color.NRGBA used by the fyne.io GUI library.
func FindSensitivity ¶
func FlashLight ¶
func FormatLabel ¶
func GetColorNameByRGB ¶
func GetFadeOnValues ¶
func GetFadeValues ¶
func GetIDfromCoordinates ¶
func HideAllSequences ¶
func HideAllSequences(commandChannels []chan Command)
func HideSequence ¶
func LightLamp ¶
func LightLamp(button Button, color Color, master int, eventsForLauchpad chan ALight, guiButtons chan ALight)
LightOn Turn on a Light.
func RevealSequence ¶
func SendCommandToSequence ¶
func ShowBottomButtons ¶
func ShowRunningStatus ¶
func ShowStaticButtons ¶
func ShowStrobeButtonStatus ¶
func ShowTopButtons ¶
func StartStaticSequences ¶
func UpdateBottomButtons ¶
Types ¶
type ButtonPresets ¶
type Color ¶
func GetColorArrayByNames ¶
func GetColorButtonsArray ¶
Colors are selected from a pallete of 8 colors, this function takes 0-9 (repeating 4 time) and returns the color array
func GetRGBColorByName ¶
func HowManyColorsInSteps ¶
func HowManyScannerColors ¶
func HowManyStepColors ¶
func InvertColor ¶
InvertColor just reverses the DMX values.
type ColorPicker ¶
type ColorPicker struct { Name string ID int Code byte // Launchpad hex code for this color Color Color X int Y int }
func GetColor ¶
func GetColor(X int, Y int) ColorPicker
type Fixture ¶
type Fixture struct { ID string Number int Name string Label string MasterDimmer int Brightness int ScannerColor Color BaseColor Color Color Color Pan int Tilt int Shutter int Rotate int Music int Gobo int Program int Enabled bool Inverted bool State int // Last thing we did :- MAKE SAME AGAIN ,FADEUP or FADEDOWN }
A common fixture can have any or some of the following, depending if its a light or a scanner.
type FixtureBuffer ¶
type FixtureBuffer struct { BaseColor Color Color Color MasterDimmer int Brightness int Gobo int Pan int Tilt int Shutter int Enabled bool DebugMsg string Step int Rule int }
Used in calculating Positions.
type FixtureCommand ¶
type FixtureCommand struct { Step int NumberSteps int Type string Label string SequenceNumber int FixtureState FixtureState LastColor Color // Common commands. Hidden bool Strobe bool StrobeSpeed int Master int MasterChanging bool Blackout bool Clear bool StartFlood bool StopFlood bool // RGB commands. RGBPosition Position RGBStaticOff bool RGBStaticOn bool RGBStaticFadeUp bool RGBStaticColors []StaticColorButton RGBPlayStaticOnce bool RGBFade int // Scanner Commands. ScannerColor int ScannerPosition Position ScannerDisableOnce bool ScannerChaser bool ScannerAvailableColors []StaticColorButton ScannerGobo int ScannerOffsetPan int ScannerOffsetTilt int ScannerNumberCoordinates int ScannerShutterPositions map[int]Position ScannerHasShutterChase bool // Derby Commands Rotate int Music int Program int // Switch Commands SwitchData Switch State State CurrentSwitchState int }
type FixtureState ¶
type Sequence ¶
type Sequence struct { Name string // Sequence name. Label string // Sequence label. Description string // Sequence description. Number int // Sequence number. Run bool // True if this sequence is running. Bounce bool // True if this sequence is bouncing. RGBInvert bool // True if RGB sequence patten is inverted. Hidden bool // Hidden is used to indicate sequence buttons are not visible. Type string // Type of sequnece, current valid values are :- rgb, scanner, or switch. Master int // Master Brightness MasterChanging bool // flag to indicate we are changing brightness. Strobe bool // Strobe is enabled. StrobeSpeed int // Strobe speed. Rotate int // Rotate speed. RGBShift int // RGB shift. CurrentSpeed time.Duration // Sequence speed represented as a duration. Speed int // Sequence speed represented by a short number. MusicTrigger bool // Is this sequence in music trigger mode. ChangeMusicTrigger bool // true when we change the state of the music trigger. LastMusicTrigger bool // Save copy of music trigger. Blackout bool // Flag to indicate we're in blackout mode. CurrentColors []Color // Storage for the colors in a sequence. SequenceColors []Color // Temporay storage for changing sequence colors. Color int // Index into current sequnece colors. ScannerSteps []Step // Pan & Tilt steps in this sequence. NumberSteps int // Holds the number of steps this sequence has. Will change if you change size, fade times etc. NumberFixtures int // Total Number of fixtures for this sequence. EnabledNumberFixtures int // Enabled Number of fixtures for this sequence. AutoColor bool // Sequence is going to automatically change the color. AutoPattern bool // Sequence is going to automatically change the pattern. GuiFixtureLabels []string // Storage for the fixture labels. Used for scanner names. Pattern Pattern // Contains fixtures and RGB steps info. RGBAvailableColors []StaticColorButton // Available colors for the RGB fixtures. RGBColor int // The selected RGB fixture color. FadeUp []int // Fade up values. FadeOn []int // Fade on values. FadeDown []int // Fade down values. FadeOff []int // Fade off values. RGBFade int // RGB Fade time RGBSize int // RGB Fade size SavedSequenceColors []Color // Used for updating the color in a sequence. RecoverSequenceColors bool // Storage for recovering sequence colors, when you come out of automatic color change. SaveColors bool // Indicate we should save colors in this sequence. used for above. Mode string // Tells sequnece if we're in sequence (chase) or static (static colors) mode. StaticColors []StaticColorButton // Used in static color editing Clear bool // Clear all fixtures in this sequence. Static bool // We're a static sequence. PlayStaticOnce bool // Play a static scene only once. PlayStaticLampsOnce bool // Play a static scene but only on indicator lamps. PlaySwitchOnce bool // Play a switch sequence scene only once. PlaySingleSwitch bool // Play a single switch. StaticFadeUpOnce bool // Only Fade up once, used for don't fade during color config operations. StaticLampsOn bool // Show the static scene on the lamps, but don't send anything to the DMX universe. StartFlood bool // We're in flood mode. StopFlood bool // We're not in flood mode. LastStatic bool // Last value of static before flood. StartStrobe bool // We're in strobe mode. StopStrobe bool // We're not in strobe mode. FloodPlayOnce bool // Play the flood sceme only once. FloodSelectedSequence map[int]bool // A map that remembers who is in flood mode. ScannerAvailableColorsMutex *sync.RWMutex // Mutex to protect the scanner available colors map from syncronous access. ScannerAvailableColors map[int][]StaticColorButton // Available colors for this scanner. ScannerAvailableGobos map[int][]StaticColorButton // Available gobos for this scanner. ScannerAvailablePatterns map[int]Pattern // Available patterns for this scanner. ScannersAvailable []StaticColorButton // Holds a set of red buttons, one for every available fixture. SelectedPattern int // The selected pattern. ScannerSize int // The selected scanner size. ScannerShift int // Used for shifting scanners patterns apart. ScannerGobo map[int]int // Eight scanners per sequence, each can have their own gobo. ScannerChaser bool // Chase the scanner shutters instead of allways being on. ScannerReverse bool // Reverse the scanner, i.e scan in the opposite direction. ScannerColor map[int]int // Eight scanners per sequence, each can have their own color. ScannerCoordinates []int // Number of scanner coordinates. ScannerSelectedCoordinates int // index into scanner coordinates. ScannerOffsetPan int // Offset for pan values. ScannerOffsetTilt int // Offset for tilt values. FixtureState map[int]FixtureState // Map of fixtures which are disabled. DisableOnceMutex *sync.RWMutex // Lock to protect DisableOnce. DisableOnce map[int]bool // Map used to play disable only once. UpdateSize bool // Command to update size. UpdateShift bool // Command to update the shift. UpdatePattern bool // Flag to indicate we're going to change the RGB pattern. UpdateSequenceColor bool // Command to update the sequence colors. Switches map[int]Switch // A switch sequence stores its data in here. CurrentSwitch int // Play this current switch position. Optimisation bool // Flag to decide on calculatePositions Optimisation. RGBNumberStepsInFade int // Number of steps in a RGB fade. }
Sequence describes sequences.
type StaticColorButton ¶
type StaticColorButton struct { Name string Label string Number int X int Y int SelectedSequence int Color Color SelectedColor int Flash bool Setting int FirstPress bool Enabled bool }
func SetDefaultStaticColorButtons ¶
func SetDefaultStaticColorButtons(selectedSequence int) []StaticColorButton
Sets the static colors to default values.
type SwitchChannel ¶
Click to show internal directories.
Click to hide internal directories.