WIP: improve Linux audio support
Some checks failed
Deploy Website / deploy (push) Failing after 4m46s
Some checks failed
Deploy Website / deploy (push) Failing after 4m46s
This commit is contained in:
19
src/main.rs
19
src/main.rs
@@ -106,7 +106,8 @@ fn main() -> io::Result<()> {
|
||||
app.ui.hue_rotation = settings.display.hue_rotation;
|
||||
app.audio.config.layout = settings.display.layout;
|
||||
let base_theme = settings.display.color_scheme.to_theme();
|
||||
let rotated = cagire_ratatui::theme::transform::rotate_theme(base_theme, settings.display.hue_rotation);
|
||||
let rotated =
|
||||
cagire_ratatui::theme::transform::rotate_theme(base_theme, settings.display.hue_rotation);
|
||||
theme::set(rotated);
|
||||
|
||||
// Load MIDI settings
|
||||
@@ -190,9 +191,11 @@ fn main() -> io::Result<()> {
|
||||
initial_samples,
|
||||
Arc::clone(&audio_sample_pos),
|
||||
) {
|
||||
Ok((s, sample_rate, analysis)) => {
|
||||
app.audio.config.sample_rate = sample_rate;
|
||||
sample_rate_shared.store(sample_rate as u32, Ordering::Relaxed);
|
||||
Ok((s, info, analysis)) => {
|
||||
app.audio.config.sample_rate = info.sample_rate;
|
||||
app.audio.config.host_name = info.host_name;
|
||||
app.audio.config.channels = info.channels;
|
||||
sample_rate_shared.store(info.sample_rate as u32, Ordering::Relaxed);
|
||||
(Some(s), Some(analysis))
|
||||
}
|
||||
Err(e) => {
|
||||
@@ -244,11 +247,13 @@ fn main() -> io::Result<()> {
|
||||
restart_samples,
|
||||
Arc::clone(&audio_sample_pos),
|
||||
) {
|
||||
Ok((new_stream, sr, new_analysis)) => {
|
||||
Ok((new_stream, info, new_analysis)) => {
|
||||
_stream = Some(new_stream);
|
||||
_analysis_handle = Some(new_analysis);
|
||||
app.audio.config.sample_rate = sr;
|
||||
sample_rate_shared.store(sr as u32, Ordering::Relaxed);
|
||||
app.audio.config.sample_rate = info.sample_rate;
|
||||
app.audio.config.host_name = info.host_name;
|
||||
app.audio.config.channels = info.channels;
|
||||
sample_rate_shared.store(info.sample_rate as u32, Ordering::Relaxed);
|
||||
app.audio.error = None;
|
||||
app.ui.set_status("Audio restarted".to_string());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user