Skip to content

Commit 1e287ec

Browse files
authored
Update 0.5 (#67)
1 parent b7ed5b4 commit 1e287ec

File tree

15 files changed

+87
-69
lines changed

15 files changed

+87
-69
lines changed

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ hound = { version = "3.4", optional = true }
2020
lewton = { version = "0.10", optional = true }
2121
claxon = { version = "0.4", optional = true }
2222
minimp3 = { version = "0.5", optional = true }
23-
bevy_math = { version = "0.10", features = ["mint"] }
23+
bevy_math = { version = "0.11", features = ["mint"] }
2424

2525
[features]
2626
wav = ["hound"]
@@ -29,7 +29,7 @@ ogg = ["lewton"]
2929
flac = ["claxon"]
3030

3131
[dependencies.bevy]
32-
version = "0.10"
32+
version = "0.11"
3333
default-features = false
3434
features = ["bevy_asset"]
3535

@@ -38,7 +38,7 @@ fastrand = "2.0"
3838

3939
[dev-dependencies.bevy]
4040
# git = "https://github.com/bevyengine/bevy.git"
41-
version = "0.10"
41+
version = "0.11"
4242
default-features = false
4343
features = [
4444
# "render",

examples/gain.rs

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
use {
22
bevy::{
33
prelude::{
4-
App, Assets, Commands, Deref, Handle, IntoSystemConfig, Res, ResMut, Resource,
5-
StartupSet,
4+
App, Assets, Commands, Deref, Handle, PostStartup, Res, ResMut, Resource, Startup,
5+
Update,
66
},
7-
reflect::TypeUuid,
7+
reflect::{TypePath, TypeUuid},
88
time::Time,
99
DefaultPlugins,
1010
},
1111
bevy_oddio::{builtins::sine, output::AudioSink, Audio, AudioApp, AudioPlugin, ToSignal},
1212
oddio::Sample,
1313
};
1414

15-
#[derive(TypeUuid)]
15+
#[derive(TypeUuid, TypePath)]
1616
#[uuid = "54498976-f7db-4ee7-a2e6-5fee0fcadbfb"]
1717
struct SineWithGain;
1818

@@ -28,11 +28,11 @@ impl ToSignal for SineWithGain {
2828
fn main() {
2929
App::new()
3030
.add_plugins(DefaultPlugins)
31-
.add_plugin(AudioPlugin::new())
31+
.add_plugins(AudioPlugin::new())
3232
.add_audio_source::<_, SineWithGain>()
33-
.add_startup_system(init_assets)
34-
.add_startup_system(play_sine_with_gain.in_base_set(StartupSet::PostStartup))
35-
.add_system(change_volume)
33+
.add_systems(Startup, init_assets)
34+
.add_systems(PostStartup, play_sine_with_gain)
35+
.add_systems(Update, change_volume)
3636
.run();
3737
}
3838

@@ -60,7 +60,9 @@ fn change_volume(
6060
mut sinks: ResMut<Assets<AudioSink<SineWithGain>>>,
6161
time: Res<Time>,
6262
) {
63-
let Some(sink) = sinks.get_mut(&sink_handle.0) else { return };
63+
let Some(sink) = sinks.get_mut(&sink_handle.0) else {
64+
return;
65+
};
6466

6567
let factor = (time.elapsed_seconds_wrapped().sin() + 1.0) / 2.0;
6668

examples/noise.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
use {
22
bevy::{
33
prelude::{
4-
App, Assets, Commands, Deref, Handle, IntoSystemConfig, Res, ResMut, Resource,
5-
StartupSet,
4+
App, Assets, Commands, Deref, Handle, PostStartup, Res, ResMut, Resource, Startup,
65
},
7-
reflect::TypeUuid,
6+
reflect::{TypePath, TypeUuid},
87
DefaultPlugins,
98
},
109
bevy_oddio::{output::AudioSink, Audio, AudioApp, AudioPlugin, ToSignal},
1110
oddio::{Sample, Signal},
1211
};
1312

14-
#[derive(TypeUuid)]
13+
#[derive(TypeUuid, TypePath)]
1514
#[uuid = "7cc24057-b499-4f7a-8f8a-e37dfa64be32"]
1615
struct Noise;
1716
#[derive(Resource)]
@@ -41,10 +40,10 @@ impl ToSignal for Noise {
4140
fn main() {
4241
App::new()
4342
.add_plugins(DefaultPlugins)
44-
.add_plugin(AudioPlugin::new())
43+
.add_plugins(AudioPlugin::new())
4544
.add_audio_source::<_, Noise>()
46-
.add_startup_system(init_assets)
47-
.add_startup_system(play_noise.in_base_set(StartupSet::PostStartup))
45+
.add_systems(Startup, init_assets)
46+
.add_systems(PostStartup, play_noise)
4847
.run();
4948
}
5049

examples/sine.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
use {
22
bevy::{
33
prelude::{
4-
App, Assets, Commands, Deref, Handle, IntoSystemConfig, Res, ResMut, Resource,
5-
StartupSet,
4+
App, Assets, Commands, Deref, Handle, PostStartup, Res, ResMut, Resource, Startup,
65
},
76
DefaultPlugins,
87
},
@@ -17,9 +16,9 @@ use {
1716
fn main() {
1817
App::new()
1918
.add_plugins(DefaultPlugins)
20-
.add_plugin(AudioPlugin::new())
21-
.add_startup_system(init_assets)
22-
.add_startup_system(play_sine.in_base_set(StartupSet::PostStartup))
19+
.add_plugins(AudioPlugin::new())
20+
.add_systems(Startup, init_assets)
21+
.add_systems(PostStartup, play_sine)
2322
.run();
2423
}
2524

examples/spatial_2d.rs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ use {
22
bevy::{
33
prelude::{
44
default, App, Assets, BuildChildren, Camera2dBundle, Color, Commands, Component, Deref,
5-
Handle, IntoSystemConfig, Query, Res, ResMut, Resource, SpatialBundle, StartupSet,
6-
Transform, Vec2, Vec3, With,
5+
Handle, PostStartup, Query, Res, ResMut, Resource, SpatialBundle, Startup, Transform,
6+
Update, Vec2, Vec3, With,
77
},
88
sprite::{Sprite, SpriteBundle},
99
time::Time,
@@ -20,10 +20,10 @@ use {
2020
fn main() {
2121
App::new()
2222
.add_plugins(DefaultPlugins)
23-
.add_plugin(AudioPlugin::new())
24-
.add_startup_system(init_assets)
25-
.add_startup_system(setup.in_base_set(StartupSet::PostStartup))
26-
.add_system(change_velocity)
23+
.add_plugins(AudioPlugin::new())
24+
.add_systems(Startup, init_assets)
25+
.add_systems(PostStartup, setup)
26+
.add_systems(Update, change_velocity)
2727
.run();
2828
}
2929

@@ -86,7 +86,9 @@ fn change_velocity(
8686
let normalized_time = time.elapsed_seconds_wrapped().sin() * 5.0;
8787
let delta = time.delta_seconds();
8888

89-
let Some(sink) = sinks.get_mut(&sink.0) else { return };
89+
let Some(sink) = sinks.get_mut(&sink.0) else {
90+
return;
91+
};
9092

9193
let prev_pos = emitter.translation;
9294
let position = Vec3::new(normalized_time, prev_pos.y, prev_pos.z);

examples/spatial_3d.rs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ use {
22
bevy::{
33
prelude::{
44
default, shape, App, Assets, Camera3dBundle, Color, Commands, Component, Deref, Handle,
5-
IntoSystemConfig, Mesh, PbrBundle, PointLight, PointLightBundle, Query, Res, ResMut,
6-
Resource, StandardMaterial, StartupSet, Transform, Vec3, With,
5+
Mesh, PbrBundle, PointLight, PointLightBundle, PostStartup, Query, Res, ResMut,
6+
Resource, StandardMaterial, Startup, Transform, Update, Vec3, With,
77
},
88
time::Time,
99
DefaultPlugins,
@@ -19,10 +19,10 @@ use {
1919
fn main() {
2020
App::new()
2121
.add_plugins(DefaultPlugins)
22-
.add_plugin(AudioPlugin::new())
23-
.add_startup_system(init_assets)
24-
.add_startup_system(setup.in_base_set(StartupSet::PostStartup))
25-
.add_system(change_velocity)
22+
.add_plugins(AudioPlugin::new())
23+
.add_systems(Startup, init_assets)
24+
.add_systems(PostStartup, setup)
25+
.add_systems(Update, change_velocity)
2626
.run();
2727
}
2828

@@ -111,7 +111,9 @@ fn change_velocity(
111111
let z = time.elapsed_seconds_wrapped().cos() * 3.0;
112112
let delta = time.delta_seconds();
113113

114-
let Some(sink) = sinks.get_mut(&sink.0) else { return };
114+
let Some(sink) = sinks.get_mut(&sink.0) else {
115+
return;
116+
};
115117

116118
let prev_pos = emitter.translation;
117119
let position = Vec3::new(x, prev_pos.y, z);

examples/stop.rs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
use {
22
bevy::{
33
prelude::{
4-
App, Assets, Commands, Deref, Handle, Input, IntoSystemConfig, KeyCode, Res, ResMut,
5-
Resource, StartupSet,
4+
App, Assets, Commands, Deref, Handle, Input, KeyCode, PostStartup, Res, ResMut,
5+
Resource, Startup, Update,
66
},
77
DefaultPlugins,
88
},
@@ -17,10 +17,10 @@ use {
1717
fn main() {
1818
App::new()
1919
.add_plugins(DefaultPlugins)
20-
.add_plugin(AudioPlugin::new())
21-
.add_startup_system(init_assets)
22-
.add_startup_system(play_sine.in_base_set(StartupSet::PostStartup))
23-
.add_system(get_input)
20+
.add_plugins(AudioPlugin::new())
21+
.add_systems(Startup, init_assets)
22+
.add_systems(PostStartup, play_sine)
23+
.add_systems(Update, get_input)
2424
.run();
2525
}
2626

@@ -49,7 +49,9 @@ fn get_input(
4949
sink: Res<SineSink>,
5050
mut sinks: ResMut<Assets<AudioSink<Sine>>>,
5151
) {
52-
let Some(sink) = sinks.get_mut(&sink.0) else { return };
52+
let Some(sink) = sinks.get_mut(&sink.0) else {
53+
return;
54+
};
5355

5456
let control = sink.control::<oddio::Stop<_>, _>();
5557

src/builtins/constant.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
use {crate::ToSignal, bevy::reflect::TypeUuid, std::marker::PhantomData};
1+
use {
2+
crate::ToSignal,
3+
bevy::reflect::{TypePath, TypeUuid},
4+
std::marker::PhantomData,
5+
};
26

37
/// [`Asset`](bevy::asset::Asset) form of [`Constant`](oddio::Constant)
4-
#[derive(TypeUuid, Default)]
8+
#[derive(TypeUuid, TypePath, Default)]
59
#[uuid = "6bcf912a-91d0-46d3-bd55-e81123bbc591"]
610
pub struct Constant<T> {
711
_phantom: PhantomData<T>,

src/builtins/cycle.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
use {
22
crate::ToSignal,
3-
bevy::reflect::TypeUuid,
3+
bevy::reflect::{TypePath, TypeUuid},
44
oddio::{Frame, Frames},
55
std::{marker::PhantomData, sync::Arc},
66
};
77

88
/// [`Asset`](bevy::asset::Asset) form of [`Constant`](oddio::Constant)
9-
#[derive(TypeUuid, Default)]
9+
#[derive(TypeUuid, TypePath, Default)]
1010
#[uuid = "f391d20f-7654-403a-b7c9-3f3c7991138a"]
1111
pub struct Cycle<T> {
1212
_phantom: PhantomData<T>,

src/builtins/sine.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
use {crate::ToSignal, bevy::reflect::TypeUuid};
1+
use {
2+
crate::ToSignal,
3+
bevy::reflect::{TypePath, TypeUuid},
4+
};
25

36
/// [`Asset`](bevy::asset::Asset) form of [`Sine`](oddio::Sine)
4-
#[derive(TypeUuid)]
7+
#[derive(TypeUuid, TypePath)]
58
#[uuid = "14597aba-d411-4bfc-b227-09cf5f88202f"]
69
pub struct Sine;
710

0 commit comments

Comments
 (0)