pub struct InstrumentPreset {
pub name: String,
pub bank: u16,
pub program: u16,
pub format: PresetFormat,
pub samples: SampleSource,
}Expand description
A format-neutral instrument preset.
Fields§
§name: StringDisplay name.
bank: u16MIDI bank (0 for SFZ, which has no inherent bank/program).
program: u16MIDI program (0 for SFZ).
format: PresetFormatOriginating format.
samples: SampleSourceHow the samples are located.
Implementations§
Source§impl InstrumentPreset
impl InstrumentPreset
Sourcepub fn from_sfz(name: impl Into<String>, instr: &SfzInstrument<'_>) -> Self
pub fn from_sfz(name: impl Into<String>, instr: &SfzInstrument<'_>) -> Self
Build a preset from a parsed SFZ instrument. name is caller-supplied (SFZ has no
embedded instrument name); the external sample refs are collected, de-duplicated, in
region order.
Sourcepub fn from_sf2(p: &Sf2Preset) -> Self
pub fn from_sf2(p: &Sf2Preset) -> Self
Build a preset from an enumerated SoundFont2 preset (samples embedded).
Sourcepub fn from_dls(i: &DlsInstrument) -> Self
pub fn from_dls(i: &DlsInstrument) -> Self
Build a preset from an enumerated DLS instrument (samples embedded).
Sourcepub fn external_refs(&self) -> &[String]
pub fn external_refs(&self) -> &[String]
The external sample references, if this preset has any (SFZ). Empty slice for embedded.
Trait Implementations§
Source§impl Clone for InstrumentPreset
impl Clone for InstrumentPreset
Source§impl Debug for InstrumentPreset
impl Debug for InstrumentPreset
impl Eq for InstrumentPreset
Source§impl PartialEq for InstrumentPreset
impl PartialEq for InstrumentPreset
impl StructuralPartialEq for InstrumentPreset
Auto Trait Implementations§
impl Freeze for InstrumentPreset
impl RefUnwindSafe for InstrumentPreset
impl Send for InstrumentPreset
impl Sync for InstrumentPreset
impl Unpin for InstrumentPreset
impl UnsafeUnpin for InstrumentPreset
impl UnwindSafe for InstrumentPreset
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more