Checkpoint
This commit is contained in:
223 files changed
+14770
-18352
No files matched your search
+27
-7
@@ -3,13 +3,22 @@ package app
|
||||
import (
|
||||
"image"
|
||||
|
||||
"github.com/BeatGlow/beatglow/player"
|
||||
"github.com/BeatGlow/audio"
|
||||
"github.com/BeatGlow/display"
|
||||
|
||||
"github.com/BeatGlow/beatglow/config"
|
||||
"github.com/BeatGlow/beatglow/player"
|
||||
)
|
||||
|
||||
type Layout interface {
|
||||
String() string
|
||||
|
||||
// Hide the layout
|
||||
Hide(Context)
|
||||
|
||||
// Show the layout.
|
||||
Show(Context)
|
||||
|
||||
// Widgets used by this screen.
|
||||
Widgets() []Widget
|
||||
}
|
||||
@@ -23,6 +32,12 @@ type Context interface {
|
||||
|
||||
// Track is the current track playing.
|
||||
Track() *player.Track
|
||||
|
||||
// Show switches layout.
|
||||
Show(Layout)
|
||||
|
||||
// Settings are the user settings.
|
||||
Settings() *config.Settings
|
||||
}
|
||||
|
||||
type Widget interface {
|
||||
@@ -46,22 +61,27 @@ type Widget interface {
|
||||
// IsVisible checks if the drawable is visible.
|
||||
IsVisible() bool
|
||||
|
||||
Refresh(Context) Widget
|
||||
// Refresh redraws the widget if it's in view.
|
||||
Refresh(Context) bool
|
||||
}
|
||||
|
||||
type RotaryInputHandler interface {
|
||||
HandleRotary(delta int)
|
||||
HandleRotary(ctx Context, delta int)
|
||||
}
|
||||
|
||||
type ButtonInputHandler interface {
|
||||
HandleButtonPress()
|
||||
HandleButtonLongPress()
|
||||
HandleButtonPress(Context)
|
||||
HandleButtonLongPress(Context)
|
||||
}
|
||||
|
||||
type StatusChangeHandler interface {
|
||||
StatusChanged(*player.Status)
|
||||
StatusChanged(Context, *player.Status)
|
||||
}
|
||||
|
||||
type TrackChangeHandler interface {
|
||||
TrackChanged(*player.Track)
|
||||
TrackChanged(Context, *player.Track)
|
||||
}
|
||||
|
||||
type BufferProcessor interface {
|
||||
ProcessBuffer(audio.Buffer[float64])
|
||||
}
|
||||
Reference in new issue
Block a user