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