Struct rea_rs::audio_accessor::AudioAccessor
source · [−]pub struct AudioAccessor<'a, T: KnowsProject, P: ProbablyMutable> { /* private fields */ }
Implementations
sourceimpl<'a, T: KnowsProject, P: ProbablyMutable> AudioAccessor<'a, T, P>
impl<'a, T: KnowsProject, P: ProbablyMutable> AudioAccessor<'a, T, P>
pub fn new(parent: &'a T, ptr: AudioAccessor) -> Self
pub fn has_state_changed(&self) -> bool
pub fn start(&self) -> Position
pub fn end(&self) -> Position
sourcepub fn get_sample_block_raw(
&self,
start: SampleAmount,
samples_per_channel: u32,
n_channels: u8,
samplerate: u32
) -> ReaperResult<Option<Vec<f64>>>
pub fn get_sample_block_raw(
&self,
start: SampleAmount,
samples_per_channel: u32,
n_channels: u8,
samplerate: u32
) -> ReaperResult<Option<Vec<f64>>>
Get buffer of samples with given absolute project position in samples.
Returned buffer is Vec<f64>
of length samples_per_channel *
n_channels: values placed sample by sample for each channel in a
turn. E.g. [spl1_ch1, spl1_ch2, spl1_ch3, spl2_ch1, spl2_ch2,
spl3_ch3]
start
is amount of samples since audio accessor start time.
You can look at the routing scheme to see where AudioAccessor is connected in case of track or take parenting: https://wiki.cockos.com/wiki/images/5/50/SWS_loudness_analysis_signal_flow_chart.png
Example from SWS: https://github.com/reaper-oss/sws/blob/bcc8fbc96f30a943bd04fb8030b4a03ea1ff7557/Breeder/BR_Loudness.cpp#L1020-L1079
note
Samples converted back to seconds as persized as possible, but I still afraid a bit of this function being sample-accurate.
sourceimpl<'a, T: KnowsProject> AudioAccessor<'a, T, Mutable>
impl<'a, T: KnowsProject> AudioAccessor<'a, T, Mutable>
Trait Implementations
sourceimpl<'a, T: Debug + KnowsProject, P: Debug + ProbablyMutable> Debug for AudioAccessor<'a, T, P>
impl<'a, T: Debug + KnowsProject, P: Debug + ProbablyMutable> Debug for AudioAccessor<'a, T, P>
sourceimpl<'a, T: KnowsProject, P: ProbablyMutable> Drop for AudioAccessor<'a, T, P>
impl<'a, T: KnowsProject, P: ProbablyMutable> Drop for AudioAccessor<'a, T, P>
sourceimpl<'a, T: PartialEq + KnowsProject, P: PartialEq + ProbablyMutable> PartialEq<AudioAccessor<'a, T, P>> for AudioAccessor<'a, T, P>
impl<'a, T: PartialEq + KnowsProject, P: PartialEq + ProbablyMutable> PartialEq<AudioAccessor<'a, T, P>> for AudioAccessor<'a, T, P>
sourcefn eq(&self, other: &AudioAccessor<'a, T, P>) -> bool
fn eq(&self, other: &AudioAccessor<'a, T, P>) -> bool
sourceimpl<'a, T: KnowsProject, P: ProbablyMutable> WithReaperPtr<'a> for AudioAccessor<'a, T, P>
impl<'a, T: KnowsProject, P: ProbablyMutable> WithReaperPtr<'a> for AudioAccessor<'a, T, P>
type Ptr = NonNull<AudioAccessor>
sourcefn get_pointer(&self) -> Self::Ptr
fn get_pointer(&self) -> Self::Ptr
sourcefn make_unchecked(&mut self)
fn make_unchecked(&mut self)
sourcefn make_checked(&mut self)
fn make_checked(&mut self)
sourcefn should_check(&self) -> bool
fn should_check(&self) -> bool
sourcefn require_valid(&self) -> ReaperResult<()>
fn require_valid(&self) -> ReaperResult<()>
sourcefn require_valid_2(&self, project: &Project) -> ReaperResult<()>
fn require_valid_2(&self, project: &Project) -> ReaperResult<()>
sourcefn with_valid_ptr(
&mut self,
f: impl FnMut(&mut Self) -> ReaperResult<()>
) -> ReaperResult<()>
fn with_valid_ptr(
&mut self,
f: impl FnMut(&mut Self) -> ReaperResult<()>
) -> ReaperResult<()>
impl<'a, T: KnowsProject, P: ProbablyMutable> StructuralPartialEq for AudioAccessor<'a, T, P>
Auto Trait Implementations
impl<'a, T, P> RefUnwindSafe for AudioAccessor<'a, T, P>where
P: RefUnwindSafe,
T: RefUnwindSafe,
impl<'a, T, P> !Send for AudioAccessor<'a, T, P>
impl<'a, T, P> !Sync for AudioAccessor<'a, T, P>
impl<'a, T, P> Unpin for AudioAccessor<'a, T, P>where
P: Unpin,
impl<'a, T, P> UnwindSafe for AudioAccessor<'a, T, P>where
P: UnwindSafe,
T: RefUnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
sourceimpl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
sourcefn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
. Read moresourcefn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read moresourcefn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read moresourcefn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more