Documentation ¶
Overview ¶
The ui package is responsible for the user interface of Juke. It's objective is to abstract and de-couple the main program's logic from the user interface.
Index ¶
- Constants
- func AddManyRowstoCurrentPlaylist(rows []*CurrentPLRow)
- func AddRowtoCurrentPlaylist(row *CurrentPLRow)
- func BoldRowById(rowId int)
- func BoldRowByReference(row *CurrentPLRow)
- func ClearCurrentPlaylist()
- func ConnectionClick(f func() error)
- func CurrentClearSongs(f func() error)
- func CurrentColumnClick(f func(chan *CurrentPLRow) error)
- func CurrentRemoveSongs(f func(chan *CurrentPLRow) error)
- func CurrentRowDoubleClick(f func(*CurrentPLRow) error)
- func InitInterface()
- func Lock()
- func MainLoop()
- func NextClick(f func() error)
- func OnExit(f func() error)
- func PlayPauseClick(f func() error)
- func PreviousClick(f func() error)
- func ProgressBarClick(f func(int, int) error)
- func RemoveManyRowsfromCurrentPlaylist(rowsList *list.List)
- func RemoveRowfromCurrentPlaylist(row *CurrentPLRow)
- func SetCurrentAlbumArt(path string)
- func SetCurrentSong(songName, artist, album string)
- func SetCurrentSongNotConnected()
- func SetCurrentSongStopped()
- func SetPlayPause(pause bool)
- func SetProgressBarTime(at, total int)
- func SetProgressBarTimeStoppedOrDisconnected()
- func StopClick(f func() error)
- func Unlock()
- type CurrentPLRow
Constants ¶
const ( PREV_BUTTON uint8 = iota PLAY_PAUSE_BUTTON STOP_BUTTON NEXT_BUTTON )
Playback control constant indexes:
const ( SHUFFLE_BUTTON uint8 = iota REPEAT_BUTTON )
Left-side control constant indexes:
const ( VOLUME_BUTTON uint8 = iota CONNECTION_BUTTON )
Right-side control constant indexes:
const ( NOT_CONNECTED_WINDOW_TITLE string = "Not Connected [Juke]" NOT_CONNECTED_SONG_LABEL string = "<span size=\"x-large\" font_weight=\"bold\">Stopped</span>\nNot connected." STOPPED_WINDOW_TITLE string = "Stopped [Juke]" STOPPED_SONG_LABEL string = "<span size=\"x-large\" font_weight=\"bold\">Stopped</span>\nConnected." STOPPED_OR_DC_PROGRESS string = "0:00 / 0:00" )
Constant referances for set program states:
const ( ICON string = "/usr/share/pixmaps/juke/juke.png" NO_COVER_ARTWORK string = "/usr/share/pixmaps/juke/no_cover.png" CUR_PL_ALBUM_SIZE int = 20 )
Constant pixmap paths:
const ( CUR_PL_COL_ID int = iota CUR_PL_COL_ARTPATH CUR_PL_COL_ARTBUF CUR_PL_COL_NAME CUR_PL_COL_ARTIST CUR_PL_COL_ALBUM NUM_PL_COLS )
const ROW_BUFFER_SIZE = 50
Variables ¶
This section is empty.
Functions ¶
func AddManyRowstoCurrentPlaylist ¶
func AddManyRowstoCurrentPlaylist(rows []*CurrentPLRow)
AddManyRowstoCurrentPlaylist adds mulitple rows at once. It is designed to be more efficient than adding one row at a time.
func AddRowtoCurrentPlaylist ¶
func AddRowtoCurrentPlaylist(row *CurrentPLRow)
AddRowtoCurrentPlaylist adds a row to the current playlist view.
func BoldRowById ¶
func BoldRowById(rowId int)
BoldRowById makes a row in the current playlist by the ID of the song. Only one row can be bold at a time.
func BoldRowByReference ¶
func BoldRowByReference(row *CurrentPLRow)
BoldRowByReference makes a row in the current playlist bold. Only one row can be bold at a time.
func ClearCurrentPlaylist ¶
func ClearCurrentPlaylist()
ClearCurrentPlaylist clears the current playlist view.
func ConnectionClick ¶
func ConnectionClick(f func() error)
ConnectionClick will bind to the "click" event on the connection button.
func CurrentClearSongs ¶
func CurrentClearSongs(f func() error)
CurrentClearSongs will bind the "click" event on the clear playlist button in the current playlist menu.
func CurrentColumnClick ¶
func CurrentColumnClick(f func(chan *CurrentPLRow) error)
CurrentColumnClick will bind to the "column click" event in the current playlist.
func CurrentRemoveSongs ¶
func CurrentRemoveSongs(f func(chan *CurrentPLRow) error)
CurrentRemoveSongs will bind to the "click" event on the remove songs button in the current playlist menu.
func CurrentRowDoubleClick ¶
func CurrentRowDoubleClick(f func(*CurrentPLRow) error)
CurrentRowDoubleClick will bind to the "double-click" event on a row in the current playlist.
func InitInterface ¶
func InitInterface()
InitInterface inits the GUI toolkit and builds most of the base interface.
func NextClick ¶
func NextClick(f func() error)
NextClick will bind to the "release" event on the next button.
func OnExit ¶
func OnExit(f func() error)
OnExit will bind additional functions to the ui "exit" event.
func PlayPauseClick ¶
func PlayPauseClick(f func() error)
PlayPauseClick will bind to the "release" event on the play/pause button.
func PreviousClick ¶
func PreviousClick(f func() error)
PreviousClick will bind to the "release" event on the previous button.
func ProgressBarClick ¶
ProgressBarClick will bind to the "click" event on the progress bar.
func RemoveManyRowsfromCurrentPlaylist ¶
RemoveManyRowsfromCurrentPlaylist removes mulitple rows at once. It is designed to be more efficient than removing one row at a time.
func RemoveRowfromCurrentPlaylist ¶
func RemoveRowfromCurrentPlaylist(row *CurrentPLRow)
RemoveRowfromCurrentPlaylist adds a row to the current playlist view.
func SetCurrentAlbumArt ¶
func SetCurrentAlbumArt(path string)
SetCurrentAlbumArt sets the current album artwork to the image specified by path.
func SetCurrentSong ¶
func SetCurrentSong(songName, artist, album string)
SetCurrentSong changes the window title and current song labeling to reflect the parameters of song name, artist name, and album name.
func SetCurrentSongNotConnected ¶
func SetCurrentSongNotConnected()
SetCurrentSongNotConnected changes the window title and current song labeling to reflect and unconnected client.
func SetCurrentSongStopped ¶
func SetCurrentSongStopped()
SetCurrentSongStopped changes the window title and current song labeling to reflect a stopped but still connected client.
func SetPlayPause ¶
func SetPlayPause(pause bool)
SetPlayPause changes the image on the play button based on the boolean argument. True will display a pause image, while false will display a play image.
func SetProgressBarTime ¶
func SetProgressBarTime(at, total int)
SetProgressBarTime takes song progress and updates the progress bar to reflect that both textually and visually.
func SetProgressBarTimeStoppedOrDisconnected ¶
func SetProgressBarTimeStoppedOrDisconnected()
SetProgressBarTimeStoppedOrDisconnected sets the progress bar to reflect that the client is stopped or is disconnected.