dfpworm gui start
This commit is contained in:
parent
30c6bf5f6f
commit
1f816f1765
5 changed files with 809 additions and 24 deletions
|
@ -1,8 +1,10 @@
|
|||
use std::sync::Arc;
|
||||
|
||||
use nih_plug::prelude::*;
|
||||
use nih_plug_iced::IcedState;
|
||||
|
||||
mod dfpwm;
|
||||
mod editor;
|
||||
|
||||
pub struct Worm {
|
||||
params: Arc<WormParams>,
|
||||
|
@ -13,10 +15,13 @@ pub struct Worm {
|
|||
|
||||
#[derive(Params)]
|
||||
struct WormParams {
|
||||
#[persist = "editor-state"]
|
||||
editor_state: Arc<IcedState>,
|
||||
|
||||
#[id = "response-increase"]
|
||||
response_increase: FloatParam,
|
||||
pub response_increase: FloatParam,
|
||||
#[id = "response-decrease"]
|
||||
response_decrease: FloatParam,
|
||||
pub response_decrease: FloatParam,
|
||||
}
|
||||
|
||||
impl Default for Worm {
|
||||
|
@ -33,6 +38,8 @@ impl Default for Worm {
|
|||
impl Default for WormParams {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
editor_state: editor::default_state(),
|
||||
|
||||
response_increase: FloatParam::new(
|
||||
"Response Increase",
|
||||
dfpwm::DEFAULT_RESPONSE_INCREASE,
|
||||
|
@ -82,6 +89,10 @@ impl Plugin for Worm {
|
|||
self.params.clone()
|
||||
}
|
||||
|
||||
fn editor(&mut self, async_executor: AsyncExecutor<Self>) -> Option<Box<dyn Editor>> {
|
||||
editor::create(self.params.clone(), self.params.editor_state.clone())
|
||||
}
|
||||
|
||||
fn initialize(
|
||||
&mut self,
|
||||
audio_io_layout: &AudioIOLayout,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue