Documentation ¶
Index ¶
- Constants
- type Base
- func (s *Base) Add(row Row)
- func (s *Base) All() []Row
- func (s *Base) Clear()
- func (s *Base) ClearSelection()
- func (s *Base) ColumnNames() []string
- func (s *Base) Columns(names []string) []Column
- func (s *Base) CommitVisualSelection()
- func (s *Base) Copy() List
- func (s *Base) Cursor() int
- func (s *Base) CursorRow() Row
- func (s *Base) DisableVisualSelection()
- func (s *Base) EnableVisualSelection()
- func (s *Base) HasLocalChanges() bool
- func (s *Base) HasRemote() bool
- func (s *Base) HasVisualSelection() bool
- func (s *Base) ID() string
- func (s *Base) IDs() []string
- func (s *Base) InRange(index int) bool
- func (s *Base) InsertList(source List, position int) error
- func (s *Base) Keys() []string
- func (s *Base) Len() int
- func (s *Base) Less(i, j int) bool
- func (s *Base) Lock()
- func (s *Base) ManuallySelected(i int) bool
- func (s *Base) MoveCursor(i int)
- func (s *Base) Name() string
- func (s *Base) NextOf(tags []string, index int, direction int) int
- func (s *Base) Remove(index int) error
- func (s *Base) RemoveIndices(indices []int) error
- func (s *Base) Row(n int) Row
- func (s *Base) RowByID(id string) Row
- func (s *Base) RowNum(id string) (int, error)
- func (s *Base) Selected(i int) bool
- func (s *Base) Selection() List
- func (s *Base) SelectionIndices() []int
- func (s *Base) SetCursor(i int)
- func (s *Base) SetCursorByID(id string) error
- func (s *Base) SetID(id string)
- func (s *Base) SetName(name string)
- func (s *Base) SetRemote(remote bool)
- func (s *Base) SetSelected(i int, selected bool)
- func (s *Base) SetSyncedToRemote()
- func (s *Base) SetURI(uri spotify.URI)
- func (s *Base) SetUpdated()
- func (s *Base) SetVisibleColumns(names []string)
- func (s *Base) SetVisualSelection(ymin, ymax, ystart int)
- func (s *Base) Sort(cols []string) error
- func (s *Base) Swap(i, j int)
- func (s *Base) ToggleVisualSelection()
- func (s *Base) URI() *spotify.URI
- func (s *Base) Unlock()
- func (s *Base) Updated() time.Time
- func (s *Base) ValidateCursor(ymin, ymax int)
- func (s *Base) VisibleColumns() []string
- func (s *Base) VisualSelection() (int, int, int)
- func (s *Base) VisuallySelected(i int) bool
- type BaseRow
- func (row *BaseRow) Fields() map[string]string
- func (row *BaseRow) Get(key string) string
- func (row *BaseRow) ID() string
- func (row *BaseRow) Keys() []string
- func (row *BaseRow) Kind() DataType
- func (row *BaseRow) Set(key, value string)
- func (row *BaseRow) SetFields(fields map[string]string)
- func (row *BaseRow) SetID(id string)
- func (row *BaseRow) URI() spotify.URI
- type Collection
- type Column
- type Cursor
- type DataType
- type Item
- type List
- type Metadata
- type Remote
- type Row
- type Selectable
Constants ¶
const ( // one for each data type DataTypeFIXME DataType = "FIXME" DataTypeWindow = "window" DataTypeList = "list" DataTypeLogLine = "logline" DataTypeKeyBinding = "keybinding" DataTypeTrack = "track" DataTypeDevice = "device" DataTypeAlbum = "album" DataTypePlaylist = "playlist" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Base ¶
type Base struct {
// contains filtered or unexported fields
}
func (*Base) ColumnNames ¶
func (*Base) CommitVisualSelection ¶
func (s *Base) CommitVisualSelection()
CommitVisualSelection converts the visual selection to manual selection.
func (*Base) DisableVisualSelection ¶
func (s *Base) DisableVisualSelection()
DisableVisualSelection disables visual selection.
func (*Base) EnableVisualSelection ¶
func (s *Base) EnableVisualSelection()
EnableVisualSelection sets start and stop of the visual selection to the cursor position.
func (*Base) HasLocalChanges ¶
Returns true if the tracklist has local changes that are not synced remotely.
func (*Base) HasVisualSelection ¶
HasVisualSelection returns true if the songlist is in visual selection mode.
func (*Base) InRange ¶
InRange returns true if the provided index is within list range, false otherwise.
func (*Base) ManuallySelected ¶
ManuallySelected returns true if the given song index is selected through manual selection.
func (*Base) MoveCursor ¶
MoveCursor moves the cursor by the specified offset.
func (*Base) NextOf ¶
NextOf searches forwards or backwards for rows having different values in the specified tags. The index of the next song is returned.
func (*Base) RemoveIndices ¶
RemoveIndices removes a selection of songs from the songlist, having the index defined by the int slice parameter.
func (*Base) Selected ¶
Selected returns true if the given song index is selected, either through visual selection or manual selection. If the song is doubly selected, the selection is inversed.
func (*Base) SelectionIndices ¶
SelectionIndices returns a slice of ints holding the position of each element in the current selection. If no elements are selected, the cursor position is returned.
func (*Base) SetCursorByID ¶
SetCursor moves the cursor to the row with the specified ID.
func (*Base) SetRemote ¶
Declare that this tracklist represents a server-side playlist, enabling it to be saved back to the Spotify servers. The playlist ID is the same as the list ID.
func (*Base) SetSelected ¶
SetSelection sets the selected status of a single song.
func (*Base) SetSyncedToRemote ¶
func (s *Base) SetSyncedToRemote()
Use this function to indicate that the local and remote copies are in sync.
func (*Base) SetUpdated ¶
func (s *Base) SetUpdated()
SetUpdated sets the update timestamp of the songlist.
func (*Base) SetVisibleColumns ¶
func (*Base) SetVisualSelection ¶
SetVisualSelection sets the range of the visual selection. Use negative integers to un-select all visually selected songs.
func (*Base) Sort ¶
Sort first sorts unstable, then stable, by all columns provided. Retains cursor position.
func (*Base) ToggleVisualSelection ¶
func (s *Base) ToggleVisualSelection()
ToggleVisualSelection toggles visual selection on and off.
func (*Base) ValidateCursor ¶
ValidateCursor makes sure the cursor is within minimum and maximum boundaries.
func (*Base) VisibleColumns ¶
func (*Base) VisualSelection ¶
VisualSelection returns the min, max, and start position of visual select.
func (*Base) VisuallySelected ¶
VisuallySelected returns true if the given song index is selected through visual selection.
type Collection ¶
type Collection struct {
Base
}
type List ¶
type List interface { Cursor Metadata Selectable Remote Add(Row) All() []Row Clear() Copy() List IDs() []string InRange(int) bool InsertList(source List, position int) error Keys() []string Len() int Lock() NextOf([]string, int, int) int RemoveIndices(indices []int) error Row(int) Row RowByID(string) Row RowNum(string) (int, error) SetUpdated() Sort([]string) error Unlock() Updated() time.Time }
type Row ¶
type Row interface { // Unique identifier of the data in the row. ID() string SetID(string) // Return a Spotify URI pointing to the track. device, album or playlist this row represents. URI() spotify.URI // Return the dataset. Fields() map[string]string SetFields(map[string]string) // Return the keys of the data. Keys() []string // Indicates what kind of data this row represents. Kind() DataType // Set a value in the dataset. Set(key, value string) // Get a value from the dataset. Get(key string) string }