Skip to content

Commit

Permalink
Move neothesia-cli recorder to separate crate
Browse files Browse the repository at this point in the history
  • Loading branch information
PolyMeilex committed Jun 4, 2023
1 parent 0f25ea3 commit b63e395
Show file tree
Hide file tree
Showing 8 changed files with 66 additions and 96 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
- uses: actions-rs/cargo@v1
with:
command: build
args: --release --no-default-features --features record
args: --release -p neothesia-cli
- name: Chmod +x
run: chmod +x target/release/neothesia-cli
- name: zip binary
Expand Down
102 changes: 27 additions & 75 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,21 @@ members = [
"piano-math",
"wgpu-jumpstart",
"neothesia",
"neothesia-cli",
"neothesia-pipelines",
"midi-file",
"midi-io",
]

default-members = ["neothesia"]

[workspace.dependencies]
wgpu = "0.16.1"
log = "0.4"
bytemuck = { version = "1.5", features = ["derive"] }
wgpu-jumpstart = { path = "./wgpu-jumpstart" }
env_logger = "0.10"
futures = "0.3"
wgpu-jumpstart = { path = "./wgpu-jumpstart" }
neothesia = { path = "./neothesia", default-features = false }
midi-file = { path = "./midi-file" }
piano-math = { path = "./piano-math" }
10 changes: 5 additions & 5 deletions makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
build-app:
cargo build --release
cargo build --release --bin neothesia
run-app:
cargo run --release
cargo run --release --bin neothesia

check-recorder:
cargo check --no-default-features --features record
cargo check -p neothesia-cli
build-recorder:
cargo build --release --no-default-features --features record
cargo build --release -p neothesia-cli
run-recorder:
cargo run --release --no-default-features --bin neothesia-cli --features record -- $(file)
cargo run --release -p neothesia-cli -- $(file)
2 changes: 1 addition & 1 deletion midi-io/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ version = "0.1.0"
edition = "2021"

[dependencies]
midir = "0.8"
midir = "0.9"
18 changes: 18 additions & 0 deletions neothesia-cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[package]
name = "neothesia-cli"
version = "0.1.0"
edition = "2021"

[features]
# Download and compile ffmpeg
build-ffmpeg = ["mpeg_encoder/build"]

[dependencies]
neothesia = { workspace = true }
midi-file = { workspace = true }
piano-math = { workspace = true }
wgpu-jumpstart = { workspace = true }
env_logger = { workspace = true }
futures = { workspace = true }

mpeg_encoder = { git = "https://github.com/PolyMeilex/mpeg_encoder_next.git" }
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use neothesia::{
render::{KeyboardRenderer, TextRenderer, WaterfallRenderer},
Gpu, TransformUniform, Uniform,
};
use wgpu_jumpstart::wgpu;

pub struct Recorder {
gpu: Gpu,
Expand Down
17 changes: 4 additions & 13 deletions neothesia/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,15 @@ app = [
"async-thread",
"winit",
]
record = ["mpeg_encoder"]
# Download and compile ffmpeg
build-ffmpeg = ["mpeg_encoder/build"]

synth = []
fluid-synth = ["synth", "cpal", "fluidlite"]
oxi-synth = ["synth", "cpal", "oxisynth"]

[dependencies]
futures = "0.3"
futures = { workspace = true }
log = { workspace = true }
env_logger = "0.10"
env_logger = { workspace = true }
fps_ticker = "1.0"
ron = "0.8"
serde = { version = "1.0", features = ["serde_derive"] }
Expand All @@ -44,7 +41,7 @@ wgpu_glyph = "0.20.0"
wgpu-jumpstart = { workspace = true }

neothesia-pipelines = { path = "../neothesia-pipelines" }
piano-math = { path = "../piano-math" }
piano-math = { workspace = true }

# App Deps

Expand All @@ -56,7 +53,7 @@ async-thread = { version = "0.1", optional = true }
fluidlite = { version = "0.2", features = ["builtin"], optional = true }
oxisynth = { version = "0.0.3", optional = true }

midi-file = { path = "../midi-file" }
midi-file = { workspace = true }
midi-io = { path = "../midi-io", optional = true }

iced_core = { git = "https://github.com/iced-rs/iced.git", rev = "b5f102c55835cf42427f9f8672634e81a5d724f6", optional = true }
Expand All @@ -72,15 +69,9 @@ iced_widget = { git = "https://github.com/iced-rs/iced.git", rev = "b5f102c55835

# Recorder Deps

mpeg_encoder = { git = "https://github.com/PolyMeilex/mpeg_encoder_next.git", optional = true }

[target.'cfg(target_os = "macos")'.dependencies]
objc = "0.2"

[[bin]]
name = "neothesia-cli"
required-features = ["record"]

[[bin]]
name = "neothesia"
required-features = ["app"]

0 comments on commit b63e395

Please sign in to comment.