]> git.r.bdr.sh - rbdr/captura/blob - Captura/Data/SettingsStructs.swift
16172cad331e17fe0d5e57c72b149d11d2f15d08
[rbdr/captura] / Captura / Data / SettingsStructs.swift
1 import Foundation
2
3 enum 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 }