[−][src]Struct thorium::dmg_apu::FrequencySweep
Fields
frequency_setting: u16
The frequency setting is an 11-bit value.
131072/(2048-x)
Hz- Should always be set in the range
0..2048
rate: i8
How often the frequency will sweep up or down.
- Given in 1/128th Sec units, correct range is +/- 7.
+
sweeps the frequency up,-
sweeps the frequency down.- Use 0 for no sweeping.
shift: u8
How much to sweep by when a sweep happens.
samples: usize
How many samples until we trigger a sweep and re-assess things.
Methods
impl FrequencySweep
[src]
pub fn setting_for(target: i32) -> u16
[src]
Gets the frequency setting that is as close as possible to the target.
pub fn samples_until_trigger(rate: i8, samples_per_second: i32) -> usize
[src]
Given a rate and SPS, how many samples until the effect triggers.
If the rate is 0, it will "never" trigger, so usize::MAX is given.
pub fn new(freq: i32, rate: i8, shift: u8, samples_per_second: i32) -> Self
[src]
Constructs a new FrequencySweep
with appropriate settings
Does a debug_assert!
that all values are correct.
pub fn frequency(&self) -> i32
[src]
Obtains the real frequency of the current frequency setting.
pub fn in_samples_per_out_sample(&self, samples_per_second: i32) -> f32
[src]
pub fn tick_sample(&mut self, samples_per_second: i32) -> SweepTickResult
[src]
Ticks down a sample, returns if the effect actually changed the frequency.
Trait Implementations
impl Clone for FrequencySweep
[src]
fn clone(&self) -> FrequencySweep
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Copy for FrequencySweep
[src]
impl Default for FrequencySweep
[src]
impl Debug for FrequencySweep
[src]
Auto Trait Implementations
impl Send for FrequencySweep
impl Sync for FrequencySweep
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,