Documentation
¶
Index ¶
- Constants
- func BestURL(images []types.Image, targetPx int) string
- type App
- type AppState
- type Auth
- type AuthState
- type ImageService
- type NavState
- type Player
- type TrackListVM
- func (vm *TrackListVM) AddBatch(tracks []*metadatapb.Track)
- func (vm *TrackListVM) AddBatchGuarded(searchID uint64, tracks []*metadatapb.Track)
- func (vm *TrackListVM) Clear()
- func (vm *TrackListVM) CurrentSearchID() uint64
- func (vm *TrackListVM) Get(index int) (**metadatapb.Track, bool)
- func (vm *TrackListVM) LastScrollY() int
- func (vm *TrackListVM) Len() int
- func (vm *TrackListVM) LoadAsync(index int, cb func(*metadatapb.Track))
- func (vm *TrackListVM) NewSearchID() uint64
- func (vm *TrackListVM) OnLengthChanged(cb func(int)) func()
- func (vm *TrackListVM) SaveScrollY(y int)
Constants ¶
View Source
const ( PCPlayPause playerCmd = 2<<iota - 1 PCStop PCNext PCPrev )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type App ¶
type App struct {
State *reactive.Prop[AppState]
Auth *Auth
Player *Player
Client types.Client
Images *ImageService
LikedTracks *TrackListVM
SearchResults *TrackListVM
}
type ImageService ¶
type ImageService struct {
// contains filtered or unexported fields
}
func NewImageService ¶
func NewImageService(ctx context.Context, db *badger.DB) *ImageService
func (*ImageService) Close ¶
func (s *ImageService) Close()
func (*ImageService) LoadCover ¶
func (s *ImageService) LoadCover(album *metadatapb.Album, targetPx int, onLoad func(*qt.QPixmap))
type Player ¶
type TrackListVM ¶
type TrackListVM struct {
// contains filtered or unexported fields
}
func NewTrackListVM ¶
func NewTrackListVM(lru *cache.LRU[*metadatapb.Track]) *TrackListVM
func (*TrackListVM) AddBatch ¶
func (vm *TrackListVM) AddBatch(tracks []*metadatapb.Track)
func (*TrackListVM) AddBatchGuarded ¶
func (vm *TrackListVM) AddBatchGuarded(searchID uint64, tracks []*metadatapb.Track)
AddBatchGuarded is like AddBatch but only writes if the provided searchID matches the current searchID, discarding results from superseded searches.
func (*TrackListVM) Clear ¶
func (vm *TrackListVM) Clear()
func (*TrackListVM) CurrentSearchID ¶
func (vm *TrackListVM) CurrentSearchID() uint64
CurrentSearchID returns the current search ID without incrementing.
func (*TrackListVM) Get ¶
func (vm *TrackListVM) Get(index int) (**metadatapb.Track, bool)
func (*TrackListVM) LastScrollY ¶
func (vm *TrackListVM) LastScrollY() int
func (*TrackListVM) Len ¶
func (vm *TrackListVM) Len() int
func (*TrackListVM) LoadAsync ¶
func (vm *TrackListVM) LoadAsync(index int, cb func(*metadatapb.Track))
func (*TrackListVM) NewSearchID ¶
func (vm *TrackListVM) NewSearchID() uint64
NewSearchID increments and returns a new search ID. Goroutines should capture this ID and only write results if it matches CurrentSearchID.
func (*TrackListVM) OnLengthChanged ¶
func (vm *TrackListVM) OnLengthChanged(cb func(int)) func()
func (*TrackListVM) SaveScrollY ¶
func (vm *TrackListVM) SaveScrollY(y int)
Click to show internal directories.
Click to hide internal directories.