Skip to main content

SampleDumpMsg

Enum SampleDumpMsg 

Source
pub enum SampleDumpMsg {
    Request {
        sample_num: u16,
    },
    Header {
        sample_num: u16,
        format: u8,
        period: u32,
        length: u32,
        sustain_loop_start: u32,
        sustain_loop_end: u32,
        loop_type: LoopType,
    },
    Packet {
        running_count: u8,
        data: Vec<u8>,
    },
    LoopPointsRequest {
        sample_num: u16,
        loop_num: LoopNumber,
    },
    LoopPointTransmission {
        sample_num: u16,
        loop_num: LoopNumber,
        loop_type: LoopType,
        start_addr: u32,
        end_addr: u32,
    },
}
Expand description

Used to request and transmit sampler data. Used by UniversalNonRealTimeMsg::SampleDump.

Variants§

§

Request

Request that the receiver send the given sample.

Fields

§sample_num: u16

The ID of the sample, between 0-16383.

§

Header

The first message in a sample dump, used to describe the data contained in the following packets.

Fields

§sample_num: u16

The ID of the sample, between 0-16383.

§format: u8
§of significant bits from 8-28.
§period: u32

Sample period (1/sample rate) in nanoseconds, 0-2097151

§length: u32

Sample length in words, 0-2097151

§sustain_loop_start: u32

Sustain loop start point word number, 0-2097151

§sustain_loop_end: u32

Sustain loop end point word number, 0-2097151

§loop_type: LoopType
§

Packet

A single packet of sample data.

Use SampleDumpMsg::packet to construct.

Fields

§running_count: u8

Running packet count, 0-127. Wraps back to 0

§data: Vec<u8>

At most 120 7 bit words

§

LoopPointsRequest

Request that the receiver return data about the loop points for a given sample.

Fields

§sample_num: u16

The ID of the sample, between 0-16383.

§loop_num: LoopNumber
§

LoopPointTransmission

Used to send additional loop points for a given sample.

Fields

§sample_num: u16

The ID of the sample, between 0-16383.

§loop_num: LoopNumber
§loop_type: LoopType
§start_addr: u32

Loop start address (in samples)

§end_addr: u32

Loop end address (in samples)

Implementations§

Source§

impl SampleDumpMsg

Source

pub fn packet(num: u32, data: [u8; 120]) -> Self

Construct a packet of exactly 120 7-bit “bytes”. num is the number of this packet.

Trait Implementations§

Source§

impl Clone for SampleDumpMsg

Source§

fn clone(&self) -> SampleDumpMsg

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for SampleDumpMsg

Source§

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

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

impl Eq for SampleDumpMsg

Source§

impl PartialEq for SampleDumpMsg

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for SampleDumpMsg

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