Development Setup
Set up your environment for contributing to bbx_audio.
Prerequisites
Rust Toolchain
# Install Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# Add nightly toolchain (required for fmt and clippy)
rustup toolchain install nightly
Platform Dependencies
Linux:
sudo apt install alsa libasound2-dev libssl-dev pkg-config
macOS/Windows: No additional dependencies.
Clone and Build
# Clone repository
git clone https://github.com/blackboxaudio/bbx_audio.git
cd bbx_audio
# Build all crates
cargo build --workspace
# Run tests
cargo test --workspace --release
IDE Setup
VS Code
Recommended extensions:
- rust-analyzer
- Even Better TOML
- CodeLLDB (debugging)
Settings (.vscode/settings.json):
{
"rust-analyzer.cargo.features": "all",
"rust-analyzer.check.command": "clippy"
}
Other IDEs
- IntelliJ IDEA - Use Rust plugin
- Vim/Neovim - Use rust-analyzer LSP
- Emacs - Use rustic-mode
Development Workflow
# Format code
cargo +nightly fmt
# Run lints
cargo +nightly clippy
# Run tests
cargo test --workspace --release
# Run an example
cargo run --release --example 01_sine_wave -p bbx_sandbox
Common Tasks
Adding a New Block
- Create block in appropriate
blocks/subdirectory - Add to
BlockTypeenum - Add builder method to
GraphBuilder - Write tests
- Update documentation
Modifying FFI
- Update Rust code in
bbx_plugin - Regenerate header with cbindgen
- Update
bbx_graph.hif needed - Test with JUCE project