poolsuite

package module
v0.0.0-...-9cac135 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2023 License: GPL-3.0 Imports: 11 Imported by: 0

README

go-poolsuite

Poolsuite FM (formerly Poolside FM) player as a Go module.

Example

func main() {
	psfm := poolsuite.NewPoolsuite()
	psfm.Load()
	track := psfm.GetRandomTrackFromPlaylist(psfm.GetRandomPlaylist())
	psfm.Play(track, nil)
	fmt.Println("Waiting ..")
	time.Sleep(8 * time.Second)
	fmt.Println("Stopping ...")
	psfm.PauseResume()
	fmt.Println("Stopped, waiting ...")
	time.Sleep(3 * time.Second)
	track = psfm.GetRandomTrackFromPlaylist(psfm.GetRandomPlaylist())
	psfm.Play(track, nil)
	fmt.Println("Waiting ..")
	time.Sleep(5 * time.Second)
	fmt.Println("Stopping ...")
	psfm.PauseResume()
	fmt.Println("Stopped, waiting ...")
	time.Sleep(3 * time.Second)
	fmt.Println("Done")
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Playlist

type Playlist struct {
	Name        string  `json:"name"`
	Slug        string  `json:"slug"`
	Order       int     `json:"order"`
	IsCustom    bool    `json:"isCustom"`
	TotalTracks int     `json:"total_tracks"`
	Tracks      []Track `json:"tracks_in_order"`
}

type Poolsuite

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

func NewPoolsuite

func NewPoolsuite() *Poolsuite

func (*Poolsuite) GetPlaylistBySlug

func (ps *Poolsuite) GetPlaylistBySlug(slug string) *Playlist

func (*Poolsuite) GetRandomPlaylist

func (ps *Poolsuite) GetRandomPlaylist() *Playlist

func (*Poolsuite) GetRandomTrackFromPlaylist

func (ps *Poolsuite) GetRandomTrackFromPlaylist(playlist *Playlist) *Track

func (*Poolsuite) ListPlaylists

func (ps *Poolsuite) ListPlaylists() *[]Playlist

func (*Poolsuite) Load

func (ps *Poolsuite) Load() error

func (*Poolsuite) PauseResume

func (ps *Poolsuite) PauseResume()

func (*Poolsuite) Play

func (ps *Poolsuite) Play(track *Track, callback func()) error

func (*Poolsuite) SetVolume

func (ps *Poolsuite) SetVolume(volume int)

type Track

type Track struct {
	SCID   int64  `json:"soundcloud_id"`
	Artist string `json:"artist"`
	Title  string `json:"title"`
}

type TracksByPlaylist

type TracksByPlaylist struct {
	Playlists []Playlist `json:"payload"`
}

Jump to

Keyboard shortcuts

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