Skip to content

Add Setting Screen#50

Merged
OpenSauce merged 3 commits into
mainfrom
add-settings
Aug 16, 2025
Merged

Add Setting Screen#50
OpenSauce merged 3 commits into
mainfrom
add-settings

Conversation

@OpenSauce

Copy link
Copy Markdown
Owner

Closes #20

  • Fixed issue with pre-amp bias
image

Copilot AI review requested due to automatic review settings August 16, 2025 18:52
@OpenSauce OpenSauce enabled auto-merge (squash) August 16, 2025 18:53
@OpenSauce OpenSauce disabled auto-merge August 16, 2025 18:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a comprehensive audio settings system to the application, including a GUI settings dialog and fixes a pre-amp bias issue. The changes introduce configurable audio port connections, buffer sizes, and sample rates while resolving DC bias problems in the preamp stage.

  • Added a complete settings management system with persistent storage and GUI controls
  • Fixed preamp bias DC compensation using asymmetric soft clipping and DC blocking
  • Introduced flexible audio port configuration replacing hardcoded connections

Reviewed Changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/sim/stages/preamp.rs Reimplemented preamp processing with DC blocking filter and asymmetric bias handling
src/sim/stages/filter.rs Added comprehensive tests for highpass filter functionality
src/io/processor.rs Removed hardcoded port connections and added settings parameter
src/io/manager.rs Enhanced with dynamic port connection management and settings application
src/gui/settings.rs New settings data structures with JSON serialization and file persistence
src/gui/mod.rs Updated to accept and pass through settings configuration
src/gui/messages.rs Added message types for settings dialog interactions
src/gui/components/settings_dialog.rs New modal dialog component for audio settings configuration
src/gui/components/mod.rs Exported the new settings dialog module
src/gui/app.rs Integrated settings dialog and management into main application

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

toggler(self.temp_settings.auto_connect).on_toggle(Message::AutoConnectToggled)
]
.spacing(10)
.align_y(Alignment::Center);

Copilot AI Aug 16, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The toggler widget should include a label parameter or proper accessibility labeling. Consider using toggler("Auto-connect on startup", self.temp_settings.auto_connect) to ensure screen readers can properly identify the control.

Suggested change
.align_y(Alignment::Center);
let auto_connect_section = iced::widget::toggler(
"Auto-connect on startup",
self.temp_settings.auto_connect,
Message::AutoConnectToggled
)
.size(16);

Copilot uses AI. Check for mistakes.
Comment thread src/io/manager.rs Outdated

if let Some(port) = client.port_by_name("rustortion:out_port_left") {
client.disconnect(&port).unwrap_or_else(|e| {
error!("Failed to disconnect in_port: {e}");

Copilot AI Aug 16, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error message incorrectly refers to 'in_port' when disconnecting the left output port. It should be 'Failed to disconnect out_port_left: {e}'.

Suggested change
error!("Failed to disconnect in_port: {e}");
error!("Failed to disconnect out_port_left: {e}");

Copilot uses AI. Check for mistakes.
Comment thread src/io/manager.rs Outdated
.center_x(Length::Fill)
.center_y(Length::Fill)
.style(|_theme: &iced::Theme| {
container::Style::default().background(iced::Color::from_rgba(0.0, 0.0, 0.0, 0.7))

Copilot AI Aug 16, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The overlay background color (black with 70% opacity) is a magic number. Consider defining this as a constant like const MODAL_OVERLAY_COLOR: iced::Color = iced::Color::from_rgba(0.0, 0.0, 0.0, 0.7); to improve maintainability.

Suggested change
container::Style::default().background(iced::Color::from_rgba(0.0, 0.0, 0.0, 0.7))
container::Style::default().background(MODAL_OVERLAY_COLOR)

Copilot uses AI. Check for mistakes.
Comment thread src/gui/app.rs

// Main content with settings button in top bar
let top_bar = row![
Space::new(Length::Fill, Length::Fixed(0.0)),

Copilot AI Aug 16, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Using Length::Fixed(0.0) for height is unusual and could be confusing. Consider using Length::Shrink or a small fixed value if specific spacing is needed.

Suggested change
Space::new(Length::Fill, Length::Fixed(0.0)),
Space::new(Length::Fill, Length::Shrink),

Copilot uses AI. Check for mistakes.
OpenSauce and others added 2 commits August 16, 2025 19:56
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@OpenSauce OpenSauce enabled auto-merge (squash) August 16, 2025 19:05
@OpenSauce OpenSauce merged commit 44a8c62 into main Aug 16, 2025
2 checks passed
@OpenSauce OpenSauce deleted the add-settings branch August 16, 2025 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Handle Jack/Pipewire on Linux Gracefully

2 participants