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,49 +82,37 @@ impl IcedEditor for WormEditor {
.horizontal_alignment(alignment::Horizontal::Center) .horizontal_alignment(alignment::Horizontal::Center)
.vertical_alignment(alignment::Vertical::Top), .vertical_alignment(alignment::Vertical::Top),
) )
// Response Increase Parameter
.push( .push(
Row::new() Text::new("Aggression")
.align_items(Alignment::Fill) .font(assets::NOTO_SANS_THIN)
.push( .width(Length::Fill)
// Response Increase Parameter .height(20.into())
Column::new() .horizontal_alignment(alignment::Horizontal::Center)
.align_items(Alignment::Start) .vertical_alignment(alignment::Vertical::Center),
.push( )
Text::new("Aggression") .push(
.font(assets::NOTO_SANS_THIN) nih_widgets::ParamSlider::new(
.width(Length::Fill) &mut self.increase_slider_state,
.height(20.into()) &self.params.response_increase,
.horizontal_alignment(alignment::Horizontal::Center) )
.vertical_alignment(alignment::Vertical::Center), .map(Message::ParamUpdate),
) )
.push( // Response Decrease Parameter
nih_widgets::ParamSlider::new( .push(
&mut self.increase_slider_state, Text::new("Regression")
&self.params.response_increase, .font(assets::NOTO_SANS_THIN)
) .width(Length::Fill)
.map(Message::ParamUpdate), .height(20.into())
), .horizontal_alignment(alignment::Horizontal::Center)
) .vertical_alignment(alignment::Vertical::Center),
.push( )
// Response Decrease Parameter .push(
Column::new() nih_widgets::ParamSlider::new(
.align_items(Alignment::Start) &mut self.decrease_slider_state,
.push( &self.params.response_decrease,
Text::new("Regression") )
.font(assets::NOTO_SANS_THIN) .map(Message::ParamUpdate),
.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),
),
),
) )
.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>();
}