pub struct Source<'a, T: ProbablyMutable> { /* private fields */ }
Implementations
sourceimpl<'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.
Trait Implementations
sourceimpl<'a, T: Debug + ProbablyMutable> Debug for Source<'a, T>
impl<'a, T: Debug + ProbablyMutable> Debug for Source<'a, T>
sourceimpl<'a, T: PartialEq + ProbablyMutable> PartialEq<Source<'a, T>> for Source<'a, T>
impl<'a, T: PartialEq + ProbablyMutable> PartialEq<Source<'a, T>> for Source<'a, T>
sourceimpl<'a, T: ProbablyMutable> WithReaperPtr<'a> for Source<'a, T>
impl<'a, T: ProbablyMutable> WithReaperPtr<'a> for Source<'a, T>
type Ptr = NonNull<PCM_source>
sourcefn get_pointer(&self) -> Self::Ptr
fn get_pointer(&self) -> Self::Ptr
Get underlying ReaperPointer.
sourcefn make_unchecked(&mut self)
fn make_unchecked(&mut self)
Turn validity checks off.
sourcefn make_checked(&mut self)
fn make_checked(&mut self)
Turn validity checks on.
sourcefn should_check(&self) -> bool
fn should_check(&self) -> bool
State of validity checks.
sourcefn require_valid(&self) -> ReaperResult<()>
fn require_valid(&self) -> ReaperResult<()>
Return ReaperError::NullPtr if check failed. Read more
sourcefn require_valid_2(&self, project: &Project) -> ReaperResult<()>
fn require_valid_2(&self, project: &Project) -> ReaperResult<()>
Return ReaperError::NullPtr if check failed. Read more
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<()>
Perform function with only one validity check. Read more
impl<'a, T: ProbablyMutable> StructuralPartialEq for Source<'a, T>
Auto Trait Implementations
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
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
Mutably borrows from an owned value. Read more
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>
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
. Read moresourcefn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert
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)
Convert
&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)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more