Skip to content

Commit

Permalink
Merge pull request RustAudio#120 from mitchmindtree/dasp
Browse files Browse the repository at this point in the history
Rename `sample` to `dasp`. Split features into multiple crates.
  • Loading branch information
mitchmindtree authored May 29, 2020
2 parents 7a8d9e5 + 221b810 commit 97c3bb9
Show file tree
Hide file tree
Showing 73 changed files with 4,709 additions and 3,587 deletions.
247 changes: 247 additions & 0 deletions .github/workflows/dasp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,247 @@
name: dasp
on: [push, pull_request]
jobs:
cargo-fmt-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install stable
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt
- name: cargo fmt check
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check

cargo-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Update apt
run: sudo apt update
- name: Install alsa
run: sudo apt-get install libasound2-dev
- name: Install stable
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: cargo test
uses: actions-rs/cargo@v1
with:
command: test
args: --all --verbose

cargo-test-no-default-features:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Update apt
run: sudo apt update
- name: Install alsa
run: sudo apt-get install libasound2-dev
- name: Install stable
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
# Can't do `--no-default-features` for all pkgs, so do them one by one.
- name: cargo test dasp (no default features)
uses: actions-rs/cargo@v1
with:
command: test
args: --manifest-path dasp/Cargo.toml --no-default-features --verbose
- name: cargo test dasp_envelope (no default features)
uses: actions-rs/cargo@v1
with:
command: test
args: --manifest-path dasp_envelope/Cargo.toml --no-default-features --verbose
- name: cargo test dasp_frame (no default features)
uses: actions-rs/cargo@v1
with:
command: test
args: --manifest-path dasp_frame/Cargo.toml --no-default-features --verbose
- name: cargo test dasp_interpolate (no default features)
uses: actions-rs/cargo@v1
with:
command: test
args: --manifest-path dasp_interpolate/Cargo.toml --no-default-features --verbose
- name: cargo test dasp_peak (no default features)
uses: actions-rs/cargo@v1
with:
command: test
args: --manifest-path dasp_peak/Cargo.toml --no-default-features --verbose
- name: cargo test dasp_ring_buffer (no default features)
uses: actions-rs/cargo@v1
with:
command: test
args: --manifest-path dasp_ring_buffer/Cargo.toml --no-default-features --verbose
- name: cargo test dasp_rms (no default features)
uses: actions-rs/cargo@v1
with:
command: test
args: --manifest-path dasp_rms/Cargo.toml --no-default-features --verbose
- name: cargo test dasp_sample (no default features)
uses: actions-rs/cargo@v1
with:
command: test
args: --manifest-path dasp_sample/Cargo.toml --no-default-features --verbose
- name: cargo test dasp_signal (no default features)
uses: actions-rs/cargo@v1
with:
command: test
args: --manifest-path dasp_signal/Cargo.toml --no-default-features --verbose
- name: cargo test dasp_slice (no default features)
uses: actions-rs/cargo@v1
with:
command: test
args: --manifest-path dasp_slice/Cargo.toml --no-default-features --verbose
- name: cargo test dasp_window (no default features)
uses: actions-rs/cargo@v1
with:
command: test
args: --manifest-path dasp_window/Cargo.toml --no-default-features --verbose

cargo-test-all-features:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Update apt
run: sudo apt update
- name: Install alsa
run: sudo apt-get install libasound2-dev
- name: Install stable
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: cargo test (all features)
uses: actions-rs/cargo@v1
with:
command: test
args: --all --all-features --verbose

cargo-test-all-features-no-std:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Update apt
run: sudo apt update
- name: Install alsa
run: sudo apt-get install libasound2-dev
- name: Install stable
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
# Can't do `--no-default-features` or `--features` for all pkgs, so do them one by one.
- name: cargo test dasp (all features no std)
uses: actions-rs/cargo@v1
with:
command: test
args: --manifest-path dasp/Cargo.toml --no-default-features --features "all-no-std" --verbose
- name: cargo test dasp_signal (all features no std)
uses: actions-rs/cargo@v1
with:
command: test
args: --manifest-path dasp_signal/Cargo.toml --no-default-features --features "all-no-std" --verbose
- name: cargo test dasp_slice (all features no std)
uses: actions-rs/cargo@v1
with:
command: test
args: --manifest-path dasp_slice/Cargo.toml --no-default-features --features "all-no-std" --verbose
- name: cargo test dasp_interpolate (all features no std)
uses: actions-rs/cargo@v1
with:
command: test
args: --manifest-path dasp_interpolate/Cargo.toml --no-default-features --features "all-no-std" --verbose
- name: cargo test window (all features no std)
uses: actions-rs/cargo@v1
with:
command: test
args: --manifest-path dasp_window/Cargo.toml --no-default-features --features "all-no-std" --verbose
- name: cargo test dasp_envelope (all features no std)
uses: actions-rs/cargo@v1
with:
command: test
args: --manifest-path dasp_envelope/Cargo.toml --no-default-features --features "all-no-std" --verbose

cargo-doc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Update apt
run: sudo apt update
- name: Install alsa
run: sudo apt-get install libasound2-dev
- name: Install stable
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: cargo doc
uses: actions-rs/cargo@v1
with:
command: doc
args: --all --all-features --verbose

cargo-publish:
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
env:
CRATESIO_TOKEN: ${{ secrets.CRATESIO_TOKEN }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Update apt
run: sudo apt update
- name: Install alsa dev tools
run: sudo apt-get install libasound2-dev
- name: Install stable
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: cargo publish dasp_sample
continue-on-error: true
run: cargo publish --token $CRATESIO_TOKEN --manifest-path dasp_sample/Cargo.toml
- name: cargo publish dasp_frame
continue-on-error: true
run: cargo publish --token $CRATESIO_TOKEN --manifest-path dasp_frame/Cargo.toml
- name: cargo publish dasp_slice
continue-on-error: true
run: cargo publish --token $CRATESIO_TOKEN --manifest-path dasp_slice/Cargo.toml
- name: cargo publish dasp_ring_buffer
continue-on-error: true
run: cargo publish --token $CRATESIO_TOKEN --manifest-path dasp_ring_buffer/Cargo.toml
- name: cargo publish dasp_peak
continue-on-error: true
run: cargo publish --token $CRATESIO_TOKEN --manifest-path dasp_peak/Cargo.toml
- name: cargo publish dasp_rms
continue-on-error: true
run: cargo publish --token $CRATESIO_TOKEN --manifest-path dasp_rms/Cargo.toml
- name: cargo publish dasp_interpolate
continue-on-error: true
run: cargo publish --token $CRATESIO_TOKEN --manifest-path dasp_interpolate/Cargo.toml
- name: cargo publish dasp_window
continue-on-error: true
run: cargo publish --token $CRATESIO_TOKEN --manifest-path dasp_window/Cargo.toml
- name: cargo publish dasp_envelope
continue-on-error: true
run: cargo publish --token $CRATESIO_TOKEN --manifest-path dasp_envelope/Cargo.toml
- name: cargo publish dasp_signal
continue-on-error: true
run: cargo publish --token $CRATESIO_TOKEN --manifest-path dasp_signal/Cargo.toml
- name: cargo publish dasp
continue-on-error: true
run: cargo publish --token $CRATESIO_TOKEN --manifest-path dasp/Cargo.toml
36 changes: 2 additions & 34 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,35 +1,3 @@
# RUST STUFF

# Compiled files
*.o
*.so
*.rlib
*.dll

# Executables
*.exe

# Generated by Cargo
/target/
assets/two_vowels_10k.wav
target/
Cargo.lock



# MAC STUFF

.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon

# Thumbnails
._*

# Files that might appear on external disk
.Spotlight-V100
.Trashes

# Ignore the generated WAV file
/assets/two_vowels_10k.wav
12 changes: 0 additions & 12 deletions .travis.yml

This file was deleted.

49 changes: 49 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Unreleased

*No unreleased changes as of yet.*

---

# 0.11.0 (2020-05-29)

- Refactor the `sample` crate into a modular collection of crates under `dasp`.
- Rename repository from `sample` to `dasp`, where `dasp` stands for digital
audio signal processing.
- Add a suite of useful feature gates:
- Add `std` to all crates. Can be disabled in order to use `no_std`.
- Add a `all-features-no-std` feature to `dasp`, `dasp_envelope`,
`dasp_interpolate`, `dasp_signal`, `dasp_slice` and `dasp_window`. Enables
all features within a `no_std` context.
- `dasp_envelope` crate:
- `peak` - enables peak detector implementation.
- `rms` - enables RMS detector implementation.
- `dasp_interpolate` crate:
- `floor` - enables `Floor` `Interpolate` implementation.
- `linear` - enables `Linear` `Interpolate` implementation.
- `sinc` - enables `Sinc` `Interpolate` implementation.
- `dasp_signal` crate:
- `boxed` - enables `Signal` implementation for `Box<dyn Signal>`.
- `bus` - enables `SignalBus` trait.
- `envelope` - enables `SignalEnvelope` trait.
- `rms` - enables `SignalRms` trait.
- `window` - enables `signal::window` module.
- `window-hanning` - enables *hanning* window constructor.
- `window-rectangle` - enables *rectangle* window constructor.
- `dasp_slice` crate:
- `boxed` - enables conversions between boxed slices.
- The `dasp` crate has a feature for each of the above.
- Make **Window** trait generic over its phase and amplitude type. Update the
`dasp_signal::window` module items accordingly.
- Remove unsafe uninitialized ring buffer constructors.
- Remove `equilibrium()` and `identity()` constructors from `Sample` and `Frame`
traitsin favour of `EQUILIBRIUM` and `IDENTITY` associated consts.
- Remove `Frame::n_channels` function in favour of `Frame::CHANNELS` associated
const.
- Add implementation of `Frame` for all primitive `Sample` types where each are
assumed to represent a frame of a monophonic signal. This greatly simplifies
working with monophonic signal sources as demonstrated in the updated
`dasp_signal` crate.

---

*CHANGELOG begins...*
34 changes: 15 additions & 19 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
[package]
name = "sample"
description = "A crate providing the fundamentals for working with audio PCM DSP."
version = "0.10.0"
authors = ["mitchmindtree <[email protected]>"]
readme = "README.md"
keywords = ["dsp", "bit-depth", "rate", "pcm", "audio"]
license = "MIT OR Apache-2.0"
repository = "https://github.com/RustAudio/sample.git"
homepage = "https://github.com/RustAudio/sample"

[dev-dependencies]
find_folder = "0.3"
hound = "2.0"
portaudio = "0.7"

[features]
default = ["std"]
std = []
[workspace]
members = [
"dasp",
"dasp_envelope",
"dasp_frame",
"dasp_interpolate",
"dasp_peak",
"dasp_ring_buffer",
"dasp_rms",
"dasp_sample",
"dasp_signal",
"dasp_slice",
"dasp_window",
"examples",
]
Loading

0 comments on commit 97c3bb9

Please sign in to comment.