add Modal::Message to handle errors

This commit is contained in:
🪞👃🪞 2025-05-04 16:38:34 +03:00
parent a77536c234
commit 0a090765d3
4 changed files with 43 additions and 16 deletions

View file

@ -38,3 +38,12 @@ pub enum Device {
#[cfg(feature = "clap")] Clap, // TODO
#[cfg(feature = "sf2")] Sf2, // TODO
}
impl Device {
pub fn name (&self) -> &str {
match self {
Self::Sampler(sampler) => sampler.name.as_ref(),
_ => todo!(),
}
}
}

View file

@ -64,6 +64,7 @@ impl Sampler {
) -> Usually<Self> {
let name = name.as_ref();
Ok(Self {
name: name.into(),
midi_in: Some(JackMidiIn::new(jack, format!("M/{name}"), midi_from)?),
audio_ins: vec![
JackAudioIn::new(jack, &format!("L/{name}"), audio_from[0])?,