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
67
//! Audio Unit v3 plugin hosting. Enabled by the `au3` feature.
//!
//! macOS and iOS only, on the same terms as [`au`](super::au).
//!
//! # What v3 changes, and what it does not
//!
//! A v3 Audio Unit ships as a sandboxed App Extension discovered through
//! `NSExtension`, not as a `.component` dylib, and the host talks to it over
//! XPC. That changes discovery entirely — which is why this is a separate
//! feature with its own scanner,
//! [`truce-rack-au3`](https://docs.rs/truce-rack-au3/1.1.5).
//!
//! It changes rendering not at all. Once an `AudioComponentInstance` is in
//! hand the interface is the v2 one, so a loaded v3 plugin is the same
//! [`AuPlugin`](truce_rack_au::AuPlugin) a v2 load produces, and both go
//! through the same [`host`](super::host) machinery.
//!
//! # Scanning finds more than loading can open
//!
//! `truce-rack-au3` scans by filtering the `AudioComponentFindNext` walk on
//! `kAudioComponentFlag_IsV3AudioUnit`, then forwards loading to
//! `truce-rack-au`. Extensions flagged
//! `kAudioComponentFlag_RequiresAsyncInstantiation` need
//! `AudioComponentInstantiate` with a completion block, which that crate has
//! not implemented — so they are found by a scan and fail on load. The error
//! comes from the backing crate and is returned as-is.
use Path;
use Au3Scanner;
use ;
use Hosted;
/// The loaded form of a v3 Audio Unit.
///
/// The same type [`au::Loaded`](super::au::Loaded) resolves to, for the reason
/// in this module's own documentation: v3 differs in how it is found, not in
/// how it renders.
pub type Loaded = ;
/// Scans `path` for v3 App Extensions and loads the first one.
///
/// # Errors
///
/// Fails if the scan finds no v3 Audio Unit at `path`, if the extension
/// requires async instantiation (see this module's documentation), or if the
/// plugin declares no `channels`-in/`channels`-out layout.
pub