sconsify

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 26, 2015 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NormalMode = iota
	ShuffleMode
	ShuffleAllMode
	SequentialMode
)
View Source
const SCONSIFY_CONF_LOCATION = "/.sconsify"

Variables

This section is empty.

Functions

func CloseLogger

func CloseLogger()

func Debug

func Debug(message string)

func Debugf

func Debugf(format string, v ...interface{})

func DeleteCache

func DeleteCache(cacheLocation string) error

func DeleteLogFile

func DeleteLogFile(logFileLocation string) error

func GetCacheLocation

func GetCacheLocation() string

func GetLogFileLocation

func GetLogFileLocation() string

func GetStateFileLocation

func GetStateFileLocation() string

func InitialiseLogger

func InitialiseLogger()

func ProcessSconsifyrc

func ProcessSconsifyrc()

func SaveFile

func SaveFile(fileLocation string, content []byte)

func StartMainLoop

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

Types

type Events

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

func InitialiseEvents

func InitialiseEvents() *Events

func (*Events) NewPlaylist

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

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 {
	// contains filtered or unexported fields
}

func InitPlaylist

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

func InitSearchPlaylist

func InitSearchPlaylist(id string, name string, tracks []*Track) *Playlist

func (*Playlist) GetNextTrack

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

func (*Playlist) Id

func (playlist *Playlist) Id() string

func (*Playlist) IndexByUri

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

func (*Playlist) IsSearch

func (playlist *Playlist) IsSearch() bool

func (*Playlist) Name

func (playlist *Playlist) Name() 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) GetById

func (playlists *Playlists) GetById(id 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(newPlaylist *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
	// contains filtered or unexported fields
}

func InitPartialTrack

func InitPartialTrack(uri string) *Track

func InitTrack

func InitTrack(uri string, artist string, 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) IsPartial

func (track *Track) IsPartial() bool

type UserInterface

type UserInterface interface {
	TrackPaused(track *Track)
	TrackPlaying(track *Track)
	TrackNotAvailable(track *Track)
	PlayTokenLost() error
	GetNextToPlay() *Track
	NewPlaylists(playlists Playlists) error
	Shutdown()
}

Jump to

Keyboard shortcuts

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