1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/// Evidence from a native query, not a guarantee that an operation will succeed.
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]
#[non_exhaustive]
pub enum Support {
/// The format has no safe query, or the query did not determine support.
#[default]
Unknown,
/// The native query explicitly reported that the feature is unavailable.
Unsupported,
/// The native query reported support for the current configuration.
Supported,
}
impl From<bool> for Support {
fn from(supported: bool) -> Self {
if supported {
Self::Supported
} else {
Self::Unsupported
}
}
}
/// A snapshot for the current platform and plugin configuration. Static scan metadata does not
/// establish these capabilities. Unknown is distinct from explicitly unsupported.
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]
#[non_exhaustive]
pub struct Capabilities {
/// A native editor embedded in the helper's parent window (not a floating-only editor).
pub embedded_editor: Support,
/// Enumerating detailed audio bus descriptions, not arbitrary layout acceptance.
pub bus_discovery: Support,
/// Note on/off input and output; does not imply support for all MIDI messages or dialects.
pub note_input: Support,
/// Producing note on/off events; other event kinds require their own port capabilities.
pub note_output: Support,
/// Applying normalized parameter edits at sample offsets within a block.
pub sample_accurate_automation: Support,
/// Saving and restoring native plugin state.
pub state: Support,
/// Enumerating factory programs/presets. File-based preset loading is a separate operation.
pub factory_presets: Support,
/// Processing all exposed audio ports in this precision. Layout negotiation may still fail.
pub f32: Support,
/// Processing all exposed audio ports in double precision; layout negotiation can still fail.
pub f64: Support,
}
/// Native plugin evidence and the isolated Chain API's implementation for the queried slot.
/// A feature needs both sides to support it. This does not describe the in-process API's limits.
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[non_exhaustive]
pub struct CapabilityReport {
/// Features reported by the native plugin.
pub plugin: Capabilities,
/// Features implemented by the isolated host path.
pub host: Capabilities,
}
impl CapabilityReport {
/// Combines independent plugin evidence and host implementation support.
#[must_use]
pub fn new(plugin: Capabilities, host: Capabilities) -> CapabilityReport {
CapabilityReport { plugin, host }
}
}