Struct rea_rs::envelope::AutomationItem
source · [−]pub struct AutomationItem<'a, P: KnowsProject, T: ProbablyMutable> { /* private fields */ }
Implementations
sourceimpl<'a, P: KnowsProject, T: ProbablyMutable> AutomationItem<'a, P, T>
impl<'a, P: KnowsProject, T: ProbablyMutable> AutomationItem<'a, P, T>
pub fn index(&self) -> usize
pub fn n_points(&self, only_visible: bool) -> usize
sourcepub fn get_point(
&self,
only_visible: bool,
point_index: usize
) -> ReaperStaticResult<EnvelopePoint>
pub fn get_point(
&self,
only_visible: bool,
point_index: usize
) -> ReaperStaticResult<EnvelopePoint>
if only_visible == true
, points will be presented as they are seen in
project, including loop, if enabled.
otherwise — raw representation, including those, that are truncated by item bounds.
sourcepub fn get_point_by_time(
&self,
only_visible: bool,
position: impl Into<Position>
) -> ReaperStaticResult<EnvelopePoint>
pub fn get_point_by_time(
&self,
only_visible: bool,
position: impl Into<Position>
) -> ReaperStaticResult<EnvelopePoint>
Get the last point before the given time.
if only_visible == true
, points will be presented as they are seen in
project, including loop, if enabled.
otherwise — raw representation, including those, that are truncated by item bounds.
sourcepub fn pool_id(&self) -> usize
pub fn pool_id(&self) -> usize
automation item pool ID (as an integer)
edits are propagated to all other automation items that share a pool ID
pub fn position(&self) -> Position
pub fn length(&self) -> Duration
pub fn start_offset(&self) -> Duration
pub fn play_rate(&self) -> f64
pub fn base_line(&self) -> f64
pub fn amplitude(&self) -> f64
pub fn is_looped(&self) -> bool
pub fn is_selected(&self) -> bool
pub fn pool_length_in_quarters(&self) -> f64
sourceimpl<'a, P: KnowsProject> AutomationItem<'a, P, Mutable>
impl<'a, P: KnowsProject> AutomationItem<'a, P, Mutable>
sourcepub fn set_pool_id(&mut self, id: usize)
pub fn set_pool_id(&mut self, id: usize)
automation item pool ID (as an integer)
edits are propagated to all other automation items that share a pool ID
pub fn set_position(&mut self, position: Position)
pub fn set_length(&mut self, length: impl GetLength)
pub fn set_play_rate(&mut self, rate: f64)
sourcepub fn set_base_line(&mut self, base_line: f64)
pub fn set_base_line(&mut self, base_line: f64)
Whatever this means, it should be in range of 0.0 .. 1.0
base line seems to work from API (I can set and read it). But it is not set in interface, and didn’t affected to points in tests.
sourcepub fn set_amplitude(&mut self, amplitude: f64)
pub fn set_amplitude(&mut self, amplitude: f64)
Amplitude should be in range of -1.0 .. 1.0
pub fn set_start_offset(&mut self, offset: Duration)
pub fn set_looped(&mut self, looped: bool)
pub fn set_selected(&mut self, selected: bool)
sourcepub fn set_pool_length_in_quarters(&mut self, pool_length_in_quarters: f64)
pub fn set_pool_length_in_quarters(&mut self, pool_length_in_quarters: f64)
automation item pooled source length in quarter notes
(setting will affect all pooled instances)
sourcepub fn set_point(
&mut self,
only_visible: bool,
point_index: usize,
position: Option<Position>,
point: EnvelopePoint,
sort: bool
) -> ReaperStaticResult<()>
pub fn set_point(
&mut self,
only_visible: bool,
point_index: usize,
position: Option<Position>,
point: EnvelopePoint,
sort: bool
) -> ReaperStaticResult<()>
if only_visible == true
, points will be presented as they are seen in
project, including loop, if enabled.
otherwise — raw representation, including those, that are truncated by item bounds.
Probably, if position == None
— it can lead to moving point to the
beginning
sourcepub fn insert_point(
&mut self,
only_visible: bool,
position: Position,
point: EnvelopePoint,
sort: bool
) -> ReaperStaticResult<()>
pub fn insert_point(
&mut self,
only_visible: bool,
position: Position,
point: EnvelopePoint,
sort: bool
) -> ReaperStaticResult<()>
if only_visible == true
, points will be presented as they are seen in
project, including loop, if enabled.
otherwise — raw representation, including those, that are truncated by item bounds.
sourcepub fn delete_point(
&mut self,
only_visible: bool,
index: usize
) -> ReaperStaticResult<()>
pub fn delete_point(
&mut self,
only_visible: bool,
index: usize
) -> ReaperStaticResult<()>
if only_visible == true
, points will be presented as they are seen in
project, including loop, if enabled.
otherwise — raw representation, including those, that are truncated by item bounds.
sourcepub fn delete_point_range(
&mut self,
only_visible: bool,
start: impl Into<Position>,
end: impl Into<Position>
) -> ReaperStaticResult<()>
pub fn delete_point_range(
&mut self,
only_visible: bool,
start: impl Into<Position>,
end: impl Into<Position>
) -> ReaperStaticResult<()>
if only_visible == true
, points will be presented as they are seen in
project, including loop, if enabled.
otherwise — raw representation, including those, that are truncated by item bounds.
pub fn sort_points(&mut self)
Trait Implementations
sourceimpl<'a, P: Debug + KnowsProject, T: Debug + ProbablyMutable> Debug for AutomationItem<'a, P, T>
impl<'a, P: Debug + KnowsProject, T: Debug + ProbablyMutable> Debug for AutomationItem<'a, P, T>
Auto Trait Implementations
impl<'a, P, T> RefUnwindSafe for AutomationItem<'a, P, T>where
P: RefUnwindSafe,
T: RefUnwindSafe,
impl<'a, P, T> !Send for AutomationItem<'a, P, T>
impl<'a, P, T> !Sync for AutomationItem<'a, P, T>
impl<'a, P, T> Unpin for AutomationItem<'a, P, T>
impl<'a, P, T> UnwindSafe for AutomationItem<'a, P, T>where
P: RefUnwindSafe,
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