Skip to content

Commit c93bfe8

Browse files
Merge pull request #86 from RustAudio/develop
Version 0.6 Release
2 parents b3fd950 + 3ec16a2 commit c93bfe8

File tree

242 files changed

+22983
-5378
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

242 files changed

+22983
-5378
lines changed

.cargo/config

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[alias]
2+
systool = "run -p systool --"

.github/workflows/book.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Book
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- develop
8+
9+
jobs:
10+
book:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v2
15+
- uses: actions/[email protected]
16+
with:
17+
python-version: 3.8
18+
- name: Install Sphinx
19+
run: |
20+
python -m pip install --upgrade pip
21+
pip install -r docs/requirements.txt
22+
- name: Build Book
23+
run: |
24+
cd docs
25+
make html
26+
touch _build/html/.nojekyll
27+
- name: Deploy
28+
if: success()
29+
uses: crazy-max/ghaction-github-pages@v1
30+
with:
31+
target_branch: gh-pages
32+
build_dir: docs/_build/html
33+
env:
34+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/rust.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Rust
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- develop
8+
pull_request:
9+
branches:
10+
- master
11+
- develop
12+
13+
jobs:
14+
build:
15+
strategy:
16+
matrix:
17+
os: [ubuntu-latest, windows-latest]
18+
toolchain: [stable, beta, nightly]
19+
20+
runs-on: ${{ matrix.os }}
21+
22+
steps:
23+
- uses: actions/checkout@v2
24+
- uses: actions-rs/toolchain@v1
25+
with:
26+
toolchain: ${{ matrix.toolchain }}
27+
override: true
28+
- name: Build
29+
run: cargo build --all --all-features --verbose
30+
- name: Run tests
31+
run: cargo test --all --all-features --verbose
32+
33+
check:
34+
runs-on: ubuntu-latest
35+
36+
steps:
37+
- uses: actions/checkout@v2
38+
- uses: actions-rs/toolchain@v1
39+
with:
40+
toolchain: stable
41+
override: true
42+
components: rustfmt, clippy
43+
- name: Format
44+
run: cargo fmt --all -- --check
45+
- uses: actions-rs/clippy-check@v1
46+
with:
47+
token: ${{ secrets.GITHUB_TOKEN }}
48+
args: --all --all-features -- -D warnings
49+
50+
linux-bindings:
51+
runs-on: ubuntu-latest
52+
53+
steps:
54+
- uses: actions/checkout@v2
55+
- uses: actions-rs/toolchain@v1
56+
with:
57+
toolchain: stable
58+
override: true
59+
target: i686-unknown-linux-gnu
60+
- name: Install 32-bit libc
61+
run: |
62+
sudo apt-get update
63+
sudo apt-get install libc6-dev-i386
64+
- name: Generate
65+
run: |
66+
mkdir bindings
67+
cargo run -p systool -- -I ./sys/lv2/ -o bindings/x86_64.rs -- -target x86_64-unknown-linux-gnu
68+
cargo run -p systool -- -I ./sys/lv2/ -o bindings/x86.rs -- -target i686-unknown-linux-gnu
69+
- uses: actions/upload-artifact@v1
70+
with:
71+
name: linux-bindings
72+
path: bindings

.travis.yml

Lines changed: 0 additions & 31 deletions
This file was deleted.

CONTRIBUTING.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
# Contributing to rust-lv2
1+
# Contributing to Rust-LV2
22

33
*Inspired by [Rust's contribution guide](https://github.com/rust-lang/rust/blob/d9051341a1c142542a3f7dab509266606c775382/CONTRIBUTING.md).*
44

5-
Thank you for your interest in contributing to rust-lv2! There are many ways to contribute, and we appreciate all of them.
5+
Thank you for your interest in contributing to Rust-LV2! There are many ways to contribute, and we appreciate all of them.
66

77
## General or Usage questions, Feature Ideas or Discussions
88

9-
Our main discussion panel is the [Rust Audio Discourse](https://rust-audio.discourse.group/). Most of our design decisions are taken there and it's the perfect place to post any question or idea. rust-lv2 isn't the only project there, so you may post anything that is somehow related to Rust and Audio Processing.
9+
Our main discussion panel is the [Rust Audio Discourse](https://rust-audio.discourse.group/). Most of our design decisions are taken there and it's the perfect place to post any question or idea. Rust-LV2 isn't the only project there, so you may post anything that is somehow related to Rust and Audio Processing.
1010

1111
## Bug Reports
1212

@@ -39,15 +39,15 @@ Instead, this happened: <explanation>
3939
### Backtrace:
4040
```
4141

42-
All three components are important: what you did, what you expected, what happened instead. Please include the dependencies to rust-lv2 in your `Cargo.toml` so we can track down where to find the bug.
42+
All three components are important: what you did, what you expected, what happened instead. Please include the dependencies to Rust-LV2 in your `Cargo.toml` so we can track down where to find the bug.
4343

4444
Sometimes, a backtrace is helpful, and so including that is nice. To get a backtrace, set the `RUST_BACKTRACE` environment variable to a value other than `0`. The easiest way to do this is to invoke `cargo` like this:
4545

4646
$ RUST_BACKTRACE=1 cargo build
4747

4848
## Pull Requests
4949

50-
Pull requests are the primary mechanism we use to change rust-lv2. GitHub itself has some [great documentation](https://help.github.com/articles/about-pull-requests/) on using the Pull Request feature. We use the "fork and pull" model [described here](https://help.github.com/articles/about-collaborative-development-models/), where contributors push changes to their personal fork and create pull requests to bring those changes into the source repository.
50+
Pull requests are the primary mechanism we use to change Rust-LV2. GitHub itself has some [great documentation](https://help.github.com/articles/about-pull-requests/) on using the Pull Request feature. We use the "fork and pull" model [described here](https://help.github.com/articles/about-collaborative-development-models/), where contributors push changes to their personal fork and create pull requests to bring those changes into the source repository.
5151

5252
Please make pull requests against the `develop` branch.
5353

@@ -59,6 +59,6 @@ Another useful feature are [draft Pull Requests](https://github.blog/2019-02-14-
5959

6060
## Writing Documentation
6161

62-
Documentation improvements are very welcome. The API documentation is generated from the source code itself. However, the [rust-lv2 book](https://github.com/Janonard/rust-lv2-book), which explains how to use rust-lv2 in general, is a separate project. Documentation pull requests function in the same way as other pull requests.
62+
Documentation improvements are very welcome. The API documentation is generated from the source code itself. Documentation pull requests function in the same way as other pull requests.
6363

6464
To find documentation-related issues, sort by the [documentation](https://github.com/RustAudio/rust-lv2/labels/documentation) label.

Cargo.toml

Lines changed: 37 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "lv2"
3-
version = "0.5.1"
3+
version = "0.6.0"
44
authors = ["Jan-Oliver 'Janonard' Opdenhövel <[email protected]>", "Adrien Prokopowicz <[email protected]>",
55
"Yruama_Lairba <[email protected]>"]
66
edition = "2018"
@@ -16,39 +16,43 @@ travis-ci = { repository = "RustAudio/rust-lv2", branch = "master" }
1616
maintenance = { status = "actively-developed" }
1717

1818
[dependencies.lv2-atom]
19-
version = "1.0.0"
19+
version = "2.0.0"
2020
optional = true
2121

2222
[dependencies.lv2-core]
23-
version = "2.0.0"
23+
version = "3.0.0"
2424
optional = true
2525

2626
[dependencies.lv2-midi]
27-
version = "1.0.0"
27+
version = "1.2.0"
2828
optional = true
2929

3030
[dependencies.lv2-time]
31-
version = "0.1.0"
31+
version = "0.1.3"
3232
optional = true
3333

3434
[dependencies.lv2-units]
35-
version = "0.1.0"
35+
version = "0.1.3"
3636
optional = true
3737

3838
[dependencies.urid]
3939
version = "0.1.0"
4040
optional = true
4141

4242
[dependencies.lv2-urid]
43-
version = "2.0.0"
43+
version = "2.1.0"
4444
optional = true
4545

4646
[dependencies.lv2-state]
47-
version = "1.0.0"
47+
version = "2.0.0"
48+
optional = true
49+
50+
[dependencies.lv2-sys]
51+
version = "2.0.0"
4852
optional = true
4953

5054
[dependencies.lv2-worker]
51-
version = "0.1.0"
55+
version = "0.1.1"
5256
optional = true
5357

5458
[features]
@@ -74,6 +78,7 @@ full = [
7478
"urid",
7579
"lv2-urid",
7680
"lv2-state",
81+
"lv2-sys",
7782
"lv2-worker",
7883
]
7984
wmidi = ["lv2-midi", "lv2-midi/wmidi"]
@@ -86,10 +91,33 @@ members = [
8691
"midi",
8792
"state",
8893
"sys",
94+
"sys/tool",
8995
"time",
9096
"units",
9197
"urid",
9298
"urid/derive",
9399
"urid/lv2-urid",
94100
"worker",
101+
"docs/amp",
102+
"docs/fifths",
103+
"docs/metro",
104+
"docs/midigate",
95105
]
106+
107+
[profile.release]
108+
lto = true
109+
110+
[patch.crates-io]
111+
lv2 = { path = "." }
112+
lv2-atom = { path = "atom" }
113+
lv2-core = { path = "core" }
114+
lv2-core-derive = { path = "core/derive" }
115+
lv2-midi = { path = "midi" }
116+
lv2-state = { path = "state" }
117+
lv2-sys = { path = "sys" }
118+
lv2-time = { path = "time" }
119+
lv2-units = { path = "units" }
120+
urid = { path = "urid" }
121+
urid-derive = { path = "urid/derive" }
122+
lv2-urid = { path = "urid/lv2-urid" }
123+
lv2-worker = { path = "worker" }

README.md

Lines changed: 38 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# rust-lv2
1+
# Rust-LV2
22

33
[![Build Status][travis-badge]][travis-url] [![Current Crates.io Version][crates-badge]][crates-url]
44

@@ -92,12 +92,26 @@ impl Plugin for Amp {
9292
lv2_descriptors!(Amp);
9393
```
9494

95-
## Using this framework
95+
## About this framework
96+
97+
### Q&A
98+
99+
#### Does my host program support it?
100+
101+
Plugins created with `rust-lv2` are compatible to all LV2 hosts that comply to the specifications. If your application uses [`lilv`](https://drobilla.net/software/lilv), it's a good sign that it will support your plugin. Some prime examples are [Carla](https://kx.studio/Applications:Carla) and [Ardour](https://ardour.org/).
102+
103+
#### Can I host plugins with `rust-lv2`?
104+
105+
Currently, hosting plugins is not supported. This project was initialy started to create plugins using safe Rust and therefore, it is very plugin-centric. There are plans for integrated plugin hosting or a spin-off project, but those won't start in the near future.
106+
107+
However, there is a lot of code that can be re-used for a hosting framework. If you want to create such a framework, you should take a look at `lv2-sys`, `urid`, and `lv2-atom`.
108+
109+
A bare hosting framework would require an RDF triple store which can load Turtle files, an internal store for plugin interfaces and their extensions, a centralized URID map store, and a graph based work scheduling system to execute `run` functions in order.
96110

97111
### Documentation
98112

99113
There are multiple valuable sources of documentation:
100-
* ["The rust-lv2 book"](https://janonard.github.io/rust-lv2-book/) describes how to use rust-lv2 in general, broad terms. It's the ideal point to get started and is updated with every new version of rust-lv2.
114+
* ["The Rust-LV2 book"](https://rustaudio.github.io/rust-lv2/) describes how to use Rust-LV2 in general, broad terms. It's the ideal point to get started and is updated with every new version of Rust-LV2.
101115
* [The API documentation](https://docs.rs/lv2).
102116
* [The LV2 specification reference](https://lv2plug.in/ns/).
103117

@@ -122,37 +136,35 @@ There are also feature sets that account for common scenarios:
122136
* `plugin`: Usual crates for standard plugins. Includes `lv2-core`, `lv2-atom`, `lv2-midi`, `lv2-urid`, and `urid`. **This is the default.**
123137
* `full`: All sub-crates.
124138

125-
### Building
139+
## Supported targets
126140

127-
Since the bindings to the raw C headers are generated with bindgen, you need to have [Clang](https://clang.llvm.org/) installed on your system and, if it isn't in your system's standard path, set the environment variable `LIBCLANG_PATH` to the path of `libClang`.
141+
Rust-LV2 uses pregenerated C API bindings for different targets in order to increase usability and building speed. Rust has a lot of [supported targets](https://forge.rust-lang.org/release/platform-support.html), but our maintaining power is limited and therefore, only certain targets can be supported. We've ranked different targets in Tiers, [just like rustc does](https://doc.rust-lang.org/nightly/rustc/platform-support.html), which gives you a general understanding of what to expect of a target. The tables below list the supported targets, the used binding in the [`lv2-sys`](sys/) crate, and, if applicable, the maintainer and the last verification of that target.
128142

129-
## Q&A
143+
The bindings itself are generated with the [LV2 systool](sys/tool/) and verified by building the [example plugins of the book](docs) and testing them with a host of that target.
130144

131-
### Does my host program support it?
145+
### Tier 1
132146

133-
Plugins created with `rust-lv2` are compatible to all LV2 hosts that comply to the specifications. If your application uses [`lilv`](https://drobilla.net/software/lilv), it's a good sign that it will support your plugin. Some prime examples are [Carla](https://kx.studio/Applications:Carla) and [Ardour](https://ardour.org/).
134-
135-
### What targets are supported?
136-
137-
We currently support stable and beta Rust running on macOS and Linux. Windows will probably work too, but the Windows build environment of Travis CI is currently broken and we therefore can not support it.
138-
139-
We would like to also support Windows as well as ARM-based embedded devices like Raspberry Pis. If you can help us with these targets, please do so!
140-
141-
### Can I host plugins with `rust-lv2`?
142-
143-
Currently, hosting plugins is not supported. This project was initialy started to create plugins using safe Rust and therefore, it is very plugin-centric. There are plans for integrated plugin hosting or a spin-off project, but those won't start in the near future.
144-
145-
However, there is a lot of code that can be re-used for a hosting framework. If you want to create such a framework, you should take a look at `lv2-sys`, `urid`, and `lv2-atom`.
146-
147-
A bare hosting framework would require an RDF triple store which can load Turtle files, an internal store for plugin interfaces and their extensions, a centralized URID map store, and a graph based work scheduling system to execute `run` functions in order.
147+
A Tier 1 target for `rust-lv2` also has to be a Tier 1 target of rustc. You can check the [platform support page](https://doc.rust-lang.org/nightly/rustc/platform-support.html) to see which targets are included and what they provide. Additionally, there has to be a [maintainer](https://github.com/orgs/RustAudio/teams/lv2-maintainers) of `rust-lv2` who has access to a machine that runs this target and who can generate and verify bindings on this machine. This means that if you have a problem running your code on a Tier 1 target, there will be a maintainer who can help you.
148148

149-
### Why `bindgen`?
149+
| Target | Binding | Maintainer | Last Verification |
150+
|----------------------------|-------------------|------------|----------------------------------------------------------------------------------------------------------|
151+
| `x86_64-unknown-linux-gnu` | `linux/x86_64.rs` | @Janonard | 10. of May 2020, using [Carla](https://github.com/falkTX/Carla) v2.1, running on Arch Linux |
152+
| `x86-unknown-linux-gnu` | `linux/x86.rs` | @Janonard | 16th of May 2020, using [Carla](https://github.com/falkTX/Carla) v2.1, running on Linux Mint 19.3 32-bit |
150153

151-
`lv2-sys` uses `bindgen` to generate the Rust representation of the LV2 C API. Rust can not handle verbatim C code, but is able to define type and function definitions that exactly match those from the C headers. However, since serveral importants details in C aren't properly defined, these bindings need to be different for every platform. One example: While Rust's `u32` is always an unsigned, 32-bit wide integer, C's `int` may be 16 to 64 bits wide and may be signed or unsigned; It depends on the platform.
154+
### Tier 2
152155

153-
One solution would be to generate bindings for every supported target, but if we would only support stable, beta and nightly Rust on [tier 1 platforms](https://forge.rust-lang.org/release/platform-support.html#tier-1), we would still have to maintain 21 different versions of the same crate. If we would add [tier 2 platforms](https://forge.rust-lang.org/release/platform-support.html#tier-2) too (which would include e.g. the Raspberry Pis), there would be 216(!) different versions.
156+
A Tier 2 target is a target that is at least in Tier 2 of rustc and has a generated binding. However, it might not work (well) and there might not be a maintainer who has access to a machine that runs this target and who can generate and verify bindings on this machine. This means that if you have a problem running your code on a Tier 2 target, you're stepping into uncharted territory.
154157

155-
I guess it's obvious that this isn't a maintainable situation. Therefore, the bindings need to be generated every time they are build, which requires the build dependency to `bindgen`.
158+
| Target | Binding |
159+
|---------------------------------------|--------------|
160+
| `aarch64-unknown-linux-gnu` | `aarch64.rs` |
161+
| `arm-unknown-linux-gnueabi` | `arm.rs` |
162+
| `arm-unknown-linux-gnueabihf` | `arm.rs` |
163+
| `armv5te-unknown-linux-gnueabi` | `arm.rs` |
164+
| `armv7-unknown-linux-gnueabi` | `arm.rs` |
165+
| `armv7-unknown-linux-gnueabihf` | `arm.rs` |
166+
| `thumbv7neon-unknown-linux-gnueabihf` | `arm.rs` |
167+
| `x86_64-pc-windows-msvc` | `windows.rs` |
156168

157169
## License
158170

0 commit comments

Comments
 (0)