1mod audio;
2pub mod client;
3mod engine;
4pub mod history;
5mod hw;
6pub mod kind;
7pub mod message;
8mod midi;
9pub mod mutex;
10mod osc;
11pub mod plugins;
12mod routing;
13#[cfg(unix)]
14mod rubberband;
15pub mod state;
16mod track;
17pub mod workers;
18pub use workers::worker;
19
20pub use plugins::clap;
21#[cfg(all(unix, not(target_os = "macos")))]
22pub use plugins::lv2;
23pub use plugins::vst3;
24
25use tokio::sync::mpsc::{Sender, channel};
26use tokio::task::JoinHandle;
27
28#[cfg(target_os = "macos")]
29pub fn discover_coreaudio_devices() -> Vec<String> {
30 hw::coreaudio::device::list_devices()
31 .into_iter()
32 .map(|d| d.name)
33 .collect()
34}
35
36pub fn init() -> (Sender<message::Message>, JoinHandle<()>) {
37 let (tx, rx) = channel::<message::Message>(32);
38 let mut engine = engine::Engine::new(rx, tx.clone());
39 let handle = tokio::spawn(async move {
40 engine.init().await;
41 engine.work().await;
42 });
43 (tx.clone(), handle)
44}