]>
Commit | Line | Data |
---|---|---|
5802c153 RBR |
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 | */ | |
a4e80427 RBR |
17 | import SwiftUI |
18 | ||
19 | struct OutputSettings: View { | |
20 | ||
e42019cd RBR |
21 | @AppStorage("outputFormats") var outputFormats: OutputFormatSetting = .all |
22 | @AppStorage("frameRate") var frameRate = 10.0 | |
377442f2 RBR |
23 | |
24 | private var anyState: String { "\(outputFormats), \(frameRate)" } | |
a4e80427 RBR |
25 | |
26 | var body: some View { | |
27 | Form { | |
c9b9e1d6 | 28 | VStack (alignment: .center) { |
a4e80427 RBR |
29 | LabeledContent("GIF Framerate") { |
30 | Slider(value: $frameRate, in: 4...10, step: 1) { | |
31 | Text("\(Int(frameRate))").font(.body).frame(width: 24) | |
32 | } minimumValueLabel: { | |
33 | Text("4") | |
34 | } maximumValueLabel: { | |
c9b9e1d6 | 35 | Text("10") |
a4e80427 RBR |
36 | } |
37 | }.font(.headline) | |
38 | Picker(selection: $outputFormats, label: Text("Output Formats").font(.headline)) { | |
39 | Text("GIF & MP4") | |
40 | .tag(OutputFormatSetting.all) | |
41 | .padding(.horizontal, 4.0) | |
42 | .padding(.vertical, 2.0) | |
43 | Text("Only GIF") | |
44 | .tag(OutputFormatSetting.gifOnly) | |
45 | .padding(.horizontal, 4.0) | |
46 | .padding(.vertical, 2.0) | |
47 | ||
48 | Text("Only MP4") | |
49 | .tag(OutputFormatSetting.mp4Only) | |
50 | .padding(.horizontal, 4.0) | |
51 | .padding(.vertical, 2.0) | |
52 | }.pickerStyle(.radioGroup) | |
53 | } | |
c9b9e1d6 | 54 | Spacer() |
a4e80427 | 55 | } |
377442f2 RBR |
56 | .onChange(of: anyState) { _ in |
57 | NotificationCenter.default.post(name: .reloadConfiguration, object: nil, userInfo: nil) | |
58 | } | |
a4e80427 RBR |
59 | } |
60 | } | |
61 | ||
62 | #Preview { | |
63 | OutputSettings() | |
64 | } |