context

package
v0.0.16 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2022 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithLight

func WithLight(parent Context, l Light, callback func(ctx LightContext))

func WithRange

func WithRange(parent Context, r timer.Ranger, callback func(ctx Context))

func WithSequence

func WithSequence(parent Context, s timer.Sequencer, callback func(ctx Context))

Types

type Context

type Context interface {
	timer.Sequence
	timer.Range
	FixedRand() float64

	Eventer
	MaxLightID(t evt.LightType) int

	BOffset(float64) Context

	Sequence(s timer.Sequencer, callback func(ctx Context))
	Range(r timer.Ranger, callback func(ctx Context))

	// Beat is syntax sugar for Sequence(timer.Beat())
	Beat(beat float64, callback func(ctx Context))
	// BeatSequence is syntax sugar for Sequence(timer.Sequence())
	BeatSequence(seq []float64, ghostBeat float64, callback func(ctx Context))
	// BeatRange is syntax sugar for Range(timer.Rng())
	BeatRange(startB, endB float64, steps int, easeFn ease.Func, callback func(ctx Context))
	// BeatRangeInterval is syntax sugar for Range(timer.RngInterval())
	BeatRangeInterval(startB, endB, interval float64, easeFn ease.Func, callback func(ctx Context))

	Light(l Light, callback func(ctx LightContext))

	MapEvents(func(e evt.Event) evt.Event)
	FilterEvents(func(e evt.Event) bool) *[]evt.Event
	// contains filtered or unexported methods
}

func Base

func Base(project Project) Context

func WithBOffset

func WithBOffset(parent Context, offset float64) Context

type Eventer

type Eventer interface {
	NewLighting(opts ...evt.LightingOpt) *evt.Lighting
	NewRGBLighting(opts ...evt.RGBLightingOpt) *evt.RGBLighting
	NewLaser(opts ...evt.LaserOpt) *evt.Laser
	NewPreciseLaser(opts ...evt.PreciseLaserOpt) *evt.PreciseLaser
	NewRotation(opts ...evt.RotationOpt) *evt.Rotation
	NewPreciseRotation(opts ...evt.PreciseRotationOpt) *evt.PreciseRotation
	NewZoom(opts ...evt.ZoomOpt) *evt.Zoom
	NewPreciseZoom(opts ...evt.PreciseZoomOpt) *evt.PreciseZoom
	NewChromaGradient(opts ...evt.ChromaGradientOpt) *evt.ChromaGradient

	EZLighting(typ evt.LightType, val evt.LightValue) *evt.Lighting
	EZRGBLighting(color colorful.Color) *evt.RGBLighting
	EZLaser(laser evt.DirectionalLaser, speed int) *evt.Laser
	EZPreciseLaser(laser evt.DirectionalLaser, speed float64) *evt.PreciseLaser
	EZRotation() *evt.Rotation
	EZPreciseRotation(rotation, step, prop, speed float64, direction chroma.SpinDirection) *evt.PreciseRotation
	EZZoom() *evt.Zoom
	EZPreciseZoom(step float64) *evt.PreciseZoom
}

type Light

type Light interface {
	NewRGBLighting(ctx LightRGBLightingContext) evt.RGBLightingEvents
	LightIDLen() int
	Name() []string
}

type LightContext

type LightContext interface {
	timer.Sequence
	timer.Range
	timer.Light
	FixedRand() float64

	LightEventer
}

type LightEventer

type LightEventer interface {
	NewRGBLighting(opts ...evt.RGBLightingOpt) evt.RGBLightingEvents
	EZRGBLighting(color colorful.Color) evt.RGBLightingEvents
}

type LightRGBLightingContext

type LightRGBLightingContext interface {
	timer.Sequence
	timer.Range
	timer.Light
	FixedRand() float64
	NewRGBLighting(opts ...evt.RGBLightingOpt) *evt.RGBLighting
}

func WithLightTimer added in v0.0.7

type MockLight

type MockLight struct {
	*MockProject
}

func (MockLight) LightIDLen

func (l MockLight) LightIDLen() int

func (MockLight) Name added in v0.0.6

func (l MockLight) Name() []string

func (MockLight) NewRGBLighting

type MockProject

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

func NewMockProject

func NewMockProject(t *testing.T, maxLightID int) *MockProject

func (*MockProject) AddEvents

func (p *MockProject) AddEvents(events ...evt.Event)

func (*MockProject) AddRefTimingFromCtx

func (p *MockProject) AddRefTimingFromCtx(ctx Context)

func (*MockProject) Cmp

func (p *MockProject) Cmp(t []RefTiming)

func (*MockProject) Events added in v0.0.2

func (p *MockProject) Events() *[]evt.Event

func (*MockProject) FilterEvents added in v0.0.6

func (p *MockProject) FilterEvents(f func(e evt.Event) bool) *[]evt.Event

func (*MockProject) MapEvents added in v0.0.6

func (p *MockProject) MapEvents(f func(e evt.Event) evt.Event)

func (*MockProject) MaxLightID

func (p *MockProject) MaxLightID(t evt.LightType) int

func (*MockProject) MockLight

func (p *MockProject) MockLight() MockLight

func (*MockProject) Range

func (p *MockProject) Range(r timer.Ranger, callback func(ctx Context))

func (*MockProject) RefTimings

func (p *MockProject) RefTimings() []RefTiming

func (*MockProject) Sequence

func (p *MockProject) Sequence(s timer.Sequencer, callback func(ctx Context))

type Project

type Project interface {
	MaxLightID(t evt.LightType) int
	AddEvents(events ...evt.Event)
	Events() *[]evt.Event
	FilterEvents(func(e evt.Event) bool) *[]evt.Event
	MapEvents(func(e evt.Event) evt.Event)
}

type RefTiming

type RefTiming struct {
	B              float64
	BWOffset       float64
	T              float64
	SeqT           float64
	SeqNextB       float64
	SeqNextBOffset float64
	LightID        lightid.ID
	LightIDT       float64
}

Jump to

Keyboard shortcuts

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