Feat: clean the codebase as much as possible
This commit is contained in:
21
src/init.rs
21
src/init.rs
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user