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 struct OutputSettings: View {
21 @AppStorage("outputFormats") var outputFormats: OutputFormatSetting = .all
22 @AppStorage("frameRate") var frameRate = 10.0
24 private var anyState: String { "\(outputFormats), \(frameRate)" }
28 VStack (alignment: .center) {
29 LabeledContent("GIF Framerate") {
30 Slider(value: $frameRate, in: 4...10, step: 1) {
31 Text("\(Int(frameRate))").font(.body).frame(width: 24)
32 } minimumValueLabel: {
34 } maximumValueLabel: {
38 Picker(selection: $outputFormats, label: Text("Output Formats").font(.headline)) {
40 .tag(OutputFormatSetting.all)
41 .padding(.horizontal, 4.0)
42 .padding(.vertical, 2.0)
44 .tag(OutputFormatSetting.gifOnly)
45 .padding(.horizontal, 4.0)
46 .padding(.vertical, 2.0)
49 .tag(OutputFormatSetting.mp4Only)
50 .padding(.horizontal, 4.0)
51 .padding(.vertical, 2.0)
52 }.pickerStyle(.radioGroup)
56 .onChange(of: anyState) { _ in
57 NotificationCenter.default.post(name: .reloadConfiguration, object: nil, userInfo: nil)