Sample

Struct Sample 

Source
pub struct Sample {
Show 13 fields pub name: Name, pub filename: DosFilename, pub global_volume: u8, pub default_volume: u8, pub default_panning: u8, pub loop_: Option<SampleLoop>, pub sustain_loop: Option<SampleLoop>, pub samplerate_c5: u32, pub vibrato_speed: u8, pub vibrato_depth: u8, pub vibrato_rate: u8, pub vibrato_type: u8, pub data: Option<Vec<f32>>,
}

Fields§

§name: Name

Sample Name, null-terminated (but may also contain nulls)

§filename: DosFilename

DOS Filename, null-terminated

§global_volume: u8

Global Volume

§default_volume: u8

Default Volume

§default_panning: u8

Default Panning

§loop_: Option<SampleLoop>

Loop after the note has been released (Off ==) command, or directly after reaching the end point if the sustain loop is off.

§sustain_loop: Option<SampleLoop>

Loop after reching the end point while holding the note.

§samplerate_c5: u32

C-5 playback frequency.

If set to the native sampling rate of the sound sample playing the sample at C-5 will play it back unchanged.

§vibrato_speed: u8

Auto-Vibrato Rate (called Sweep in IT)

§vibrato_depth: u8

Auto-Vibrato Depth

§vibrato_rate: u8

Auto-Vibrato Sweep (called Rate in IT)

§vibrato_type: u8

Auto-Vibrato Type

§data: Option<Vec<f32>>

Sample samples converted to a normalized f32 representation (values from -1.0 to 1.0)

Trait Implementations§

Source§

impl Clone for Sample

Source§

fn clone(&self) -> Sample

Returns a duplicate 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 Sample

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Sample

§

impl RefUnwindSafe for Sample

§

impl Send for Sample

§

impl Sync for Sample

§

impl Unpin for Sample

§

impl UnwindSafe for Sample

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<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<I, C> Get<&I> for C
where C: Get<I>, I: Copy,

Source§

type Output = <C as Get<I>>::Output

Source§

fn get(&self, index: &I) -> Option<&<C as Get<&I>>::Output>

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> 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.