From 6234ee872ccce2cf02f4ae3c24e72b02e33824c4 Mon Sep 17 00:00:00 2001 From: Brad Stein Date: Sun, 19 Apr 2026 14:33:52 -0300 Subject: [PATCH] lesavka: remove fake source controls --- client/Cargo.toml | 2 +- client/src/launcher/ui.rs | 121 -------------------------- client/src/launcher/ui_components.rs | 122 +-------------------------- common/Cargo.toml | 2 +- common/src/cli.rs | 2 +- server/Cargo.toml | 2 +- 6 files changed, 8 insertions(+), 243 deletions(-) diff --git a/client/Cargo.toml b/client/Cargo.toml index b5f08da..820df98 100644 --- a/client/Cargo.toml +++ b/client/Cargo.toml @@ -4,7 +4,7 @@ path = "src/main.rs" [package] name = "lesavka_client" -version = "0.11.15" +version = "0.11.16" edition = "2024" [dependencies] diff --git a/client/src/launcher/ui.rs b/client/src/launcher/ui.rs index 9fcb34c..e1ca644 100644 --- a/client/src/launcher/ui.rs +++ b/client/src/launcher/ui.rs @@ -229,30 +229,10 @@ fn refresh_eye_feed_controls( choice.preset, ); } - super::ui_components::sync_capture_fps_combo( - &widgets.display_panes[monitor_id].capture_fps_combo, - state.capture_fps_options(), - choice.fps, - true, - choice.fps, - ); - super::ui_components::sync_capture_bitrate_combo( - &widgets.display_panes[monitor_id].capture_bitrate_combo, - state.capture_bitrate_options(), - choice.max_bitrate_kbit, - true, - choice.max_bitrate_kbit, - ); } else { super::ui_components::sync_capture_resolution_disabled( &widgets.display_panes[monitor_id].capture_resolution_combo, ); - super::ui_components::sync_capture_fps_disabled( - &widgets.display_panes[monitor_id].capture_fps_combo, - ); - super::ui_components::sync_capture_bitrate_disabled( - &widgets.display_panes[monitor_id].capture_bitrate_combo, - ); } super::ui_components::sync_breakout_size_combo( &widgets.display_panes[monitor_id].breakout_combo, @@ -942,107 +922,6 @@ pub fn run_gui_launcher(server_addr: String) -> Result<()> { }); } - for monitor_id in 0..2 { - let state = Rc::clone(&state); - let widgets = widgets.clone(); - let popouts = Rc::clone(&popouts); - let child_proc = Rc::clone(&child_proc); - let preview = preview.clone(); - let fps_combo = widgets.display_panes[monitor_id].capture_fps_combo.clone(); - fps_combo.connect_changed(move |combo| { - let Some(active_id) = combo.active_id() else { - return; - }; - if active_id.as_str() == "source" { - return; - } - let Ok(fps) = active_id.as_str().parse::() else { - return; - }; - if state.borrow().feed_source_preset(monitor_id) != FeedSourcePreset::ThisEye { - return; - } - if state.borrow().capture_fps(monitor_id) == fps { - return; - } - { - let mut state = state.borrow_mut(); - state.set_capture_fps(monitor_id, fps); - } - if let Some(preview) = preview.as_ref() { - let choice = state - .borrow() - .display_capture_size_choice(monitor_id) - .unwrap_or_else(|| state.borrow().capture_size_choice(monitor_id)); - let source_monitor_id = state - .borrow() - .resolved_feed_monitor_id(monitor_id) - .unwrap_or(monitor_id); - preview.set_capture_profile( - monitor_id, - source_monitor_id, - choice.width, - choice.height, - choice.fps, - choice.max_bitrate_kbit, - ); - sync_preview_profiles(preview, &widgets, &popouts, &state.borrow()); - } - refresh_launcher_ui(&widgets, &state.borrow(), child_proc.borrow().is_some()); - }); - } - - for monitor_id in 0..2 { - let state = Rc::clone(&state); - let widgets = widgets.clone(); - let popouts = Rc::clone(&popouts); - let child_proc = Rc::clone(&child_proc); - let preview = preview.clone(); - let bitrate_combo = - widgets.display_panes[monitor_id].capture_bitrate_combo.clone(); - bitrate_combo.connect_changed(move |combo| { - let Some(active_id) = combo.active_id() else { - return; - }; - if active_id.as_str() == "source" { - return; - } - let Ok(max_bitrate_kbit) = active_id.as_str().parse::() else { - return; - }; - if state.borrow().feed_source_preset(monitor_id) != FeedSourcePreset::ThisEye { - return; - } - if state.borrow().capture_bitrate_kbit(monitor_id) == max_bitrate_kbit { - return; - } - { - let mut state = state.borrow_mut(); - state.set_capture_bitrate_kbit(monitor_id, max_bitrate_kbit); - } - if let Some(preview) = preview.as_ref() { - let choice = state - .borrow() - .display_capture_size_choice(monitor_id) - .unwrap_or_else(|| state.borrow().capture_size_choice(monitor_id)); - let source_monitor_id = state - .borrow() - .resolved_feed_monitor_id(monitor_id) - .unwrap_or(monitor_id); - preview.set_capture_profile( - monitor_id, - source_monitor_id, - choice.width, - choice.height, - choice.fps, - choice.max_bitrate_kbit, - ); - sync_preview_profiles(preview, &widgets, &popouts, &state.borrow()); - } - refresh_launcher_ui(&widgets, &state.borrow(), child_proc.borrow().is_some()); - }); - } - for monitor_id in 0..2 { let state = Rc::clone(&state); let widgets = widgets.clone(); diff --git a/client/src/launcher/ui_components.rs b/client/src/launcher/ui_components.rs index ffc3798..b40b399 100644 --- a/client/src/launcher/ui_components.rs +++ b/client/src/launcher/ui_components.rs @@ -8,8 +8,8 @@ use super::{ diagnostics::DiagnosticsLog, preview::{LauncherPreview, PreviewBinding, PreviewSurface}, state::{ - BreakoutSizeChoice, BreakoutSizePreset, CaptureBitrateChoice, CaptureFpsChoice, - CaptureSizeChoice, CaptureSizePreset, FeedSourceChoice, FeedSourcePreset, LauncherState, + BreakoutSizeChoice, BreakoutSizePreset, CaptureSizeChoice, CaptureSizePreset, + FeedSourceChoice, FeedSourcePreset, LauncherState, }, }; @@ -33,8 +33,6 @@ pub struct DisplayPaneWidgets { pub placeholder: gtk::Label, pub feed_source_combo: gtk::ComboBoxText, pub capture_resolution_combo: gtk::ComboBoxText, - pub capture_fps_combo: gtk::ComboBoxText, - pub capture_bitrate_combo: gtk::ComboBoxText, pub breakout_combo: gtk::ComboBoxText, pub action_button: gtk::Button, pub preview_binding: Rc>>, @@ -582,24 +580,8 @@ pub fn build_launcher_view( choice.preset, ); } - sync_capture_fps_combo( - &left_pane.capture_fps_combo, - state.capture_fps_options(), - choice.fps, - true, - choice.fps, - ); - sync_capture_bitrate_combo( - &left_pane.capture_bitrate_combo, - state.capture_bitrate_options(), - choice.max_bitrate_kbit, - true, - choice.max_bitrate_kbit, - ); } else { sync_capture_resolution_disabled(&left_pane.capture_resolution_combo); - sync_capture_fps_disabled(&left_pane.capture_fps_combo); - sync_capture_bitrate_disabled(&left_pane.capture_bitrate_combo); } if state.feed_source_preset(1) != FeedSourcePreset::Off { let choice = state @@ -618,24 +600,8 @@ pub fn build_launcher_view( choice.preset, ); } - sync_capture_fps_combo( - &right_pane.capture_fps_combo, - state.capture_fps_options(), - choice.fps, - true, - choice.fps, - ); - sync_capture_bitrate_combo( - &right_pane.capture_bitrate_combo, - state.capture_bitrate_options(), - choice.max_bitrate_kbit, - true, - choice.max_bitrate_kbit, - ); } else { sync_capture_resolution_disabled(&right_pane.capture_resolution_combo); - sync_capture_fps_disabled(&right_pane.capture_fps_combo); - sync_capture_bitrate_disabled(&right_pane.capture_bitrate_combo); } sync_breakout_size_combo( &left_pane.breakout_combo, @@ -957,71 +923,6 @@ pub fn sync_capture_resolution_disabled(combo: >k::ComboBoxText) { combo.set_sensitive(false); } -pub fn sync_capture_fps_combo( - combo: >k::ComboBoxText, - options: Vec, - selected: u32, - locked_to_source: bool, - source_fps: u32, -) { - combo.remove_all(); - if locked_to_source { - combo.append(Some("source"), &format!("{source_fps} fps (Device mode)")); - combo.set_active_id(Some("source")); - combo.set_sensitive(false); - return; - } - for option in options { - combo.append( - Some(&option.fps.to_string()), - &format!("{} fps", option.fps), - ); - } - combo.set_active_id(Some(&selected.max(1).to_string())); - combo.set_sensitive(true); -} - -pub fn sync_capture_fps_disabled(combo: >k::ComboBoxText) { - combo.remove_all(); - combo.append(Some("off"), "Feed disabled"); - combo.set_active_id(Some("off")); - combo.set_sensitive(false); -} - -pub fn sync_capture_bitrate_combo( - combo: >k::ComboBoxText, - options: Vec, - selected: u32, - locked_to_source: bool, - source_bitrate_kbit: u32, -) { - combo.remove_all(); - if locked_to_source { - combo.append( - Some("source"), - &format!("~{source_bitrate_kbit} kbit (Estimated, device-managed)"), - ); - combo.set_active_id(Some("source")); - combo.set_sensitive(false); - return; - } - for option in options { - combo.append( - Some(&option.max_bitrate_kbit.to_string()), - &format!("{} kbit", option.max_bitrate_kbit), - ); - } - combo.set_active_id(Some(&selected.max(800).to_string())); - combo.set_sensitive(true); -} - -pub fn sync_capture_bitrate_disabled(combo: >k::ComboBoxText) { - combo.remove_all(); - combo.append(Some("off"), "Feed disabled"); - combo.set_active_id(Some("off")); - combo.set_sensitive(false); -} - pub fn sync_breakout_size_combo( combo: >k::ComboBoxText, options: Vec, @@ -1208,17 +1109,6 @@ fn build_display_pane(title: &str, capture_path: &str) -> DisplayPaneWidgets { )); capture_resolution_combo.set_size_request(0, -1); capture_resolution_combo.set_hexpand(true); - let capture_fps_combo = gtk::ComboBoxText::new(); - capture_fps_combo.set_tooltip_text(Some( - "Source pass-through uses the HDMI device's own cadence. This control will wake back up if we add a proven source-side fps option later.", - )); - capture_fps_combo.set_size_request(96, -1); - let capture_bitrate_combo = gtk::ComboBoxText::new(); - capture_bitrate_combo.set_tooltip_text(Some( - "Source pass-through uses the eye device's own H.264 bitrate behavior. This control stays disabled until the hardware exposes a real source-side bitrate mode we can trust.", - )); - capture_bitrate_combo.set_size_request(0, -1); - capture_bitrate_combo.set_hexpand(true); let breakout_combo = gtk::ComboBoxText::new(); breakout_combo.set_tooltip_text(Some( "Choose the client-side breakout window size for this eye feed. Source Size preserves the feed's own dimensions; Display Size fills the effective monitor size.", @@ -1235,10 +1125,8 @@ fn build_display_pane(title: &str, capture_path: &str) -> DisplayPaneWidgets { controls_grid.set_hexpand(true); controls_grid.attach(&feed_source_combo, 0, 0, 1, 1); controls_grid.attach(&capture_resolution_combo, 1, 0, 1, 1); - controls_grid.attach(&capture_fps_combo, 0, 1, 1, 1); - controls_grid.attach(&capture_bitrate_combo, 1, 1, 1, 1); - controls_grid.attach(&breakout_combo, 0, 2, 1, 1); - controls_grid.attach(&action_button, 1, 2, 1, 1); + controls_grid.attach(&breakout_combo, 0, 1, 1, 1); + controls_grid.attach(&action_button, 1, 1, 1, 1); footer_shell.append(&controls_grid); root.append(&footer_shell); @@ -1250,8 +1138,6 @@ fn build_display_pane(title: &str, capture_path: &str) -> DisplayPaneWidgets { placeholder, feed_source_combo, capture_resolution_combo, - capture_fps_combo, - capture_bitrate_combo, breakout_combo, action_button, preview_binding: Rc::new(RefCell::new(None)), diff --git a/common/Cargo.toml b/common/Cargo.toml index 30fca70..cf7493a 100644 --- a/common/Cargo.toml +++ b/common/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "lesavka_common" -version = "0.11.15" +version = "0.11.16" edition = "2024" build = "build.rs" diff --git a/common/src/cli.rs b/common/src/cli.rs index 4107760..173accb 100644 --- a/common/src/cli.rs +++ b/common/src/cli.rs @@ -17,6 +17,6 @@ mod tests { #[test] fn banner_includes_version() { - assert_eq!(banner("0.11.15"), "lesavka-common CLI (v0.11.15)"); + assert_eq!(banner("0.11.16"), "lesavka-common CLI (v0.11.16)"); } } diff --git a/server/Cargo.toml b/server/Cargo.toml index c985af2..82a85bd 100644 --- a/server/Cargo.toml +++ b/server/Cargo.toml @@ -10,7 +10,7 @@ bench = false [package] name = "lesavka_server" -version = "0.11.15" +version = "0.11.16" edition = "2024" autobins = false