aboutsummaryrefslogtreecommitdiff
path: root/Captura/Domain/CaptureSessionConfiguration.swift
diff options
context:
space:
mode:
authorRuben Beltran del Rio <git@r.bdr.sh>2024-09-16 11:07:46 +0200
committerRuben Beltran del Rio <git@r.bdr.sh>2024-09-16 11:07:46 +0200
commit505c1e620497828ffb914e05dd76d9ab124f144a (patch)
tree0d93162c4228dbee9e29c35e9f97f58daa5e3eef /Captura/Domain/CaptureSessionConfiguration.swift
parent5802c153cae64142d84e3cd5f762939501ee7e53 (diff)
Format the code
Diffstat (limited to 'Captura/Domain/CaptureSessionConfiguration.swift')
-rw-r--r--Captura/Domain/CaptureSessionConfiguration.swift14
1 files changed, 7 insertions, 7 deletions
diff --git a/Captura/Domain/CaptureSessionConfiguration.swift b/Captura/Domain/CaptureSessionConfiguration.swift
index c2ebe75..673db5f 100644
--- a/Captura/Domain/CaptureSessionConfiguration.swift
+++ b/Captura/Domain/CaptureSessionConfiguration.swift
@@ -14,7 +14,7 @@ struct CaptureSessionConfiguration {
let preventResize: Bool
let autoStart: Bool
let maxLength: Int
-
+
init(
frameRate: Int? = nil,
outputFormats: OutputFormatSetting? = nil,
@@ -36,7 +36,7 @@ struct CaptureSessionConfiguration {
autoStart = false
maxLength = 300
}
-
+
init(from action: RecordAction) {
self.frameRate = action.fps ?? CapturaSettings.frameRate
self.outputFormats = action.outputs ?? CapturaSettings.outputFormats
@@ -56,23 +56,23 @@ struct CaptureSessionConfiguration {
autoStart = action.autoStart ?? false
maxLength = action.maxLength ?? 300
}
-
+
var shouldSaveMp4: Bool {
outputFormats.shouldSaveMp4() || (shouldUseBackend && shouldUploadMp4)
}
-
+
var shouldSaveGif: Bool {
outputFormats.shouldSaveGif() || (shouldUseBackend && shouldUploadGif)
}
-
+
var shouldUploadGif: Bool {
backendFormat.shouldSaveGif()
}
-
+
var shouldUploadMp4: Bool {
backendFormat.shouldSaveMp4()
}
-
+
var shouldUseBackend: Bool {
backend != nil
}