aboutsummaryrefslogtreecommitdiff
path: root/Captura/Domain
diff options
context:
space:
mode:
Diffstat (limited to 'Captura/Domain')
-rw-r--r--Captura/Domain/CaptureSessionConfiguration.swift36
1 files changed, 36 insertions, 0 deletions
diff --git a/Captura/Domain/CaptureSessionConfiguration.swift b/Captura/Domain/CaptureSessionConfiguration.swift
index 69c1ebf..c2ebe75 100644
--- a/Captura/Domain/CaptureSessionConfiguration.swift
+++ b/Captura/Domain/CaptureSessionConfiguration.swift
@@ -6,6 +6,14 @@ struct CaptureSessionConfiguration {
let backendFormat: OutputFormatSetting
let backend: URL?
let shouldKeepLocalFiles: Bool
+ let x: Int?
+ let y: Int?
+ let width: Int?
+ let height: Int?
+ let preventMove: Bool
+ let preventResize: Bool
+ let autoStart: Bool
+ let maxLength: Int
init(
frameRate: Int? = nil,
@@ -19,6 +27,34 @@ struct CaptureSessionConfiguration {
self.backendFormat = backendFormat ?? CapturaSettings.backendFormat
self.backend = backend ?? CapturaSettings.backend
self.shouldKeepLocalFiles = shouldKeepLocalFiles ?? CapturaSettings.shouldKeepLocalFiles
+ x = nil
+ y = nil
+ width = nil
+ height = nil
+ preventMove = false
+ preventResize = false
+ autoStart = false
+ maxLength = 300
+ }
+
+ init(from action: RecordAction) {
+ self.frameRate = action.fps ?? CapturaSettings.frameRate
+ self.outputFormats = action.outputs ?? CapturaSettings.outputFormats
+ self.backendFormat = action.backendOutput ?? CapturaSettings.backendFormat
+ if action.skipBackend {
+ self.backend = nil
+ } else {
+ self.backend = action.backend ?? CapturaSettings.backend
+ }
+ self.shouldKeepLocalFiles = action.keepLocalFiles ?? CapturaSettings.shouldKeepLocalFiles
+ self.x = action.x
+ self.y = action.y
+ self.width = action.width
+ self.height = action.height
+ preventMove = action.preventMove ?? false
+ preventResize = action.preventResize ?? false
+ autoStart = action.autoStart ?? false
+ maxLength = action.maxLength ?? 300
}
var shouldSaveMp4: Bool {