Documentation ¶
Index ¶
- Constants
- type Display
- func (d *Display) AdjustBase(delta int)
- func (d *Display) AdjustSizes(barDelta, spaceDelta int)
- func (d *Display) Bins(chCount int) int
- func (d *Display) Close() error
- func (d *Display) Init(sampleRate float64, sampleSize int) error
- func (d *Display) SetBase(size int)
- func (d *Display) SetDrawType(dt DrawType)
- func (d *Display) SetInvertDraw(invert bool)
- func (d *Display) SetSizes(bar, space int)
- func (d *Display) SetStyles(styles Styles)
- func (d *Display) Start(ctx context.Context) context.Context
- func (d *Display) Stop() error
- func (d *Display) Write(buffers [][]float64, channels int) error
- type DrawType
- type Styles
Constants ¶
View Source
const ( SpaceRune = '\u0020' BarRuneV = '\u2580' BarRune = '\u2588' BarRuneH = '\u2590' StyleReverse = termbox.AttrReverse // NumRunes number of runes for sub step bars NumRunes = 8 // ScalingWindow in seconds ScalingWindow = 1.5 // PeakThreshold is the threshold to not draw if the peak is less. PeakThreshold = 0.001 )
Constants
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Display ¶
Display handles drawing our visualizer.
func NewDisplay ¶
func NewDisplay() *Display
func (*Display) AdjustBase ¶
AdjustBase will change the base by delta units
func (*Display) AdjustSizes ¶ added in v1.5.0
AdjustSizes modifies the bar and space size by barDelta and spaceDelta.
func (*Display) Init ¶
Init initializes the display. Should be called before any other display method.
func (*Display) SetDrawType ¶
SetDrawType sets the draw type for future draws
func (*Display) SetInvertDraw ¶ added in v1.7.0
func (*Display) SetSizes ¶ added in v1.5.0
SetSizes takes a bar size and spacing size. Returns number of bars able to show.
type DrawType ¶
type DrawType int
DrawType is the type.
const ( DrawMin DrawType = iota DrawUp DrawUpDown DrawDown DrawLeft DrawLeftRight DrawRight DrawUpDownSplit DrawLeftRightSplit DrawUpDownSplitVert DrawMax // DrawDefault is the default draw type. DrawDefault = DrawUpDown )
draw types
type Styles ¶ added in v1.5.0
type Styles struct { Foreground termbox.Attribute Background termbox.Attribute CenterLine termbox.Attribute }
Styles is the structure for the styles that Display will draw using.
func DefaultStyles ¶ added in v1.5.0
func DefaultStyles() Styles
DefaultStyles returns the default styles.
func StylesFromUInt16 ¶ added in v1.5.0
StylesFromUInt16 converts 3 uint16 values to styles.
Click to show internal directories.
Click to hide internal directories.