artnet

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: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindArtNetIP

func FindArtNetIP() (net.IP, error)

FindArtNetIP finds the matching interface with an IP address inside of the addressRange

func NodeToString

func NodeToString(n *artnet.ControlledNode) string

NodeToString returns a string representation of the given Node

func ToNet

func ToNet(net uint16) (add artnet.Address)

ToNet transforms the given net to an artnet.Address

Types

type ChannelValue

type ChannelValue struct {
	Universe uint16
	Channel  uint16
	Value    uint8
}

ChannelValue defines an ArtNet Universe and the value of the DMX channel

type Controller

type Controller interface {
	Write(cntl.Command) error
	SetDMXChannelValue(value ChannelValue)
	SetDMXChannelValues(values []ChannelValue)
	Start(ctx context.Context) error
	Stop()
}

Controller is a convenience interface to use within this application

func NewController

func NewController(logger logging.Logger) (Controller, error)

NewController returns a artnet Controller as an anonymous interface

type Sender

type Sender interface {
	SendDMXToAddress(dmx [512]byte, address artnet.Address)
	Start() error
	Stop()
}

Sender is an artnet controller abstraction of the base implementation of jsimonetti

type State

type State struct {
	// contains filtered or unexported fields
}

State stores the state of universes

func NewState

func NewState() *State

NewState returns a new state instance

func NewStateFromData

func NewStateFromData(data map[uint16]Universe) *State

NewStateFromData takes the given data and stores it into a freshly created store

func NewStateFromUniverseStateMap

func NewStateFromUniverseStateMap(data map[uint16]Universe) *State

NewStateFromUniverseStateMap takes the given data and stores it into a freshly created store

func (*State) Get

func (s *State) Get() UniverseStateMap

Get returns all of the current state

func (*State) GetUniverse

func (s *State) GetUniverse(u uint16) Universe

GetUniverse gets a complete DMX universe data

func (*State) GetUniverses

func (s *State) GetUniverses() []uint16

GetUniverses returns a slice of all available universe indexes

func (*State) SetChannel

func (s *State) SetChannel(u, c uint16, v uint8)

SetChannel sets a given channel on a given universe on a given value.

func (*State) SetChannelValue

func (s *State) SetChannelValue(value ChannelValue)

func (*State) SetChannelValues

func (s *State) SetChannelValues(values []ChannelValue)

SetChannelValues sets a range of ChannelValues for convenience

func (*State) SetUniverse

func (s *State) SetUniverse(u uint16, dmx Universe)

SetUniverse sets a complete DMX universe data

type Universe

type Universe [512]byte

Universe wraps the 512 byte array for convenience

type UniverseStateMap

type UniverseStateMap map[uint16]Universe

UniverseStateMap holds the state of all used universes

Jump to

Keyboard shortcuts

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