aboutsummaryrefslogtreecommitdiff
path: root/ui.go
diff options
context:
space:
mode:
authorlawl <github@dumbinter.net>2020-08-02 11:40:44 +0200
committerlawl <github@dumbinter.net>2020-08-02 11:40:44 +0200
commit4243d5036d1e7d339ca8ee3ff8a0be88a9f0d92c (patch)
tree7d5264c8d992d3ff12bf337352b0e640aa95e5e7 /ui.go
parentc07c021e49beb828c140e6b6e8961653b957e052 (diff)
downloadnoisetorch-4243d5036d1e7d339ca8ee3ff8a0be88a9f0d92c.tar.gz
noisetorch-4243d5036d1e7d339ca8ee3ff8a0be88a9f0d92c.zip
Don't fail to display UI when pa connection fails
Additionaly we now re-establish the connection if it fails while we are already running.
Diffstat (limited to 'ui.go')
-rw-r--r--ui.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/ui.go b/ui.go
index d4334fa..0b5b7e3 100644
--- a/ui.go
+++ b/ui.go
@@ -50,6 +50,11 @@ func updatefn(w *nucular.Window, ui *uistate) {
return
}
+ if !ui.paClient.Connected() {
+ connectScreen(w, ui)
+ return
+ }
+
w.MenubarBegin()
w.Row(10).Dynamic(2)
@@ -260,3 +265,8 @@ func versionScreen(w *nucular.Window, ui *uistate) {
ui.versionScreen = false
}
}
+
+func connectScreen(w *nucular.Window, ui *uistate) {
+ w.Row(50).Dynamic(1)
+ w.Label("Connecting to pulseaudio...", "CB")
+}