standalone version

This commit is contained in:
Haze Weathers 2025-09-17 12:38:55 -06:00
parent 1f816f1765
commit 5144852e01
6 changed files with 771 additions and 70 deletions

743
Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -3,7 +3,7 @@ resolver = "3"
members = [
"xtask",
"plugins/dfpworm",
"plugins/gain", "plugins/blep",
"plugins/gain",
]
[profile.release]

View file

@ -4,9 +4,14 @@ version = "0.1.0"
edition = "2024"
[lib]
crate-type = ["cdylib"]
path = "src/lib.rs"
crate-type = ["cdylib", "lib"]
[[bin]]
name = "dfpworm"
path = "src/standalone.rs"
[dependencies]
atomic_float = "1.1"
nih_plug = { git = "https://github.com/robbert-vdh/nih-plug.git", version = "0.0.0" }
nih_plug = { git = "https://github.com/robbert-vdh/nih-plug.git", version = "0.0.0", features = ["standalone"]}
nih_plug_iced = { git = "https://github.com/robbert-vdh/nih-plug.git", version = "0.0.0" }

View file

@ -1,6 +1,5 @@
use std::sync::Arc;
use atomic_float::AtomicF32;
use nih_plug::editor::Editor;
use nih_plug::prelude::GuiContext;
use nih_plug_iced::widgets as nih_widgets;
@ -9,7 +8,7 @@ use nih_plug_iced::*;
use crate::WormParams;
pub(crate) fn default_state() -> Arc<IcedState> {
IcedState::from_size(200, 215)
IcedState::from_size(200, 150)
}
pub(crate) fn create(
@ -47,6 +46,7 @@ impl IcedEditor for WormEditor {
let editor = WormEditor {
params,
context,
increase_slider_state: Default::default(),
decrease_slider_state: Default::default(),
};
@ -60,7 +60,7 @@ impl IcedEditor for WormEditor {
fn update(
&mut self,
window: &mut WindowQueue,
_window: &mut WindowQueue,
message: Self::Message,
) -> Command<Self::Message> {
match message {
@ -82,49 +82,37 @@ impl IcedEditor for WormEditor {
.horizontal_alignment(alignment::Horizontal::Center)
.vertical_alignment(alignment::Vertical::Top),
)
// Response Increase Parameter
.push(
Row::new()
.align_items(Alignment::Fill)
.push(
// Response Increase Parameter
Column::new()
.align_items(Alignment::Start)
.push(
Text::new("Aggression")
.font(assets::NOTO_SANS_THIN)
.width(Length::Fill)
.height(20.into())
.horizontal_alignment(alignment::Horizontal::Center)
.vertical_alignment(alignment::Vertical::Center),
)
.push(
nih_widgets::ParamSlider::new(
&mut self.increase_slider_state,
&self.params.response_increase,
)
.map(Message::ParamUpdate),
),
)
.push(
// Response Decrease Parameter
Column::new()
.align_items(Alignment::Start)
.push(
Text::new("Regression")
.font(assets::NOTO_SANS_THIN)
.width(Length::Fill)
.height(20.into())
.horizontal_alignment(alignment::Horizontal::Center)
.vertical_alignment(alignment::Vertical::Center),
)
.push(
nih_widgets::ParamSlider::new(
&mut self.decrease_slider_state,
&self.params.response_increase,
)
.map(Message::ParamUpdate),
),
),
Text::new("Aggression")
.font(assets::NOTO_SANS_THIN)
.width(Length::Fill)
.height(20.into())
.horizontal_alignment(alignment::Horizontal::Center)
.vertical_alignment(alignment::Vertical::Center),
)
.push(
nih_widgets::ParamSlider::new(
&mut self.increase_slider_state,
&self.params.response_increase,
)
.map(Message::ParamUpdate),
)
// Response Decrease Parameter
.push(
Text::new("Regression")
.font(assets::NOTO_SANS_THIN)
.width(Length::Fill)
.height(20.into())
.horizontal_alignment(alignment::Horizontal::Center)
.vertical_alignment(alignment::Vertical::Center),
)
.push(
nih_widgets::ParamSlider::new(
&mut self.decrease_slider_state,
&self.params.response_decrease,
)
.map(Message::ParamUpdate),
)
.into()
}

View file

@ -89,7 +89,7 @@ impl Plugin for Worm {
self.params.clone()
}
fn editor(&mut self, async_executor: AsyncExecutor<Self>) -> Option<Box<dyn Editor>> {
fn editor(&mut self, _async_executor: AsyncExecutor<Self>) -> Option<Box<dyn Editor>> {
editor::create(self.params.clone(), self.params.editor_state.clone())
}

View file

@ -0,0 +1,7 @@
use nih_plug::prelude::*;
use dfpworm::Worm;
pub fn main() {
nih_export_standalone::<Worm>();
}