pub enum ArrangeRow {
PatternRow {
pattern_id: u8,
repetitions: u8,
mute_mask: u8,
tempo_1: u8,
tempo_2: u8,
scene_a: u8,
scene_b: u8,
offset: u8,
length: u8,
midi_transpose: [u8; 8],
},
LoopOrJumpOrHaltRow {
loop_count: u8,
row_target: u8,
},
ReminderRow(String),
EmptyRow(),
}Expand description
Base model for an arranger row within an arrangement block.
Variants§
PatternRow
pattern choice and playback
Fields
pattern_id: u8Which Pattern should be played at this point. Patterns are indexed from 0 (A01) -> 256 (P16).
tempo_1: u8First part of the Tempo mask for this row.
Needs to be combined with tempo_2 to work out the actual tempo (not sure how it works yet).
tempo_2: u8Second part of the Tempo mask for this row.
Needs to be combined with tempo_1 to work out the actual tempo (not sure how it works yet).
LoopOrJumpOrHaltRow
Loop/Jump/Halt rows are all essentially just loops. Example: Jumps are an infinite loop. So these are bundled into one type.
Loops are loop_count = 0 -> 65 and the row_target is any row before this one (loop_count=0 is infinite looping).
Halts are loop_count = 0 and the row_target is this row.
Jumps are loop_count = 0 and the row_target is any row after this one.
Fields
ReminderRow(String)
A row of ASCII text data with 15 maximum length.
EmptyRow()
Row is not in use. Only used in an ArrangementBlock as a placeholder for null basically.
Trait Implementations§
Source§impl Clone for ArrangeRow
impl Clone for ArrangeRow
Source§fn clone(&self) -> ArrangeRow
fn clone(&self) -> ArrangeRow
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ArrangeRow
impl Debug for ArrangeRow
Source§impl Default for ArrangeRow
impl Default for ArrangeRow
Source§impl<const N: usize> Defaults<[ArrangeRow; N]> for ArrangeRow
impl<const N: usize> Defaults<[ArrangeRow; N]> for ArrangeRow
Source§impl<const N: usize> Defaults<Box<Array<ArrangeRow, N>>> for ArrangeRow
impl<const N: usize> Defaults<Box<Array<ArrangeRow, N>>> for ArrangeRow
Source§impl<'de> Deserialize<'de> for ArrangeRow
Custom Deserialize trait for ArrangeRow variants.
Ensures we can do
impl<'de> Deserialize<'de> for ArrangeRow
Custom Deserialize trait for ArrangeRow variants.
Ensures we can do
- conditional/dynamic deserialization for binary data based on the row type byte
- deserialize from both human-readable and raw binary formats
The variant of an ArrangeRow is determined by
- the row’s index in the
ArrangementBlock.rowsarray versus number of rows in the arrangementArrangementBlock.n_rows - The value of the first byte for an
ArrangeRow. See the table below:
ArrangeRow Variant | First Byte |
|---|---|
PatternRow | 0 |
ReminderRow | 0 |
LoopOrJumpOrHaltRow | 0 |
PatternRow | 0 |
EmptyRow | n/a |
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 PartialEq for ArrangeRow
impl PartialEq for ArrangeRow
Source§impl Serialize for ArrangeRow
Custom serialization to ensure we can serialize both bytes and human-readable data formats
correctly.
Please note this currently abuses the serialize_struct pattern for writing binary/bytes to
ensure we get the correct number of bytes in the correct positions.
impl Serialize for ArrangeRow
Custom serialization to ensure we can serialize both bytes and human-readable data formats
correctly.
Please note this currently abuses the serialize_struct pattern for writing binary/bytes to
ensure we get the correct number of bytes in the correct positions.
impl Eq for ArrangeRow
impl StructuralPartialEq for ArrangeRow
Auto Trait Implementations§
impl Freeze for ArrangeRow
impl RefUnwindSafe for ArrangeRow
impl Send for ArrangeRow
impl Sync for ArrangeRow
impl Unpin for ArrangeRow
impl UnwindSafe for ArrangeRow
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