func (bp *Proc) GetCache(idx int) (Value, bool) {
	val, ok := bp.cache.get(idx)
	return val, ok
}
GetCache gets value from cache.
package dsp
import (
	"bytes"
	"errors"
	"fmt"
	"reflect"
	"strings"
)
var ErrNoFunc = errors.New("no ProcFunc set")
var ErrOOB = errors.New("frame index out of bounds")
type Value interface {
}
type Processer interface {
}
type Framer interface {
	Get(int) (Value, error)
}
type OneValuer interface {
	Get() (Value, error)
}
type Inputter interface {
	SetInputs(...Processer)
}
type Resetter interface {
	Reset()
}
type ProcFunc func(int, ...Processer) (Value, error)
type Proc struct {
	f      ProcFunc
	inputs []Processer
	cache  *cache
}
func NewProc(bufSize int, f ProcFunc) *Proc {
	return &Proc{
		f:     f,
		cache: newCache(bufSize),
	}
}
func (bp *Proc) SetInputs(inputs ...Processer) {
	bp.inputs = inputs
}
func (bp *Proc) Reset() {
	bp.cache.clear()
}
func (bp *Proc) Get(idx int) (Value, error) {
	if idx < 0 {
		return nil, ErrOOB
	}
	val, ok := bp.cache.get(idx)
	if ok {
		return val, nil
	}
	if bp.f != nil {
		v, e := bp.f(idx, bp.inputs...)
		if e != nil {
			return nil, e
		}
		bp.cache.set(idx, v)
		return v, nil
	}
	return nil, ErrNoFunc
}
func (bp *Proc) SetCache(idx int, val Value) {
	bp.cache.set(idx, val)
}