pub struct HostAudioProcessorHandle<'a> { /* private fields */ }Expand description
An audio-processor handle to the host.
This can be used to perform requests to the host that can only be made from the audio thread.
Implementations§
Source§impl<'a> HostAudioProcessorHandle<'a>
impl<'a> HostAudioProcessorHandle<'a>
Gets a thread-safe host handle from this handle.
Sourcepub const fn as_raw(&self) -> &'a clap_host
pub const fn as_raw(&self) -> &'a clap_host
Returns a raw, C FFI-compatible reference to the host handle.
Returns this handle as a reference to a thread-safe host handle from this handle.
Sourcepub unsafe fn from_raw(raw: NonNull<clap_host>) -> Self
pub unsafe fn from_raw(raw: NonNull<clap_host>) -> Self
Creates a HostAudioProcessorHandle from a raw clap_host pointer.
§Safety
Sourcepub unsafe fn with_arbitrary_lifetime<'b>(&self) -> HostAudioProcessorHandle<'b>
pub unsafe fn with_arbitrary_lifetime<'b>(&self) -> HostAudioProcessorHandle<'b>
Returns a HostAudioProcessorHandle that points to the same host, but with an arbitrary lifetime
instead of the host’s.
This can be useful in situations where you need to use host callbacks in a container that
does not let you use proper lifetimes, but you can still guarantee that host callbacks won’t
be called after the host’s 'a lifetime.
§Safety
The returned handle’s lifetime is completely meaningless here.
Proper care muse be taken in order to ensure no methods on this type are used beyond the
original host 'a lifetime.
Methods from Deref<Target = HostSharedHandle<'a>>§
Methods from Deref<Target = HostInfo<'a>>§
Sourcepub fn clap_version(&self) -> ClapVersion
pub fn clap_version(&self) -> ClapVersion
The ClapVersion the host uses.
Sourcepub fn name(&self) -> Option<&'a CStr>
pub fn name(&self) -> Option<&'a CStr>
A user-friendly name for the host (e.g. “Bitwig Studio”).
This should always be set by the host.
Sourcepub fn vendor(&self) -> Option<&'a CStr>
pub fn vendor(&self) -> Option<&'a CStr>
The host’s vendor (e.g. “Bitwig GmbH”).
This field is optional.
Sourcepub fn version(&self) -> Option<&'a CStr>
pub fn version(&self) -> Option<&'a CStr>
A version string for the host (e.g. “4.3”).
This should always be set by the host.
Sourcepub fn get_extension<E: Extension<ExtensionSide = HostExtensionSide>>(
&self,
) -> Option<E>
pub fn get_extension<E: Extension<ExtensionSide = HostExtensionSide>>( &self, ) -> Option<E>
Retrieves the host’s pointer to the given extension type E.
This returns None if the host does not support the given extension.
§Example
use clack_extensions::log::{HostLog, LogSeverity};
use clack_plugin::host::HostInfo;
let info: HostInfo = /* ... */
if let Some(log) = info.get_extension::<HostLog>() {
// The log extension is supported by this host
} else {
// The log extension is not supported by this host
}