volumebutler

package
v0.0.0-...-f69f2d5 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ScanForVolume

func ScanForVolume(spk *soundtouch.Speaker) *soundtouch.Volume

ScanForVolume listens for Volume updates and returns the latest received Volume, when the channel is closed

func WriteDB

func WriteDB(sdb *scribble.Driver, speakerName, album string, storedAlbum *DbEntry)

Types

type Config

type Config struct {
	Speakers []string `toml:"speakers"`
	Artists  []string `toml:"artists"`
	Database string   `toml:"database"`
}

Config contains the configuration of the plugin Speakers list of SpeakerNames the handler is added. All if empty Artists a list of artists for which episodes should be collected

type DbEntry

type DbEntry struct {
	ContentItem soundtouch.ContentItem
	AlbumName   string
	Volume      int
	DeviceID    string
	LastUpdated time.Time
}

func ReadAlbumDB

func ReadAlbumDB(sdb *scribble.Driver, album string, updateMsg soundtouch.Update) *DbEntry

func ReadDB

func ReadDB(sdb *scribble.Driver, collection string, album string, currentAlbum *DbEntry) *DbEntry

ReadDB returns a databaseEntry for a given Album, or an empty databaseEntry if collection has no album stored

type VolumeButler

type VolumeButler struct {
	Config
	Plugin soundtouch.PluginFunc
	// contains filtered or unexported fields
}

VolumeButler describes the plugin. It has a Config to store the configuration Plugin the plugin function suspended indicates that the plugin is temporarely suspended scribbleDB a link to the volumes database

func NewVolumeButler

func NewVolumeButler(config Config) (d *VolumeButler)

NewVolumeButler creates a new Collector plugin with the configuration

func (*VolumeButler) Description

func (vb *VolumeButler) Description() string

Description returns a string explaining the purpose of this plugin

func (*VolumeButler) Disable

func (vb *VolumeButler) Disable()

Disable temporarely the execution of the plugin

func (*VolumeButler) Enable

func (vb *VolumeButler) Enable()

Enable temporarely the execution of the plugin

func (*VolumeButler) Execute

func (vb *VolumeButler) Execute(pluginName string, update soundtouch.Update, speaker soundtouch.Speaker)

Execute runs the plugin with the given parameter

func (*VolumeButler) IsEnabled

func (vb *VolumeButler) IsEnabled() bool

IsEnabled returns true if the plugin is not suspened

func (*VolumeButler) Name

func (vb *VolumeButler) Name() string

Name returns the plugin name

func (*VolumeButler) SampleConfig

func (vb *VolumeButler) SampleConfig() string

SampleConfig returns text explaining how plugin should be configured

func (*VolumeButler) Terminate

func (vb *VolumeButler) Terminate() bool

Terminate indicates that no further plugin will be executed on this speaker

Jump to

Keyboard shortcuts

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