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 = [ members = [
"xtask", "xtask",
"plugins/dfpworm", "plugins/dfpworm",
"plugins/gain", "plugins/blep", "plugins/gain",
] ]
[profile.release] [profile.release]

View file

@ -4,9 +4,14 @@ version = "0.1.0"
edition = "2024" edition = "2024"
[lib] [lib]
crate-type = ["cdylib"] path = "src/lib.rs"
crate-type = ["cdylib", "lib"]
[[bin]]
name = "dfpworm"
path = "src/standalone.rs"
[dependencies] [dependencies]
atomic_float = "1.1" 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" } 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 std::sync::Arc;
use atomic_float::AtomicF32;
use nih_plug::editor::Editor; use nih_plug::editor::Editor;
use nih_plug::prelude::GuiContext; use nih_plug::prelude::GuiContext;
use nih_plug_iced::widgets as nih_widgets; use nih_plug_iced::widgets as nih_widgets;
@ -9,7 +8,7 @@ use nih_plug_iced::*;
use crate::WormParams; use crate::WormParams;
pub(crate) fn default_state() -> Arc<IcedState> { pub(crate) fn default_state() -> Arc<IcedState> {
IcedState::from_size(200, 215) IcedState::from_size(200, 150)
} }
pub(crate) fn create( pub(crate) fn create(
@ -47,6 +46,7 @@ impl IcedEditor for WormEditor {
let editor = WormEditor { let editor = WormEditor {
params, params,
context, context,
increase_slider_state: Default::default(), increase_slider_state: Default::default(),
decrease_slider_state: Default::default(), decrease_slider_state: Default::default(),
}; };
@ -60,7 +60,7 @@ impl IcedEditor for WormEditor {
fn update( fn update(
&mut self, &mut self,
window: &mut WindowQueue, _window: &mut WindowQueue,
message: Self::Message, message: Self::Message,
) -> Command<Self::Message> { ) -> Command<Self::Message> {
match message { match message {
@ -82,13 +82,7 @@ impl IcedEditor for WormEditor {
.horizontal_alignment(alignment::Horizontal::Center) .horizontal_alignment(alignment::Horizontal::Center)
.vertical_alignment(alignment::Vertical::Top), .vertical_alignment(alignment::Vertical::Top),
) )
.push(
Row::new()
.align_items(Alignment::Fill)
.push(
// Response Increase Parameter // Response Increase Parameter
Column::new()
.align_items(Alignment::Start)
.push( .push(
Text::new("Aggression") Text::new("Aggression")
.font(assets::NOTO_SANS_THIN) .font(assets::NOTO_SANS_THIN)
@ -103,12 +97,8 @@ impl IcedEditor for WormEditor {
&self.params.response_increase, &self.params.response_increase,
) )
.map(Message::ParamUpdate), .map(Message::ParamUpdate),
),
) )
.push(
// Response Decrease Parameter // Response Decrease Parameter
Column::new()
.align_items(Alignment::Start)
.push( .push(
Text::new("Regression") Text::new("Regression")
.font(assets::NOTO_SANS_THIN) .font(assets::NOTO_SANS_THIN)
@ -120,11 +110,9 @@ impl IcedEditor for WormEditor {
.push( .push(
nih_widgets::ParamSlider::new( nih_widgets::ParamSlider::new(
&mut self.decrease_slider_state, &mut self.decrease_slider_state,
&self.params.response_increase, &self.params.response_decrease,
) )
.map(Message::ParamUpdate), .map(Message::ParamUpdate),
),
),
) )
.into() .into()
} }

View file

@ -89,7 +89,7 @@ impl Plugin for Worm {
self.params.clone() 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()) 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>();
}