pub struct Take<'a, T: ProbablyMutable> { /* private fields */ }
Implementations
sourceimpl<'a, T: ProbablyMutable> Take<'a, T>
impl<'a, T: ProbablyMutable> Take<'a, T>
pub fn new(ptr: MediaItemTake, item: &'a Item<'a, T>) -> Self
pub fn item(&self) -> &Item<'_, T>
pub fn get_visible_fx(&'a self) -> Option<TakeFX<'a, Immutable>>
pub fn is_active(&self) -> bool
pub fn is_midi(&self) -> bool
pub fn n_envelopes(&self) -> usize
pub fn n_fx(&self) -> usize
pub fn n_midi_events(&self) -> usize
pub fn name(&self) -> String
pub fn source(&self) -> Option<Source<'_, Immutable>>
sourcepub fn iter_midi(
&self,
buf_size_override: impl Into<Option<i32>>
) -> ReaperStaticResult<MidiEventBuilder>
pub fn iter_midi(
&self,
buf_size_override: impl Into<Option<i32>>
) -> ReaperStaticResult<MidiEventBuilder>
Get iterator on human-readable MIDI events.
See crate::midi
sourcepub fn get_midi(
&self,
buf_size_override: impl Into<Option<i32>>
) -> ReaperStaticResult<Vec<u8>>
pub fn get_midi(
&self,
buf_size_override: impl Into<Option<i32>>
) -> ReaperStaticResult<Vec<u8>>
Get take raw midi data.
It is quite useless as it is, but, it can be used several times with MidiEventBuilder for iterating through various event types.
In the case one desire to iter through raw binary data
MIDI buffer is returned as a list of { int offset, char flag, int msglen, unsigned char msg[] }
.
- offset: MIDI ticks from previous event
- flag: &1=selected &2=muted
- flag high 4 bits for CC shape: &16=linear, &32=slow start/end, &16|32=fast start, &64=fast end, &64|16=bezier
- msg: the MIDI message.
- A meta-event of type 0xF followed by ’CCBZ ’ and 5 more bytes represents bezier curve data for the previous MIDI event: 1 byte for the bezier type (usually 0) and 4 bytes for the bezier tension as a float.
- For tick intervals longer than a 32 bit word can represent, zero-length meta events may be placed between valid events.
pub fn guid(&self) -> GUID
pub fn start_offset(&self) -> Duration
pub fn volume(&self) -> Volume
pub fn pan(&self) -> Pan
pub fn pan_law(&self) -> PanLaw
pub fn play_rate(&self) -> PlayRate
sourcepub fn pitch(&self) -> Pitch
pub fn pitch(&self) -> Pitch
take pitch adjustment in semitones, -12=one octave down, 0=normal, +12=one octave up, etc
sourcepub fn preserve_pitch(&self) -> bool
pub fn preserve_pitch(&self) -> bool
preserve pitch when changing playback rate
pub fn channel_mode(&self) -> TakeChannelMode
pub fn pitch_mode(&self) -> Option<TakePitchMode>
sourceimpl<'a> Take<'a, Mutable>
impl<'a> Take<'a, Mutable>
pub fn add_audio_accessor(
&mut self
) -> AudioAccessor<'a, Take<'_, Mutable>, Mutable>
pub fn set_active(&mut self)
sourcepub fn add_fx(
&mut self,
name: impl Into<String>,
position: impl Into<Option<u8>>,
even_if_exists: bool
) -> Option<TakeFX<'_, Mutable>>
pub fn add_fx(
&mut self,
name: impl Into<String>,
position: impl Into<Option<u8>>,
even_if_exists: bool
) -> Option<TakeFX<'_, Mutable>>
Add FX at given position, or return existing one.
If even_if_exists
is false
, plugin will be added only
if no plugin exists on track.
Otherwise, if position is None → the last slot will be used. The resulting FX will have real index, that may differ from the desired.
pub fn get_fx_mut(&'a mut self, index: usize) -> Option<TakeFX<'a, Mutable>>
pub fn get_visible_fx_mut(&'a mut self) -> Option<TakeFX<'a, Mutable>>
pub fn select_all_midi_events(&mut self, select: bool)
pub fn sort_midi(&mut self)
pub fn source_mut(&mut self) -> Option<Source<'_, Mutable>>
pub fn set_source<T: ProbablyMutable>(
&mut self,
source: Source<'_, T>
) -> ReaperStaticResult<()>
sourcepub fn set_midi(&self, midi: Vec<u8>) -> ReaperStaticResult<()>
pub fn set_midi(&self, midi: Vec<u8>) -> ReaperStaticResult<()>
Set raw MIDI to take.
Probably, it’s bad idea to construct it DIY, so, see:
pub fn set_name(&mut self, name: impl Into<String>)
pub fn set_guid(&mut self, guid: GUID)
pub fn set_start_offset(&mut self, offset: Duration) -> ReaperStaticResult<()>
pub fn set_volume(&mut self, volume: Volume)
pub fn set_pan(&mut self, pan: Pan)
pub fn set_pan_law(&mut self, pan_law: PanLaw)
pub fn set_play_rate(&mut self, play_rate: PlayRate) -> ReaperStaticResult<()>
sourcepub fn set_pitch(&mut self, pitch: Pitch) -> ReaperStaticResult<()>
pub fn set_pitch(&mut self, pitch: Pitch) -> ReaperStaticResult<()>
take pitch adjustment in semitones, -12=one octave down, 0=normal, +12=one octave up, etc
sourcepub fn set_preserve_pitch(&mut self, preserve: bool)
pub fn set_preserve_pitch(&mut self, preserve: bool)
preserve pitch when changing playback rate
pub fn set_channel_mode(&mut self, mode: TakeChannelMode)
pub fn set_pitch_mode(&mut self, mode: Option<TakePitchMode>)
Trait Implementations
sourceimpl<'a, T: Debug + ProbablyMutable> Debug for Take<'a, T>
impl<'a, T: Debug + ProbablyMutable> Debug for Take<'a, T>
sourceimpl<'a, T: ProbablyMutable> FXParent<'a, TakeFX<'a, Immutable>> for Take<'a, T>
impl<'a, T: ProbablyMutable> FXParent<'a, TakeFX<'a, Immutable>> for Take<'a, T>
fn n_fx(&self) -> usize
fn get_fx(&self, index: usize) -> Option<TakeFX<'_, Immutable>>
fn iter_fx(&'a self) -> FXIterator<'a, T, Self>ⓘNotable traits for FXIterator<'a, T, P>impl<'a, T: FX<Immutable> + 'a, P: FXParent<'a, T>> Iterator for FXIterator<'a, T, P> type Item = T;
where
Self: Sized,
sourceimpl<'a> HasExtState for Take<'a, Mutable>
impl<'a> HasExtState for Take<'a, Mutable>
sourceimpl<'a, T: ProbablyMutable> KnowsProject for Take<'a, T>
impl<'a, T: ProbablyMutable> KnowsProject for Take<'a, T>
sourceimpl<'a, T: PartialEq + ProbablyMutable> PartialEq<Take<'a, T>> for Take<'a, T>
impl<'a, T: PartialEq + ProbablyMutable> PartialEq<Take<'a, T>> for Take<'a, T>
sourceimpl<'a, T: ProbablyMutable> WithReaperPtr<'a> for Take<'a, T>
impl<'a, T: ProbablyMutable> WithReaperPtr<'a> for Take<'a, T>
type Ptr = NonNull<MediaItem_Take>
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, T: ProbablyMutable> StructuralPartialEq for Take<'a, T>
Auto Trait Implementations
impl<'a, T> RefUnwindSafe for Take<'a, T>where
T: RefUnwindSafe,
impl<'a, T> !Send for Take<'a, T>
impl<'a, T> !Sync for Take<'a, T>
impl<'a, T> Unpin for Take<'a, T>
impl<'a, T> UnwindSafe for Take<'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
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