pub struct MergedRecording { /* private fields */ }Expand description
Channels of several recordings, side by side.
Implementations§
Source§impl MergedRecording
impl MergedRecording
Sourcepub fn new(parts: Vec<MergeInput>) -> DspResult<Self>
pub fn new(parts: Vec<MergeInput>) -> DspResult<Self>
Merges parts, each with the channels to take from it (None: all, in order).
§Errors
DspError::InvalidConfig when there are no parts, a part’s channel does not exist, or the
parts differ in sample rate or length.
Trait Implementations§
Source§impl RecordingSource for MergedRecording
impl RecordingSource for MergedRecording
fn info(&self) -> &RecordingInfo
Source§fn read(
&self,
channels: &[usize],
samples: Range<u64>,
out: &mut [f32],
) -> DspResult<()>
fn read( &self, channels: &[usize], samples: Range<u64>, out: &mut [f32], ) -> DspResult<()>
Reads
samples of every channel in channels into out, channel-major and scaled to each
channel’s unit (ChannelInfo):
out[i * n..(i + 1) * n] holds channels[i], where n = samples.end - samples.start.Source§fn read_stored(
&self,
channels: &[usize],
samples: Range<u64>,
out: &mut [u8],
) -> DspResult<()>
fn read_stored( &self, channels: &[usize], samples: Range<u64>, out: &mut [u8], ) -> DspResult<()>
Reads the stored values (
info().format, little-endian, before each channel’s gain and
offset) of samples of every channel in channels into out, channel-major:
out holds channels.len() · n · format.bytes() bytes. Lets pipelines move compact integer
samples and scale them on the device. Read moreSource§fn read_native(
&self,
samples: Range<u64>,
out: &mut [f32],
) -> Result<MemoryOrder, DspError>
fn read_native( &self, samples: Range<u64>, out: &mut [f32], ) -> Result<MemoryOrder, DspError>
Reads
samples of every channel, scaled, in the order the source stores them, and returns
that order: MemoryOrder::ChannelMajor fills out as Self::read of all channels;
MemoryOrder::TimeMajor fills out[t * channels + c]. Whole-recording passes (min/max
summaries) use it to skip the transposition read does for time-major sources. Read moreSource§fn chunk_samples(&self) -> Option<u64>
fn chunk_samples(&self) -> Option<u64>
Samples per storage chunk along time, for formats stored in independently decoded chunks
(Zarr, NWB, mtscomp). Reads covering whole multiples of it, aligned to it, decode each
chunk once;
None when every range costs the same (memory-mapped, in-memory, procedural).fn read_channel( &self, channel: usize, samples: Range<u64>, out: &mut [f32], ) -> Result<(), DspError>
Source§fn read_chunk(
&self,
channels: &[usize],
samples: Range<u64>,
) -> Result<SignalChunk, DspError>
fn read_chunk( &self, channels: &[usize], samples: Range<u64>, ) -> Result<SignalChunk, DspError>
Reads into a newly allocated channel-major
SignalChunk.Auto Trait Implementations§
impl !RefUnwindSafe for MergedRecording
impl !UnwindSafe for MergedRecording
impl Forget for MergedRecording
impl Freeze for MergedRecording
impl Move for MergedRecording
impl Send for MergedRecording
impl Sync for MergedRecording
impl Unpin for MergedRecording
impl UnsafeUnpin for MergedRecording
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more