[−][src]Struct ltc::LTCDecoder
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 emptyVecDeque
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?
fn into_iter(self) -> LTCDecoderIter<'a>
[src]
Auto Trait Implementations
impl RefUnwindSafe for LTCDecoder
impl Send for LTCDecoder
impl Sync for LTCDecoder
impl Unpin for LTCDecoder
impl UnwindSafe for LTCDecoder
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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>,