Added README; cleaned up the repo
This commit is contained in:
33 files changed
+270
-9330
No files matched your search
+13
-36
@@ -15,6 +15,7 @@ import (
|
||||
"github.com/BeatGlow/beatglow/app"
|
||||
"github.com/BeatGlow/beatglow/app/font"
|
||||
"github.com/BeatGlow/beatglow/app/widget"
|
||||
"github.com/BeatGlow/beatglow/config"
|
||||
"github.com/BeatGlow/beatglow/player"
|
||||
|
||||
_ "embed"
|
||||
@@ -31,6 +32,7 @@ const (
|
||||
|
||||
type playing struct {
|
||||
base
|
||||
settings *config.Settings
|
||||
phonesWidget *widget.Text
|
||||
formatRate bool
|
||||
formatText string
|
||||
@@ -53,6 +55,7 @@ func Playing(ctx app.Context) app.Layout {
|
||||
styles := app.StylesFor(ctx.Display().ColorModel())
|
||||
layout := &playing{
|
||||
base: base{name: "playing"},
|
||||
settings: ctx.Settings(),
|
||||
phonesWidget: widget.NewText(image.Pt(10, 12)),
|
||||
formatText: formatTextPlaceholder,
|
||||
formatWidget: widget.NewText(image.Pt(2+len(formatTextPlaceholder)*9, 12)),
|
||||
@@ -129,46 +132,20 @@ func Playing(ctx app.Context) app.Layout {
|
||||
return layout
|
||||
}
|
||||
|
||||
/*
|
||||
func (l *playing) log() *logrus.Entry {
|
||||
return logrus.WithField("layout", "playing")
|
||||
}
|
||||
|
||||
|
||||
func (playing) String() string {
|
||||
return "playing"
|
||||
}
|
||||
|
||||
func (l *playing) Hide(ctx app.Context) {
|
||||
log := l.log()
|
||||
log.Debug("hide")
|
||||
for _, widget := range l.Widgets() {
|
||||
log.WithField("widget", widget.String()).Debug("hide widget")
|
||||
_ = widget.Hide(ctx)
|
||||
}
|
||||
}
|
||||
|
||||
func (l *playing) Show(ctx app.Context) {
|
||||
log := l.log()
|
||||
log.Debug("show")
|
||||
for _, widget := range l.Widgets() {
|
||||
log.WithField("widget", widget.String()).Debug("show widget")
|
||||
_ = widget.Show(ctx)
|
||||
channels := 2
|
||||
if l.settings.Spectrum.Mono {
|
||||
channels = 1
|
||||
}
|
||||
}
|
||||
|
||||
func (l *playing) Widgets() []app.Widget {
|
||||
return []app.Widget{
|
||||
l.phonesWidget,
|
||||
l.formatWidget,
|
||||
l.iconWidget,
|
||||
l.durationWidget,
|
||||
l.trackWidget,
|
||||
l.artWidget,
|
||||
l.spectrumWidget,
|
||||
}
|
||||
l.spectrumWidget.
|
||||
SetWaterfall(l.settings.Spectrum.Waterfall).
|
||||
SetChannels(channels).
|
||||
SetHold(int(l.settings.Spectrum.Hold)).
|
||||
SetRange(l.settings.Spectrum.MinFrequency, l.settings.Spectrum.MaxFrequency)
|
||||
|
||||
l.base.Show(ctx)
|
||||
}
|
||||
*/
|
||||
|
||||
func (l *playing) TrackChanged(ctx app.Context, track *player.Track) {
|
||||
if track == nil {
|
||||
|
||||
Reference in new issue
Block a user