sconsify

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2017 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NormalMode = iota
	ShuffleMode
	ShuffleAllMode
	SequentialMode
)

Variables

This section is empty.

Functions

func StartMainLoop

func StartMainLoop(events *Events, ui UserInterface, askForFirstTrack bool) error

Types

type Album added in v0.3.0

type Album struct {
	URI string

	Name    string
	Artists []*Artist
}

type Artist added in v0.3.0

type Artist struct {
	URI string

	Name   string
	Albums []*Album
}

func InitArtist added in v0.3.0

func InitArtist(URI string, name string) *Artist

func (*Artist) GetSpotifyID added in v0.3.0

func (artist *Artist) GetSpotifyID() string

type Events

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

func InitialiseEvents

func InitialiseEvents() *Events

func (*Events) ArtistAlbums added in v0.3.0

func (events *Events) ArtistAlbums(folder *Playlist)

func (*Events) ArtistAlbumsUpdates added in v0.3.0

func (events *Events) ArtistAlbumsUpdates() <-chan *Playlist

func (*Events) GetArtistAlbums added in v0.3.0

func (events *Events) GetArtistAlbums(artist *Artist)

func (*Events) GetArtistAlbumsUpdates added in v0.3.0

func (events *Events) GetArtistAlbumsUpdates() <-chan *Artist

func (*Events) NewPlaylist

func (events *Events) NewPlaylist(playlists *Playlists)

func (*Events) NewTrackLoaded added in v0.4.0

func (events *Events) NewTrackLoaded(duration time.Duration)

func (*Events) NewTrackLoadedUpdate added in v0.4.0

func (events *Events) NewTrackLoadedUpdate() <-chan time.Duration

func (*Events) NextPlay

func (events *Events) NextPlay()

func (*Events) NextPlayUpdates

func (events *Events) NextPlayUpdates() <-chan bool

func (*Events) Pause

func (events *Events) Pause()

func (*Events) PauseUpdates

func (events *Events) PauseUpdates() <-chan bool

func (*Events) Play

func (events *Events) Play(track *Track)

func (*Events) PlayTokenLost

func (events *Events) PlayTokenLost()

func (*Events) PlayTokenLostUpdates

func (events *Events) PlayTokenLostUpdates() <-chan bool

func (*Events) PlayUpdates

func (events *Events) PlayUpdates() <-chan *Track

func (*Events) PlaylistsUpdates

func (events *Events) PlaylistsUpdates() <-chan Playlists

func (*Events) Replay

func (events *Events) Replay()

func (*Events) ReplayUpdates

func (events *Events) ReplayUpdates() <-chan bool

func (*Events) Search

func (events *Events) Search(query string)

func (*Events) SearchUpdates

func (events *Events) SearchUpdates() <-chan string

func (*Events) ShutdownEngine

func (events *Events) ShutdownEngine()

func (*Events) ShutdownEngineUpdates

func (events *Events) ShutdownEngineUpdates() <-chan bool

func (*Events) ShutdownSpotify

func (events *Events) ShutdownSpotify()

func (*Events) ShutdownSpotifyUpdates

func (events *Events) ShutdownSpotifyUpdates() <-chan bool

func (*Events) TrackNotAvailable

func (events *Events) TrackNotAvailable(track *Track)

func (*Events) TrackNotAvailableUpdates

func (events *Events) TrackNotAvailableUpdates() <-chan *Track

func (*Events) TrackPaused

func (events *Events) TrackPaused(track *Track)

func (*Events) TrackPausedUpdates

func (events *Events) TrackPausedUpdates() <-chan *Track

func (*Events) TrackPlaying

func (events *Events) TrackPlaying(track *Track)

func (*Events) TrackPlayingUpdates

func (events *Events) TrackPlayingUpdates() <-chan *Track

type Playlist

type Playlist struct {
	URI string
	// contains filtered or unexported fields
}

func InitFolder added in v0.2.0

func InitFolder(URI string, name string, playlists []*Playlist) *Playlist

func InitOnDemandFolder added in v0.3.0

func InitOnDemandFolder(URI string, name string, oneTimeLoad bool, loadCallback func(playlist *Playlist)) *Playlist

func InitOnDemandPlaylist added in v0.3.0

func InitOnDemandPlaylist(URI string, name string, oneTimeLoad bool, loadCallback func(playlist *Playlist)) *Playlist

func InitPlaylist

func InitPlaylist(URI string, name string, tracks []*Track) *Playlist

func InitSearchPlaylist

func InitSearchPlaylist(URI string, name string, loadCallback func(playlist *Playlist)) *Playlist

func InitSubPlaylist added in v0.2.0

func InitSubPlaylist(URI string, name string, tracks []*Track) *Playlist

func (*Playlist) AddPlaylist added in v0.2.0

func (playlist *Playlist) AddPlaylist(subPlaylist *Playlist) bool

func (*Playlist) AddTrack added in v0.3.0

func (playlist *Playlist) AddTrack(track *Track)

func (*Playlist) ExecuteLoad added in v0.3.0

func (playlist *Playlist) ExecuteLoad()

func (*Playlist) GetNextTrack

func (playlist *Playlist) GetNextTrack(currentIndexTrack int) (int, bool)

func (*Playlist) GetPlaylist added in v0.4.0

func (playlist *Playlist) GetPlaylist(name string) *Playlist

func (*Playlist) HasSameNameIncludingSubPlaylists added in v0.2.0

func (playlist *Playlist) HasSameNameIncludingSubPlaylists(otherPlaylist *Playlist) bool

func (*Playlist) IndexByUri

func (playlist *Playlist) IndexByUri(URI string) int

func (*Playlist) InvertOpenClose added in v0.2.0

func (playlist *Playlist) InvertOpenClose()

func (*Playlist) IsFolder added in v0.2.0

func (playlist *Playlist) IsFolder() bool

func (*Playlist) IsFolderOpen added in v0.2.0

func (playlist *Playlist) IsFolderOpen() bool

func (*Playlist) IsOnDemand added in v0.3.0

func (playlist *Playlist) IsOnDemand() bool

func (*Playlist) IsSearch

func (playlist *Playlist) IsSearch() bool

func (*Playlist) LoadFolderTracks added in v0.3.0

func (playlist *Playlist) LoadFolderTracks()

func (*Playlist) Name

func (playlist *Playlist) Name() string

func (*Playlist) OpenFolder added in v0.2.0

func (playlist *Playlist) OpenFolder()

func (*Playlist) OriginalName added in v0.2.0

func (playlist *Playlist) OriginalName() string

func (*Playlist) Playlist added in v0.2.0

func (playlist *Playlist) Playlist(index int) *Playlist

func (*Playlist) Playlists added in v0.2.0

func (playlist *Playlist) Playlists() int

func (*Playlist) RemoveAllTracks added in v0.3.0

func (playlist *Playlist) RemoveAllTracks()

func (*Playlist) RemovePlaylist added in v0.2.0

func (playlist *Playlist) RemovePlaylist(playlistName string) bool

func (*Playlist) RemoveTrack added in v0.3.0

func (playlist *Playlist) RemoveTrack(index int)

func (*Playlist) ToSpotifyID added in v0.3.0

func (playlist *Playlist) ToSpotifyID() string

func (*Playlist) Track

func (playlist *Playlist) Track(index int) *Track

func (*Playlist) Tracks

func (playlist *Playlist) Tracks() int

type PlaylistByName

type PlaylistByName []Playlist

func (PlaylistByName) Len

func (p PlaylistByName) Len() int

sort Interface

func (PlaylistByName) Less

func (p PlaylistByName) Less(i, j int) bool

func (PlaylistByName) Swap

func (p PlaylistByName) Swap(i, j int)

type Playlists

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

func InitPlaylists

func InitPlaylists() *Playlists

func (*Playlists) AddPlaylist

func (playlists *Playlists) AddPlaylist(playlist *Playlist)

func (*Playlists) Get

func (playlists *Playlists) Get(name string) *Playlist

func (*Playlists) GetByURI added in v0.3.0

func (playlists *Playlists) GetByURI(URI string) *Playlist

func (*Playlists) GetModeAsString

func (playlists *Playlists) GetModeAsString() string

func (*Playlists) GetNext

func (playlists *Playlists) GetNext() (*Track, bool)

func (*Playlists) GetPlayingPlaylist

func (playlists *Playlists) GetPlayingPlaylist() *Playlist

func (*Playlists) GetPlayingTrack

func (playlists *Playlists) GetPlayingTrack() *Track

func (*Playlists) HasPlaylistSelected

func (playlists *Playlists) HasPlaylistSelected() bool

func (*Playlists) InvertMode

func (playlists *Playlists) InvertMode(mode int) int

func (*Playlists) Merge

func (playlists *Playlists) Merge(newPlaylists *Playlists)

func (*Playlists) Names

func (playlists *Playlists) Names() []string

func (*Playlists) Playlists

func (playlists *Playlists) Playlists() int

func (*Playlists) PremadeTracks

func (playlists *Playlists) PremadeTracks() int

func (*Playlists) Remove

func (playlists *Playlists) Remove(playlistName string)

func (*Playlists) SetCurrents

func (playlists *Playlists) SetCurrents(currentPlaylist string, currentIndexTrack int) error

func (*Playlists) SetMode

func (playlists *Playlists) SetMode(mode int)

func (*Playlists) Tracks

func (playlists *Playlists) Tracks() int

type Track

type Track struct {
	URI string

	Artist   *Artist
	Name     string
	Duration string
	Album    *Album
	// contains filtered or unexported fields
}

func InitPartialTrack

func InitPartialTrack(URI string) *Track

func InitTrack

func InitTrack(URI string, artist *Artist, name string, duration string) *Track

func InitWebApiTrack added in v0.3.0

func InitWebApiTrack(URI string, artist *Artist, name string, duration string) *Track

func ToSconsifyTrack

func ToSconsifyTrack(track *sp.Track) *Track

func (*Track) GetFullTitle

func (track *Track) GetFullTitle() string

func (*Track) GetTitle

func (track *Track) GetTitle() string

func (*Track) IsFromWebApi added in v0.3.0

func (track *Track) IsFromWebApi() bool

func (*Track) IsPartial

func (track *Track) IsPartial() bool

func (*Track) RetryLoading added in v0.3.0

func (track *Track) RetryLoading() int

type UserInterface

type UserInterface interface {
	TrackPaused(track *Track)
	TrackPlaying(track *Track)
	TrackNotAvailable(track *Track)
	PlayTokenLost() error
	GetNextToPlay() *Track
	NewPlaylists(playlists Playlists) error
	ArtistAlbums(folder *Playlist)
	Shutdown()
	NewTrackLoaded(duration time.Duration)
}

Jump to

Keyboard shortcuts

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