🚸 Add main menu
This commit is contained in:
parent
5b2896c032
commit
d8e671d5ca
4 changed files with 83 additions and 28 deletions
13
app/run.go
13
app/run.go
|
|
@ -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()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue