var remoteFiles: [CapturaRemoteFile] = []
var captureSessionConfiguration: CaptureSessionConfiguration = CaptureSessionConfiguration()
+ @objc var scriptedPreferences: ScriptedPreferences?
+
func applicationDidFinishLaunching(_ notification: Notification) {
setupStatusBar()
NotificationCenter.default.addObserver(
object: nil)
closeWindow()
fetchRemoteItems()
+
+ scriptedPreferences = ScriptedPreferences()
}
// MARK: - Setup Functions
case let .configure(config):
CapturaSettings.apply(config)
case let .record(config):
- captureSessionConfiguration = CaptureSessionConfiguration(from: config)
+ let config = CaptureSessionConfiguration(from: config)
+ NotificationCenter.default.post(name: .startAreaSelection, object: nil, userInfo: [
+ "config": config
+ ])
NotificationCenter.default.post(name: .startAreaSelection, object: nil, userInfo: nil)
}
}
if let frame = notification.userInfo?["frame"] {
receivedFrame(frame as! CVImageBuffer)
}
+ case .reloadConfiguration:
+ reloadConfiguration()
+ case .setCaptureSessionConfiguration:
+ if let userInfo = notification.userInfo {
+ if let config = userInfo["config"] as? RecordAction {
+ setCaptureSessionConfiguration(config)
+ }
+ }
case .NSManagedObjectContextObjectsDidChange:
DispatchQueue.main.async {
self.fetchRemoteItems()
}
}
+ func reloadConfiguration() {
+ self.captureSessionConfiguration = CaptureSessionConfiguration()
+ }
+
+ func setCaptureSessionConfiguration(_ config: RecordAction) {
+ self.captureSessionConfiguration = CaptureSessionConfiguration(from: config)
+ }
+
// MARK: - CoreData
private func fetchRemoteItems() {