2 Copyright (C) 2024 Rubén Beltrán del Río
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see https://captura.tranquil.systems.
19 @objc(ConfigureCommand)
20 class ConfigureCommand: NSScriptCommand {
21 override func performDefaultImplementation() -> Any? {
23 let args = self.directParameter as? [String: Any] ?? [:]
25 // Here you can extract the parameters from the args dictionary and configure your settings
26 let fps = args["fps"] as? Int
27 let outputs = OutputFormatSetting(args["outputs"] as? String ?? "")
28 let backend = URL(string: args["backend"] as? String ?? "")
29 let backendOutput = OutputFormatSetting(args["backend_output"] as? String ?? "")
30 let keepLocalFiles = args["keep_local_files"] as? Bool
32 let config = ConfigureAction(
37 backendOutput: backendOutput,
38 keepLocalFiles: keepLocalFiles
41 NotificationCenter.default.post(
42 name: .setConfiguration, object: nil,
46 NotificationCenter.default.post(name: .reloadConfiguration, object: nil, userInfo: nil)
48 // Return a result if needed