pub struct Source<'a, T: ProbablyMutable> { /* private fields */ }
Implementations§
Source§impl<'a, T: ProbablyMutable> Source<'a, T>
impl<'a, T: ProbablyMutable> Source<'a, T>
pub fn new(take: &'a Take<'a, T>, ptr: PcmSource) -> Self
pub fn take(&self) -> &Take<'a, T>
pub fn filename(&self) -> PathBuf
Sourcepub fn length(&self) -> Duration
pub fn length(&self) -> Duration
Get source media length.
§Safety
Reaper can return length as quarter notes. Since, there is no very good way to determine length in qn as duration, it can fail sometimes.
pub fn n_channels(&self) -> usize
pub fn sample_rate(&self) -> usize
Sourcepub fn type_string(&self) -> String
pub fn type_string(&self) -> String
Source type (“WAV, “MIDI”, etc.).
pub fn sub_project(&self) -> Option<Project>
Sourcepub fn section_info(&self) -> Option<SourceSectionInfo>
pub fn section_info(&self) -> Option<SourceSectionInfo>
If a section/reverse block, retrieves offset/len/reverse.
pub fn calculate_normalization( &self, units: SourceNoramlizeUnit, target: Volume, start: SourceOffset, end: SourceOffset, ) -> Volume
Trait Implementations§
Source§impl<'a, T: ProbablyMutable> WithReaperPtr for Source<'a, T>
impl<'a, T: ProbablyMutable> WithReaperPtr for Source<'a, T>
type Ptr = NonNull<PCM_source>
Source§fn get_pointer(&self) -> Self::Ptr
fn get_pointer(&self) -> Self::Ptr
Get underlying ReaperPointer.
Source§fn make_unchecked(&mut self)
fn make_unchecked(&mut self)
Turn validity checks off.
Source§fn make_checked(&mut self)
fn make_checked(&mut self)
Turn validity checks on.
Source§fn should_check(&self) -> bool
fn should_check(&self) -> bool
State of validity checks.
Source§fn require_valid(&self) -> ReaperResult<()>
fn require_valid(&self) -> ReaperResult<()>
Return ReaperError::NullPtr if check failed. Read more
Source§fn require_valid_2(&self, project: &Project) -> ReaperResult<()>
fn require_valid_2(&self, project: &Project) -> ReaperResult<()>
Return ReaperError::NullPtr if check failed. Read more
Source§fn 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<()>
Perform function with only one validity check. Read more
impl<'a, T: ProbablyMutable> StructuralPartialEq for Source<'a, T>
Auto Trait Implementations§
impl<'a, T> Freeze for Source<'a, T>
impl<'a, T> RefUnwindSafe for Source<'a, T>where
T: RefUnwindSafe,
impl<'a, T> !Send for Source<'a, T>
impl<'a, T> !Sync for Source<'a, T>
impl<'a, T> Unpin for Source<'a, T>
impl<'a, T> UnwindSafe for Source<'a, T>where
T: RefUnwindSafe,
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
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
.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.