Documentation
¶
Index ¶
- type BackMsg
- type BookDetailLoadedMsg
- type EpisodesLoadedMsg
- type KeyMap
- type Model
- type NavigateMsg
- type PlaySessionData
- type PlaySessionMsg
- type PlaybackErrorMsg
- type PlaybackStoppedMsg
- type PlayerReadyMsg
- type QueueEntry
- type RestorePlaySessionMsg
- type RestoreSessionMsg
- type Screen
- 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 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
NextInQueue key.Binding
NextChapter key.Binding
PrevChapter key.Binding
SleepTimer 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 ¶
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.
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 PlaySessionData ¶
type PlaySessionData struct {
SessionID string
ItemID string
EpisodeID string
CurrentTime float64
Duration float64
Title string
Chapters []abs.Chapter
TrackStartOffset float64
TrackDuration float64
}
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 PlayerReadyMsg ¶
type PlayerReadyMsg struct{}
PlayerReadyMsg signals that mpv has been launched and connected.
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 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.