Skip to content

Commit

Permalink
playing widget now has blinking lights
Browse files Browse the repository at this point in the history
  • Loading branch information
Grantley Cullar authored and Grantley Cullar committed Nov 17, 2022
1 parent 5acf548 commit 34629fc
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions internal/player.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,14 @@ func AudioPlayer(file string, name string) {
p.TitleStyle.Fg = ui.Color(TitleThemeColor)
p.BorderStyle.Fg = ui.Color(BorderThemeColor)

updateParagraph := func(count int) {
if count%2 == 0 {
p.TextStyle.Fg = ui.Color(TitleThemeColor)
} else {
p.TextStyle.Fg = ui.ColorWhite
}
}

posGauge := widgets.NewGauge()
posGauge.Title = "Position"
posGauge.Percent = 0
Expand Down Expand Up @@ -145,6 +153,8 @@ Back to Menu: [BACKSPACE]
c.SetRect(0, 12, 50, 19)
c.BorderStyle.Fg = ui.Color(BorderThemeColor)

tickerCount := 1
tickerCount++
uiEvents := ui.PollEvents()
ticker := time.NewTicker(time.Second).C

Expand Down Expand Up @@ -211,7 +221,9 @@ Back to Menu: [BACKSPACE]
Menu()
}
case <-ticker:
updateParagraph(tickerCount)
draw()
tickerCount++
}

//set max and min volume and speed
Expand Down

0 comments on commit 34629fc

Please sign in to comment.