]>
Commit | Line | Data |
---|---|---|
a4e80427 RBR |
1 | import SwiftUI |
2 | ||
3 | struct OutputSettings: View { | |
4 | ||
e42019cd RBR |
5 | @AppStorage("outputFormats") var outputFormats: OutputFormatSetting = .all |
6 | @AppStorage("frameRate") var frameRate = 10.0 | |
377442f2 RBR |
7 | |
8 | private var anyState: String { "\(outputFormats), \(frameRate)" } | |
a4e80427 RBR |
9 | |
10 | var body: some View { | |
11 | Form { | |
c9b9e1d6 | 12 | VStack (alignment: .center) { |
a4e80427 RBR |
13 | LabeledContent("GIF Framerate") { |
14 | Slider(value: $frameRate, in: 4...10, step: 1) { | |
15 | Text("\(Int(frameRate))").font(.body).frame(width: 24) | |
16 | } minimumValueLabel: { | |
17 | Text("4") | |
18 | } maximumValueLabel: { | |
c9b9e1d6 | 19 | Text("10") |
a4e80427 RBR |
20 | } |
21 | }.font(.headline) | |
22 | Picker(selection: $outputFormats, label: Text("Output Formats").font(.headline)) { | |
23 | Text("GIF & MP4") | |
24 | .tag(OutputFormatSetting.all) | |
25 | .padding(.horizontal, 4.0) | |
26 | .padding(.vertical, 2.0) | |
27 | Text("Only GIF") | |
28 | .tag(OutputFormatSetting.gifOnly) | |
29 | .padding(.horizontal, 4.0) | |
30 | .padding(.vertical, 2.0) | |
31 | ||
32 | Text("Only MP4") | |
33 | .tag(OutputFormatSetting.mp4Only) | |
34 | .padding(.horizontal, 4.0) | |
35 | .padding(.vertical, 2.0) | |
36 | }.pickerStyle(.radioGroup) | |
37 | } | |
c9b9e1d6 | 38 | Spacer() |
a4e80427 | 39 | } |
377442f2 RBR |
40 | .onChange(of: anyState) { _ in |
41 | NotificationCenter.default.post(name: .reloadConfiguration, object: nil, userInfo: nil) | |
42 | } | |
a4e80427 RBR |
43 | } |
44 | } | |
45 | ||
46 | #Preview { | |
47 | OutputSettings() | |
48 | } |