From a36d252d35a1b0e07498bbaf94cd847baf9ee2b6 Mon Sep 17 00:00:00 2001 From: mgi388 <> Date: Sat, 29 Jun 2024 08:43:44 +1000 Subject: [PATCH] Make asset loaders public in prelude --- src/lib.rs | 17 ++++++++++++++++- src/source/flac_loader.rs | 1 + src/source/mp3_loader.rs | 1 + src/source/settings_loader.rs | 1 + src/source/wav_loader.rs | 1 + 5 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index bd13286..191c96c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -71,6 +71,21 @@ pub mod prelude { #[doc(hidden)] pub use crate::instance::{AudioCommandError, AudioInstance, AudioInstanceAssetsExt}; #[doc(hidden)] + #[cfg(feature = "flac")] + pub use crate::source::flac_loader::*; + #[doc(hidden)] + #[cfg(feature = "mp3")] + pub use crate::source::mp3_loader::*; + #[doc(hidden)] + #[cfg(feature = "ogg")] + pub use crate::source::ogg_loader::*; + #[doc(hidden)] + #[cfg(feature = "settings_loader")] + pub use crate::source::settings_loader::*; + #[doc(hidden)] + #[cfg(feature = "wav")] + pub use crate::source::wav_loader::*; + #[doc(hidden)] pub use crate::source::AudioSource; #[doc(hidden)] pub use crate::spatial::{AudioEmitter, AudioReceiver, SpatialAudio}; @@ -80,7 +95,7 @@ pub mod prelude { dsp::Frame, sound::{ static_sound::{StaticSoundData, StaticSoundSettings}, - Sound, SoundData, + FromFileError, Sound, SoundData, }, Volume, }; diff --git a/src/source/flac_loader.rs b/src/source/flac_loader.rs index 741e5aa..48ff5ba 100644 --- a/src/source/flac_loader.rs +++ b/src/source/flac_loader.rs @@ -21,6 +21,7 @@ pub enum FlacLoaderError { FileError(#[from] FromFileError), } +/// Asset loader for FLAC files. #[derive(Default)] pub struct FlacLoader; diff --git a/src/source/mp3_loader.rs b/src/source/mp3_loader.rs index 1bbe78c..3a480fc 100644 --- a/src/source/mp3_loader.rs +++ b/src/source/mp3_loader.rs @@ -9,6 +9,7 @@ use thiserror::Error; use crate::source::AudioSource; +/// Asset loader for MP3 files. #[derive(Default)] pub struct Mp3Loader; diff --git a/src/source/settings_loader.rs b/src/source/settings_loader.rs index 16ef785..0705ff5 100644 --- a/src/source/settings_loader.rs +++ b/src/source/settings_loader.rs @@ -13,6 +13,7 @@ use thiserror::Error; use crate::AudioSource; +/// Asset loader for sound settings files. #[derive(Default)] pub struct SettingsLoader; diff --git a/src/source/wav_loader.rs b/src/source/wav_loader.rs index 2b86da2..d4934b0 100644 --- a/src/source/wav_loader.rs +++ b/src/source/wav_loader.rs @@ -9,6 +9,7 @@ use thiserror::Error; use crate::source::AudioSource; +/// Asset loader for WAV files. #[derive(Default)] pub struct WavLoader;