Struct Source

Source
pub struct Source<'a, T: ProbablyMutable> { /* private fields */ }

Implementations§

Source§

impl<'a, T: ProbablyMutable> Source<'a, T>

Source

pub fn new(take: &'a Take<'a, T>, ptr: PcmSource) -> Self

Source

pub fn take(&self) -> &Take<'a, T>

Source

pub fn filename(&self) -> PathBuf

Source

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.

Source

pub fn n_channels(&self) -> usize

Source

pub fn sample_rate(&self) -> usize

Source

pub fn type_string(&self) -> String

Source type (“WAV, “MIDI”, etc.).

Source

pub fn sub_project(&self) -> Option<Project>

Source

pub fn section_info(&self) -> Option<SourceSectionInfo>

If a section/reverse block, retrieves offset/len/reverse.

Source

pub fn calculate_normalization( &self, units: SourceNoramlizeUnit, target: Volume, start: SourceOffset, end: SourceOffset, ) -> Volume

Source§

impl<'a> Source<'a, Mutable>

Source

pub fn delete(&mut self)

Trait Implementations§

Source§

impl<'a, T: Debug + ProbablyMutable> Debug for Source<'a, T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a, T: PartialEq + ProbablyMutable> PartialEq for Source<'a, T>

Source§

fn eq(&self, other: &Source<'a, T>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a, T: ProbablyMutable> WithReaperPtr for Source<'a, T>

Source§

type Ptr = NonNull<PCM_source>

Source§

fn get_pointer(&self) -> Self::Ptr

Get underlying ReaperPointer.
Source§

fn get(&self) -> Self::Ptr

Get underlying ReaperPointer with validity check.
Source§

fn make_unchecked(&mut self)

Turn validity checks off.
Source§

fn make_checked(&mut self)

Turn validity checks on.
Source§

fn should_check(&self) -> bool

State of validity checks.
Source§

fn require_valid(&self) -> ReaperResult<()>

Return ReaperError::NullPtr if check failed. Read more
Source§

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<()>

Perform function with only one validity check. Read more
Source§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> Downcast for T
where T: Any,

Source§

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>

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)

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)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.