X-Git-Url: https://git.r.bdr.sh/rbdr/captura/blobdiff_plain/ba17de891507da74fb07423803fd636a4457354c..refs/heads/rbdr-multimonitor:/Captura/Data/CapturaURLDecoder.swift diff --git a/Captura/Data/CapturaURLDecoder.swift b/Captura/Data/CapturaURLDecoder.swift index 3fa6412..f4c325b 100644 --- a/Captura/Data/CapturaURLDecoder.swift +++ b/Captura/Data/CapturaURLDecoder.swift @@ -25,6 +25,8 @@ protocol RecordActionProtocol { var backendOutput: OutputFormatSetting? { get } var keepLocalFiles: Bool? { get } var autoStart: Bool? { get } + var skipBackend: Bool { get } + var maxLength: Int? { get } } // The concrete implementations @@ -51,6 +53,8 @@ struct RecordAction: RecordActionProtocol { var backendOutput: OutputFormatSetting? var keepLocalFiles: Bool? var autoStart: Bool? + var skipBackend: Bool + var maxLength: Int? } enum CapturaAction { @@ -113,15 +117,28 @@ struct CapturaURLDecoder { let keepLocalFiles = Bool(paramsDict["keep_local_files"] as? String ?? "") let outputs = OutputFormatSetting(paramsDict["outputs"] as? String ?? "") var backendOutput = OutputFormatSetting(paramsDict["backend_output"] as? String ?? "") + let autoStart = Bool(paramsDict["auto_start"] as? String ?? "") + var maxLength = Int(paramsDict["max_length"] as? String ?? "") if fps != nil { fps = min(10, max(4, fps!)) } + if maxLength != nil { + maxLength = min(300, max(1, fps!)) + } + if backendOutput == .all { backendOutput = .gifOnly } + var skipBackend = false + if let backendString = paramsDict["backend"] as? String { + if backendString == "" { + skipBackend = true + } + } + return .record(RecordAction( action: action, x: x, @@ -134,7 +151,10 @@ struct CapturaURLDecoder { outputs: outputs, backend: backend, backendOutput: backendOutput, - keepLocalFiles: keepLocalFiles + keepLocalFiles: keepLocalFiles, + autoStart: autoStart, + skipBackend: skipBackend, + maxLength: maxLength )) default: