Documentation ¶
Index ¶
- Constants
- Variables
- func Frame(fps float64) tea.Cmd
- type FrameMsg
- type Frames
- type KeyMap
- type Rave
- func (m *Rave) Desync() tea.Cmd
- func (rave *Rave) Init() tea.Cmd
- func (sched *Rave) Progress(now time.Time) (int, float64)
- func (rave *Rave) SpotifyCallbackURL() string
- func (m *Rave) Sync() tea.Cmd
- func (rave *Rave) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (rave *Rave) View() string
- func (rave *Rave) ViewFancy() string
- func (rave *Rave) ViewFrame(frames Frames) (string, time.Time, int)
- type SetFPSMsg
- type Spinner
- type Vterm
- func (term *Vterm) Bytes(offset, height int) []byte
- func (term *Vterm) Init() tea.Cmd
- func (term *Vterm) Print(w io.Writer) error
- func (term *Vterm) ScrollPercent() float64
- func (term *Vterm) SetHeight(height int)
- func (term *Vterm) SetPrefix(prefix string)
- func (term *Vterm) SetWidth(width int)
- func (term *Vterm) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (term *Vterm) UsedHeight() int
- func (term *Vterm) View() string
- func (term *Vterm) Write(p []byte) (int, error)
Constants ¶
View Source
const DefaultBPM = 123
DefaultBPM is a sane default of 123 beats per minute.
View Source
const FramesPerBeat = 10
FramesPerBeat determines the granularity that the spinner's animation timing for each beat, i.e. 10 for tenths of a second.
Variables ¶
View Source
var FadeFrames = [FramesPerBeat]string{
0: "█",
1: "█",
2: "▓",
3: "▓",
4: "▒",
5: "▒",
6: "░",
7: "░",
8: " ",
9: " ",
}
View Source
var Keys = KeyMap{ Help: key.NewBinding( key.WithKeys("?"), key.WithHelp("?", "help"), ), Quit: key.NewBinding( key.WithKeys("q", "esc", "ctrl+c"), key.WithHelp("q", "quit"), ), Debug: key.NewBinding( key.WithKeys("d"), key.WithHelp("d", "debug ui"), ), Rave: key.NewBinding( key.WithKeys("r"), key.WithHelp("r", "rave"), ), EndRave: key.NewBinding( key.WithKeys("R"), key.WithHelp("R", "end rave"), ), ForwardRave: key.NewBinding( key.WithKeys("+", "="), key.WithHelp("+/=", "seek forward"), ), BackwardRave: key.NewBinding( key.WithKeys("-"), key.WithHelp("-", "seek backward"), ), Up: key.NewBinding( key.WithKeys("up", "k"), key.WithHelp("↑/k", "move up"), ), Down: key.NewBinding( key.WithKeys("down", "j"), key.WithHelp("↓/j", "move down"), ), Home: key.NewBinding( key.WithKeys("home"), key.WithHelp("home", "go to top"), ), End: key.NewBinding( key.WithKeys("end"), key.WithHelp("end", "go to bottom"), ), PageDown: key.NewBinding( key.WithKeys("pgdown"), key.WithHelp("pgdn", "page down"), ), PageUp: key.NewBinding( key.WithKeys("pgup"), key.WithHelp("pgup", "page up"), ), }
View Source
var MeterFrames = [FramesPerBeat]string{
0: "█",
1: "█",
2: "▇",
3: "▆",
4: "▅",
5: "▄",
6: "▃",
7: "▂",
8: "▁",
9: " ",
}
Functions ¶
Types ¶
type KeyMap ¶
type Rave ¶
type Rave struct { // Show extra details useful for debugging a desynced rave. ShowDetails bool // Address (host:port) on which to listen for auth callbacks. AuthCallbackAddr string // Configuration for syncing with Spotify. SpotifyAuth *spotifyauth.Authenticator // File path where tokens will be cached. SpotifyTokenPath string // The animation to display. Frames Frames // contains filtered or unexported fields }
func (*Rave) SpotifyCallbackURL ¶
type Vterm ¶
type Vterm struct { Offset int Height int Width int Prefix string // contains filtered or unexported fields }
func (*Vterm) Bytes ¶ added in v0.4.1
Bytes returns the output for the given region of the terminal, with ANSI formatting.
func (*Vterm) ScrollPercent ¶
func (*Vterm) UsedHeight ¶
Click to show internal directories.
Click to hide internal directories.