Added Title To progressBar
The progressBar now has title which displays the Current Status.
This commit is contained in:
16
utils.go
16
utils.go
@@ -28,7 +28,7 @@ func insertAt(inputString, stringTobeInserted string, index int) string{
|
||||
}
|
||||
|
||||
func getText(width , percentage float64, eta string) string{
|
||||
q := "[#000000:#ffffff]"
|
||||
q := "[#000000:#ffffff:bl]"
|
||||
var a string
|
||||
a += strings.Repeat(" ", int(width) - len(eta))
|
||||
a = insertAt(a, eta, int(width/2) - 10)
|
||||
@@ -36,3 +36,17 @@ func getText(width , percentage float64, eta string) string{
|
||||
q += a
|
||||
return q
|
||||
}
|
||||
|
||||
func formatString(a interface{}) string {
|
||||
if a == "play" {
|
||||
return "Playing"
|
||||
} else if a == "1" {
|
||||
return "On"
|
||||
} else if a == "0" {
|
||||
return "Off"
|
||||
} else if a == "stop" {
|
||||
return "Stopped"
|
||||
} else {
|
||||
return "Paused"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user