|
|
|
@ -18,8 +18,7 @@ import (
|
|
|
|
|
const (
|
|
|
|
|
volumeBase = 2
|
|
|
|
|
|
|
|
|
|
version = "0.0.0"
|
|
|
|
|
versionInfo = `ditty - Audio player - v` + version + `
|
|
|
|
|
versionInfo = `ditty - Audio player - v0.0.0
|
|
|
|
|
https://gitlab.com/tslocum/ditty
|
|
|
|
|
The MIT License (MIT)
|
|
|
|
|
Copyright (c) 2020 Trevor Slocum <trevor@rocketnine.space>
|
|
|
|
@ -27,16 +26,18 @@ Copyright (c) 2020 Trevor Slocum <trevor@rocketnine.space>
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
var (
|
|
|
|
|
configPath string
|
|
|
|
|
printVersionInfo bool
|
|
|
|
|
bufferSize time.Duration
|
|
|
|
|
debugAddress string
|
|
|
|
|
cpuProfile string
|
|
|
|
|
streamFdInt int
|
|
|
|
|
streamFd *os.File
|
|
|
|
|
restrictLibrary string
|
|
|
|
|
|
|
|
|
|
done = make(chan bool)
|
|
|
|
|
configPath string
|
|
|
|
|
printVersionInfo bool
|
|
|
|
|
bufferSize time.Duration
|
|
|
|
|
debugAddress string
|
|
|
|
|
cpuProfile string
|
|
|
|
|
streamFdInt int
|
|
|
|
|
streamFd *os.File
|
|
|
|
|
restrictLibrary string
|
|
|
|
|
showHiddenFolders bool
|
|
|
|
|
|
|
|
|
|
version = "0.0.0"
|
|
|
|
|
done = make(chan bool)
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func exit() {
|
|
|
|
@ -52,11 +53,12 @@ func main() {
|
|
|
|
|
flag.StringVar(&restrictLibrary, "restrict-library", "", "restrict library to path")
|
|
|
|
|
flag.DurationVar(&bufferSize, "buffer-size", defaultBufferSize, "audio buffer size")
|
|
|
|
|
flag.StringVar(&debugAddress, "debug-address", "", "address to serve debug info")
|
|
|
|
|
flag.BoolVar(&showHiddenFolders, "hidden-folders", false, "show hidden folders")
|
|
|
|
|
flag.StringVar(&cpuProfile, "cpu-profile", "", "path to save CPU profiling")
|
|
|
|
|
flag.Parse()
|
|
|
|
|
|
|
|
|
|
if printVersionInfo {
|
|
|
|
|
fmt.Print(versionInfo)
|
|
|
|
|
fmt.Print(strings.Replace(versionInfo, "0.0.0", version, 1))
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|