Add simple yes/no interface

This commit is contained in:
Dan Jones 2023-09-03 22:39:40 -05:00
commit 433f49e9e0
5 changed files with 75 additions and 6 deletions

View file

@ -8,6 +8,7 @@ import (
"os"
"codeberg.org/danjones000/strip-beats/files"
"codeberg.org/danjones000/strip-beats/input/boolean"
"codeberg.org/danjones000/strip-beats/media"
"github.com/spf13/cobra"
)
@ -22,9 +23,12 @@ var rootCmd = &cobra.Command{
file := files.PickRandomFile()
out := media.ProbeFile(file)
fmt.Printf("%+v\n", out)
media.Watch(out.Format.Path)
stream := media.SelectAudioStream(out)
fmt.Printf("Stream %d of %s: %+v\n", stream, out.Format.Path, out.Streams[stream])
// media.Watch(out.Format.Path)
show := boolean.Choose("Show stream?")
if show {
stream := media.SelectAudioStream(out)
fmt.Printf("Stream %d of %s: %+v\n", stream, out.Format.Path, out.Streams[stream])
}
},
}
@ -46,5 +50,5 @@ func init() {
// Cobra also supports local flags, which will only run
// when this action is called directly.
rootCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
// rootCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
}