From 3ac6f6a6891655390a92b80000fd990547754a21 Mon Sep 17 00:00:00 2001 From: Jan Beich Date: Tue, 7 Jan 2020 16:18:49 +0000 Subject: [PATCH] Enable ALSA on DragonFly DragonFly like FreeBSD uses OSS under the hood but OSS backend isn't available, so use ALSA. --- src/host/alsa/mod.rs | 4 ++-- src/host/mod.rs | 2 +- src/platform/mod.rs | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/host/alsa/mod.rs b/src/host/alsa/mod.rs index afc32c6..646ea2c 100644 --- a/src/host/alsa/mod.rs +++ b/src/host/alsa/mod.rs @@ -34,7 +34,7 @@ pub type SupportedOutputFormats = VecIntoIter; mod enumerate; -/// The default linux and freebsd host type. +/// The default linux, dragonfly and freebsd host type. #[derive(Debug)] pub struct Host; @@ -50,7 +50,7 @@ impl HostTrait for Host { type EventLoop = EventLoop; fn is_available() -> bool { - // Assume ALSA is always available on linux/freebsd. + // Assume ALSA is always available on linux/dragonfly/freebsd. true } diff --git a/src/host/mod.rs b/src/host/mod.rs index 3b1b61a..b64fa12 100644 --- a/src/host/mod.rs +++ b/src/host/mod.rs @@ -1,4 +1,4 @@ -#[cfg(any(target_os = "linux", target_os = "freebsd"))] +#[cfg(any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd"))] pub(crate) mod alsa; #[cfg(all(windows, feature = "asio"))] pub(crate) mod asio; diff --git a/src/platform/mod.rs b/src/platform/mod.rs index 6e9ee28..dedb868 100644 --- a/src/platform/mod.rs +++ b/src/platform/mod.rs @@ -466,7 +466,7 @@ macro_rules! impl_platform_host { } // TODO: Add pulseaudio and jack here eventually. -#[cfg(any(target_os = "linux", target_os = "freebsd"))] +#[cfg(any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd"))] mod platform_impl { pub use crate::host::alsa::{ Device as AlsaDevice, @@ -569,7 +569,7 @@ mod platform_impl { } } -#[cfg(not(any(windows, target_os = "linux", target_os = "freebsd", target_os = "macos", +#[cfg(not(any(windows, target_os = "linux", target_os = "dragonfly", target_os = "freebsd", target_os = "macos", target_os = "ios", target_os = "emscripten")))] mod platform_impl { pub use crate::host::null::{