🚧 Fade in menu
This commit is contained in:
parent
d8e671d5ca
commit
d175360362
2 changed files with 81 additions and 18 deletions
28
app/run.go
28
app/run.go
|
|
@ -24,21 +24,6 @@ func quit() {
|
|||
os.Exit(0)
|
||||
}
|
||||
|
||||
func testTrim() {
|
||||
path := "/home/drj/MyFiles/Videos/WebShows/YouTube/Savannah_Outen/Love_Me_Like_You_Do_-_Ellie_Goulding_Cover_by_Savannah_Outen-tPYfBpRxXfI.mp4"
|
||||
file := SetFile(path)
|
||||
tmp, _ := os.CreateTemp("", "audio.*.mka")
|
||||
tmp.Close()
|
||||
// err := media.TrimWithFade(file, tmp.Name(), 0, 215.84, 0, 3)
|
||||
// err := media.Trim(file, tmp.Name(), 0, 215.84)
|
||||
err := media.TrimWithFade(file, tmp.Name(), 15.2, 70.84, 3.6, 8.4)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
fmt.Println(tmp.Name())
|
||||
quit()
|
||||
}
|
||||
|
||||
func Run(step AppStep) {
|
||||
for step < Quit {
|
||||
switch step {
|
||||
|
|
@ -56,16 +41,23 @@ func Run(step AppStep) {
|
|||
}
|
||||
case Watch:
|
||||
media.Watch(file.Format.Path)
|
||||
fade := boolean.Choose(fmt.Sprintf("Would you like to trim/fade %s?", file.ShortPath()))
|
||||
if fade {
|
||||
fadeAns := boolean.Choose(fmt.Sprintf("Would you like to trim/fade %s?", file.ShortPath()))
|
||||
if fadeAns {
|
||||
step = Fade
|
||||
} else {
|
||||
step = mainMenu()
|
||||
}
|
||||
case Fade:
|
||||
fadeFile()
|
||||
listenFaded := boolean.Choose(fmt.Sprintf("Would you like to listen to %s?", tmpfile.ShortPath()))
|
||||
if listenFaded {
|
||||
media.Watch(tmpfile.Format.Path)
|
||||
}
|
||||
step = mainMenu() // @todo ask to check new file
|
||||
case Quit:
|
||||
quit()
|
||||
default:
|
||||
step = mainMen()
|
||||
step = mainMenu()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue