Skip to content

Commit

Permalink
Merge pull request #125 from mgi388/pub-asset-loaders
Browse files Browse the repository at this point in the history
Make asset loaders public in prelude
  • Loading branch information
NiklasEi authored Jun 29, 2024
2 parents 02dc1f4 + 4c6e017 commit dba0bb6
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand All @@ -80,7 +95,7 @@ pub mod prelude {
dsp::Frame,
sound::{
static_sound::{StaticSoundData, StaticSoundSettings},
Sound, SoundData,
FromFileError, Sound, SoundData,
},
Volume,
};
Expand Down
1 change: 1 addition & 0 deletions src/source/flac_loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ pub enum FlacLoaderError {
FileError(#[from] FromFileError),
}

/// Asset loader for FLAC files.
#[derive(Default)]
pub struct FlacLoader;

Expand Down
1 change: 1 addition & 0 deletions src/source/mp3_loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use thiserror::Error;

use crate::source::AudioSource;

/// Asset loader for MP3 files.
#[derive(Default)]
pub struct Mp3Loader;

Expand Down
1 change: 1 addition & 0 deletions src/source/ogg_loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ pub enum OggLoaderError {
FileError(#[from] FromFileError),
}

/// Asset loader for OGG files.
#[derive(Default)]
pub struct OggLoader;

Expand Down
1 change: 1 addition & 0 deletions src/source/settings_loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ use thiserror::Error;

use crate::AudioSource;

/// Asset loader for sound settings files.
#[derive(Default)]
pub struct SettingsLoader;

Expand Down
1 change: 1 addition & 0 deletions src/source/wav_loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use thiserror::Error;

use crate::source::AudioSource;

/// Asset loader for WAV files.
#[derive(Default)]
pub struct WavLoader;

Expand Down

0 comments on commit dba0bb6

Please sign in to comment.