Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update bevy to 0.12.0 and update breaking changes #46

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ features = [

[dependencies.bevy]
# git = "https://github.com/bevyengine/bevy"
version = "0.11"
default-features = false
version = "0.12"
default-features = false
features = ["bevy_asset"]

[dependencies.bevy_kira_audio]
# git = "https://github.com/NiklasEi/bevy_kira_audio.git"
# branch = "bevy_main"
version = "0.16"
version = "0.18"
default-features = false
features = ["wav"]
optional = true
Expand All @@ -55,7 +55,7 @@ features = ["wav"]

[dev-dependencies.bevy]
# git = "https://github.com/bevyengine/bevy"
version = "0.11"
version = "0.12"
default-features = false
features = [
"bevy_core_pipeline",
Expand All @@ -70,7 +70,7 @@ features = [
"bevy_gilrs",
"png",
"hdr",
"filesystem_watcher",
"file_watcher",
"x11"
]

Expand Down
3 changes: 2 additions & 1 deletion src/dsp_source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
use {
crate::dsp_graph::DspGraph,
bevy::reflect::{TypePath, TypeUuid},
bevy::asset::{Asset},
fundsp::{hacker32::AudioUnit32, wave::Wave32},
std::{cell::RefCell, sync::Arc},
};
Expand All @@ -12,7 +13,7 @@ use {
///
/// These can be played directly when the [`SourceType`] is dynamic,
/// otherwise, the DSP source must be played with a given duration.
#[derive(TypeUuid, Clone, TypePath)]
#[derive(Asset, TypeUuid, Clone, TypePath)]
#[uuid = "107a9069-d37d-46a8-92f2-23ec23b73bf6"]
pub struct DspSource {
pub(crate) dsp_graph: Arc<dyn DspGraph>,
Expand Down
15 changes: 6 additions & 9 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@
//! It is more intuitive to remove the parentheses when writing these types of expressions,
//! as FunDSP is essentially a domain specific language.
//! See the [FunDSP] README for more information.
//!
//!
//! [FunDSP]: https://github.com/SamiPerttu/fundsp
//! [Bevy]: https://bevyengine.org/

use {
backend::{Backend, DefaultBackend},
bevy::prelude::{AddAsset, App, Plugin},
bevy::prelude::{App, AssetApp, Plugin},
dsp_graph::DspGraph,
dsp_manager::DspManager,
dsp_source::{DspSource, SourceType},
Expand All @@ -49,8 +49,7 @@ pub mod dsp_source;
/// # use bevy::prelude::*;
/// # use bevy_fundsp::prelude::*;
/// App::new()
/// .add_plugins(DefaultPlugins)
/// .add_plugin(DspPlugin::default())
/// .add_plugins((DefaultPlugins, DspPlugin::default()))
/// .run()
/// ```
pub struct DspPlugin {
Expand All @@ -70,8 +69,7 @@ impl DspPlugin {
/// # use bevy::prelude::*;
/// # use bevy_fundsp::prelude::*;
/// App::new()
/// .add_plugins(DefaultPlugins)
/// .add_plugin(DspPlugin::new(44100.0))
/// .add_plugins((DefaultPlugins, DspPlugin::new(44100.0)))
/// .run()
/// ```
#[allow(clippy::must_use_candidate)]
Expand All @@ -89,7 +87,7 @@ impl Default for DspPlugin {
impl Plugin for DspPlugin {
fn build(&self, app: &mut App) {
app.insert_resource(DspManager::new(self.sample_rate))
.add_asset::<DspSource>();
.init_asset::<DspSource>();

DefaultBackend::init_app(app);
}
Expand All @@ -105,8 +103,7 @@ pub trait DspAppExt {
/// # use bevy::prelude::*;
/// # use bevy_fundsp::prelude::*;
/// App::new()
/// .add_plugins(DefaultPlugins)
/// .add_plugin(DspPlugin::default())
/// .add_plugins((DefaultPlugins, DspPlugin::default()))
/// .add_dsp_source(a_simple_440hz_sine_wave, SourceType::Dynamic)
/// .run();
///
Expand Down
Loading