WIP: half broken

This commit is contained in:
2026-01-24 01:59:51 +01:00
parent 3bb19cbda8
commit b3c56bc56c
21 changed files with 1310 additions and 119 deletions

View File

@@ -50,7 +50,7 @@ fn render_audio_section(frame: &mut Frame, app: &App, area: Rect) {
let [devices_area, _, settings_area, _, samples_area] = Layout::vertical([
Constraint::Length(devices_height),
Constraint::Length(1),
Constraint::Length(8),
Constraint::Length(10),
Constraint::Length(1),
Constraint::Min(3),
])
@@ -131,18 +131,21 @@ fn render_settings(frame: &mut Frame, app: &App, area: Rect) {
let channels_focused = app.audio.focus == AudioFocus::Channels;
let buffer_focused = app.audio.focus == AudioFocus::BufferSize;
let polyphony_focused = app.audio.focus == AudioFocus::Polyphony;
let fps_focused = app.audio.focus == AudioFocus::RefreshRate;
let highlight_focused = app.audio.focus == AudioFocus::RuntimeHighlight;
let scope_focused = app.audio.focus == AudioFocus::ShowScope;
let spectrum_focused = app.audio.focus == AudioFocus::ShowSpectrum;
let completion_focused = app.audio.focus == AudioFocus::ShowCompletion;
let highlight_text = if app.ui.runtime_highlight { "On" } else { "Off" };
let scope_text = if app.audio.config.show_scope { "On" } else { "Off" };
let spectrum_text = if app.audio.config.show_spectrum { "On" } else { "Off" };
let completion_text = if app.ui.show_completion { "On" } else { "Off" };
let rows = vec![
Row::new(vec![
Span::styled("Channels", label_style),
Span::styled("Output channels", label_style),
render_selector(
&format!("{}", app.audio.config.channels),
channels_focused,
@@ -151,7 +154,7 @@ fn render_settings(frame: &mut Frame, app: &App, area: Rect) {
),
]),
Row::new(vec![
Span::styled("Buffer", label_style),
Span::styled("Buffer size", label_style),
render_selector(
&format!("{}", app.audio.config.buffer_size),
buffer_focused,
@@ -160,7 +163,16 @@ fn render_settings(frame: &mut Frame, app: &App, area: Rect) {
),
]),
Row::new(vec![
Span::styled("FPS", label_style),
Span::styled("Max voices", label_style),
render_selector(
&format!("{}", app.audio.config.max_voices),
polyphony_focused,
highlight,
normal,
),
]),
Row::new(vec![
Span::styled("Refresh rate", label_style),
render_selector(
app.audio.config.refresh_rate.label(),
fps_focused,
@@ -169,19 +181,23 @@ fn render_settings(frame: &mut Frame, app: &App, area: Rect) {
),
]),
Row::new(vec![
Span::styled("Highlight", label_style),
Span::styled("Show highlight", label_style),
render_selector(highlight_text, highlight_focused, highlight, normal),
]),
Row::new(vec![
Span::styled("Scope", label_style),
Span::styled("Show scope", label_style),
render_selector(scope_text, scope_focused, highlight, normal),
]),
Row::new(vec![
Span::styled("Spectrum", label_style),
Span::styled("Show spectrum", label_style),
render_selector(spectrum_text, spectrum_focused, highlight, normal),
]),
Row::new(vec![
Span::styled("Rate", label_style),
Span::styled("Completion", label_style),
render_selector(completion_text, completion_focused, highlight, normal),
]),
Row::new(vec![
Span::styled("Sample rate", label_style),
Span::styled(
format!("{:.0} Hz", app.audio.config.sample_rate),
value_style,
@@ -189,7 +205,7 @@ fn render_settings(frame: &mut Frame, app: &App, area: Rect) {
]),
];
let table = Table::new(rows, [Constraint::Length(8), Constraint::Fill(1)]);
let table = Table::new(rows, [Constraint::Length(16), Constraint::Fill(1)]);
frame.render_widget(table, content_area);
}