queue

package
v0.0.0-...-69b8586 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2023 License: BSD-2-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entry

type Entry struct {
	Identifier  Identifier
	Source      audio.Source
	ReadSamples atomic.Uint64

	StartCallback  EntryCallback
	EndCallback    EntryCallback
	RemoveCallback EntryCallback
	// contains filtered or unexported fields
}

func NewEntry

func NewEntry(identifier Identifier, source audio.Source, cancel chan struct{}, start, end, remove EntryCallback) *Entry

func (*Entry) Cancel

func (e *Entry) Cancel()

func (*Entry) Done

func (e *Entry) Done() <-chan struct{}

type EntryCallback

type EntryCallback func(q *Queue, entry *Entry)

type Identifier

type Identifier int

type Queue

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

func NewQueue

func NewQueue(format audio.SourceFormat, bitDepth, sampleRate, channels int) *Queue

func (*Queue) AddHead

func (q *Queue) AddHead(source audio.Source, startCallback, endCallback, removeCallback EntryCallback) (identifier Identifier)

func (*Queue) AddTail

func (q *Queue) AddTail(source audio.Source, startCallback, endCallback, removeCallback EntryCallback) (identifier Identifier)

func (*Queue) Close

func (q *Queue) Close()

func (*Queue) GetChannels

func (q *Queue) GetChannels() int

func (*Queue) GetQueue

func (q *Queue) GetQueue() (entries []*Entry)

func (*Queue) GetQueueEntry

func (q *Queue) GetQueueEntry(identifier Identifier) (index int, entry *Entry)

func (*Queue) GetQueueHead

func (q *Queue) GetQueueHead() *Entry

func (*Queue) GetQueueIndex

func (q *Queue) GetQueueIndex(index int) *Entry

func (*Queue) GetQueueSize

func (q *Queue) GetQueueSize() int

func (*Queue) GetQueueTail

func (q *Queue) GetQueueTail() (index int, entry *Entry)

func (*Queue) GetSampleRate

func (q *Queue) GetSampleRate() int

func (*Queue) GetSource

func (q *Queue) GetSource() audio.Source

func (*Queue) IsClosed

func (q *Queue) IsClosed() bool

func (*Queue) Remove

func (q *Queue) Remove(identifier Identifier) bool

func (*Queue) Wait

func (q *Queue) Wait()

Jump to

Keyboard shortcuts

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