Documentation
¶
Index ¶
- type BackMsg
- type BookDetailLoadedMsg
- type CaptionLoadedMsg
- type EpisodesLoadedMsg
- type KeyMap
- type Model
- type MprisState
- func (s *MprisState) CanGoNext() bool
- func (s *MprisState) CanGoPrevious() bool
- func (s *MprisState) CanSeek() bool
- func (s *MprisState) CurrentAuthors() []string
- func (s *MprisState) CurrentItemID() string
- func (s *MprisState) CurrentTitle() string
- func (s *MprisState) HasActiveItem() bool
- func (s *MprisState) IsPaused() bool
- func (s *MprisState) IsPlaying() bool
- func (s *MprisState) PlayerDuration() float64
- func (s *MprisState) PlayerMaximumRate() float64
- func (s *MprisState) PlayerMinimumRate() float64
- func (s *MprisState) PlayerPosition() float64
- func (s *MprisState) PlayerSpeed() float64
- func (s *MprisState) PlayerVolume() int
- func (s *MprisState) QueueLength() int
- func (s *MprisState) Update(fn func(s *MprisState))
- type NavigateMsg
- type PaletteContextProvider
- type PlaySessionData
- type PlaySessionMsg
- type PlaybackErrorMsg
- type PlaybackStoppedMsg
- type PrewarmDoneMsg
- type QueueEntry
- type RestorePlaySessionMsg
- type RestoreSessionMsg
- type Screen
- type SeriesContinueMsg
- type SessionSyncedMsg
- type SleepTimerExpiredMsg
- type SyncTickMsg
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BookDetailLoadedMsg ¶
type BookDetailLoadedMsg struct {
ItemID string
Item *abs.LibraryItem
Err error
}
BookDetailLoadedMsg carries an enriched library item fetched from ABS.
type CaptionLoadedMsg ¶ added in v0.6.0
CaptionLoadedMsg carries parsed VTT cues for the current play generation.
type EpisodesLoadedMsg ¶
type EpisodesLoadedMsg struct {
ItemID string
Episodes []abs.PodcastEpisode
Err error
}
EpisodesLoadedMsg carries podcast episodes fetched from the API.
type KeyMap ¶
type KeyMap struct {
Quit key.Binding
Back key.Binding
Help key.Binding
ChapterOverlay key.Binding
Captions key.Binding
NextInQueue key.Binding
SleepTimer key.Binding
GlobalPalette key.Binding
}
KeyMap defines the global keybindings for the root model.
func DefaultKeyMap ¶
func DefaultKeyMap(cfg config.KeybindsConfig) KeyMap
DefaultKeyMap returns the default keybindings using the given config.
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model is the root application model that manages screen routing.
func New ¶
New creates a new root model. If client is non-nil (authenticated), the initial screen is Home; otherwise it starts at Login.
func NewWithPlayer ¶
func NewWithPlayer(cfg config.Config, store *db.Store, client *cache.Client, cacheStore *cache.Store, mpv player.Player) Model
NewWithPlayer creates a new root model with a specific player implementation.
func (Model) ActiveScreen ¶
ActiveScreen returns the currently active screen.
func (Model) Cleanup ¶
func (m Model) Cleanup()
Cleanup performs synchronous cleanup of playback resources.
func (Model) Queue ¶
func (m Model) Queue() []QueueEntry
Queue returns a copy of the current playback queue.
func (*Model) SetProgram ¶ added in v0.2.0
SetProgram sets the bubbletea program reference and starts the MPRIS bridge.
type MprisState ¶ added in v0.2.0
type MprisState struct {
// contains filtered or unexported fields
}
MprisState holds playback state shared between the Model and MPRIS accessor. The Model writes to it via Update; the MPRIS adapter reads from it via the getter methods. All access is guarded by mu.
func (*MprisState) CanGoNext ¶ added in v0.6.0
func (s *MprisState) CanGoNext() bool
func (*MprisState) CanGoPrevious ¶ added in v0.6.0
func (s *MprisState) CanGoPrevious() bool
func (*MprisState) CanSeek ¶ added in v0.6.0
func (s *MprisState) CanSeek() bool
func (*MprisState) CurrentAuthors ¶ added in v0.5.0
func (s *MprisState) CurrentAuthors() []string
func (*MprisState) CurrentItemID ¶ added in v0.5.0
func (s *MprisState) CurrentItemID() string
func (*MprisState) CurrentTitle ¶ added in v0.5.0
func (s *MprisState) CurrentTitle() string
func (*MprisState) HasActiveItem ¶ added in v0.2.0
func (s *MprisState) HasActiveItem() bool
func (*MprisState) IsPaused ¶ added in v0.2.0
func (s *MprisState) IsPaused() bool
func (*MprisState) IsPlaying ¶ added in v0.2.0
func (s *MprisState) IsPlaying() bool
func (*MprisState) PlayerDuration ¶ added in v0.5.0
func (s *MprisState) PlayerDuration() float64
func (*MprisState) PlayerMaximumRate ¶ added in v0.6.0
func (s *MprisState) PlayerMaximumRate() float64
func (*MprisState) PlayerMinimumRate ¶ added in v0.6.0
func (s *MprisState) PlayerMinimumRate() float64
func (*MprisState) PlayerPosition ¶ added in v0.5.0
func (s *MprisState) PlayerPosition() float64
func (*MprisState) PlayerSpeed ¶ added in v0.5.0
func (s *MprisState) PlayerSpeed() float64
func (*MprisState) PlayerVolume ¶ added in v0.5.0
func (s *MprisState) PlayerVolume() int
func (*MprisState) QueueLength ¶ added in v0.2.0
func (s *MprisState) QueueLength() int
func (*MprisState) Update ¶ added in v0.5.0
func (s *MprisState) Update(fn func(s *MprisState))
Update runs fn with the write lock held. fn must not call the getter methods on s (or any *MprisState that aliases the same receiver) to avoid deadlocks.
type NavigateMsg ¶
type NavigateMsg struct {
}
NavigateMsg requests navigation to a different screen. Data carries optional context (e.g., a library item ID for detail view).
type PaletteContextProvider ¶ added in v0.2.0
type PaletteContextProvider interface {
SelectedPaletteActions() []components.PaletteItem
}
type PlaySessionData ¶
type PlaySessionData struct {
SessionID string
ItemID string
EpisodeID string
CurrentTime float64
SyncedTime float64 // book position that the server has
Duration float64
Title string
Authors []string
Chapters []abs.Chapter
TrackStartOffset float64
TrackDuration float64
TrackFilename string
TranscriptIno string
}
PlaySessionData carries the data returned from ABS when starting a session.
type PlaySessionMsg ¶
type PlaySessionMsg struct {
Session PlaySessionData
StreamURL string
AuthToken string
}
PlaySessionMsg is sent after a play session is successfully started on ABS.
type PlaybackErrorMsg ¶
type PlaybackErrorMsg struct {
Err error
}
PlaybackErrorMsg carries an error from the playback lifecycle.
type PlaybackStoppedMsg ¶
type PlaybackStoppedMsg struct{}
PlaybackStoppedMsg signals that playback cleanup is complete.
type PrewarmDoneMsg ¶ added in v0.2.0
type PrewarmDoneMsg struct{}
PrewarmDoneMsg is sent after cache pre-warming completes. No action needed, just used to keep the command chain alive.
type QueueEntry ¶
type QueueEntry struct {
Item abs.LibraryItem
Episode *abs.PodcastEpisode
}
QueueEntry represents a queued book or podcast episode.
type RestorePlaySessionMsg ¶ added in v0.1.1
type RestorePlaySessionMsg struct {
PlaySessionMsg PlaySessionMsg
}
RestorePlaySessionMsg carries a restore-initiated play session that should launch paused.
type RestoreSessionMsg ¶
type RestoreSessionMsg struct {
Item *abs.LibraryItem
Episode *abs.PodcastEpisode
SavedEpisodeID string
}
RestoreSessionMsg carries the result of a session restore attempt. If Item is nil, no session was found or the restore failed — the app proceeds to the Home screen as usual.
type SeriesContinueMsg ¶ added in v0.2.0
type SeriesContinueMsg struct {
Item abs.LibraryItem
Err error
}
SeriesContinueMsg carries the next book in a series after auto-continue lookup. Empty Item.ID with nil Err means the finished book was the last in the series.
type SessionSyncedMsg ¶ added in v0.8.1
type SessionSyncedMsg struct {
SessionID string
NewSessionID string
CurrentTime float64
TimeListened float64
Err error
}
SessionSyncedMsg carries the result of a sync of the playback session. NewSessionID is the session that pine opened because the server did not have the session SessionID.
type SleepTimerExpiredMsg ¶
type SleepTimerExpiredMsg struct {
Generation uint64
}
SleepTimerExpiredMsg fires when the sleep timer reaches zero.
type SyncTickMsg ¶
type SyncTickMsg struct{}
SyncTickMsg fires every 30 seconds to sync playback progress with ABS.