mirror of
https://github.com/lightsoutgames/bevy_openal.git
synced 2024-12-04 05:55:56 +00:00
Refactor to derive_more
and clean up imports.
This commit is contained in:
parent
7055c53b9a
commit
3dada2fd8d
|
@ -12,6 +12,7 @@ alto = "3"
|
||||||
anyhow = "1"
|
anyhow = "1"
|
||||||
bevy = { version = "0.6", default-features = false }
|
bevy = { version = "0.6", default-features = false }
|
||||||
claxon = "0.4"
|
claxon = "0.4"
|
||||||
|
derive_more = "0.99"
|
||||||
hound = "3"
|
hound = "3"
|
||||||
lewton = "0.10"
|
lewton = "0.10"
|
||||||
minimp3 = "0.5"
|
minimp3 = "0.5"
|
26
src/lib.rs
26
src/lib.rs
|
@ -1,16 +1,11 @@
|
||||||
use std::{
|
use std::{
|
||||||
collections::HashMap,
|
collections::HashMap,
|
||||||
io::Cursor,
|
io::Cursor,
|
||||||
ops::{Deref, DerefMut},
|
|
||||||
sync::{Arc, Mutex},
|
sync::{Arc, Mutex},
|
||||||
};
|
};
|
||||||
|
|
||||||
pub use alto::efx;
|
pub use alto::{efx, Context, Device, Source};
|
||||||
pub use alto::Context;
|
use alto::{efx::AuxEffectSlot, Alto, ContextAttrs, Mono, SourceState, StaticSource, Stereo};
|
||||||
pub use alto::Device;
|
|
||||||
pub use alto::Source;
|
|
||||||
use alto::{efx::AuxEffectSlot, ContextAttrs, SourceState};
|
|
||||||
use alto::{Alto, Mono, StaticSource, Stereo};
|
|
||||||
use bevy::{
|
use bevy::{
|
||||||
asset::{AssetLoader, HandleId, LoadContext, LoadedAsset},
|
asset::{AssetLoader, HandleId, LoadContext, LoadedAsset},
|
||||||
prelude::*,
|
prelude::*,
|
||||||
|
@ -18,6 +13,7 @@ use bevy::{
|
||||||
transform::TransformSystem,
|
transform::TransformSystem,
|
||||||
utils::BoxedFuture,
|
utils::BoxedFuture,
|
||||||
};
|
};
|
||||||
|
use derive_more::{Deref, DerefMut};
|
||||||
use lewton::inside_ogg::OggStreamReader;
|
use lewton::inside_ogg::OggStreamReader;
|
||||||
use minimp3::{Decoder, Error};
|
use minimp3::{Decoder, Error};
|
||||||
|
|
||||||
|
@ -247,23 +243,9 @@ impl Sound {
|
||||||
#[reflect(Component)]
|
#[reflect(Component)]
|
||||||
pub struct Listener;
|
pub struct Listener;
|
||||||
|
|
||||||
#[derive(Default)]
|
#[derive(Default, Deref, DerefMut)]
|
||||||
pub struct GlobalEffects(Vec<AuxEffectSlot>);
|
pub struct GlobalEffects(Vec<AuxEffectSlot>);
|
||||||
|
|
||||||
impl Deref for GlobalEffects {
|
|
||||||
type Target = Vec<AuxEffectSlot>;
|
|
||||||
|
|
||||||
fn deref(&self) -> &Self::Target {
|
|
||||||
&self.0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl DerefMut for GlobalEffects {
|
|
||||||
fn deref_mut(&mut self) -> &mut Self::Target {
|
|
||||||
&mut self.0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn update_listener(
|
fn update_listener(
|
||||||
context: ResMut<Context>,
|
context: ResMut<Context>,
|
||||||
listener: Query<(Option<&Transform>, Option<&GlobalTransform>), With<Listener>>,
|
listener: Query<(Option<&Transform>, Option<&GlobalTransform>), With<Listener>>,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user