Commit aafe81b4 authored by Trevor Slocum's avatar Trevor Slocum

Add --disable-mouse option

parent 3ed0a1ee
Pipeline #113355655 passed with stages
in 2 minutes and 24 seconds
0.1.7:
- Add scrollbar to lists
- Add --disable-mouse option
0.1.6:
- Add mouse support to queue
......
......@@ -4,8 +4,9 @@ configuration options and their defaults.
# Options
* **--buffer-size** Audio buffer size, defaults to 500ms.
* **--autoplay-queue** Start playing when the queue is added to.
* **--restrict-library** Restrict access to a folder and its subfolders.
* **--disable-autoplay** Disable automatically playing the queue.
* **--disable-mouse** Disable mouse support.
* **--fd** Write audio in WAV format to the specified file descriptor instead. This allows ditty to be used over ssh:
* `ssh ditty.rocketnine.space -t 'ditty --fd=2' 2> >(aplay --quiet)`
* Note: Writing to a file descriptor disables pause support.
......
......@@ -59,7 +59,9 @@ var (
func initTUI() error {
app = cview.NewApplication()
app.EnableMouse()
if !disableMouse {
app.EnableMouse()
}
app.SetInputCapture(inputConfig.Capture)
......
......@@ -133,7 +133,7 @@ func listQueue() {
queueFiles = append(queueFiles, scanFiles...)
queueLock.Unlock()
if playOnQueue && playingFileID == 0 && len(queueFiles) > 0 {
if !disableAutoplay && playingFileID == 0 && len(queueFiles) > 0 {
queueSelect()
}
go app.QueueUpdateDraw(updateQueue)
......@@ -145,7 +145,7 @@ func listQueue() {
queueFiles = append(queueFiles, entry)
if playOnQueue && playingFileID == 0 {
if !disableAutoplay && playingFileID == 0 {
queueSelect()
}
go app.QueueUpdateDraw(updateLists)
......
......@@ -36,7 +36,8 @@ var (
restrictLibrary string
showHiddenFolders bool
startingVolumeFlag int
playOnQueue bool
disableAutoplay bool
disableMouse bool
version = "0.0.0"
done = make(chan bool)
......@@ -54,7 +55,8 @@ func main() {
flag.IntVar(&streamFdInt, "fd", -1, "stream audio to file descriptor")
flag.IntVar(&startingVolumeFlag, "volume", -1, "initial volume level 0-100")
flag.StringVar(&restrictLibrary, "restrict-library", "", "restrict library to path")
flag.BoolVar(&playOnQueue, "autoplay-queue", true, "starting playing on initial queue")
flag.BoolVar(&disableAutoplay, "disable-autoplay", false, "disable automatically playing the queue")
flag.BoolVar(&disableMouse, "disable-mouse", false, "disable mouse support")
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")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment