lv2_core/feature/
core_features.rs

1//! Contains the LV2 features defined by the LV2 Core specification.
2//!
3//! This module is for internal organization only and is not meant to be exposed.
4
5use crate::feature::*;
6use std::ffi::c_void;
7use urid::UriBound;
8
9/// Marker feature to signal that the plugin can run in a hard real-time environment.
10pub struct HardRTCapable;
11
12unsafe impl UriBound for HardRTCapable {
13    const URI: &'static [u8] = ::lv2_sys::LV2_CORE__hardRTCapable;
14}
15
16unsafe impl Feature for HardRTCapable {
17    unsafe fn from_feature_ptr(_feature: *const c_void, _: ThreadingClass) -> Option<Self> {
18        Some(Self)
19    }
20}
21
22/// Marker feature to signal the host to avoid in-place operation.
23///
24/// This feature has to be required by any plugin that may break if ANY input port is connected to the same memory location as ANY output port.
25pub struct InPlaceBroken;
26
27unsafe impl UriBound for InPlaceBroken {
28    const URI: &'static [u8] = ::lv2_sys::LV2_CORE__inPlaceBroken;
29}
30
31unsafe impl Feature for InPlaceBroken {
32    unsafe fn from_feature_ptr(_feature: *const c_void, _: ThreadingClass) -> Option<Self> {
33        Some(Self)
34    }
35}
36
37/// Marker feature to signal the host to only run the plugin in a live environment.
38pub struct IsLive;
39
40unsafe impl UriBound for IsLive {
41    const URI: &'static [u8] = ::lv2_sys::LV2_CORE__isLive;
42}
43
44unsafe impl Feature for IsLive {
45    unsafe fn from_feature_ptr(_feature: *const c_void, _: ThreadingClass) -> Option<Self> {
46        Some(Self)
47    }
48}