diff --git a/.tool-versions b/.tool-versions new file mode 100644 index 0000000..83d3f70 --- /dev/null +++ b/.tool-versions @@ -0,0 +1 @@ +golang 1.21.4 diff --git a/main.go b/main.go index 62bca0f..99aa35a 100644 --- a/main.go +++ b/main.go @@ -133,10 +133,16 @@ func main() { radiospiral_label, nowplaying_label, widget.NewButton("Play", func() { - nowplaying_label.SetText("Playing!") - mplayer.Play("http://radiospiral.radio/stream.mp3") + if !mplayer.is_playing { + nowplaying_label.SetText("Playing!") + mplayer.Play("http://radiospiral.radio/stream.mp3") + } else { + nowplaying_label.SetText("Stopped") + mplayer.Pause() + } }), )) window.ShowAndRun() + mplayer.Close() }