3 struct CapturaSettings {
4 static var frameRate: Int {
5 UserDefaults.standard.integer(forKey: "frameRate")
8 static var outputFormats: OutputFormatSetting {
9 OutputFormatSetting(rawValue: UserDefaults.standard.integer(forKey: "outputFormats")) ?? .all
12 static var shouldSaveMp4: Bool {
13 outputFormats.shouldSaveMp4() || (shouldUseBackend && shouldUploadMp4)
16 static var shouldSaveGif: Bool {
17 outputFormats.shouldSaveGif() || (shouldUseBackend && shouldUploadGif)
20 static var shouldUploadGif: Bool {
21 backendFormat.shouldSaveGif()
24 static var shouldUploadMp4: Bool {
25 backendFormat.shouldSaveMp4()
28 static var shouldUseBackend: Bool {
32 static var backend: URL? {
33 if let url = UserDefaults.standard.string(forKey: "backendUrl") {
34 return URL(string: url)
39 static var backendFormat: OutputFormatSetting {
40 OutputFormatSetting(rawValue: UserDefaults.standard.integer(forKey: "backendFormat")) ?? .all
43 static var shouldKeepLocalFiles: Bool {
44 UserDefaults.standard.bool(forKey: "keepFiles")