pub struct SlotsAttributes {
    pub static_slots: Array<Option<SlotAttributes>, 128>,
    pub flex_slots: Array<Option<SlotAttributes>, 136>,
}Expand description
Container type for all sample slots.
The project.* data files store all sample slots together in a single 1-indexed array.
This tends to lead to a lot of additional yak-shaving when interacting with sample slots.
So this type models the octatrack’s UI, displaying slots in 2x arrays: Flex and Static.
These individual arrays are 0-indexed (easier lookups within for loops etc), but the
slots themselves retain their 1-indexed slot IDs.
NOTE: This type only includes the ATTRIBUTE data for slots. Markers data is stored separately in crate::markers::MarkersFile.
NOTE: I’m aware of the dangerous naming here – SlotX versus SlotsX …
lean into the type system to stop you from using the wrong one! SlotsX is
a container, while SlotX is the single slot with it’s data (naming things
is hard, okay).
To create a new SlotsAttributes instance, start with a mutable default as it will generate the recording buffer flex slots for you!
let mut slots = SlotsAttributes::default();
for i in (128..=135_usize) {
   let s = slots.flex_slots[i].clone();
   assert_eq!(s.unwrap().slot_type, SlotType::Flex)
}Fields§
§static_slots: Array<Option<SlotAttributes>, 128>§flex_slots: Array<Option<SlotAttributes>, 136>Trait Implementations§
Source§impl Clone for SlotsAttributes
 
impl Clone for SlotsAttributes
Source§fn clone(&self) -> SlotsAttributes
 
fn clone(&self) -> SlotsAttributes
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
 
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SlotsAttributes
 
impl Debug for SlotsAttributes
Source§impl Default for SlotsAttributes
 
impl Default for SlotsAttributes
Source§impl<'de> Deserialize<'de> for SlotsAttributes
 
impl<'de> Deserialize<'de> for SlotsAttributes
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
    D: Deserializer<'de>,
 
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
    D: Deserializer<'de>,
Source§impl Display for SlotsAttributes
 
impl Display for SlotsAttributes
Source§impl FromStr for SlotsAttributes
 
impl FromStr for SlotsAttributes
Source§impl IsDefault for SlotsAttributes
 
impl IsDefault for SlotsAttributes
Source§impl PartialEq for SlotsAttributes
 
impl PartialEq for SlotsAttributes
Source§impl Serialize for SlotsAttributes
 
impl Serialize for SlotsAttributes
impl Eq for SlotsAttributes
impl StructuralPartialEq for SlotsAttributes
Auto Trait Implementations§
impl Freeze for SlotsAttributes
impl RefUnwindSafe for SlotsAttributes
impl Send for SlotsAttributes
impl Sync for SlotsAttributes
impl Unpin for SlotsAttributes
impl UnwindSafe for SlotsAttributes
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
Source§impl<T> CloneToUninit for Twhere
    T: Clone,
 
impl<T> CloneToUninit for Twhere
    T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
 
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
 
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
 
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> IntoEither for T
 
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
 
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
 
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more