diff --git a/Cargo.toml b/Cargo.toml index 01e683a..b933c25 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bevy_midi" -version = "0.8.0" +version = "0.9.0" authors = ["Black Phlox "] edition = "2021" license = "MIT OR Apache-2.0" @@ -25,21 +25,21 @@ midir = "0.10" crossbeam-channel = "0.5.8" [dev-dependencies] -bevy_egui = { version = "0.27", features = ["immutable_ctx"]} +bevy_egui = { version = "0.28", features = ["immutable_ctx"]} strum = { version = "0.26", features = ["derive"] } -bevy_mod_picking = "0.18" +bevy_mod_picking = "0.20" [dependencies.bevy] -version = "0.13" +version = "0.14" default-features = false -features = ["multi-threaded"] +features = ["multi_threaded"] [dev-dependencies.bevy] -version = "0.13" +version = "0.14" features = ["bevy_core_pipeline","bevy_asset", "bevy_scene", "bevy_render", "bevy_winit", "bevy_gltf", "bevy_ui", "bevy_text", "zstd", "tonemapping_luts", "ktx2", "hdr"] default-features = false [target.'cfg(target_os = "linux")'.dev-dependencies.bevy] -version = "0.13" +version = "0.14" features = ["x11", "wayland"] default-features = false diff --git a/README.md b/README.md index 3358432..2166313 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,7 @@ See examples |0.10|0.6.X| |0.12|0.7.X| |0.13|0.8.X| +|0.14|0.9.X| # Licensing The project is under dual license MIT and Apache 2.0, so joink to your hearts content, just remember the license agreements. diff --git a/examples/input.rs b/examples/input.rs index fab1262..fee2666 100644 --- a/examples/input.rs +++ b/examples/input.rs @@ -1,4 +1,5 @@ use bevy::{ + color::palettes::basic::{GREEN, RED}, log::{Level, LogPlugin}, prelude::*, }; @@ -27,7 +28,7 @@ fn main() { .add_plugins(DefaultPlugins.set(LogPlugin { level: Level::WARN, filter: "bevy_midi=debug".to_string(), - update_subscriber: None, + ..default() })) .add_plugins(MidiInputPlugin) .add_systems(Startup, setup) @@ -90,10 +91,10 @@ fn show_connection( let text_section = &mut instructions.single_mut().sections[2]; if connection.is_connected() { text_section.value = "Connected\n".to_string(); - text_section.style.color = Color::GREEN; + text_section.style.color = GREEN.into(); } else { text_section.value = "Disconnected\n".to_string(); - text_section.style.color = Color::RED; + text_section.style.color = RED.into(); } } } @@ -146,7 +147,7 @@ fn setup(mut commands: Commands, asset_server: Res) { TextStyle { font: asset_server.load("fonts/FiraSans-Bold.ttf"), font_size: 30.0, - color: Color::RED, + color: RED.into(), }, ), TextSection::new( diff --git a/examples/output.rs b/examples/output.rs index f8dc3a7..9a8b220 100644 --- a/examples/output.rs +++ b/examples/output.rs @@ -1,4 +1,7 @@ -use bevy::prelude::*; +use bevy::{ + color::palettes::basic::{GREEN, RED}, + prelude::*, +}; use bevy_midi::prelude::*; const KEY_PORT_MAP: [(KeyCode, usize); 10] = [ @@ -102,10 +105,10 @@ fn show_connection( let text_section = &mut instructions.single_mut().sections[2]; if connection.is_connected() { text_section.value = "Connected".to_string(); - text_section.style.color = Color::GREEN; + text_section.style.color = GREEN.into(); } else { text_section.value = "Disconnected".to_string(); - text_section.style.color = Color::RED; + text_section.style.color = RED.into(); } } } @@ -139,7 +142,7 @@ fn setup(mut commands: Commands, asset_server: Res) { TextStyle { font: asset_server.load("fonts/FiraSans-Bold.ttf"), font_size: 30.0, - color: Color::RED, + color: RED.into(), }, ), ], diff --git a/examples/piano.rs b/examples/piano.rs index 15a7513..8da5bd5 100644 --- a/examples/piano.rs +++ b/examples/piano.rs @@ -16,7 +16,7 @@ fn main() { .add_plugins(DefaultPlugins.set(LogPlugin { level: Level::WARN, filter: "bevy_midi=debug".to_string(), - update_subscriber: None, + ..default() })) .add_plugins(DefaultPickingPlugins) .add_plugins(MidiInputPlugin) diff --git a/src/input.rs b/src/input.rs index cb10c2b..e973de6 100644 --- a/src/input.rs +++ b/src/input.rs @@ -107,23 +107,20 @@ impl MidiInputConnection { /// An [`Event`](bevy::ecs::event::Event) for incoming midi data. /// /// This event fires from [`CoreStage::PreUpdate`]. -#[derive(Resource)] +#[derive(Resource, Event)] pub struct MidiData { pub stamp: u64, pub message: MidiMessage, } -impl bevy::prelude::Event for MidiData {} - /// The [`Error`] type for midi input operations, accessible as an [`Event`](bevy::ecs::event::Event). -#[derive(Clone, Debug)] +#[derive(Clone, Debug, Event)] pub enum MidiInputError { ConnectionError(ConnectErrorKind), PortRefreshError, } impl Error for MidiInputError {} -impl Event for MidiInputError {} impl Display for MidiInputError { fn fmt(&self, f: &mut std::fmt::Formatter) -> Result<(), std::fmt::Error> { match self { diff --git a/src/output.rs b/src/output.rs index 3d49568..f2b60a5 100644 --- a/src/output.rs +++ b/src/output.rs @@ -99,7 +99,7 @@ impl MidiOutputConnection { } /// The [`Error`] type for midi output operations, accessible as an [`Event`](bevy::ecs::event::Event) -#[derive(Clone, Debug)] +#[derive(Clone, Debug, Event)] pub enum MidiOutputError { ConnectionError(ConnectErrorKind), SendError(midir::SendError), @@ -108,7 +108,6 @@ pub enum MidiOutputError { } impl Error for MidiOutputError {} -impl Event for MidiOutputError {} impl Display for MidiOutputError { fn fmt(&self, f: &mut std::fmt::Formatter) -> Result<(), std::fmt::Error> { match self {