sampler: wip: add play_sample and stop_sample

This commit is contained in:
🪞👃🪞 2025-05-11 19:20:58 +03:00
parent decbb177f0
commit ea48dd6fa1
2 changed files with 12 additions and 0 deletions

View file

@ -81,6 +81,16 @@ impl SamplerCommand {
sampler.recording = None;
Ok(None)
}
fn play_sample (sampler: &mut Sampler, pitch: usize) -> Perhaps<Self> {
if let Some(ref sample) = sampler.mapped[pitch] {
sampler.voices.write().unwrap().push(Sample::play(sample, 0, &u7::from(128)));
}
Ok(None)
}
fn stop_sample (sampler: &mut Sampler, pitch: usize) -> Perhaps<Self> {
todo!();
Ok(None)
}
//fn select (&self, state: &mut Sampler, i: usize) -> Option<Self> {
//Self::Select(state.set_note_pos(i))
//}