song_queue

package
v0.0.0-...-23f444a Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	QueueSnapshot string = "/tmp/ytbox.queue" // location of the queue snapshot
)

Variables

This section is empty.

Functions

This section is empty.

Types

type FifoQueuer

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

* Contains the state data for the queue

func NewFifoQueuer

func NewFifoQueuer() *FifoQueuer

func (*FifoQueuer) RemoveSong

func (fifo *FifoQueuer) RemoveSong(songId uint32, userId uint32) error

type RoundRobinQueuer

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

func NewRoundRobinQueuer

func NewRoundRobinQueuer() *RoundRobinQueuer

type SongQueueManager

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

* Manages the song queue

func (*SongQueueManager) AddSong

func (manager *SongQueueManager) AddSong(song *cmpb.Song)

* Adds a song to the queue

func (*SongQueueManager) ClearNowPlaying

func (manager *SongQueueManager) ClearNowPlaying()

* Clear the now playing state

func (*SongQueueManager) GetPlaylist

func (manager *SongQueueManager) GetPlaylist() *bepb.Playlist

* Returns a list of songs in the queue

func (*SongQueueManager) Init

func (manager *SongQueueManager) Init(queuer songQueuer)

* Initializes the queue

func (*SongQueueManager) Len

func (manager *SongQueueManager) Len() int

* Returns the length of the queue

func (*SongQueueManager) NowPlaying

func (manager *SongQueueManager) NowPlaying() *cmpb.Song

* Returns the data for the currently playing song

func (*SongQueueManager) PopQueue

func (manager *SongQueueManager) PopQueue() *cmpb.Song

* Pops the next song off the queue and returns it

func (*SongQueueManager) RemoveSong

func (manager *SongQueueManager) RemoveSong(songId uint32, userId uint32) error

* Removes the identified song from the queue. Both the song id and uesr id * must match in order for the song to be successfully removed.

func (*SongQueueManager) SavePlaylist

func (manager *SongQueueManager) SavePlaylist(path string) error

* Saves the playlist to a file

func (*SongQueueManager) WaitForMoreSongs

func (manager *SongQueueManager) WaitForMoreSongs()

* Blocks the current thread while the size of the playlist is zero. The playlist * will notify all blocked threads that the size is once again greater than one * when a new song is added.

Jump to

Keyboard shortcuts

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