player

package
v0.0.0-...-9174c1b Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2022 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Callback

type Callback interface{}

type Client

type Client struct {
	CmdCh chan<- Cmd
	// ErrCh is blocking meaning that you will have to constantly read it,
	// either using another goroutine or a select statement whenever sending a
	// command.
	ErrCh <-chan error
}

func NewClient

func NewClient(excfg extractor.Config, ffmpegPath string, outCh chan<- []byte, callbacks ...Callback) Client

Creates a new player client that will run in parallel and receive commands via the returned Client.CmdCh. All audio will be sent via the given outCh. Closing the returned Client.CmdCh channel acts as a kill signal.

func (Client) GetQueue

func (c Client) GetQueue() *Queue

func (Client) GetSpeed

func (c Client) GetSpeed() float64

func (Client) GetTime

func (c Client) GetTime() float64

type Cmd

type Cmd interface{}

Client commands Get commands can most easily be executed via the builtin convenience functions NOTE: When using commands like Jump, Swap and Delete, we can't be sure that our versions of the indices correspond to the versions the caller is referring to, but in this context, that should be fine

type CmdAddBack

type CmdAddBack []extractor.Data

type CmdAddFront

type CmdAddFront []extractor.Data

type CmdDelete

type CmdDelete []int

type CmdGetQueue

type CmdGetQueue chan<- *Queue

type CmdGetSpeed

type CmdGetSpeed chan<- float64

type CmdGetTime

type CmdGetTime chan<- float64

type CmdJump

type CmdJump int // relative track to jump to (e.g. -2, -1, 4)

type CmdLoop

type CmdLoop bool

type CmdPause

type CmdPause struct{}

type CmdPlay

type CmdPlay struct{}

type CmdPlayFileAndStop

type CmdPlayFileAndStop struct {
	DoneCh chan<- struct{}
	Data   []byte
}

type CmdSeek

type CmdSeek float64 // seconds

type CmdShuffle

type CmdShuffle struct{}

type CmdSkipAll

type CmdSkipAll struct{}

type CmdSpeed

type CmdSpeed float64 // speed factor

type CmdSwap

type CmdSwap struct{ A, B int }

type CmdUnshuffle

type CmdUnshuffle struct{}

type Event

type Event interface{}

type EventKilled

type EventKilled struct{}

type EventStreamUpdated

type EventStreamUpdated struct{}

type Queue

type Queue struct {
	Done            []extractor.Data
	Playing         *extractor.Data
	Ahead           []extractor.Data
	AheadUnshuffled []extractor.Data
	ShuffleOffset   int
	Paused          bool
	Loop            bool
}

func (*Queue) At

func (q *Queue) At(i int) *extractor.Data

func (*Queue) Copy

func (q *Queue) Copy() *Queue

func (*Queue) InBounds

func (q *Queue) InBounds(i int) bool

Jump to

Keyboard shortcuts

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