Struct Program Bank
pub struct ProgramBank<'a, const N: usize> { /* private fields */ }Expand description
Borrowed 1..128-program bank with 1..1024 parameters and <=65536 values total.
Preparation rejects duplicate IDs/addresses and strictly validates every
complete state; no partial registration, clamping or default-filled programs.
Lookup/state copying uses bounded linear work without allocation, locks or I/O.
Returned states remain tied to this schema and normalize signed zero just as
ParameterSchema::state does. A bank has no mutable current index: the consumer
decides when/where to apply a complete state and how edits affect its identity.
No file loading, MIDI routing, host registration/notifications, undo, voice
reset, DSP history migration or click-free switching is synthesized.
Implementations§
§impl<'a, const N: usize> ProgramBank<'a, N>
impl<'a, const N: usize> ProgramBank<'a, N>
pub fn new( schema: ParameterSchema<'a, N>, programs: &'a [ParameterProgram<'a, N>], ) -> Result<Self, ProgramError>
pub fn programs(self) -> &'a [ParameterProgram<'a, N>]
pub fn index(self, id: ProgramId) -> Option<usize>
pub fn index(self, id: ProgramId) -> Option<usize>
Index for a permanent ID, independent of display/MIDI addressing.
pub fn midi_index(self, bank: u16, number: u8) -> Option<usize>
pub fn midi_index(self, bank: u16, number: u8) -> Option<usize>
Exact MIDI address lookup. Invalid or unavailable addresses return None.
pub fn state(self, index: usize) -> Option<ParameterState<'a, N>>
pub fn state(self, index: usize) -> Option<ParameterState<'a, N>>
Copy a complete validated state. Invalid indices return None; the bank and any consumer state remain unchanged. This is a proposal, not publication.
Trait Implementations§
§impl<'a, const N: usize> Clone for ProgramBank<'a, N>
impl<'a, const N: usize> Clone for ProgramBank<'a, N>
§fn clone(&self) -> ProgramBank<'a, N>
fn clone(&self) -> ProgramBank<'a, N>
1.0.0 (const: unstable) · §fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more