]> git.r.bdr.sh - rbdr/captura/blob - Captura/Scripting/ScriptedPreferences.swift
72aa45ea2e34ed2d5ea159a9e28140bea7836e73
[rbdr/captura] / Captura / Scripting / ScriptedPreferences.swift
1 /*
2 Copyright (C) 2024 Rubén Beltrán del Río
3
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.
8
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.
13
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.
16 */
17
18 import Foundation
19
20 @objc(ScriptedPreferences)
21 class ScriptedPreferences: NSObject {
22 @objc dynamic var fps: Int {
23 get {
24 CapturaSettings.frameRate
25 }
26 set {
27 CapturaSettings.frameRate = newValue
28 }
29 }
30 @objc dynamic var outputs: String {
31 get {
32 CapturaSettings.outputFormats.toString()
33 }
34 set {
35 CapturaSettings.outputFormats = OutputFormatSetting(newValue) ?? .gifOnly
36 }
37 }
38
39 @objc dynamic var backend: String {
40 get {
41 CapturaSettings.backend?.absoluteString ?? ""
42 }
43 set {
44 CapturaSettings.backend = URL(string: newValue)
45 }
46 }
47
48 @objc dynamic var backend_output: String {
49 get {
50 CapturaSettings.backendFormat.toString()
51 }
52 set {
53 CapturaSettings.backendFormat = OutputFormatSetting(newValue) ?? .gifOnly
54 }
55 }
56
57 @objc dynamic var keep_local_files: Bool {
58 get {
59 CapturaSettings.shouldKeepLocalFiles
60 }
61 set {
62 CapturaSettings.shouldKeepLocalFiles = newValue
63 }
64 }
65 }