london

package module
v0.1.1-ttlPatch Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2021 License: Apache-2.0 Imports: 9 Imported by: 1

README

london-driver

Documentation

Overview

Package london provides a struct for controlling BSS London DSPs.

Supported Devices

This is a list of devices that BYU currently uses in production, controlled with this driver.

BSS BLU-50 https://bssaudio.com/en/products/blu-50
BSS BLU-100 https://bssaudio.com/en/products/blu-100

This list is not comprehensive.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DSP

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

DSP represents a DSP being controlled.

func New added in v0.1.0

func New(addr string, opts ...Option) *DSP

New returns a new DSP with the given address.

func (*DSP) GetInfo

func (d *DSP) GetInfo(ctx context.Context) (interface{}, error)

GetInfo is not implemented.

func (*DSP) GetMutedByBlock

func (d *DSP) GetMutedByBlock(ctx context.Context, block string) (bool, error)

GetMutedByBlock returns true if the given block is muted.

func (*DSP) GetVolumeByBlock

func (d *DSP) GetVolumeByBlock(ctx context.Context, block string) (int, error)

GetVolumeByBlock returns the volume [0, 100] of the given block.

func (*DSP) SetMutedByBlock

func (d *DSP) SetMutedByBlock(ctx context.Context, block string, muted bool) error

SetMutedByBlock sets the mute state on the given block.

func (*DSP) SetVolumeByBlock

func (d *DSP) SetVolumeByBlock(ctx context.Context, block string, volume int) error

SetVolumeByBlock sets the volume on the given block. Volume must be in the range [0, 100].

type Logger added in v0.1.0

type Logger interface {
	Debugf(format string, a ...interface{})
	Infof(format string, a ...interface{})
	Warnf(format string, a ...interface{})
	Errorf(format string, a ...interface{})
}

Logger is a logger usable by DSP.

type Option

type Option interface {
	// contains filtered or unexported methods
}

Option configures how we create the DSP.

func WithDelay

func WithDelay(t time.Duration) Option

WithDelay changes the delay between sending commands to the DSP. The default value is 250 milliseconds. See more details about delay in https://github.com/byuoitav/connpool.

func WithLogger added in v0.1.0

func WithLogger(l Logger) Option

WithLogger adds a logger to DSP. DSP will log appropriate information about the underlying connection and the commands being sent. The default value is nil, meaning that no logs are written.

func WithTTL

func WithTTL(t time.Duration) Option

WithTTL changes the TTL for the underlying TCP connection to the DSP. The default value is 30 seconds. See more details about TTL in https://github.com/byuoitav/connpool.

Jump to

Keyboard shortcuts

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