A ton of bug fixes

This commit is contained in:
2026-01-28 01:09:23 +01:00
parent 935df84920
commit f4eafdf5b2
13 changed files with 400 additions and 130 deletions

View File

@@ -139,6 +139,7 @@ pub enum SettingKind {
Channels,
BufferSize,
Polyphony,
Nudge,
}
impl SettingKind {
@@ -146,15 +147,17 @@ impl SettingKind {
match self {
Self::Channels => Self::BufferSize,
Self::BufferSize => Self::Polyphony,
Self::Polyphony => Self::Channels,
Self::Polyphony => Self::Nudge,
Self::Nudge => Self::Channels,
}
}
pub fn prev(self) -> Self {
match self {
Self::Channels => Self::Polyphony,
Self::Channels => Self::Nudge,
Self::BufferSize => Self::Channels,
Self::Polyphony => Self::BufferSize,
Self::Nudge => Self::Polyphony,
}
}
}
@@ -170,6 +173,7 @@ pub struct Metrics {
pub peak_left: f32,
pub peak_right: f32,
pub spectrum: [f32; 32],
pub nudge_ms: f64,
}
impl Default for Metrics {
@@ -185,6 +189,7 @@ impl Default for Metrics {
peak_left: 0.0,
peak_right: 0.0,
spectrum: [0.0; 32],
nudge_ms: 0.0,
}
}
}
@@ -211,8 +216,14 @@ impl Default for AudioSettings {
setting_kind: SettingKind::default(),
output_devices: doux::audio::list_output_devices(),
input_devices: doux::audio::list_input_devices(),
output_list: ListSelectState { cursor: 0, scroll_offset: 0 },
input_list: ListSelectState { cursor: 0, scroll_offset: 0 },
output_list: ListSelectState {
cursor: 0,
scroll_offset: 0,
},
input_list: ListSelectState {
cursor: 0,
scroll_offset: 0,
},
restart_pending: false,
error: None,
}
@@ -290,7 +301,6 @@ impl AudioSettings {
self.config.refresh_rate = self.config.refresh_rate.toggle();
}
pub fn add_sample_path(&mut self, path: PathBuf) {
if !self.config.sample_paths.contains(&path) {
self.config.sample_paths.push(path);