Enable ALSA on DragonFly

DragonFly like FreeBSD uses OSS under the hood but OSS backend isn't
available, so use ALSA.
This commit is contained in:
Jan Beich 2020-01-07 16:18:49 +00:00
parent e77634941d
commit 3ac6f6a689
3 changed files with 5 additions and 5 deletions

View File

@ -34,7 +34,7 @@ pub type SupportedOutputFormats = VecIntoIter<SupportedFormat>;
mod enumerate; mod enumerate;
/// The default linux and freebsd host type. /// The default linux, dragonfly and freebsd host type.
#[derive(Debug)] #[derive(Debug)]
pub struct Host; pub struct Host;
@ -50,7 +50,7 @@ impl HostTrait for Host {
type EventLoop = EventLoop; type EventLoop = EventLoop;
fn is_available() -> bool { fn is_available() -> bool {
// Assume ALSA is always available on linux/freebsd. // Assume ALSA is always available on linux/dragonfly/freebsd.
true true
} }

View File

@ -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; pub(crate) mod alsa;
#[cfg(all(windows, feature = "asio"))] #[cfg(all(windows, feature = "asio"))]
pub(crate) mod asio; pub(crate) mod asio;

View File

@ -466,7 +466,7 @@ macro_rules! impl_platform_host {
} }
// TODO: Add pulseaudio and jack here eventually. // 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 { mod platform_impl {
pub use crate::host::alsa::{ pub use crate::host::alsa::{
Device as AlsaDevice, 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")))] target_os = "ios", target_os = "emscripten")))]
mod platform_impl { mod platform_impl {
pub use crate::host::null::{ pub use crate::host::null::{