Compare commits
No commits in common. "2e69dae28b3b153c6ec5e522d60d437f85382c75" and "6f18f7ffbc187c8d03eff23cf1710e3f9b067a4b" have entirely different histories.
2e69dae28b
...
6f18f7ffbc
|
@ -6,7 +6,11 @@ on:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
runs-on: ubuntu-latest
|
strategy:
|
||||||
|
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
|
||||||
|
@ -22,7 +26,12 @@ jobs:
|
||||||
~/.cargo/git/db/
|
~/.cargo/git/db/
|
||||||
target/
|
target/
|
||||||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
||||||
- name: Install Nix
|
- uses: dtolnay/rust-toolchain@master
|
||||||
uses: https://github.com/cachix/install-nix-action@v31
|
with:
|
||||||
- name: Test
|
toolchain: stable
|
||||||
run: nix develop --command pre-commit run -a
|
components: rustfmt, clippy
|
||||||
|
- 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
|
||||||
|
|
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -1,4 +1,3 @@
|
||||||
/target
|
/target
|
||||||
*.dll
|
*.dll
|
||||||
Cargo.lock
|
Cargo.lock
|
||||||
.direnv
|
|
|
@ -2,13 +2,6 @@
|
||||||
|
|
||||||
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.10.0"
|
version = "0.9.1"
|
||||||
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.16", default-features = false, features = ["bevy_asset"] }
|
bevy = { version = "0.15", default-features = false, features = ["bevy_asset"] }
|
||||||
synthizer = "0.5.6"
|
synthizer = "0.5.6"
|
||||||
thiserror = "2"
|
thiserror = "1"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
bevy = { version = "0.16", default-features = true }
|
bevy = { version = "0.15", default-features = true }
|
||||||
|
|
||||||
[package.metadata.release]
|
[package.metadata.release]
|
||||||
publish = false
|
publish = false
|
||||||
|
|
61
flake.lock
61
flake.lock
|
@ -1,61 +0,0 @@
|
||||||
{
|
|
||||||
"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
54
flake.nix
|
@ -1,54 +0,0 @@
|
||||||
{
|
|
||||||
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.single() {
|
if let Ok(transform) = listener.get_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<&ChildOf>, &mut Sound)>,
|
mut query: Query<(Entity, Option<&Parent>, &mut Sound)>,
|
||||||
mut sources: Query<&mut Source>,
|
mut sources: Query<&mut Source>,
|
||||||
parents: Query<&ChildOf>,
|
parents: Query<&Parent>,
|
||||||
) {
|
) {
|
||||||
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.parent()).is_ok() {
|
if sources.get(**p).is_ok() {
|
||||||
target = Some(p.parent());
|
target = Some(**p);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
parent = parents.get(p.parent()).ok();
|
parent = parents.get(**p).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<(&ChildOf, Option<&Source>)>,
|
parents: Query<(&Parent, 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.parent();
|
target = **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.write(SynthizerEvent::Finished(entity));
|
output.send(SynthizerEvent::Finished(entity));
|
||||||
}
|
}
|
||||||
syz::EventType::Looped => {
|
syz::EventType::Looped => {
|
||||||
output.write(SynthizerEvent::Looped(entity));
|
output.send(SynthizerEvent::Looped(entity));
|
||||||
}
|
}
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user