Fix bugs with pa reconnection

pull/56/head 0.6.1-beta
lawl 4 years ago
parent 4243d5036d
commit 371b3e33b5

@ -101,6 +101,7 @@ func removeLib(file string) {
func paConnectionWatchdog(ui *uistate) {
for {
if ui.paClient.Connected() {
time.Sleep(500 * time.Millisecond)
continue
}
@ -139,6 +140,8 @@ func paConnectionWatchdog(ui *uistate) {
ui.inputList = inputs
resetUI(ui)
time.Sleep(500 * time.Millisecond)
}
}

18
ui.go

@ -35,6 +35,11 @@ var orange = color.RGBA{255, 140, 0, 255}
func updatefn(w *nucular.Window, ui *uistate) {
if !ui.paClient.Connected() {
connectScreen(w, ui)
return
}
if ui.loadingScreen {
loadingScreen(w, ui)
return
@ -50,11 +55,6 @@ func updatefn(w *nucular.Window, ui *uistate) {
return
}
if !ui.paClient.Connected() {
connectScreen(w, ui)
return
}
w.MenubarBegin()
w.Row(10).Dynamic(2)
@ -270,3 +270,11 @@ func connectScreen(w *nucular.Window, ui *uistate) {
w.Row(50).Dynamic(1)
w.Label("Connecting to pulseaudio...", "CB")
}
func resetUI(ui *uistate) {
ui.loadingScreen = false
if ui.masterWindow != nil {
(*ui.masterWindow).Changed()
}
}

Loading…
Cancel
Save