-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.go
More file actions
46 lines (40 loc) · 1.1 KB
/
main.go
File metadata and controls
46 lines (40 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package main
import (
"context"
"flag"
"log/slog"
"os"
"time"
"github.com/Dekr0/wwise-teller/automation"
"github.com/Dekr0/wwise-teller/db"
"github.com/Dekr0/wwise-teller/ui"
"github.com/Dekr0/wwise-teller/utils"
"github.com/Dekr0/wwise-teller/waapi"
)
func main() {
proc := flag.String("proc", "", "Filepath to sound bank processor pipelines specification")
procDeadline := flag.Uint64("deadline", 16, "Deadline in seconds of running sound bank processor pipelines")
flag.Parse()
if *proc != "" {
defer utils.CleanTmp()
utils.InitTmp()
if err := db.InitDatabase(); err != nil {
slog.Error("Failed to initialize Wwise sound bank database", "error", err)
os.Exit(1)
}
if *procDeadline == 0 {
automation.Process(context.Background(), *proc)
} else {
ctx, cancel := context.WithTimeout(context.Background(), time.Second * time.Duration(*procDeadline))
defer cancel()
automation.Process(ctx, *proc)
}
return
}
if err := ui.Run(); err != nil {
slog.Error("Failed to launch GUI", "error", err)
}
slog.Info("Application Closed")
utils.CleanTmp()
waapi.CleanWEMCache()
}