[][src]Struct ltc::LTCDecoder

pub struct LTCDecoder { /* fields omitted */ }

A decoder of LTC data. See top-level documentation for more information.

Methods

impl LTCDecoder[src]

pub fn new(samples_per_frame: f32, queue: VecDeque<LTCFrame>) -> LTCDecoder[src]

Initialises a new decoder.

Arguments

  • samples_per_frame - An approximate length of each frame based on the sample rate and the expected framerate. Should theoretically be fine as long as it is within 30% of the actual value, as it is continuously adjusted with an exponential smoothing function at the end of each state-change.
  • queue - An initial value for the internal queue. You likely want to supply an empty VecDeque here.

pub fn with_capacity(samples_per_frame: f32, capacity: usize) -> LTCDecoder[src]

Initialises a decoder with a specific queue capacity.

pub fn write_samples(&mut self, samples: &[f32]) -> bool[src]

Writes a new block of samples to the decoder.

Return value indicates whether the invocation has caused new frames to be added to the internal queue. These can be then extracted by using LTCDecoder's IntoIterator implementation to iterate over the decoder.

This does not ever store a reference or copy of any of the samples.

Trait Implementations

impl<'a> IntoIterator for &'a mut LTCDecoder[src]

Converts a mutable reference to a decoder into an iterator.

Mutability is needed as any items returned from the iterator are removed from the internal queue.

type Item = LTCFrame

The type of the elements being iterated over.

type IntoIter = LTCDecoderIter<'a>

Which kind of iterator are we turning this into?

Auto Trait Implementations

Blanket Implementations

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

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

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

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

impl<T, U> Into<U> for T where
    U: From<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.