Enum voicemeeter::DeviceBuffer
source · pub enum DeviceBuffer<T> {
None,
Buffer(T),
}
interface
only.Expand description
A devices buffer.
See BufferMainData
, BufferInData
and BufferOutData
for examples.
Variants§
Implementations§
source§impl<T> DeviceBuffer<T>
impl<T> DeviceBuffer<T>
sourcepub fn as_opt_ref(&self) -> Option<&T>
pub fn as_opt_ref(&self) -> Option<&T>
Converts from &DeviceBuffer<T>
to Option<&T>
.
sourcepub fn as_opt_mut(&mut self) -> Option<&mut T>
pub fn as_opt_mut(&mut self) -> Option<&mut T>
Converts from &mut DeviceBuffer<T>
to Option<&mut T>
.
sourcepub fn as_ref(&self) -> DeviceBuffer<&T>
pub fn as_ref(&self) -> DeviceBuffer<&T>
Converts from &DeviceBuffer<T>
to DeviceBuffer<&T>
.
sourcepub fn as_mut(&mut self) -> DeviceBuffer<&mut T>
pub fn as_mut(&mut self) -> DeviceBuffer<&mut T>
Converts from &mut DeviceBuffer<T>
to DeviceBuffer<&mut T>
.
source§impl<'a, 'b: 'a, B> DeviceBuffer<B>where
B: BufferMut<'a, 'b>,
impl<'a, 'b: 'a, B> DeviceBuffer<B>where
B: BufferMut<'a, 'b>,
sourcepub fn to_mut_slice(&'a mut self) -> &'a mut [&'b mut [f32]]
pub fn to_mut_slice(&'a mut self) -> &'a mut [&'b mut [f32]]
Make the buffer into a mutable slice
sourcepub fn as_mut_slice(&mut self) -> DeviceBuffer<&mut [&'b mut [f32]]>
pub fn as_mut_slice(&mut self) -> DeviceBuffer<&mut [&'b mut [f32]]>
Get the buffer as a mutable slice
sourcepub fn apply<F, B2: Buffer<'a, 'b>>(
&'a mut self,
read: &'a DeviceBuffer<B2>,
f: F
)
pub fn apply<F, B2: Buffer<'a, 'b>>( &'a mut self, read: &'a DeviceBuffer<B2>, f: F )
Given a device, apply a specific function on all channels
The function is given the current channel as the first argument, the samples in the read buffer as the second argument, and the write buffer as the third argument.
sourcepub fn apply_all_samples<F, B2: Buffer<'a, 'b>>(
&'a mut self,
read: &'a DeviceBuffer<B2>,
f: F
)
pub fn apply_all_samples<F, B2: Buffer<'a, 'b>>( &'a mut self, read: &'a DeviceBuffer<B2>, f: F )
Given a device, apply a specific function on all channels and their samples.
The function is given the current channel as the first argument, the current sample in the read buffer as the second argument, and the current sample in the write buffer as the third argument.