Feat: clean the codebase as much as possible

This commit is contained in:
2026-02-21 14:46:53 +01:00
parent ab353edc0b
commit 7a95207c58
17 changed files with 233 additions and 368 deletions

View File

@@ -7,8 +7,9 @@ use doux::EngineMetrics;
use crate::app::App;
use crate::engine::{
build_stream, spawn_sequencer, AnalysisHandle, AudioStreamConfig, LinkState, MidiCommand,
PatternChange, ScopeBuffer, SequencerConfig, SequencerHandle, SpectrumBuffer,
build_stream, preload_sample_heads, spawn_sequencer, AnalysisHandle, AudioStreamConfig,
LinkState, MidiCommand, PatternChange, ScopeBuffer, SequencerConfig, SequencerHandle,
SpectrumBuffer,
};
use crate::midi;
use crate::model;
@@ -230,19 +231,3 @@ pub fn init(args: InitArgs) -> Init {
}
}
pub fn preload_sample_heads(
entries: Vec<(String, std::path::PathBuf)>,
target_sr: f32,
registry: &doux::SampleRegistry,
) {
let mut batch = Vec::with_capacity(entries.len());
for (name, path) in &entries {
match doux::sampling::decode_sample_head(path, target_sr) {
Ok(data) => batch.push((name.clone(), Arc::new(data))),
Err(e) => eprintln!("preload {name}: {e}"),
}
}
if !batch.is_empty() {
registry.insert_batch(batch);
}
}