feat: add -auto-transmit flag to start transmitting on connect

When -auto-transmit is passed, barnard automatically keys up the
microphone as soon as the connection sync completes. Useful for
testing, bots, and unattended operation.

Usage:
  barnard -auto-transmit -server=mumble.example.com -username=test_bot
This commit is contained in:
Brandon McGinty (deepseek)
2026-08-08 22:52:27 -04:00
committed by Brandon McGinty
parent 3ca57a847c
commit b861193306
3 changed files with 17 additions and 2 deletions
+12
View File
@@ -110,6 +110,18 @@ func (b *Barnard) OnConnect(e *gumble.ConnectEvent) {
b.AddOutputLine(fmt.Sprintf("Welcome message: %s", wmsg))
}
b.Ui.Refresh()
// Auto-start transmission if requested
if b.AutoTransmit && b.Stream != nil && !b.Tx {
err := b.Stream.StartSource(b.UserConfig.GetInputDevice())
if err != nil {
b.AddOutputLine(fmt.Sprintf("auto-transmit failed: %s", err.Error()))
} else {
b.Tx = true
b.UpdateGeneralStatus(" AutoTx ", true)
b.AddOutputLine("Auto-transmit started")
}
}
}
func (b *Barnard) OnDisconnect(e *gumble.DisconnectEvent) {