lasprs 0.14.3

Library for Acoustic Signal Processing (Rust edition, with optional Python bindings via pyo3)
Documentation
//! Provides stream messages that come from a running stream
use super::*;
use crate::config::*;
use crate::daq::Qty;
use crate::siggen::Siggen;
use anyhow::{Result, bail};
use crossbeam::channel::Sender;
use reinterpret::{reinterpret_slice, reinterpret_vec};
use std::any::TypeId;
use std::sync::{Arc, RwLock};
use strum_macros::Display;

/// Status of the pre-capture buffer, always sent together with stream metadata.
#[derive(Clone, Debug)]
pub enum PreCaptureBuffer {
    /// Buffer is fully loaded with the last 3 seconds of data.
    /// Oldest blocks first.
    Loaded(Vec<Arc<InStreamData>>),
    /// Stream has not been running long enough to fill 3 seconds of pre-capture data.
    NotLoaded,
}

/// Input stream messages, to be send to handlers.
#[derive(Clone, Debug)]
pub enum InStreamMsg {
    /// Raw stream data that is coming from a device. This is interleaved data. The number of channels is correct and
    /// specified in the stream metadata.
    InStreamData(Arc<InStreamData>),

    /// An error has occured in the stream
    StreamError(StreamError),

    /// new Stream metadata enters the scene. Probably a new stream started.
    /// Includes the pre-capture buffer status as second argument.
    StreamStarted(Arc<StreamMetaData>, PreCaptureBuffer),

    /// An existing stream stopped.
    StreamStopped,
}