[−][src]Struct lv2::prelude::PluginInstance
Plugin wrapper which translated between the host and the plugin.
The host interacts with the plugin via a C API, but the plugin is implemented with ideomatic, safe Rust. To bridge this gap, this wrapper is used to translate and abstract the communcation between the host and the plugin.
This struct is repr(C)
and has the plugin as it's first field. Therefore, a valid *mut PluginInstance<T>
is also a valid *mut T
.
Implementations
impl<T> PluginInstance<T> where
T: Plugin,
[src]
T: Plugin,
pub unsafe fn ports(&self, sample_count: u32) -> Option<<T as Plugin>::Ports>
[src]
Try to create a port collection from the currently collected connections.
Safety
This method is unsafe since it needs to dereference raw pointers, which are only valid if the method is called in the "Audio" threading class.
pub unsafe extern "C" fn instantiate(
descriptor: *const LV2_Descriptor,
sample_rate: f64,
bundle_path: *const i8,
features: *const *const LV2_Feature
) -> *mut c_void
[src]
descriptor: *const LV2_Descriptor,
sample_rate: f64,
bundle_path: *const i8,
features: *const *const LV2_Feature
) -> *mut c_void
Instantiate the plugin.
This method provides a required method for the C interface of a plugin and is used by the lv2_descriptors
macro.
Safety
This method is unsafe since it derefences multiple raw pointers and is part of the C interface.
pub unsafe extern "C" fn cleanup(instance: *mut c_void)
[src]
Clean the plugin.
This method provides a required method for the C interface of a plugin and is used by the lv2_descriptors
macro.
Safety
This method is unsafe since it derefences multiple raw pointers and is part of the C interface.
pub unsafe extern "C" fn activate(instance: *mut c_void)
[src]
Call activate
.
This method provides a required method for the C interface of a plugin and is used by the lv2_descriptors
macro.
Safety
This method is unsafe since it derefences multiple raw pointers and is part of the C interface.
pub unsafe extern "C" fn deactivate(instance: *mut c_void)
[src]
Call deactivate
.
This method provides a required method for the C interface of a plugin and is used by the lv2_descriptors
macro.
Safety
This method is unsafe since it derefences multiple raw pointers and is part of the C interface.
pub unsafe extern "C" fn connect_port(
instance: *mut c_void,
port: u32,
data: *mut c_void
)
[src]
instance: *mut c_void,
port: u32,
data: *mut c_void
)
Update a port pointer.
This method provides a required method for the C interface of a plugin and is used by the lv2_descriptors
macro.
Safety
This method is unsafe since it derefences multiple raw pointers and is part of the C interface.
pub unsafe extern "C" fn run(instance: *mut c_void, sample_count: u32)
[src]
Construct a port collection and call the run
method.
This method provides a required method for the C interface of a plugin and is used by the lv2_descriptors
macro.
Safety
This method is unsafe since it derefences multiple raw pointers and is part of the C interface.
pub unsafe extern "C" fn extension_data(uri: *const i8) -> *const c_void
[src]
Dereference the URI, call the extension_data
function and return the pointer.
This method provides a required method for the C interface of a plugin and is used by the lv2_descriptors
macro.
Safety
This method is unsafe since it derefences multiple raw pointers and is part of the C interface.
pub fn plugin_handle(&mut self) -> &mut T
[src]
Retrieve the internal plugin.
pub fn init_class_handle(
&mut self
) -> (&mut T, &mut <T as Plugin>::InitFeatures)
[src]
&mut self
) -> (&mut T, &mut <T as Plugin>::InitFeatures)
Retrieve the required handles to execute an Initialization class method.
This method can be used by extensions to call an extension method in the Initialization threading class and provide it the host features for that class.
pub fn audio_class_handle(
&mut self
) -> (&mut T, &mut <T as Plugin>::AudioFeatures)
[src]
&mut self
) -> (&mut T, &mut <T as Plugin>::AudioFeatures)
Retrieve the required handles to execute an Audio class method.
This method can be used by extensions to call an extension method in the Audio threading class and provide it the host features for that class.
Auto Trait Implementations
impl<T> RefUnwindSafe for PluginInstance<T> where
T: RefUnwindSafe,
<T as Plugin>::AudioFeatures: RefUnwindSafe,
<<T as Plugin>::Ports as PortCollection>::Cache: RefUnwindSafe,
<T as Plugin>::InitFeatures: RefUnwindSafe,
T: RefUnwindSafe,
<T as Plugin>::AudioFeatures: RefUnwindSafe,
<<T as Plugin>::Ports as PortCollection>::Cache: RefUnwindSafe,
<T as Plugin>::InitFeatures: RefUnwindSafe,
impl<T> Send for PluginInstance<T> where
<T as Plugin>::AudioFeatures: Send,
<<T as Plugin>::Ports as PortCollection>::Cache: Send,
<T as Plugin>::InitFeatures: Send,
<T as Plugin>::AudioFeatures: Send,
<<T as Plugin>::Ports as PortCollection>::Cache: Send,
<T as Plugin>::InitFeatures: Send,
impl<T> Sync for PluginInstance<T> where
<T as Plugin>::AudioFeatures: Sync,
<<T as Plugin>::Ports as PortCollection>::Cache: Sync,
<T as Plugin>::InitFeatures: Sync,
<T as Plugin>::AudioFeatures: Sync,
<<T as Plugin>::Ports as PortCollection>::Cache: Sync,
<T as Plugin>::InitFeatures: Sync,
impl<T> Unpin for PluginInstance<T> where
T: Unpin,
<T as Plugin>::AudioFeatures: Unpin,
<<T as Plugin>::Ports as PortCollection>::Cache: Unpin,
<T as Plugin>::InitFeatures: Unpin,
T: Unpin,
<T as Plugin>::AudioFeatures: Unpin,
<<T as Plugin>::Ports as PortCollection>::Cache: Unpin,
<T as Plugin>::InitFeatures: Unpin,
impl<T> UnwindSafe for PluginInstance<T> where
T: UnwindSafe,
<T as Plugin>::AudioFeatures: UnwindSafe,
<<T as Plugin>::Ports as PortCollection>::Cache: UnwindSafe,
<T as Plugin>::InitFeatures: UnwindSafe,
T: UnwindSafe,
<T as Plugin>::AudioFeatures: UnwindSafe,
<<T as Plugin>::Ports as PortCollection>::Cache: UnwindSafe,
<T as Plugin>::InitFeatures: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,