lv2-0.6.0/.cargo/config010064400017500001750000000000461374457150200127520ustar 00000000000000[alias] systool = "run -p systool --" lv2-0.6.0/.cargo_vcs_info.json0000644000000001121374457226300116070ustar { "git": { "sha1": "c93bfe859a849c5189a27c62c659bd3b724a39b6" } } lv2-0.6.0/.github/workflows/book.yml010064400017500001750000000012741374457150200154670ustar 00000000000000name: Book on: push: branches: - master - develop jobs: book: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: actions/setup-python@v1.2.0 with: python-version: 3.8 - name: Install Sphinx run: | python -m pip install --upgrade pip pip install -r docs/requirements.txt - name: Build Book run: | cd docs make html touch _build/html/.nojekyll - name: Deploy if: success() uses: crazy-max/ghaction-github-pages@v1 with: target_branch: gh-pages build_dir: docs/_build/html env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} lv2-0.6.0/.github/workflows/rust.yml010064400017500001750000000032711374457150200155310ustar 00000000000000name: Rust on: push: branches: - master - develop pull_request: branches: - master - develop jobs: build: strategy: matrix: os: [ubuntu-latest, windows-latest] toolchain: [stable, beta, nightly] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v2 - uses: actions-rs/toolchain@v1 with: toolchain: ${{ matrix.toolchain }} override: true - name: Build run: cargo build --all --all-features --verbose - name: Run tests run: cargo test --all --all-features --verbose check: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: actions-rs/toolchain@v1 with: toolchain: stable override: true components: rustfmt, clippy - name: Format run: cargo fmt --all -- --check - uses: actions-rs/clippy-check@v1 with: token: ${{ secrets.GITHUB_TOKEN }} args: --all --all-features -- -D warnings linux-bindings: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: actions-rs/toolchain@v1 with: toolchain: stable override: true target: i686-unknown-linux-gnu - name: Install 32-bit libc run: | sudo apt-get update sudo apt-get install libc6-dev-i386 - name: Generate run: | mkdir bindings cargo run -p systool -- -I ./sys/lv2/ -o bindings/x86_64.rs -- -target x86_64-unknown-linux-gnu cargo run -p systool -- -I ./sys/lv2/ -o bindings/x86.rs -- -target i686-unknown-linux-gnu - uses: actions/upload-artifact@v1 with: name: linux-bindings path: bindingslv2-0.6.0/.gitignore010064400017500001731000000000451364504410600123720ustar 00000000000000/target **/*.rs.bk Cargo.lock .vscodelv2-0.6.0/CONTRIBUTING.md010064400017500001750000000111111374457150200126350ustar 00000000000000# Contributing to Rust-LV2 *Inspired by [Rust's contribution guide](https://github.com/rust-lang/rust/blob/d9051341a1c142542a3f7dab509266606c775382/CONTRIBUTING.md).* Thank you for your interest in contributing to Rust-LV2! There are many ways to contribute, and we appreciate all of them. ## General or Usage questions, Feature Ideas or Discussions 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. ## Bug Reports While bugs are unfortunate, they're a reality in software. We can't fix what we don't know about, so please report liberally. If you're not sure if something is a bug or not, feel free to file a bug anyway. If you have the chance, before reporting a bug, please [search existing issues](https://github.com/RustAudio/rust-lv2/issues), as it's possible that someone else has already reported your error. This doesn't always work, and sometimes it's hard to know what to search for, so consider this extra credit. We won't mind if you accidentally file a duplicate report. Similarly, to help others who encountered the bug find your issue, consider filing an issue with a descriptive title, which contains information that might be unique to it. This can be the used crates, the conditions that trigger the bug, or part of the error message if there is any. Opening an issue is as easy as following [this link](https://github.com/RustAudio/rust-lv2/issues/new) and filling out the fields. Here's a template that you can use to file a bug, though it's not necessary to use it exactly: ``` MD I tried this code: I expected to see this happen: Instead, this happened: ## Meta ### Dependencies: lv2-core = "1.0.0" ... ### Backtrace: ``` 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. 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: $ RUST_BACKTRACE=1 cargo build ## Pull Requests 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. Please make pull requests against the `develop` branch. Only pull requests that are up to date with the `develop` branch can be merged. Therefore, you should always use rebase to bring changes from the `develop` branch to your feature branch. Your changes also have to pass a check by Travis CI. This includes formatting checks using [rustfmt](https://github.com/rust-lang/rustfmt), coding style checks using [clippy](https://github.com/rust-lang/rust-clippy) and automated unit and integration tests. Your changes are checked on MacOS and Linux, using the stable, beta, and nightly versions of Rust. Although only the stable and beta versions are required to pass, you are also encouraged to make your changes work with nightly Rust. For more details, checkout our [Travis CI setup.](.travis.yml) GitHub allows closing issues using keywords. This feature should be used to keep the issue tracker tidy. However, it is generally preferred to put the "closes #123" text in the PR description rather than the issue commit; particularly during rebasing, citing the issue number in the commit can "spam" the issue in question. Another useful feature are [draft Pull Requests](https://github.blog/2019-02-14-introducing-draft-pull-requests/). If you want to let us know that you are working on something, but don't want us to pull it yet, you should create a draft pull request. ## Writing Documentation 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. To find documentation-related issues, sort by the [documentation](https://github.com/RustAudio/rust-lv2/labels/documentation) label.lv2-0.6.0/Cargo.toml0000644000000040121374457226300076100ustar # THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g., crates.io) dependencies # # If you believe there's an error in this file please file an # issue against the rust-lang/cargo repository. If you're # editing this file be aware that the upstream Cargo.toml # will likely look very different (and much more reasonable) [package] edition = "2018" name = "lv2" version = "0.6.0" authors = ["Jan-Oliver 'Janonard' Opdenhövel ", "Adrien Prokopowicz ", "Yruama_Lairba "] description = "A safe, fast, and ergonomic framework to create LV2 plugins" readme = "README.md" keywords = ["lv2", "audio", "dsp", "safe", "signal"] license = "MIT OR Apache-2.0" repository = "https://github.com/RustAudio/rust-lv2" [profile.release] lto = true [dependencies.lv2-atom] version = "2.0.0" optional = true [dependencies.lv2-core] version = "3.0.0" optional = true [dependencies.lv2-midi] version = "1.2.0" optional = true [dependencies.lv2-state] version = "2.0.0" optional = true [dependencies.lv2-sys] version = "2.0.0" optional = true [dependencies.lv2-time] version = "0.1.3" optional = true [dependencies.lv2-units] version = "0.1.3" optional = true [dependencies.lv2-urid] version = "2.1.0" optional = true [dependencies.lv2-worker] version = "0.1.1" optional = true [dependencies.urid] version = "0.1.0" optional = true [features] default = ["plugin"] full = ["lv2-atom", "lv2-core", "lv2-midi", "lv2-time", "lv2-units", "urid", "lv2-urid", "lv2-state", "lv2-sys", "lv2-worker"] minimal_plugin = ["lv2-core", "urid"] plugin = ["minimal_plugin", "lv2-urid", "lv2-units", "lv2-atom", "wmidi", "lv2-midi"] wmidi = ["lv2-midi", "lv2-midi/wmidi"] [badges.maintenance] status = "actively-developed" [badges.travis-ci] branch = "master" repository = "RustAudio/rust-lv2" lv2-0.6.0/Cargo.toml.orig010064400017500001750000000044341374457150200133050ustar 00000000000000[package] name = "lv2" version = "0.6.0" authors = ["Jan-Oliver 'Janonard' Opdenhövel ", "Adrien Prokopowicz ", "Yruama_Lairba "] edition = "2018" license = "MIT OR Apache-2.0" description = "A safe, fast, and ergonomic framework to create LV2 plugins" readme = "README.md" keywords = ["lv2", "audio", "dsp", "safe", "signal"] repository = "https://github.com/RustAudio/rust-lv2" [badges] travis-ci = { repository = "RustAudio/rust-lv2", branch = "master" } maintenance = { status = "actively-developed" } [dependencies.lv2-atom] version = "2.0.0" optional = true [dependencies.lv2-core] version = "3.0.0" optional = true [dependencies.lv2-midi] version = "1.2.0" optional = true [dependencies.lv2-time] version = "0.1.3" optional = true [dependencies.lv2-units] version = "0.1.3" optional = true [dependencies.urid] version = "0.1.0" optional = true [dependencies.lv2-urid] version = "2.1.0" optional = true [dependencies.lv2-state] version = "2.0.0" optional = true [dependencies.lv2-sys] version = "2.0.0" optional = true [dependencies.lv2-worker] version = "0.1.1" optional = true [features] default = ["plugin"] minimal_plugin = [ "lv2-core", "urid", ] plugin = [ "minimal_plugin", "lv2-urid", "lv2-units", "lv2-atom", "wmidi", "lv2-midi", ] full = [ "lv2-atom", "lv2-core", "lv2-midi", "lv2-time", "lv2-units", "urid", "lv2-urid", "lv2-state", "lv2-sys", "lv2-worker", ] wmidi = ["lv2-midi", "lv2-midi/wmidi"] [workspace] members = [ "atom", "core", "core/derive", "midi", "state", "sys", "sys/tool", "time", "units", "urid", "urid/derive", "urid/lv2-urid", "worker", "docs/amp", "docs/fifths", "docs/metro", "docs/midigate", ] [profile.release] lto = true [patch.crates-io] lv2 = { path = "." } lv2-atom = { path = "atom" } lv2-core = { path = "core" } lv2-core-derive = { path = "core/derive" } lv2-midi = { path = "midi" } lv2-state = { path = "state" } lv2-sys = { path = "sys" } lv2-time = { path = "time" } lv2-units = { path = "units" } urid = { path = "urid" } urid-derive = { path = "urid/derive" } lv2-urid = { path = "urid/lv2-urid" } lv2-worker = { path = "worker" } lv2-0.6.0/LICENSE-APACHE010064400017500001731000000251371364504410600123370ustar 00000000000000 Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. lv2-0.6.0/LICENSE-MIT010064400017500001731000000017761364504410600120520ustar 00000000000000Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.lv2-0.6.0/README.md010064400017500001750000000241571374457150200117010ustar 00000000000000# Rust-LV2 [![Build Status][travis-badge]][travis-url] [![Current Crates.io Version][crates-badge]][crates-url] [travis-badge]: https://travis-ci.org/rustaudio/rust-lv2.svg?branch=master [travis-url]: https://travis-ci.org/rustaudio/rust-lv2 [crates-badge]: https://img.shields.io/crates/v/lv2.svg [crates-url]: https://crates.io/crates/lv2 A safe, fast, and ergonomic framework to create [LV2 plugins](http://lv2plug.in/) for audio processing, written in Rust. **This library is a work in progress.** It provides the following features, through the [LV2 Core specification](http://lv2plug.in/ns/lv2core/lv2core.html): * Lightweight, realtime non-blocking and allocation-free audio processing. * Generates all the boilerplate to make a LV2 plugin binary, usable by any LV2 host. * Any number of ports / Any channel mapping, which can be different for input and output. This obviously includes Mono, Stereo, Surround, etc., any configuration your CPU can handle. * Can be extended to support any additional features, extensions and port types. They can be official, unofficial or completely custom. Through the [LV2 official additional specifications](http://lv2plug.in/ns/), this library also provides many additional features, including: * MIDI processing * Serialization of custom data structures, and plugin-plugin or plugin-GUI communication and property manipulation * State management * Asynchronous work processing * Custom Graphical User Interfaces, both in a toolkit-agnostic and in a platform-agnostic way **(Not yet implemented)** * Presets handling **(Not yet implemented)** * ... and more! (Not yet implemented either) Note that this library will only provide Rust bindings for the official LV2 specifications, however it is compatible with any other arbitrary or custom specification, and other, external crates are able and welcome to provide Rust bindings to any other specification that will integrate with this library. ## Example This example contains the code of a simple amplification plugin. Please note that this isn't the only thing required to create a plugin, see the documentation below for more details. ```Rust // Import everything we need. use lv2::prelude::*; // The input and output ports are defined by a struct which implements the `PortCollection` trait. // In this case, there is an input control port for the gain of the amplification, an input audio // port and an output audio port. #[derive(PortCollection)] struct Ports { gain: InputPort, input: InputPort