use object to parse and add jack stub

This commit is contained in:
🪞👃🪞 2025-02-19 22:55:09 +02:00
parent 686f47a3cf
commit 10c922e0c5
8 changed files with 281 additions and 1355 deletions

View file

@ -7,4 +7,5 @@ edition = "2021"
crate-type = ["cdylib"]
[dependencies]
nih_plug = { git = "https://github.com/robbert-vdh/nih-plug" }
#nih_plug = { git = "https://github.com/robbert-vdh/nih-plug" }
tek_jack = { git = "https://codeberg.org/unspeaker/tek", ref = "77d617f9" }

View file

@ -1,49 +1,8 @@
use std::sync::Arc;
use nih_plug::prelude::*;
#[derive(Default)] pub struct VestalWrapper { params: Arc<VestalWrapperParams> }
#[derive(Default, Clone, Params)] struct VestalWrapperParams {}
impl Plugin for VestalWrapper {
const NAME: &'static str = "VESTAL";
const VENDOR: &'static str = "AUTHOR";
const URL: &'static str = env!("CARGO_PKG_HOMEPAGE");
const EMAIL: &'static str = "EMAIL";
const VERSION: &'static str = env!("CARGO_PKG_VERSION");
const AUDIO_IO_LAYOUTS: &'static [AudioIOLayout] = &[];
const SAMPLE_ACCURATE_AUTOMATION: bool = true;
type SysExMessage = ();
type BackgroundTask = ();
fn params (&self) -> Arc<dyn Params> {
self.params.clone()
}
fn editor (&mut self, _async_executor: AsyncExecutor<Self>) -> Option<Box<dyn Editor>> {
None
}
fn initialize (
&mut self, _: &AudioIOLayout, _: &BufferConfig, _: &mut impl InitContext<Self>,
) -> bool {
todo!("initialize");
true
}
fn reset (&mut self) {
todo!("reset");
}
fn process (
&mut self, _: &mut Buffer, _: &mut AuxiliaryBuffers, _: &mut impl ProcessContext<Self>
) -> ProcessStatus {
todo!("process");
ProcessStatus::Normal
}
use tek_jack::{*, jack::*};
use std::error::Error;
pub fn main () -> Result<(), Box<dyn Error>> {
let jack = Jack::new("vestal")?.run(|jack|Ok(Host(jack.clone())))?;
Ok(())
}
impl ClapPlugin for VestalWrapper {
const CLAP_ID: &'static str = "ID";
const CLAP_DESCRIPTION: Option<&'static str> = Some("DESC");
const CLAP_MANUAL_URL: Option<&'static str> = Some(Self::URL);
const CLAP_SUPPORT_URL: Option<&'static str> = None;
const CLAP_FEATURES: &'static [ClapFeature] = &[];
}
impl Vst3Plugin for VestalWrapper {
const VST3_CLASS_ID: [u8; 16] = *b"VESTAL_________.";
const VST3_SUBCATEGORIES: &'static [Vst3SubCategory] = &[];
}
nih_export_clap!(VestalWrapper);
nih_export_vst3!(VestalWrapper);
struct Host(Jack);
audio!(|self: Host, _c, _s|Control::Continue);

96
crates/wrapper/src/nih.rs Normal file
View file

@ -0,0 +1,96 @@
use std::sync::Arc;
use nih_plug::prelude::*;
#[derive(Default)] pub struct VestalWrapper { params: Arc<VestalWrapperParams> }
#[derive(Default, Clone, Params)] struct VestalWrapperParams {}
impl Plugin for VestalWrapper {
const NAME: &'static str = "VESTAL";
const VENDOR: &'static str = "AUTHOR";
const URL: &'static str = env!("CARGO_PKG_HOMEPAGE");
const EMAIL: &'static str = "EMAIL";
const VERSION: &'static str = env!("CARGO_PKG_VERSION");
const AUDIO_IO_LAYOUTS: &'static [AudioIOLayout] = &[];
const SAMPLE_ACCURATE_AUTOMATION: bool = true;
type SysExMessage = ();
type BackgroundTask = ();
fn params (&self) -> Arc<dyn Params> {
self.params.clone()
}
fn editor (&mut self, _async_executor: AsyncExecutor<Self>) -> Option<Box<dyn Editor>> {
None
}
fn initialize (
&mut self, _: &AudioIOLayout, _: &BufferConfig, _: &mut impl InitContext<Self>,
) -> bool {
todo!("initialize");
true
}
fn reset (&mut self) {
todo!("reset");
}
fn process (
&mut self, _: &mut Buffer, _: &mut AuxiliaryBuffers, _: &mut impl ProcessContext<Self>
) -> ProcessStatus {
todo!("process");
ProcessStatus::Normal
}
}
impl ClapPlugin for VestalWrapper {
const CLAP_ID: &'static str = "ID";
const CLAP_DESCRIPTION: Option<&'static str> = Some("DESC");
const CLAP_MANUAL_URL: Option<&'static str> = Some(Self::URL);
const CLAP_SUPPORT_URL: Option<&'static str> = None;
const CLAP_FEATURES: &'static [ClapFeature] = &[];
}
impl Vst3Plugin for VestalWrapper {
const VST3_CLASS_ID: [u8; 16] = *b"VESTAL_________.";
const VST3_SUBCATEGORIES: &'static [Vst3SubCategory] = &[];
}
nih_export_clap!(VestalWrapper);
nih_export_vst3!(VestalWrapper);
#[derive(Default)] pub struct VestalWrapper { params: Arc<VestalWrapperParams> }
#[derive(Default, Clone, Params)] struct VestalWrapperParams {}
impl Plugin for VestalWrapper {
const NAME: &'static str = "VESTAL";
const VENDOR: &'static str = "AUTHOR";
const URL: &'static str = env!("CARGO_PKG_HOMEPAGE");
const EMAIL: &'static str = "EMAIL";
const VERSION: &'static str = env!("CARGO_PKG_VERSION");
const AUDIO_IO_LAYOUTS: &'static [AudioIOLayout] = &[];
const SAMPLE_ACCURATE_AUTOMATION: bool = true;
type SysExMessage = ();
type BackgroundTask = ();
fn params (&self) -> Arc<dyn Params> {
self.params.clone()
}
fn editor (&mut self, _async_executor: AsyncExecutor<Self>) -> Option<Box<dyn Editor>> {
None
}
fn initialize (
&mut self, _: &AudioIOLayout, _: &BufferConfig, _: &mut impl InitContext<Self>,
) -> bool {
todo!("initialize");
true
}
fn reset (&mut self) {
todo!("reset");
}
fn process (
&mut self, _: &mut Buffer, _: &mut AuxiliaryBuffers, _: &mut impl ProcessContext<Self>
) -> ProcessStatus {
todo!("process");
ProcessStatus::Normal
}
}
impl ClapPlugin for VestalWrapper {
const CLAP_ID: &'static str = "ID";
const CLAP_DESCRIPTION: Option<&'static str> = Some("DESC");
const CLAP_MANUAL_URL: Option<&'static str> = Some(Self::URL);
const CLAP_SUPPORT_URL: Option<&'static str> = None;
const CLAP_FEATURES: &'static [ClapFeature] = &[];
}
impl Vst3Plugin for VestalWrapper {
const VST3_CLASS_ID: [u8; 16] = *b"VESTAL_________.";
const VST3_SUBCATEGORIES: &'static [Vst3SubCategory] = &[];
}
nih_export_clap!(VestalWrapper);
nih_export_vst3!(VestalWrapper);