Compare commits
4 Commits
6f18f7ffbc
...
2e69dae28b
Author | SHA1 | Date | |
---|---|---|---|
2e69dae28b | |||
e121945a7c | |||
6a2182ce52 | |||
7b0b3d8262 |
|
@ -6,11 +6,7 @@ on:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
strategy:
|
runs-on: ubuntu-latest
|
||||||
matrix:
|
|
||||||
# os: [windows-latest, ubuntu-latest, macos-latest]
|
|
||||||
os: [ubuntu-latest]
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: actions/cache@v4
|
- uses: actions/cache@v4
|
||||||
|
@ -26,12 +22,7 @@ jobs:
|
||||||
~/.cargo/git/db/
|
~/.cargo/git/db/
|
||||||
target/
|
target/
|
||||||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
||||||
- uses: dtolnay/rust-toolchain@master
|
- name: Install Nix
|
||||||
with:
|
uses: https://github.com/cachix/install-nix-action@v31
|
||||||
toolchain: stable
|
- name: Test
|
||||||
components: rustfmt, clippy
|
run: nix develop --command pre-commit run -a
|
||||||
- name: install Linux build dependencies
|
|
||||||
run: sudo apt-get update; sudo apt-get install -y --no-install-recommends libasound2-dev libudev-dev libwayland-dev libclang-dev cmake
|
|
||||||
if: runner.os == 'linux'
|
|
||||||
- uses: actions/setup-python@v3
|
|
||||||
- uses: pre-commit/action@v3.0.1
|
|
||||||
|
|
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,3 +1,4 @@
|
||||||
/target
|
/target
|
||||||
*.dll
|
*.dll
|
||||||
Cargo.lock
|
Cargo.lock
|
||||||
|
.direnv
|
|
@ -2,6 +2,13 @@
|
||||||
|
|
||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
|
|
||||||
|
## Version 0.10.0 - 2025-05-16
|
||||||
|
|
||||||
|
### Miscellaneous Tasks
|
||||||
|
|
||||||
|
- Add Nix-based build and CI configuration.
|
||||||
|
- Update to Bevy 0.16.
|
||||||
|
|
||||||
## Version 0.9.1 - 2025-01-07
|
## Version 0.9.1 - 2025-01-07
|
||||||
|
|
||||||
### Miscellaneous Tasks
|
### Miscellaneous Tasks
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "bevy_synthizer"
|
name = "bevy_synthizer"
|
||||||
version = "0.9.1"
|
version = "0.10.0"
|
||||||
authors = ["Nolan Darilek <nolan@thewordnerd.info>"]
|
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"
|
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"
|
license = "MIT OR Apache-2.0"
|
||||||
|
@ -10,12 +10,12 @@ repository = "https://labs.lightsout.games/projects/bevy_synthizer"
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
bevy = { version = "0.15", default-features = false, features = ["bevy_asset"] }
|
bevy = { version = "0.16", default-features = false, features = ["bevy_asset"] }
|
||||||
synthizer = "0.5.6"
|
synthizer = "0.5.6"
|
||||||
thiserror = "1"
|
thiserror = "2"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
bevy = { version = "0.15", default-features = true }
|
bevy = { version = "0.16", default-features = true }
|
||||||
|
|
||||||
[package.metadata.release]
|
[package.metadata.release]
|
||||||
publish = false
|
publish = false
|
||||||
|
|
61
flake.lock
Normal file
61
flake.lock
Normal file
|
@ -0,0 +1,61 @@
|
||||||
|
{
|
||||||
|
"nodes": {
|
||||||
|
"nixpkgs": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1747312588,
|
||||||
|
"narHash": "sha256-MmJvj6mlWzeRwKGLcwmZpKaOPZ5nJb/6al5CXqJsgjo=",
|
||||||
|
"owner": "NixOS",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "b1bebd0fe266bbd1820019612ead889e96a8fa2d",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "NixOS",
|
||||||
|
"ref": "nixpkgs-unstable",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": "nixpkgs",
|
||||||
|
"utils": "utils"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"systems": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1681028828,
|
||||||
|
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"utils": {
|
||||||
|
"inputs": {
|
||||||
|
"systems": "systems"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1731533236,
|
||||||
|
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": "root",
|
||||||
|
"version": 7
|
||||||
|
}
|
54
flake.nix
Normal file
54
flake.nix
Normal file
|
@ -0,0 +1,54 @@
|
||||||
|
{
|
||||||
|
inputs = {
|
||||||
|
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
||||||
|
utils.url = "github:numtide/flake-utils";
|
||||||
|
};
|
||||||
|
|
||||||
|
outputs =
|
||||||
|
{
|
||||||
|
self,
|
||||||
|
nixpkgs,
|
||||||
|
utils,
|
||||||
|
}:
|
||||||
|
utils.lib.eachDefaultSystem (
|
||||||
|
system:
|
||||||
|
let
|
||||||
|
pkgs = import nixpkgs { inherit system; };
|
||||||
|
in
|
||||||
|
{
|
||||||
|
devShell =
|
||||||
|
with pkgs;
|
||||||
|
mkShell.override { stdenv = pkgs.clangStdenv; } rec {
|
||||||
|
nativeBuildInputs = [
|
||||||
|
cargo
|
||||||
|
rustc
|
||||||
|
rustfmt
|
||||||
|
rustPackages.clippy
|
||||||
|
cmake
|
||||||
|
pkg-config
|
||||||
|
pre-commit
|
||||||
|
git-cliff
|
||||||
|
cargo-release
|
||||||
|
cargo-outdated
|
||||||
|
];
|
||||||
|
buildInputs = [
|
||||||
|
udev
|
||||||
|
alsa-lib
|
||||||
|
vulkan-loader
|
||||||
|
xorg.libX11
|
||||||
|
xorg.libXcursor
|
||||||
|
xorg.libXi
|
||||||
|
xorg.libXrandr
|
||||||
|
libxkbcommon
|
||||||
|
wayland
|
||||||
|
];
|
||||||
|
shellHook = ''
|
||||||
|
export LIBCLANG_PATH="${pkgs.libclang.lib}/lib"
|
||||||
|
export RUSTFLAGS="-C link-arg=-Wl,-rpath,${lib.makeLibraryPath buildInputs}"
|
||||||
|
pre-commit install
|
||||||
|
'';
|
||||||
|
RUST_SRC_PATH = rustPlatform.rustLibSrc;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
20
src/lib.rs
20
src/lib.rs
|
@ -188,7 +188,7 @@ fn update_listener(
|
||||||
context: ResMut<Context>,
|
context: ResMut<Context>,
|
||||||
listener: Query<Option<&GlobalTransform>, With<Listener>>,
|
listener: Query<Option<&GlobalTransform>, With<Listener>>,
|
||||||
) {
|
) {
|
||||||
if let Ok(transform) = listener.get_single() {
|
if let Ok(transform) = listener.single() {
|
||||||
let transform: Transform = transform
|
let transform: Transform = transform
|
||||||
.map(|v| {
|
.map(|v| {
|
||||||
let transform: Transform = (*v).into();
|
let transform: Transform = (*v).into();
|
||||||
|
@ -272,9 +272,9 @@ fn add_source_handle(
|
||||||
fn add_generator(
|
fn add_generator(
|
||||||
context: Res<Context>,
|
context: Res<Context>,
|
||||||
buffers: Res<Assets<Buffer>>,
|
buffers: Res<Assets<Buffer>>,
|
||||||
mut query: Query<(Entity, Option<&Parent>, &mut Sound)>,
|
mut query: Query<(Entity, Option<&ChildOf>, &mut Sound)>,
|
||||||
mut sources: Query<&mut Source>,
|
mut sources: Query<&mut Source>,
|
||||||
parents: Query<&Parent>,
|
parents: Query<&ChildOf>,
|
||||||
) {
|
) {
|
||||||
for (entity, parent, mut sound) in &mut query {
|
for (entity, parent, mut sound) in &mut query {
|
||||||
if sound.generator.is_some() {
|
if sound.generator.is_some() {
|
||||||
|
@ -286,11 +286,11 @@ fn add_generator(
|
||||||
let mut parent = parent;
|
let mut parent = parent;
|
||||||
let mut target = None;
|
let mut target = None;
|
||||||
while let Some(p) = parent {
|
while let Some(p) = parent {
|
||||||
if sources.get(**p).is_ok() {
|
if sources.get(p.parent()).is_ok() {
|
||||||
target = Some(**p);
|
target = Some(p.parent());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
parent = parents.get(**p).ok();
|
parent = parents.get(p.parent()).ok();
|
||||||
}
|
}
|
||||||
target.map(|v| sources.get_mut(v).unwrap())
|
target.map(|v| sources.get_mut(v).unwrap())
|
||||||
} else {
|
} else {
|
||||||
|
@ -341,7 +341,7 @@ fn add_generator(
|
||||||
fn add_sound_without_source(
|
fn add_sound_without_source(
|
||||||
mut commands: Commands,
|
mut commands: Commands,
|
||||||
query: Query<Entity, (Added<Sound>, Without<Source>)>,
|
query: Query<Entity, (Added<Sound>, Without<Source>)>,
|
||||||
parents: Query<(&Parent, Option<&Source>)>,
|
parents: Query<(&ChildOf, Option<&Source>)>,
|
||||||
) {
|
) {
|
||||||
for entity in &query {
|
for entity in &query {
|
||||||
let mut has_source = false;
|
let mut has_source = false;
|
||||||
|
@ -351,7 +351,7 @@ fn add_sound_without_source(
|
||||||
has_source = true;
|
has_source = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
target = **parent;
|
target = parent.parent();
|
||||||
}
|
}
|
||||||
if !has_source {
|
if !has_source {
|
||||||
commands.entity(entity).insert(Source::default());
|
commands.entity(entity).insert(Source::default());
|
||||||
|
@ -709,10 +709,10 @@ fn events(
|
||||||
if *generator.handle() == event.source {
|
if *generator.handle() == event.source {
|
||||||
match event.r#type {
|
match event.r#type {
|
||||||
syz::EventType::Finished => {
|
syz::EventType::Finished => {
|
||||||
output.send(SynthizerEvent::Finished(entity));
|
output.write(SynthizerEvent::Finished(entity));
|
||||||
}
|
}
|
||||||
syz::EventType::Looped => {
|
syz::EventType::Looped => {
|
||||||
output.send(SynthizerEvent::Looped(entity));
|
output.write(SynthizerEvent::Looped(entity));
|
||||||
}
|
}
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user