This repository has been archived by the owner on Jan 2, 2020. It is now read-only.
/
main.go
59 lines (53 loc) · 1.42 KB
/
main.go
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
47
48
49
50
51
52
53
54
55
56
57
58
59
package main
import (
"flag"
"github.com/asticode/go-astiffmpeg"
"github.com/asticode/go-astiffprobe"
"github.com/asticode/go-astilectron"
"github.com/asticode/go-astilectron-bootstrap"
"github.com/asticode/go-astilog"
)
// Vars
var (
AppName string
BuiltAt string
c Configuration
ffmpeg *astiffmpeg.FFMpeg
ffprobe *astiffprobe.FFProbe
)
// TODO Add subtitle actions => add / convert
func main() {
// Init
flag.Parse()
c = newConfiguration()
astilog.SetLogger(astilog.New(c.Logger))
ffmpeg = astiffmpeg.New(c.FFMpeg)
ffprobe = astiffprobe.New(c.FFProbe)
// TODO Provision ffprobe + ffmpeg =>
// - Linux: https://www.johnvansickle.com/ffmpeg/
// - Mac: https://evermeet.cx/ffmpeg/
// - Windows: https://ffmpeg.zeranoe.com/builds/
// Run bootstrap
if err := bootstrap.Run(bootstrap.Options{
Asset: Asset,
AstilectronOptions: astilectron.Options{
AppName: AppName,
AppIconDarwinPath: "resources/gopher.icns",
AppIconDefaultPath: "resources/gopher.png",
},
Debug: true,
RestoreAssets: RestoreAssets,
Windows: []*bootstrap.Window{{
Homepage: "index.html",
MessageHandler: handleMessages,
Options: &astilectron.WindowOptions{
BackgroundColor: astilectron.PtrStr("#333"),
Center: astilectron.PtrBool(true),
Height: astilectron.PtrInt(600),
Width: astilectron.PtrInt(600),
},
}},
}); err != nil {
astilog.Fatal(err)
}
}