-
Notifications
You must be signed in to change notification settings - Fork 7
/
data.go
81 lines (69 loc) · 1.57 KB
/
data.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
package main
import (
"fmt"
"gopkg.in/vansante/go-ffprobe.v2"
)
type Anime struct {
Name string
Length int64
Size int64
Width int
Height int
FrameRate float64
TotalFrames int
HasSubtitlesStream bool
Streams []*ffprobe.Stream
PixelFormat string
Path string
Status AnimeStatus
}
type Gui struct {
CurrentSpeed string
Eta string
Progress float32
ProgressLabel string
TotalProgress string
ButtonLabel string
Logs string
}
type Shader struct {
Name string
Path string
}
type Encoder struct {
Name string
FfmpegValue string
Vendor string
}
type Resolution struct {
Width int
Height int
Panoramic bool
}
type AnimeStatus string
const (
Waiting AnimeStatus = "Waiting"
Processing AnimeStatus = "Processing"
Finished AnimeStatus = "Finished"
Error AnimeStatus = "Error"
NotStarted AnimeStatus = "Not started"
)
func (res *Resolution) Format() string {
if !res.Panoramic {
return fmt.Sprintf("%dx%d (4:3)", res.Width, res.Height)
}
return fmt.Sprintf("%dx%d", res.Width, res.Height)
}
func removeAnime(index int) {
anime := animeList[index]
animeList = append(animeList[:index], animeList[index+1:]...)
resetUI()
logMessage(fmt.Sprintf("Removed %s from queue", anime.Name), false)
}
func addEncoders(vendor string) {
for _, encoder := range allEncoders {
if encoder.Vendor == vendor || encoder.Vendor == "cpu" {
availableEncoders = append(availableEncoders, encoder)
}
}
}