Struct ProjectSampleSlot

Source
pub struct ProjectSampleSlot {
    pub sample_type: ProjectSampleSlotType,
    pub slot_id: u8,
    pub path: PathBuf,
    pub trim_bars_x100: u16,
    pub timestrech_mode: SampleAttributeTimestrechMode,
    pub loop_mode: SampleAttributeLoopMode,
    pub trig_quantization_mode: SampleAttributeTrigQuantizationMode,
    pub gain: i8,
    pub bpm: u16,
}

Fields§

§sample_type: ProjectSampleSlotType

Type of sample: STATIC or FLEX

§slot_id: u8

String ID Number of the slot the sample is assigned to e.g. 001, 002, 003… Maximum of 128 entries for STATIC sample slots, but can be up to 136 for flex slots as there are 8 recorders + 128 flex slots.

§path: PathBuf

Relative path to the file on the card from the project directory.

§trim_bars_x100: u16

Current bar trim (float). This is multiplied by 100 on the machine. This is not used for recording buffer ‘flex’ tracks.

§timestrech_mode: SampleAttributeTimestrechMode

Current SampleTimestrechModes setting for the specific slot. Example: TSMODE=2

§loop_mode: SampleAttributeLoopMode

Current SampleLoopModes setting for the specific slot.

§trig_quantization_mode: SampleAttributeTrigQuantizationMode

Current SampleTrigQuantizationModes setting for this specific slot. This is not used for recording buffer ‘flex’ tracks.

§gain: i8

Sample gain. 48 is default as per sample attributes file. maximum 96, minimum 0.

§bpm: u16

BPM of the sample in this slot.

Implementations§

Source§

impl ProjectSampleSlot

Source

pub fn new( sample_type: ProjectSampleSlotType, slot_id: u8, path: PathBuf, trim_bars_x100: Option<u16>, timestretch_mode: Option<SampleAttributeTimestrechMode>, loop_mode: Option<SampleAttributeLoopMode>, trig_quantization_mode: Option<SampleAttributeTrigQuantizationMode>, gain: Option<i8>, bpm: Option<u16>, ) -> Result<Self, Box<dyn Error>>

Source

pub fn defaults() -> Vec<Self>

Create a default vector of Project Sample Slots; 8x Recorder Buffers.

Trait Implementations§

Source§

impl Clone for ProjectSampleSlot

Source§

fn clone(&self) -> ProjectSampleSlot

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ProjectSampleSlot

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for ProjectSampleSlot

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Hash for ProjectSampleSlot

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for ProjectSampleSlot

Source§

fn eq(&self, other: &ProjectSampleSlot) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for ProjectSampleSlot

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Eq for ProjectSampleSlot

Source§

impl StructuralPartialEq for ProjectSampleSlot

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,