Compare commits
No commits in common. "2553ea9bc2fdb0ba806528a621556172ed2366ef" and "b76ca954951d79e1c5fc5eac5140e8a65755c582" have entirely different histories.
2553ea9bc2
...
b76ca95495
|
@ -2,12 +2,6 @@
|
|||
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
## Version 0.4.0 - 2023-07-16
|
||||
|
||||
### Miscellaneous Tasks
|
||||
|
||||
- Update to Bevy 0.11.
|
||||
|
||||
## Version 0.3.2 - 2023-05-04
|
||||
|
||||
### Bug Fixes
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "bevy_synthizer"
|
||||
version = "0.4.0"
|
||||
version = "0.3.2"
|
||||
authors = ["Nolan Darilek <nolan@thewordnerd.info>"]
|
||||
description = "A Bevy plugin for Synthizer, a library for 3D audio and synthesis with a focus on games and VR applications"
|
||||
license = "MIT OR Apache-2.0"
|
||||
|
@ -11,11 +11,11 @@ repository = "https://labs.lightsout.games/projects/bevy_synthizer"
|
|||
|
||||
[dependencies]
|
||||
anyhow = "1"
|
||||
bevy = { version = "0.11", default-features = false, features = ["bevy_asset"] }
|
||||
bevy = { version = "0.10", default-features = false, features = ["bevy_asset"] }
|
||||
synthizer = "0.5.6"
|
||||
|
||||
[dev-dependencies]
|
||||
bevy = { version = "0.11", default-features = true }
|
||||
bevy = { version = "0.10", default-features = true }
|
||||
|
||||
[package.metadata.release]
|
||||
publish = false
|
||||
|
|
|
@ -63,19 +63,16 @@ fn rotate_listener(time: Res<Time>, mut query: Query<(&mut RotationTimer, &mut T
|
|||
|
||||
fn main() {
|
||||
App::new()
|
||||
.add_plugins((
|
||||
DefaultPlugins,
|
||||
SynthizerPlugin {
|
||||
default_panner_strategy: Some(bevy_synthizer::syz::PannerStrategy::Hrtf),
|
||||
default_distance_model: Some(bevy_synthizer::syz::DistanceModel::Inverse),
|
||||
..default()
|
||||
},
|
||||
))
|
||||
.add_plugins(DefaultPlugins)
|
||||
.add_plugin(SynthizerPlugin {
|
||||
default_panner_strategy: Some(bevy_synthizer::syz::PannerStrategy::Hrtf),
|
||||
default_distance_model: Some(bevy_synthizer::syz::DistanceModel::Inverse),
|
||||
..default()
|
||||
})
|
||||
.add_system(bevy::window::close_on_esc)
|
||||
.init_resource::<AssetHandles>()
|
||||
.add_systems(Startup, setup)
|
||||
.add_systems(
|
||||
Update,
|
||||
(bevy::window::close_on_esc, load_and_create, rotate_listener),
|
||||
)
|
||||
.add_startup_system(setup)
|
||||
.add_system(load_and_create)
|
||||
.add_system(rotate_listener)
|
||||
.run();
|
||||
}
|
||||
|
|
|
@ -42,15 +42,14 @@ fn rotate_listener(time: Res<Time>, mut query: Query<(&mut RotationTimer, &mut T
|
|||
|
||||
fn main() {
|
||||
App::new()
|
||||
.add_plugins((
|
||||
DefaultPlugins,
|
||||
SynthizerPlugin {
|
||||
default_panner_strategy: Some(bevy_synthizer::syz::PannerStrategy::Hrtf),
|
||||
default_distance_model: Some(bevy_synthizer::syz::DistanceModel::Inverse),
|
||||
..default()
|
||||
},
|
||||
))
|
||||
.add_systems(Startup, setup)
|
||||
.add_systems(Update, (bevy::window::close_on_esc, rotate_listener))
|
||||
.add_plugins(DefaultPlugins)
|
||||
.add_plugin(SynthizerPlugin {
|
||||
default_panner_strategy: Some(bevy_synthizer::syz::PannerStrategy::Hrtf),
|
||||
default_distance_model: Some(bevy_synthizer::syz::DistanceModel::Inverse),
|
||||
..default()
|
||||
})
|
||||
.add_system(bevy::window::close_on_esc)
|
||||
.add_startup_system(setup)
|
||||
.add_system(rotate_listener)
|
||||
.run();
|
||||
}
|
||||
|
|
54
src/lib.rs
54
src/lib.rs
|
@ -4,13 +4,13 @@ use std::collections::HashMap;
|
|||
use bevy::{
|
||||
asset::{AssetLoader, LoadContext, LoadedAsset},
|
||||
prelude::*,
|
||||
reflect::{TypePath, TypeUuid},
|
||||
reflect::TypeUuid,
|
||||
transform::TransformSystem,
|
||||
utils::BoxedFuture,
|
||||
};
|
||||
pub use synthizer as syz;
|
||||
|
||||
#[derive(Clone, Debug, Deref, DerefMut, PartialEq, Eq, TypePath, TypeUuid)]
|
||||
#[derive(Clone, Debug, Deref, DerefMut, PartialEq, Eq, TypeUuid)]
|
||||
#[uuid = "6b6b533a-bb1f-11ec-bda2-00155d8fdde9"]
|
||||
pub struct Buffer(syz::Buffer);
|
||||
|
||||
|
@ -171,7 +171,6 @@ impl Default for Sound {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Event, Debug)]
|
||||
pub enum SynthizerEvent {
|
||||
Finished(Entity),
|
||||
Looped(Entity),
|
||||
|
@ -760,53 +759,44 @@ impl Plugin for SynthizerPlugin {
|
|||
.insert_resource(defaults)
|
||||
.add_event::<SynthizerEvent>()
|
||||
.add_systems(
|
||||
PreUpdate,
|
||||
(
|
||||
sync_config,
|
||||
swap_buffers,
|
||||
change_panner_strategy,
|
||||
add_sound_without_source,
|
||||
)
|
||||
.in_set(SynthizerSets::First),
|
||||
.in_set(SynthizerSets::First)
|
||||
.in_base_set(CoreSet::PreUpdate),
|
||||
)
|
||||
.configure_set(
|
||||
PreUpdate,
|
||||
SynthizerSets::First.before(SynthizerSets::UpdateHandles),
|
||||
.configure_set(SynthizerSets::First.before(SynthizerSets::UpdateHandles))
|
||||
.add_systems(
|
||||
(add_source_handle, add_generator)
|
||||
.in_base_set(CoreSet::PostUpdate)
|
||||
.in_set(SynthizerSets::UpdateHandles),
|
||||
)
|
||||
.configure_set(SynthizerSets::UpdateHandles.before(SynthizerSets::UpdateProperties))
|
||||
.add_system(
|
||||
update_sound_properties
|
||||
.in_base_set(CoreSet::PostUpdate)
|
||||
.in_set(SynthizerSets::UpdateProperties),
|
||||
)
|
||||
.add_systems(
|
||||
PostUpdate,
|
||||
(add_source_handle, add_generator).in_set(SynthizerSets::UpdateHandles),
|
||||
)
|
||||
.configure_set(
|
||||
PostUpdate,
|
||||
SynthizerSets::UpdateHandles.before(SynthizerSets::UpdateProperties),
|
||||
)
|
||||
.add_systems(
|
||||
PostUpdate,
|
||||
update_sound_properties.in_set(SynthizerSets::UpdateProperties),
|
||||
)
|
||||
.add_systems(
|
||||
PostUpdate,
|
||||
(update_listener, update_source_properties)
|
||||
.in_base_set(CoreSet::PostUpdate)
|
||||
.in_set(SynthizerSets::UpdateProperties)
|
||||
.after(TransformSystem::TransformPropagate),
|
||||
)
|
||||
.configure_set(
|
||||
PostUpdate,
|
||||
SynthizerSets::UpdateProperties.before(SynthizerSets::UpdateState),
|
||||
)
|
||||
.configure_set(SynthizerSets::UpdateProperties.before(SynthizerSets::UpdateState))
|
||||
.add_systems(
|
||||
PostUpdate,
|
||||
(update_source_playback_state, update_sound_playback_state)
|
||||
.in_base_set(CoreSet::PostUpdate)
|
||||
.in_set(SynthizerSets::UpdateState),
|
||||
)
|
||||
.configure_set(
|
||||
PostUpdate,
|
||||
SynthizerSets::UpdateState.before(SynthizerSets::Last),
|
||||
)
|
||||
.configure_set(SynthizerSets::UpdateState.before(SynthizerSets::Last))
|
||||
.add_systems(
|
||||
PostUpdate,
|
||||
(remove_sound, events).in_set(SynthizerSets::Last),
|
||||
(remove_sound, events)
|
||||
.in_set(SynthizerSets::Last)
|
||||
.in_base_set(CoreSet::PostUpdate),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user