ui

package
v0.0.0-...-45548fe Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2023 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewWindow

func NewWindow(title string, w, h float64) *pixelgl.Window

Types

type Button

type Button struct {
	Imd   *imdraw.IMDraw
	Rect  pixel.Rect
	Label string
	// contains filtered or unexported fields
}

func NewButton

func NewButton(label string, r pixel.Rect) *Button

func (*Button) Compose

func (b *Button) Compose()

func (*Button) PosInBounds

func (b *Button) PosInBounds(pos pixel.Vec) bool

func (*Button) SetEngaged

func (b *Button) SetEngaged(state bool)

func (*Button) SetGrouped

func (b *Button) SetGrouped(state bool)

func (*Button) SetPressed

func (b *Button) SetPressed(state bool)

type Controls

type Controls struct {
	Rect                pixel.Rect
	W, H                float64
	Dials               []*Dial
	Buttons             []*Button
	ModeButtons         []*Button
	Imd                 *imdraw.IMDraw
	ImdBatch            *imdraw.IMDraw
	Typ                 *Typography
	InputSessionChannel chan signals.Signal
	OutputChannels      []chan signals.Signal
	SessionData         *session.SessionData
}

func NewControls

func NewControls(r pixel.Rect, sessionData *session.SessionData) *Controls

func (*Controls) AddOutputChannel

func (c *Controls) AddOutputChannel(outputChannel chan signals.Signal)

func (*Controls) Compose

func (c *Controls) Compose()

func (*Controls) DrawTo

func (c *Controls) DrawTo(imd *imdraw.IMDraw)

func (*Controls) InitButtons

func (c *Controls) InitButtons()

func (*Controls) InitDials

func (c *Controls) InitDials()

func (*Controls) ListenToInputSessionChannel

func (c *Controls) ListenToInputSessionChannel()

func (*Controls) ResetDials

func (c *Controls) ResetDials()

func (*Controls) RespondToInput

func (c *Controls) RespondToInput(win *pixelgl.Window)

func (*Controls) SendToOutputChannels

func (c *Controls) SendToOutputChannels(signal signals.Signal)

type Dial

type Dial struct {
	ImdStatic *imdraw.IMDraw
	Imd       *imdraw.IMDraw
	Rect      pixel.Rect
	Radius    float64
	Label     string
	Value     float64
	ValueFrmt string

	IsUnread bool
	// contains filtered or unexported fields
}

func NewDial

func NewDial(label string, valueFrmt string, r pixel.Rect, value, min, max, scale float64) *Dial

func (*Dial) Compose

func (d *Dial) Compose()

func (*Dial) DrawTo

func (d *Dial) DrawTo(imd *imdraw.IMDraw)

func (*Dial) JustPressed

func (d *Dial) JustPressed(pos pixel.Vec)

func (*Dial) Pressed

func (d *Dial) Pressed(pos pixel.Vec)

func (*Dial) Set

func (d *Dial) Set(v float64)

func (*Dial) Update

func (d *Dial) Update()

type Grid

type Grid struct {
	Rect                pixel.Rect
	W, H                float64
	Imd                 *imdraw.IMDraw
	Matrix              [][]uint32
	InputBeatChannel    chan signals.Signal
	InputCtrlChannel    chan signals.Signal
	InputSessionChannel chan signals.Signal
	BeatIndex           uint8
	Notes               []Note
	NotesToStrike       []uint8
	Scale               []uint8
	NoteNames           []string
	MidiWriter          *writer.Writer
	MidiOutput          midi.Out
	Playhead            *Playhead
	Typ                 *Typography
	IsPlaying           bool
	SignalReceived      bool
	SessionData         *session.SessionData
}

func NewGrid

func NewGrid(r pixel.Rect, ao midi.Out, sessionData *session.SessionData) *Grid

func (*Grid) Compose

func (g *Grid) Compose()

func (*Grid) DrawTo

func (g *Grid) DrawTo(imd *imdraw.IMDraw)

func (*Grid) ListenToInputBeatChannel

func (g *Grid) ListenToInputBeatChannel()

func (*Grid) ListenToInputCtrlChannel

func (g *Grid) ListenToInputCtrlChannel()

func (*Grid) ListenToInputSessionChannel

func (g *Grid) ListenToInputSessionChannel()

func (*Grid) Play

func (g *Grid) Play()

func (*Grid) RespondToInput

func (g *Grid) RespondToInput(win *pixelgl.Window)

func (*Grid) SetPlayheadPosition

func (g *Grid) SetPlayheadPosition()

func (*Grid) SetScale

func (g *Grid) SetScale(scaleIndex int)

func (*Grid) Stop

func (g *Grid) Stop()

func (*Grid) Toggle

func (g *Grid) Toggle()

func (*Grid) TurnAllNotesOff

func (g *Grid) TurnAllNotesOff()

func (*Grid) TurnNotesOff

func (g *Grid) TurnNotesOff()

func (*Grid) TurnNotesOn

func (g *Grid) TurnNotesOn()

type Note

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

type Playhead

type Playhead struct {
	Imd  *imdraw.IMDraw
	Rect pixel.Rect
	W, H float64
}

func NewPlayhead

func NewPlayhead(r pixel.Rect) *Playhead

func (*Playhead) Compose

func (p *Playhead) Compose()

func (*Playhead) DrawTo

func (p *Playhead) DrawTo(imd *imdraw.IMDraw)

type Typography

type Typography struct {
	TxtBatch *pixel.Batch
	Txt      *text.Text
}

func NewTypography

func NewTypography() *Typography

func (*Typography) DrawTextToBatch

func (typ *Typography) DrawTextToBatch(s string, vec pixel.Vec, clr color.Color, txtBatch *pixel.Batch, txt *text.Text)

Jump to

Keyboard shortcuts

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