output

package
v0.0.0-...-48ef994 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2024 License: MIT Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HardwareWriter

type HardwareWriter interface {
	Name() string
	Start(ctx context.Context) error
	End(ctx context.Context) error
	Send(ctx context.Context, v Value) error
}

HardwareWriter is an interface for things that can send the sequence signals outward to the physical devices rendering the show Examples might be OSC, DMX, MQTT etc..

type LogWriter

type LogWriter struct {
}

LogWriter simply issues a debug log for each value sent to it

func (*LogWriter) End

func (m *LogWriter) End(ctx context.Context) error

End logs a message when the sequence stops streaming

func (*LogWriter) Name

func (m *LogWriter) Name() string

Name returns "logwriter", assuming there should never be more than one of these so...

func (*LogWriter) Send

func (m *LogWriter) Send(ctx context.Context, v Value) error

Send will call Send on each of the writers in m Since they are all fired asynchronously, errors from the underlying writers are discareded

func (*LogWriter) Start

func (m *LogWriter) Start(ctx context.Context) error

Start logs a start message when the sequence begins to stream

type Multiplexer

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

Multiplexer is a HardwareWriter that writes the same message asynchronously to each device the writes are not treated as reliable and errors are logged and discarded

func NewMultiplexer

func NewMultiplexer(n string, w []HardwareWriter) *Multiplexer

NewMultiplexer creates and returns a Multiplexer with the given writes

func (*Multiplexer) End

func (m *Multiplexer) End(ctx context.Context) error

End calls end on all of the other writers since it is done asynchronously, errors are logged and disregarded

func (*Multiplexer) Name

func (m *Multiplexer) Name() string

Name returns the name this was given when it was created

func (*Multiplexer) Send

func (m *Multiplexer) Send(ctx context.Context, v Value) error

Send will call Send on each of the writers in m Since they are all fired asynchronously, errors from the underlying writers are discareded

func (*Multiplexer) Start

func (m *Multiplexer) Start(ctx context.Context) error

Start calls start on all of the other writers since it is done asynchronously, errors are logged and disregarded

type OSCWriter

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

OSCWriter is a HardwareWriter that transmits the data as OSC messages

func NewOSCWriter

func NewOSCWriter(n string, c *osc.Client) *OSCWriter

func (*OSCWriter) End

func (w *OSCWriter) End(ctx context.Context) error

func (*OSCWriter) Name

func (w *OSCWriter) Name() string

func (*OSCWriter) Send

func (w *OSCWriter) Send(ctx context.Context, v Value) error

func (*OSCWriter) Start

func (w *OSCWriter) Start(ctx context.Context) error

type Sequence

type Sequence map[float64][]Value

func (Sequence) AddValue

func (s Sequence) AddValue(t float64, v Value)

func (Sequence) MarshalJSON

func (s Sequence) MarshalJSON() ([]byte, error)

func (Sequence) UnmarshalJSON

func (s Sequence) UnmarshalJSON(p []byte) error

type Value

type Value struct {
	Key   string  `json:"key"`
	Value float64 `json:"value"`
}

Jump to

Keyboard shortcuts

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