48 lines
925 B
Go
48 lines
925 B
Go
package main
|
|
|
|
// with this tool you can setup a pipewire audio configuration
|
|
// you can select the bitrate and the buffersize for your audiocard
|
|
// you need ncurses to be installed on your system
|
|
|
|
import (
|
|
"log"
|
|
|
|
gc "github.com/rthornton128/goncurses"
|
|
)
|
|
|
|
func main() {
|
|
|
|
// setup main window
|
|
stdscr, err := gc.Init()
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
defer gc.End()
|
|
gc.Echo(false)
|
|
|
|
if !gc.HasColors() {
|
|
log.Fatal("Example requires a colour capable terminal")
|
|
}
|
|
if err := gc.StartColor(); err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
if err := gc.InitPair(1, gc.C_BLACK, gc.C_CYAN); err != nil {
|
|
log.Fatal("InitPair failed: ", err)
|
|
}
|
|
|
|
stdscr.Keypad(true)
|
|
stdscr.ColorOn(1)
|
|
stdscr.SetBackground(gc.Char(' ') | gc.ColorPair(1))
|
|
stdscr.Box(gc.ACS_VLINE, gc.ACS_HLINE)
|
|
// Window title
|
|
stdscr.MovePrint(0, 2, " Pipewire setup utility ")
|
|
stdscr.Refresh()
|
|
|
|
// Main loop
|
|
stdscr.GetChar()
|
|
|
|
// end
|
|
stdscr.ColorOff(1)
|
|
|
|
}
|