Checkpoint
This commit is contained in:
160 files changed
+76293
-387
No files matched your search
+67
@@ -0,0 +1,67 @@
|
||||
package app
|
||||
|
||||
import (
|
||||
"image"
|
||||
|
||||
"github.com/BeatGlow/beatglow/player"
|
||||
"github.com/BeatGlow/display"
|
||||
)
|
||||
|
||||
type Layout interface {
|
||||
String() string
|
||||
|
||||
// Widgets used by this screen.
|
||||
Widgets() []Widget
|
||||
}
|
||||
|
||||
type Context interface {
|
||||
// Display is the display driver.
|
||||
Display() display.Display
|
||||
|
||||
// Player is the music player.
|
||||
Player() player.Player
|
||||
|
||||
// Track is the current track playing.
|
||||
Track() *player.Track
|
||||
}
|
||||
|
||||
type Widget interface {
|
||||
String() string
|
||||
|
||||
// Bounds is the bounding box.
|
||||
Bounds() image.Rectangle
|
||||
|
||||
// Move the drawable to a new position on the screen.
|
||||
Move(image.Point) Widget
|
||||
|
||||
// Resize changes the widget's size.
|
||||
Resize(image.Point) Widget
|
||||
|
||||
// Hide the drawable.
|
||||
Hide(Context) Widget
|
||||
|
||||
// Show the drawable.
|
||||
Show(Context) Widget
|
||||
|
||||
// IsVisible checks if the drawable is visible.
|
||||
IsVisible() bool
|
||||
|
||||
Refresh(Context) Widget
|
||||
}
|
||||
|
||||
type RotaryInputHandler interface {
|
||||
HandleRotary(delta int)
|
||||
}
|
||||
|
||||
type ButtonInputHandler interface {
|
||||
HandleButtonPress()
|
||||
HandleButtonLongPress()
|
||||
}
|
||||
|
||||
type StatusChangeHandler interface {
|
||||
StatusChanged(*player.Status)
|
||||
}
|
||||
|
||||
type TrackChangeHandler interface {
|
||||
TrackChanged(*player.Track)
|
||||
}
|
||||
Reference in new issue
Block a user