[][src]Struct thorium::dmg_apu::LevelEnvelope

pub struct LevelEnvelope {
    pub rate: i8,
    pub level: f32,
    pub samples: usize,
}

Fields

rate: i8

How often to adjust the envelope up or down.

  • Given in 1/64th Sec units, correct range is +/- 7.
  • Use 0 for no envelope update.
level: f32

The level (0.0 through 1.0) when the sound is "on"

samples: usize

How many samples until we trigger the envelops and re-assess things.

Methods

impl LevelEnvelope[src]

pub fn samples_until_trigger(rate: i8, samples_per_second: i32) -> usize[src]

Computes the samples until the envelope triggers

pub fn new(rate: i8, level: f32, samples_per_second: i32) -> Self[src]

Constructs a new LevelEnvelope with a correct samples remaining.

pub fn tick_sample(&mut self, samples_per_second: i32)[src]

Trait Implementations

impl Clone for LevelEnvelope[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Copy for LevelEnvelope[src]

impl Default for LevelEnvelope[src]

impl Debug for LevelEnvelope[src]

Auto Trait Implementations

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]