Struct reaper_medium::PluginContext
source · [−]pub struct PluginContext<'a, UsageScope> { /* private fields */ }
Expand description
This represents the context in which this REAPER plug-in runs.
Implementations
sourceimpl<'a, UsageScope> PluginContext<'a, UsageScope>
impl<'a, UsageScope> PluginContext<'a, UsageScope>
sourcepub fn get_func<'b>(&self, name: impl Into<ReaperStringArg<'b>>) -> *mut c_voidwhere
UsageScope: MainThreadOnly,
pub fn get_func<'b>(&self, name: impl Into<ReaperStringArg<'b>>) -> *mut c_voidwhere
UsageScope: MainThreadOnly,
Returns a generic API function by its name.
The returned *mut c_void
function pointer must be cast to a function pointer type via
transmute()
. Please note that it can be null
if the desired
function is not registered.
sourcepub fn h_instance(&self) -> Option<Hinstance>where
UsageScope: AnyThread,
pub fn h_instance(&self) -> Option<Hinstance>where
UsageScope: AnyThread,
On Windows, this returns the HINSTANCE
passed to DllMain
(VST plug-ins) or
ReaperPluginEntry
(extension plug-ins).
The returned HINSTANCE
represents the handle of the module (DLL) containing the plug-in.
On Linux, this returns None
.
sourcepub fn is_in_main_thread(&self) -> boolwhere
UsageScope: AnyThread,
pub fn is_in_main_thread(&self) -> boolwhere
UsageScope: AnyThread,
Returns whether we are currently in the main thread.
sourcepub fn type_specific(&self) -> TypeSpecificPluginContext<'_>where
UsageScope: AnyThread,
pub fn type_specific(&self) -> TypeSpecificPluginContext<'_>where
UsageScope: AnyThread,
Returns the type-specific plug-in context.
Trait Implementations
sourceimpl<'a, UsageScope: Clone> Clone for PluginContext<'a, UsageScope>
impl<'a, UsageScope: Clone> Clone for PluginContext<'a, UsageScope>
sourcefn clone(&self) -> PluginContext<'a, UsageScope>
fn clone(&self) -> PluginContext<'a, UsageScope>
Returns a copy of the value. Read more
1.0.0 · sourceconst fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl<'a, UsageScope: Debug> Debug for PluginContext<'a, UsageScope>
impl<'a, UsageScope: Debug> Debug for PluginContext<'a, UsageScope>
sourceimpl<'a, UsageScope: PartialEq> PartialEq<PluginContext<'a, UsageScope>> for PluginContext<'a, UsageScope>
impl<'a, UsageScope: PartialEq> PartialEq<PluginContext<'a, UsageScope>> for PluginContext<'a, UsageScope>
sourcefn eq(&self, other: &PluginContext<'a, UsageScope>) -> bool
fn eq(&self, other: &PluginContext<'a, UsageScope>) -> bool
impl<'a, UsageScope: Copy> Copy for PluginContext<'a, UsageScope>
impl<'a, UsageScope: Eq> Eq for PluginContext<'a, UsageScope>
impl<'a, UsageScope> StructuralEq for PluginContext<'a, UsageScope>
impl<'a, UsageScope> StructuralPartialEq for PluginContext<'a, UsageScope>
Auto Trait Implementations
impl<'a, UsageScope> RefUnwindSafe for PluginContext<'a, UsageScope>where
UsageScope: RefUnwindSafe,
impl<'a, UsageScope> !Send for PluginContext<'a, UsageScope>
impl<'a, UsageScope> !Sync for PluginContext<'a, UsageScope>
impl<'a, UsageScope> Unpin for PluginContext<'a, UsageScope>where
UsageScope: Unpin,
impl<'a, UsageScope> UnwindSafe for PluginContext<'a, UsageScope>where
UsageScope: 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
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