]> git.r.bdr.sh - rbdr/captura/blame_incremental - Captura/Data/OutputFormatSetting.swift
Remove SwiftData references
[rbdr/captura] / Captura / Data / OutputFormatSetting.swift
... / ...
CommitLineData
1import Foundation
2
3enum OutputFormatSetting: Int {
4 case gifOnly = 0
5 case mp4Only = 1
6 case all = 2
7
8 init?(_ string: String) {
9 switch(string) {
10 case "gif":
11 self = .gifOnly
12 case "mp4":
13 self = .mp4Only
14 case "all":
15 self = .all
16 default:
17 return nil
18 }
19 }
20
21 func shouldSaveGif() -> Bool {
22 return self == .gifOnly || self == .all
23 }
24
25 func shouldSaveMp4() -> Bool {
26 return self == .mp4Only || self == .all
27 }
28
29 func toString() -> String {
30 switch(self) {
31 case .gifOnly:
32 return "gif"
33 case .mp4Only:
34 return "mp4"
35 case .all:
36 return "all"
37 }
38 }
39}