Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WrapExternalWindowFn ¶
WrapExternalWindowFn wraps external (mostly gonum/dsp/window) functions to be compatible with catnip's usage. The implementation will assume that the given function modifies the given slice in its place, which is the case for most gonum functions, but it might not always be the case. If the implementation does not, then the caller should write their own function to copy.
Types ¶
type AllocatedSizeGetter ¶
AllocatedSizeGetter is any widget that can be obtained dimensions of. This is used for the Draw method.
type CairoColor ¶
type CairoColor [4]float64
func ColorFromGDK ¶
func ColorFromGDK(rgba *gdk.RGBA) CairoColor
func (CairoColor) RGBA ¶
func (cc CairoColor) RGBA() (r, g, b, a uint32)
type Colors ¶
type Colors struct { Foreground color.Color // use Gtk if nil Background color.Color // transparent if nil }
Colors is the color settings for the Drawer.
type Config ¶
type Config struct { // Backend is the backend name from list-backends Backend string // Device is the device name from list-devices Device string WindowFn window.Function // default CosSum, a0 = 0.50 Scaling ScalingConfig SampleRate float64 SampleSize int SmoothFactor float64 MinimumClamp float64 // height before visible DrawOptions DrawStyle DrawStyle Monophonic bool }
Config is the catnip config.
func (*Config) InitBackend ¶
InitBackend initializes a new input backend.
type DrawOffsets ¶
type DrawOffsets struct {
X, Y float64
}
DrawOffsets controls the offset for the Drawer.
type DrawOptions ¶
type DrawOptions struct { LineCap cairo.LineCap // default BUTT LineJoin cairo.LineJoin // default MITER AntiAlias cairo.Antialias FrameRate int Colors Colors Offsets DrawOffsets BarWidth float64 // not really pixels SpaceWidth float64 // not really pixels // ForceEven will round the width and height to be even. This will force // Cairo to always draw the bars sharply. ForceEven bool }
DrawOptions is the option for Cairo draws.
type DrawQueuer ¶
type DrawQueuer interface {
QueueDraw()
}
DrawQueuer is a custom widget interface that allows draw queueing.
type Drawer ¶
type Drawer struct {
// contains filtered or unexported fields
}
Drawer is the separated drawer state without any widget.
func NewDrawer ¶
NewDrawer creates a separated drawer state. The given drawQueuer will be called every redrawn frame.
func (*Drawer) Draw ¶
Draw is bound to the draw signal. Although Draw won't crash if Drawer is not started yet, the drawn result is undefined.
func (*Drawer) Process ¶
func (d *Drawer) Process()
Process processes the internal read buffer and analyzes its spectrum.
func (*Drawer) SetBackend ¶
SetBackend overrides the given Backend in the config.