🚸 Add main menu

This commit is contained in:
Dan Jones 2023-09-08 11:00:07 -05:00
commit d8e671d5ca
4 changed files with 83 additions and 28 deletions

View file

@ -13,6 +13,7 @@ type AppStep int
const (
Pick AppStep = iota
Watch
Fade
Restart
Quit
)
@ -39,7 +40,6 @@ func testTrim() {
}
func Run(step AppStep) {
testTrim()
for step < Quit {
switch step {
case Pick:
@ -51,12 +51,21 @@ func Run(step AppStep) {
watch := boolean.Choose(fmt.Sprintf("Would you like to watch %s?", file.ShortPath()))
if watch {
step = Watch
} else {
step = mainMenu()
}
case Watch:
media.Watch(file.Format.Path)
step = Quit // @todo
fade := boolean.Choose(fmt.Sprintf("Would you like to trim/fade %s?", file.ShortPath()))
if fade {
step = Fade
} else {
step = mainMenu()
}
case Quit:
quit()
default:
step = mainMen()
}
}
}