Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MinMaxValue ¶
func MinMaxValue(bs []Breakpoint) (smallest float64, largest float64)
MinMaxValue returns the smallest and largest value found in the breakpoint file
Types ¶
type Breakpoint ¶
type Breakpoint struct {
Time, Value float64
}
Breakpoint represents a time:value pair
func ParseBreakpoints ¶
func ParseBreakpoints(in io.Reader) ([]Breakpoint, error)
ParseBreakpoints reads the breakpoints from an io.Reader and turns them into a slice. A file is expected to be [time: value] formatted Will panic if file format is wrong TODO: don't panic
type BreakpointStream ¶
type BreakpointStream struct { Breakpoints Breakpoints Left Breakpoint Right Breakpoint IndexLeft int IndexRight int CurrentPosition float64 // current position in timeframes Increment float64 Width float64 Height float64 HasMore bool }
BreakpointStream can be used to to treat breakpoints as a stream of data Each 'tick' can manipulate the state of the breakpoint stream
func NewBreakpointStream ¶
func NewBreakpointStream(bs []Breakpoint, sr int) (*BreakpointStream, error)
NewBreakpointStream represents a slice of breakpoints streamed at a given sample rate
func (*BreakpointStream) Tick ¶
func (b *BreakpointStream) Tick() (out float64)
Tick returns the next value in the breakpoint stream
type Breakpoints ¶
type Breakpoints []Breakpoint
Breakpoints is a collection of Breakpoint (time:value) pairs
func (Breakpoints) Any ¶
func (bs Breakpoints) Any(f func(Breakpoint) bool) bool
Any returns true if any breakpoint matches the filter.