Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Iced to 0.13 #170

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
2,014 changes: 1,204 additions & 810 deletions Cargo.lock

Large diffs are not rendered by default.

23 changes: 18 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,14 @@ assert_process_allocs = ["dep:assert_no_alloc"]
# Enables an export target for standalone binaries through the
# `nih_export_standalone()` function. Disabled by default as this requires
# building additional dependencies for audio and MIDI handling.
standalone = ["dep:baseview", "dep:clap", "dep:cpal", "dep:jack", "dep:midir", "dep:rtrb"]
standalone = [
"dep:baseview",
"dep:clap",
"dep:cpal",
"dep:jack",
"dep:midir",
"dep:rtrb",
]
# Enables the `nih_export_vst3!()` macro. Enabled by default. This feature
# exists mostly for GPL-compliance reasons, since even if you don't use the VST3
# wrapper you might otherwise still include a couple (unused) symbols from the
Expand Down Expand Up @@ -84,7 +91,7 @@ backtrace = "0.3.65"
bitflags = "1.3"
cfg-if = "1.0"
# This supports CLAP 1.1.8
clap-sys = { git = "https://github.com/robbert-vdh/clap-sys.git", branch = "feature/cstr-macro" }
clap-sys = { git = "https://github.com/robbert-vdh/clap-sys.git", branch = "feature/cstr-macro" }
crossbeam = "0.8"
log = { version = "0.4", features = ["std", "release_max_level_info"] }
midi-consts = "0.1"
Expand All @@ -96,14 +103,20 @@ serde_json = "1.0"
widestring = "1.0.0-beta.1"

# Used for the `assert_process_allocs` feature
assert_no_alloc = { git = "https://github.com/robbert-vdh/rust-assert-no-alloc.git", branch = "feature/nested-permit-forbid", features = ["backtrace", "log"], optional = true }
assert_no_alloc = { git = "https://github.com/robbert-vdh/rust-assert-no-alloc.git", branch = "feature/nested-permit-forbid", features = [
"backtrace",
"log",
], optional = true }

# Used for the `standalone` feature
# NOTE: OpenGL support is not needed here, but rust-analyzer gets confused when
# some crates do use it and others don't
baseview = { git = "https://github.com/RustAudio/baseview.git", rev = "579130ecb4f9f315ae52190af42f0ea46aeaa4a2", features = ["opengl"], optional = true }
baseview = { git = "https://github.com/RustAudio/baseview.git", rev = "579130ecb4f9f315ae52190af42f0ea46aeaa4a2", default_features = false, optional = true }
# All the claps!
clap = { version = "4.1.8", features = ["derive", "wrap_help"], optional = true }
clap = { version = "4.1.8", features = [
"derive",
"wrap_help",
], optional = true }
cpal = { version = "0.15", optional = true }
jack = { version = "0.11.4", optional = true }
midir = { version = "0.9.1", optional = true }
Expand Down
2 changes: 2 additions & 0 deletions config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[env]
RUST_LOG = "info"
2 changes: 1 addition & 1 deletion nih_plug_iced/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ configurations. To use wgpu instead, include the crate with the following
options:

```toml
nih_plug_iced = { git = "https://github.com/robbert-vdh/nih-plug.git", default-features = false, features = ["wgpu"] }
nih_plug_iced = { git = "https://github.com/robbert-vdh/nih-plug.git", default_features = false, features = ["wgpu"] }
```

Iced has many more optional features. Check the `Cargo.toml` file for more
Expand Down
4 changes: 4 additions & 0 deletions nih_plug_iced/src/widgets/param_slider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ const GRANULAR_DRAG_MULTIPLIER: f32 = 0.1;
/// The thickness of this widget's borders.
const BORDER_WIDTH: f32 = 1.0;

/// A slider that integrates with NIH-plug's [`Param`] types.
///
/// TODO: There are currently no styling options at all
/// TODO: Handle scrolling for steps (and shift+scroll for smaller steps?)
pub struct ParamSlider<'a, P: Param> {
param: &'a P,

Expand Down
2 changes: 1 addition & 1 deletion plugins/examples/gain_gui_iced/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ mod editor;
const PEAK_METER_DECAY_MS: f64 = 150.0;

/// This is mostly identical to the gain example, minus some fluff, and with a GUI.
struct Gain {
pub struct Gain {
params: Arc<GainParams>,

/// Needed to normalize the peak meter's response based on the sample rate.
Expand Down
7 changes: 7 additions & 0 deletions plugins/examples/gain_gui_iced/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
use gain_gui_iced::Gain;
use nih_plug::prelude::*;
use nih_plug::wrapper::standalone::nih_export_standalone;

fn main() {
nih_export_standalone::<Gain>();
}
2 changes: 1 addition & 1 deletion src/wrapper/standalone/wrapper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ impl<P: Plugin, B: Backend<P>> Wrapper<P, B> {
height: height as f64,
},
scale: scaling_policy,
gl_config: None,
// gl_config: None,
},
move |window| {
let parent_handle = match window.raw_window_handle() {
Expand Down