app: drop split and audio settings from the recording tab
The recorder declared split_size_mb and split_time_minutes and never read them: no capture setting was built from either, so the two rows promised a file split that the recorder does not do. The recording tab also carried a card of audio toggles and a microphone picker that the Quick tab already has, and a line that opened the Audio tab. Every one of those settings stays where it belongs. Recording is now the encoder and quality, then folder, file name and container.
This commit is contained in:
1 parent
73b41fa86b
commit
dbdec05752
3 files changed
-92
No files matched your search
@@ -17,8 +17,6 @@ pub struct Form {
|
||||
pub open_select: Option<&'static str>,
|
||||
pub path: TextEdit,
|
||||
pub naming: TextEdit,
|
||||
pub split_size: TextEdit,
|
||||
pub split_time: TextEdit,
|
||||
pub poll_interval: TextEdit,
|
||||
pub bitrate: TextEdit,
|
||||
pub source_name: TextEdit,
|
||||
@@ -32,8 +30,6 @@ impl Form {
|
||||
Self {
|
||||
path: TextEdit::new(&draft.output.path),
|
||||
naming: TextEdit::new(&draft.output.naming_pattern),
|
||||
split_size: TextEdit::new(draft.output.split_size_mb.to_string()),
|
||||
split_time: TextEdit::new(draft.output.split_time_minutes.to_string()),
|
||||
poll_interval: TextEdit::new(draft.daemon.poll_interval_ms.to_string()),
|
||||
bitrate: TextEdit::new(draft.audio.bitrate.to_string()),
|
||||
source_name: TextEdit::new(""),
|
||||
@@ -55,10 +51,6 @@ impl Form {
|
||||
self.draft = settings.clone();
|
||||
self.path.replace_text(&settings.output.path);
|
||||
self.naming.replace_text(&settings.output.naming_pattern);
|
||||
self.split_size
|
||||
.replace_text(settings.output.split_size_mb.to_string());
|
||||
self.split_time
|
||||
.replace_text(settings.output.split_time_minutes.to_string());
|
||||
self.poll_interval
|
||||
.replace_text(settings.daemon.poll_interval_ms.to_string());
|
||||
self.bitrate
|
||||
@@ -73,8 +65,6 @@ impl Form {
|
||||
let mut out = self.draft.clone();
|
||||
out.output.path = self.path.text.trim().to_string();
|
||||
out.output.naming_pattern = self.naming.text.trim().to_string();
|
||||
out.output.split_size_mb = self.split_size.text.trim().parse().unwrap_or(0);
|
||||
out.output.split_time_minutes = self.split_time.text.trim().parse().unwrap_or(0);
|
||||
out.daemon.poll_interval_ms = self
|
||||
.poll_interval
|
||||
.text
|
||||
@@ -427,7 +417,6 @@ fn short_path(path: &str) -> String {
|
||||
|
||||
fn recording(app: &App, p: Paint, kit: &rune_kit::Kit, layer: &mut Vec<El>, content: El) -> El {
|
||||
let v = &app.form.draft.video;
|
||||
let a = &app.form.draft.audio;
|
||||
let o = &app.form.draft.output;
|
||||
|
||||
// Only the encoders this machine reports are offered. The static list stands in until the
|
||||
@@ -511,73 +500,8 @@ fn recording(app: &App, p: Paint, kit: &rune_kit::Kit, layer: &mut Vec<El>, cont
|
||||
Some(o.container.clone()),
|
||||
app,
|
||||
),
|
||||
text_row(
|
||||
p,
|
||||
"split-size",
|
||||
"Split at size",
|
||||
"Start a new file past this many MB (0 for never)",
|
||||
&app.form.split_size,
|
||||
|app| &mut app.form.split_size,
|
||||
),
|
||||
text_row(
|
||||
p,
|
||||
"split-time",
|
||||
"Split at time",
|
||||
"Start a new file after this many minutes (0 for never)",
|
||||
&app.form.split_time,
|
||||
|app| &mut app.form.split_time,
|
||||
),
|
||||
],
|
||||
))
|
||||
.child(ui::card(
|
||||
p,
|
||||
Some("Audio"),
|
||||
vec![
|
||||
ui::toggle_row(
|
||||
p,
|
||||
"rec-game",
|
||||
"Game audio",
|
||||
a.enabled && a.capture_game,
|
||||
|app: &mut App| {
|
||||
let on =
|
||||
!(app.form.draft.audio.enabled && app.form.draft.audio.capture_game);
|
||||
app.form.draft.audio.enabled = on;
|
||||
app.form.draft.audio.capture_game = on;
|
||||
app.form.dirty = true;
|
||||
},
|
||||
),
|
||||
ui::toggle_row(
|
||||
p,
|
||||
"rec-mic",
|
||||
"Microphone",
|
||||
a.capture_mic,
|
||||
|app: &mut App| {
|
||||
app.form.draft.audio.capture_mic ^= true;
|
||||
app.form.dirty = true;
|
||||
},
|
||||
),
|
||||
mic_row(p, kit, layer, app, "rec-mic-device"),
|
||||
ui::setting_row_with(
|
||||
p,
|
||||
"rec-apps",
|
||||
"Applications",
|
||||
&source_summary(&a.capture_apps),
|
||||
ui::button(p, "edit-apps", "Edit", false, |app: &mut App| {
|
||||
app.settings_tab = SettingsTab::Audio;
|
||||
}),
|
||||
),
|
||||
],
|
||||
))
|
||||
}
|
||||
|
||||
/// The applications a clip takes sound from, as one line.
|
||||
fn source_summary(sources: &[AudioSource]) -> String {
|
||||
match sources.len() {
|
||||
0 => "None yet".to_string(),
|
||||
1 => sources[0].name.clone(),
|
||||
2 => format!("{} and {}", sources[0].name, sources[1].name),
|
||||
n => format!("{} and {} more", sources[0].name, n - 1),
|
||||
}
|
||||
}
|
||||
|
||||
/// The microphone picker: the system default plus every input device the daemon reports.
|
||||
|
||||
@@ -190,10 +190,6 @@ pub struct OutputSettings {
|
||||
pub naming_pattern: String,
|
||||
#[serde(default = "container")]
|
||||
pub container: String,
|
||||
#[serde(default)]
|
||||
pub split_size_mb: u32,
|
||||
#[serde(default)]
|
||||
pub split_time_minutes: u32,
|
||||
}
|
||||
|
||||
impl Default for OutputSettings {
|
||||
@@ -202,8 +198,6 @@ impl Default for OutputSettings {
|
||||
path: output_path(),
|
||||
naming_pattern: naming_pattern(),
|
||||
container: container(),
|
||||
split_size_mb: 0,
|
||||
split_time_minutes: 0,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user