pub struct Envelope<'a, P: KnowsProject, T: ProbablyMutable> { /* private fields */ }
Expand description
Can be either TrackEnvelope, or TakeEnvelope
Main points of struct construction are:
- crate::Track::get_envelope
- crate::Track::get_envelope_by_chunk (or guid)
- crate::Track::get_envelope_by_name (I’m not sure it works.)
- [crate::TrackSend::get_envelope]
- [crate::FxParam::add_envelope]
- [crate::Take::get_envelope]
Implementations
sourceimpl<'a, P: KnowsProject, T: ProbablyMutable> Envelope<'a, P, T>
impl<'a, P: KnowsProject, T: ProbablyMutable> Envelope<'a, P, T>
pub fn new(ptr: TrackEnvelope, parent: &'a P) -> Self
pub fn guid(&self) -> GUID
pub fn get_automation_item(
&'a self,
index: usize
) -> Option<AutomationItem<'a, P, T>>
pub fn name(&self) -> String
sourcepub fn state_chunk(&self) -> String
pub fn state_chunk(&self) -> String
Full Envelope state, as it written in project file.
pub fn n_points(&self) -> usize
pub fn n_automation_items(&self) -> usize
pub fn get_point(&self, point_index: usize) -> ReaperStaticResult<EnvelopePoint>
sourcepub fn get_point_by_time(
&self,
position: impl Into<Position>
) -> ReaperStaticResult<EnvelopePoint>
pub fn get_point_by_time(
&self,
position: impl Into<Position>
) -> ReaperStaticResult<EnvelopePoint>
Get the last point before the given time.
sourcepub fn evaluate(
&self,
position: Position,
samplerate: u32,
samples_requested: usize
) -> EnvelopeEvaluateResult
pub fn evaluate(
&self,
position: Position,
samplerate: u32,
samples_requested: usize
) -> EnvelopeEvaluateResult
Get the effective envelope value at a given time position.
samples_requested
is how long the caller expects until the next call
to evaluate
(often, the buffer block size).
sourcepub fn format_value(&self, value: f64) -> String
pub fn format_value(&self, value: f64) -> String
Get value, as it written in GUI
sourcepub fn get_info_value(&self, category: impl Into<String>) -> f64
pub fn get_info_value(&self, category: impl Into<String>) -> f64
Get info value by string key. Should not be used in 99% cases.
Is public only for the case of pointers information retrieval, if suddenly needed.
unimplemented categories:
- P_TRACK : MediaTrack * : parent track pointer (if any)
- P_DESTTRACK : MediaTrack * : destination track pointer, if on a send
- P_ITEM : MediaItem * : parent item pointer (if any)
- P_TAKE : MediaItem_Take * : parent take pointer (if any)
sourcepub fn send_info(&self) -> Option<EnvelopeSendInfo>
pub fn send_info(&self) -> Option<EnvelopeSendInfo>
Is envelope relative to track send\receive\hw_out
None if not.
sourcepub fn automation_state(&self) -> EnvelopeAutomationFlags
pub fn automation_state(&self) -> EnvelopeAutomationFlags
current envelope automation state
sourcepub fn tcp_y_offset(&self) -> usize
pub fn tcp_y_offset(&self) -> usize
Y offset of envelope relative to parent track
(may be separate lane or overlap with track contents)
sourcepub fn tcp_y_offset_wo_padding(&self) -> usize
pub fn tcp_y_offset_wo_padding(&self) -> usize
Y offset of envelope relative to parent track, exclusive of padding
sourcepub fn tcp_height(&self) -> usize
pub fn tcp_height(&self) -> usize
visible height of envelope
sourcepub fn tcp_height_wo_padding(&self) -> usize
pub fn tcp_height_wo_padding(&self) -> usize
visible height of envelope, exclusive of padding
sourceimpl<'a, P: KnowsProject> Envelope<'a, P, Mutable>
impl<'a, P: KnowsProject> Envelope<'a, P, Mutable>
sourcepub fn add_automation_item(
&'a mut self,
pool_id: usize,
position: Position,
length: impl GetLength
) -> AutomationItem<'a, P, Mutable>
pub fn add_automation_item(
&'a mut self,
pool_id: usize,
position: Position,
length: impl GetLength
) -> AutomationItem<'a, P, Mutable>
Insert new automation item.
if pool_id
> 0 automation item will be a new instance of that pool
(which will be created as an empty instance if it does not exist
Otherwise, All underlying points will be collected.
sourcepub fn set_point(
&mut self,
point_index: usize,
position: Option<Position>,
point: EnvelopePoint,
sort: bool
) -> ReaperStaticResult<()>
pub fn set_point(
&mut self,
point_index: usize,
position: Option<Position>,
point: EnvelopePoint,
sort: bool
) -> ReaperStaticResult<()>
Probably, if position == None
— it can lead to moving point to the
beginning
pub fn insert_point(
&mut self,
position: Position,
point: EnvelopePoint,
sort: bool
) -> ReaperStaticResult<()>
pub fn delete_point(&mut self, index: usize) -> ReaperStaticResult<()>
pub fn delete_point_range(
&mut self,
start: impl Into<Position>,
end: impl Into<Position>
) -> ReaperStaticResult<()>
pub fn sort_points(&mut self)
sourcepub fn set_state_chunk(
&mut self,
state: impl Into<String>,
with_undo: bool
) -> ReaperStaticResult<()>
pub fn set_state_chunk(
&mut self,
state: impl Into<String>,
with_undo: bool
) -> ReaperStaticResult<()>
Full Envelope state, as it written in project file.
Trait Implementations
sourceimpl<'a, P: Debug + KnowsProject, T: Debug + ProbablyMutable> Debug for Envelope<'a, P, T>
impl<'a, P: Debug + KnowsProject, T: Debug + ProbablyMutable> Debug for Envelope<'a, P, T>
sourceimpl<'a, P: KnowsProject> HasExtState for Envelope<'a, P, Mutable>
impl<'a, P: KnowsProject> HasExtState for Envelope<'a, P, Mutable>
sourceimpl<'a, P: PartialEq + KnowsProject, T: PartialEq + ProbablyMutable> PartialEq<Envelope<'a, P, T>> for Envelope<'a, P, T>
impl<'a, P: PartialEq + KnowsProject, T: PartialEq + ProbablyMutable> PartialEq<Envelope<'a, P, T>> for Envelope<'a, P, T>
sourceimpl<'a, P: KnowsProject, T: ProbablyMutable> WithReaperPtr<'a> for Envelope<'a, P, T>
impl<'a, P: KnowsProject, T: ProbablyMutable> WithReaperPtr<'a> for Envelope<'a, P, T>
type Ptr = NonNull<TrackEnvelope>
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, P: KnowsProject, T: ProbablyMutable> StructuralPartialEq for Envelope<'a, P, T>
Auto Trait Implementations
impl<'a, P, T> RefUnwindSafe for Envelope<'a, P, T>where
P: RefUnwindSafe,
T: RefUnwindSafe,
impl<'a, P, T> !Send for Envelope<'a, P, T>
impl<'a, P, T> !Sync for Envelope<'a, P, T>
impl<'a, P, T> Unpin for Envelope<'a, P, T>where
T: Unpin,
impl<'a, P, T> UnwindSafe for Envelope<'a, P, T>where
P: RefUnwindSafe,
T: UnwindSafe,
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