From 17f2aa1920221ef7be1dc7309569503a78aff7df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Oliver=20=27Janonard=27=20Opdenh=C3=B6vel?= Date: Fri, 27 Mar 2020 12:23:12 +0100 Subject: [PATCH 001/151] Revert "Removing the patches for lv2-midi and lv2-state" This reverts commit 17728681255e154d29311acccb3b6e550c6f9a24. --- Cargo.toml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index f2623260..4e3c398e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -91,3 +91,7 @@ members = [ "urid/lv2-urid", "worker", ] + +[patch.crates-io] +lv2-midi = { path = "midi" } +lv2-state = { path = "state" } \ No newline at end of file From 9d70a215e39a04d32550df6a62f33599907cf855 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Oliver=20=27Janonard=27=20Opdenh=C3=B6vel?= Date: Fri, 27 Mar 2020 12:23:15 +0100 Subject: [PATCH 002/151] Revert "Removing the patch for lv2-atom" This reverts commit 354509a882efc24ca5706d8cf06419df9b9c23cd. --- Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/Cargo.toml b/Cargo.toml index 4e3c398e..3a79b5b5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -93,5 +93,6 @@ members = [ ] [patch.crates-io] +lv2-atom = { path = "atom" } lv2-midi = { path = "midi" } lv2-state = { path = "state" } \ No newline at end of file From 621c77d49f3984a3897941fa267154aee44a1ff4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Oliver=20=27Janonard=27=20Opdenh=C3=B6vel?= Date: Fri, 27 Mar 2020 12:23:17 +0100 Subject: [PATCH 003/151] Revert "Removing the patches for lv2-urid and lv2-worker" This reverts commit b90f52b8b26b9fb515275fa9a056a45a3b70cb25. --- Cargo.toml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 3a79b5b5..862aa6a5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -95,4 +95,6 @@ members = [ [patch.crates-io] lv2-atom = { path = "atom" } lv2-midi = { path = "midi" } -lv2-state = { path = "state" } \ No newline at end of file +lv2-state = { path = "state" } +lv2-urid = { path = "urid/lv2-urid" } +lv2-worker = { path = "worker" } \ No newline at end of file From 1b69969eaf8f663e4bbbce1467d831aea80e54e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Oliver=20=27Janonard=27=20Opdenh=C3=B6vel?= Date: Fri, 27 Mar 2020 12:23:19 +0100 Subject: [PATCH 004/151] Revert "Removing the patches for time, units, and core" This reverts commit b905ca68f8d8be902731d62401c0d9f7c986432e. --- Cargo.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 862aa6a5..f43a011e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -94,7 +94,10 @@ members = [ [patch.crates-io] lv2-atom = { path = "atom" } +lv2-core = { path = "core" } lv2-midi = { path = "midi" } lv2-state = { path = "state" } +lv2-time = { path = "time" } +lv2-units = { path = "units" } lv2-urid = { path = "urid/lv2-urid" } lv2-worker = { path = "worker" } \ No newline at end of file From d52d195b0e894b9e20babb8efec66d35f4ff9f89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Oliver=20=27Janonard=27=20Opdenh=C3=B6vel?= Date: Fri, 27 Mar 2020 12:23:21 +0100 Subject: [PATCH 005/151] Revert "Removing the patch for urid" This reverts commit 6ffe7308585c3a1764f29f7ad0415f0213275390. --- Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/Cargo.toml b/Cargo.toml index f43a011e..75ac4dfb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -99,5 +99,6 @@ lv2-midi = { path = "midi" } lv2-state = { path = "state" } lv2-time = { path = "time" } lv2-units = { path = "units" } +urid = { path = "urid" } lv2-urid = { path = "urid/lv2-urid" } lv2-worker = { path = "worker" } \ No newline at end of file From 79bfa2addda1d63c26cb7b71f2d3358ad1463eed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Oliver=20=27Janonard=27=20Opdenh=C3=B6vel?= Date: Fri, 27 Mar 2020 12:23:22 +0100 Subject: [PATCH 006/151] Revert "Removing the patches for lv2-sys and the derive crates" This reverts commit f94e5c62f3510f3f0f2bb1548ddd331cfd2ef134. --- Cargo.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 75ac4dfb..f3e38e03 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -95,10 +95,13 @@ members = [ [patch.crates-io] lv2-atom = { path = "atom" } lv2-core = { path = "core" } +lv2-core-derive = { path = "core/derive" } lv2-midi = { path = "midi" } lv2-state = { path = "state" } +lv2-sys = { path = "sys" } lv2-time = { path = "time" } lv2-units = { path = "units" } urid = { path = "urid" } +urid-derive = { path = "urid/derive" } lv2-urid = { path = "urid/lv2-urid" } lv2-worker = { path = "worker" } \ No newline at end of file From 2368086f2dd64a1d00247c8ba98d5de8af94a787 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Oliver=20=27Janonard=27=20Opdenh=C3=B6vel?= Date: Thu, 2 Apr 2020 11:19:27 +0200 Subject: [PATCH 007/151] Cloning the features cache to allow features to be used in both feature collections --- core/src/feature/cache.rs | 1 + core/src/plugin/mod.rs | 24 ++++++++++++++---------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/core/src/feature/cache.rs b/core/src/feature/cache.rs index 2c548e44..2eb1c588 100644 --- a/core/src/feature/cache.rs +++ b/core/src/feature/cache.rs @@ -8,6 +8,7 @@ use std::iter::Map; /// At initialization time, a raw LV2 plugin receives a null-terminated array containing all requested host features. Obviously, this is not suited for safe Rust code and therefore, it needs an abstraction layer. /// /// Internally, this struct contains a hash map which is filled the raw LV2 feature descriptors. Using this map, methods are defined to identify and retrieve features. +#[derive(Clone)] pub struct FeatureCache<'a> { internal: HashMap<&'a CStr, *const c_void>, } diff --git a/core/src/plugin/mod.rs b/core/src/plugin/mod.rs index e6c1d7c7..6514b512 100644 --- a/core/src/plugin/mod.rs +++ b/core/src/plugin/mod.rs @@ -131,17 +131,21 @@ impl PluginInstance { }; // Collect the supported features. - let mut feature_cache = FeatureCache::from_raw(features); - let mut init_features = - match T::InitFeatures::from_cache(&mut feature_cache, ThreadingClass::Instantiation) { - Ok(f) => f, - Err(e) => { - eprintln!("{}", e); - return std::ptr::null_mut(); - } - }; + let mut init_features_cache = FeatureCache::from_raw(features); + let mut audio_features_cache = init_features_cache.clone(); + + let mut init_features = match T::InitFeatures::from_cache( + &mut init_features_cache, + ThreadingClass::Instantiation, + ) { + Ok(f) => f, + Err(e) => { + eprintln!("{}", e); + return std::ptr::null_mut(); + } + }; let audio_features = - match T::AudioFeatures::from_cache(&mut feature_cache, ThreadingClass::Audio) { + match T::AudioFeatures::from_cache(&mut audio_features_cache, ThreadingClass::Audio) { Ok(f) => f, Err(e) => { eprintln!("{}", e); From 9abaab0752cc5a6a5550a70fb7c6b195de4e0c5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Oliver=20=27Janonard=27=20Opdenh=C3=B6vel?= Date: Thu, 2 Apr 2020 11:35:16 +0200 Subject: [PATCH 008/151] Restricting access to the feature collections --- core/src/plugin/mod.rs | 27 +++++++++++++++++++++++---- worker/src/lib.rs | 12 ++++-------- 2 files changed, 27 insertions(+), 12 deletions(-) diff --git a/core/src/plugin/mod.rs b/core/src/plugin/mod.rs index 6514b512..10d2dd46 100644 --- a/core/src/plugin/mod.rs +++ b/core/src/plugin/mod.rs @@ -77,13 +77,13 @@ pub trait Plugin: UriBound + Sized + Send + Sync + 'static { #[repr(C)] pub struct PluginInstance { /// The plugin instance. - pub instance: T, + instance: T, /// A temporary storage for all ports of the plugin. - pub connections: ::Cache, + connections: ::Cache, /// All features that may be used in the initialization threading class. - pub init_features: T::InitFeatures, + init_features: T::InitFeatures, /// All features that may be used in the audio threading class. - pub audio_features: T::AudioFeatures, + audio_features: T::AudioFeatures, } impl PluginInstance { @@ -247,6 +247,25 @@ impl PluginInstance { std::ptr::null() } } + + /// Retrieve the internal plugin. + pub fn plugin_handle(&mut self) -> &mut T { + &mut self.instance + } + + /// Retrieve the required handles to execute an Initialization class method. + /// + /// This method can be used by extensions to call an extension method in the Initialization threading class and provide it the host features for that class. + pub fn init_class_handle(&mut self) -> (&mut T, &mut T::InitFeatures) { + (&mut self.instance, &mut self.init_features) + } + + /// Retrieve the required handles to execute an Audio class method. + /// + /// This method can be used by extensions to call an extension method in the Audio threading class and provide it the host features for that class. + pub fn audio_class_handle(&mut self) -> (&mut T, &mut T::AudioFeatures) { + (&mut self.instance, &mut self.audio_features) + } } #[doc(hidden)] diff --git a/worker/src/lib.rs b/worker/src/lib.rs index e293a302..3c83a06a 100644 --- a/worker/src/lib.rs +++ b/worker/src/lib.rs @@ -437,10 +437,8 @@ impl WorkerDescriptor

{ return lv2_sys::LV2_Worker_Status_LV2_WORKER_ERR_UNKNOWN; } - match plugin_instance - .instance - .work_response(response_data, &mut plugin_instance.audio_features) - { + let (instance, features) = plugin_instance.audio_class_handle(); + match instance.work_response(response_data, features) { Ok(()) => lv2_sys::LV2_Worker_Status_LV2_WORKER_SUCCESS, Err(WorkerError::Unknown) => lv2_sys::LV2_Worker_Status_LV2_WORKER_ERR_UNKNOWN, Err(WorkerError::NoSpace) => lv2_sys::LV2_Worker_Status_LV2_WORKER_ERR_NO_SPACE, @@ -450,10 +448,8 @@ impl WorkerDescriptor

{ /// Extern unsafe version of `end_run` method actually called by the host unsafe extern "C" fn extern_end_run(handle: lv2_sys::LV2_Handle) -> lv2_sys::LV2_Worker_Status { if let Some(plugin_instance) = (handle as *mut PluginInstance

).as_mut() { - match plugin_instance - .instance - .end_run(&mut plugin_instance.audio_features) - { + let (instance, features) = plugin_instance.audio_class_handle(); + match instance.end_run(features) { Ok(()) => lv2_sys::LV2_Worker_Status_LV2_WORKER_SUCCESS, Err(WorkerError::Unknown) => lv2_sys::LV2_Worker_Status_LV2_WORKER_ERR_UNKNOWN, Err(WorkerError::NoSpace) => lv2_sys::LV2_Worker_Status_LV2_WORKER_ERR_NO_SPACE, From 44ca65dc91013db19c8d09dc41f846970306df28 Mon Sep 17 00:00:00 2001 From: Yruama_Lairba Date: Mon, 6 Apr 2020 23:57:40 +0200 Subject: [PATCH 009/151] bindgen, use filter to keep only 'LV2' stuff --- sys/build.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sys/build.rs b/sys/build.rs index d19fa6ec..33b0f345 100644 --- a/sys/build.rs +++ b/sys/build.rs @@ -39,8 +39,11 @@ fn main() { } } } - - bindings = bindings.bitfield_enum("LV2_State_Flags"); + bindings = bindings + .whitelist_type("LV2.*") + .whitelist_function("LV2.*") + .whitelist_var("LV2.*") + .bitfield_enum("LV2_State_Flags"); // Generating the bindings. let bindings = bindings.generate().expect("Unable to generate bindings"); From 196dcc61fb0895681fd9538e9ac9ad430acb6e45 Mon Sep 17 00:00:00 2001 From: Yruama_Lairba Date: Wed, 8 Apr 2020 21:21:55 +0200 Subject: [PATCH 010/151] disable bindgen layout test --- sys/build.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/build.rs b/sys/build.rs index 33b0f345..5a581497 100644 --- a/sys/build.rs +++ b/sys/build.rs @@ -43,6 +43,7 @@ fn main() { .whitelist_type("LV2.*") .whitelist_function("LV2.*") .whitelist_var("LV2.*") + .layout_tests(false) .bitfield_enum("LV2_State_Flags"); // Generating the bindings. From 9f655b9632e51213e051afdb2e08851b2ee60b98 Mon Sep 17 00:00:00 2001 From: Yruama_Lairba Date: Wed, 8 Apr 2020 21:23:20 +0200 Subject: [PATCH 011/151] have a feature to choose between bindgen and pregenerated bindings --- sys/Cargo.toml | 2 +- sys/build.rs | 22 +- sys/build_data/bindings.rs | 2643 ++++++++++++++++++++++++++++++++++++ 3 files changed, 2662 insertions(+), 5 deletions(-) create mode 100644 sys/build_data/bindings.rs diff --git a/sys/Cargo.toml b/sys/Cargo.toml index 32a2eee0..8993637b 100644 --- a/sys/Cargo.toml +++ b/sys/Cargo.toml @@ -14,4 +14,4 @@ travis-ci = { repository = "RustAudio/rust-lv2", branch = "master" } maintenance = { status = "passively-maintained" } [build-dependencies] -bindgen = "0.53.1" +bindgen = {version= "0.53.1", optional=true} diff --git a/sys/build.rs b/sys/build.rs index 5a581497..64f3998a 100644 --- a/sys/build.rs +++ b/sys/build.rs @@ -1,10 +1,24 @@ -extern crate bindgen; +#[cfg(not(feature = "bindgen"))] +fn main() { + use std::env; + use std::fs; + use std::path::PathBuf; -use std::env; -use std::fs; -use std::path::PathBuf; + let mut source_path = PathBuf::from(env::var("CARGO_MANIFEST_DIR").unwrap()); + source_path.push("build_data"); + source_path.push("bindings.rs"); + let mut out_path = PathBuf::from(env::var("OUT_DIR").unwrap()); + out_path.push("bindings.rs"); + fs::copy(source_path, out_path).unwrap(); +} +#[cfg(feature = "bindgen")] fn main() { + extern crate bindgen; + use std::env; + use std::fs; + use std::path::PathBuf; + let mut bindings = bindgen::Builder::default().size_t_is_usize(true); let mut source_dir = PathBuf::new(); diff --git a/sys/build_data/bindings.rs b/sys/build_data/bindings.rs new file mode 100644 index 00000000..26b01c00 --- /dev/null +++ b/sys/build_data/bindings.rs @@ -0,0 +1,2643 @@ +/* automatically generated by rust-bindgen */ + +pub const LV2_PORT_PROPS_URI: &'static [u8; 36usize] = b"http://lv2plug.in/ns/ext/port-props\0"; +pub const LV2_PORT_PROPS_PREFIX: &'static [u8; 37usize] = b"http://lv2plug.in/ns/ext/port-props#\0"; +pub const LV2_PORT_PROPS__causesArtifacts: &'static [u8; 52usize] = + b"http://lv2plug.in/ns/ext/port-props#causesArtifacts\0"; +pub const LV2_PORT_PROPS__continuousCV: &'static [u8; 49usize] = + b"http://lv2plug.in/ns/ext/port-props#continuousCV\0"; +pub const LV2_PORT_PROPS__discreteCV: &'static [u8; 47usize] = + b"http://lv2plug.in/ns/ext/port-props#discreteCV\0"; +pub const LV2_PORT_PROPS__displayPriority: &'static [u8; 52usize] = + b"http://lv2plug.in/ns/ext/port-props#displayPriority\0"; +pub const LV2_PORT_PROPS__expensive: &'static [u8; 46usize] = + b"http://lv2plug.in/ns/ext/port-props#expensive\0"; +pub const LV2_PORT_PROPS__hasStrictBounds: &'static [u8; 52usize] = + b"http://lv2plug.in/ns/ext/port-props#hasStrictBounds\0"; +pub const LV2_PORT_PROPS__logarithmic: &'static [u8; 48usize] = + b"http://lv2plug.in/ns/ext/port-props#logarithmic\0"; +pub const LV2_PORT_PROPS__notAutomatic: &'static [u8; 49usize] = + b"http://lv2plug.in/ns/ext/port-props#notAutomatic\0"; +pub const LV2_PORT_PROPS__notOnGUI: &'static [u8; 45usize] = + b"http://lv2plug.in/ns/ext/port-props#notOnGUI\0"; +pub const LV2_PORT_PROPS__rangeSteps: &'static [u8; 47usize] = + b"http://lv2plug.in/ns/ext/port-props#rangeSteps\0"; +pub const LV2_PORT_PROPS__supportsStrictBounds: &'static [u8; 57usize] = + b"http://lv2plug.in/ns/ext/port-props#supportsStrictBounds\0"; +pub const LV2_PORT_PROPS__trigger: &'static [u8; 44usize] = + b"http://lv2plug.in/ns/ext/port-props#trigger\0"; +pub const LV2_INSTANCE_ACCESS_URI: &'static [u8; 41usize] = + b"http://lv2plug.in/ns/ext/instance-access\0"; +pub const LV2_PARAMETERS_URI: &'static [u8; 36usize] = b"http://lv2plug.in/ns/ext/parameters\0"; +pub const LV2_PARAMETERS_PREFIX: &'static [u8; 37usize] = b"http://lv2plug.in/ns/ext/parameters#\0"; +pub const LV2_PARAMETERS__CompressorControls: &'static [u8; 55usize] = + b"http://lv2plug.in/ns/ext/parameters#CompressorControls\0"; +pub const LV2_PARAMETERS__ControlGroup: &'static [u8; 49usize] = + b"http://lv2plug.in/ns/ext/parameters#ControlGroup\0"; +pub const LV2_PARAMETERS__EnvelopeControls: &'static [u8; 53usize] = + b"http://lv2plug.in/ns/ext/parameters#EnvelopeControls\0"; +pub const LV2_PARAMETERS__FilterControls: &'static [u8; 51usize] = + b"http://lv2plug.in/ns/ext/parameters#FilterControls\0"; +pub const LV2_PARAMETERS__OscillatorControls: &'static [u8; 55usize] = + b"http://lv2plug.in/ns/ext/parameters#OscillatorControls\0"; +pub const LV2_PARAMETERS__amplitude: &'static [u8; 46usize] = + b"http://lv2plug.in/ns/ext/parameters#amplitude\0"; +pub const LV2_PARAMETERS__attack: &'static [u8; 43usize] = + b"http://lv2plug.in/ns/ext/parameters#attack\0"; +pub const LV2_PARAMETERS__bypass: &'static [u8; 43usize] = + b"http://lv2plug.in/ns/ext/parameters#bypass\0"; +pub const LV2_PARAMETERS__cutoffFrequency: &'static [u8; 52usize] = + b"http://lv2plug.in/ns/ext/parameters#cutoffFrequency\0"; +pub const LV2_PARAMETERS__decay: &'static [u8; 42usize] = + b"http://lv2plug.in/ns/ext/parameters#decay\0"; +pub const LV2_PARAMETERS__delay: &'static [u8; 42usize] = + b"http://lv2plug.in/ns/ext/parameters#delay\0"; +pub const LV2_PARAMETERS__dryLevel: &'static [u8; 45usize] = + b"http://lv2plug.in/ns/ext/parameters#dryLevel\0"; +pub const LV2_PARAMETERS__frequency: &'static [u8; 46usize] = + b"http://lv2plug.in/ns/ext/parameters#frequency\0"; +pub const LV2_PARAMETERS__gain: &'static [u8; 41usize] = + b"http://lv2plug.in/ns/ext/parameters#gain\0"; +pub const LV2_PARAMETERS__hold: &'static [u8; 41usize] = + b"http://lv2plug.in/ns/ext/parameters#hold\0"; +pub const LV2_PARAMETERS__pulseWidth: &'static [u8; 47usize] = + b"http://lv2plug.in/ns/ext/parameters#pulseWidth\0"; +pub const LV2_PARAMETERS__ratio: &'static [u8; 42usize] = + b"http://lv2plug.in/ns/ext/parameters#ratio\0"; +pub const LV2_PARAMETERS__release: &'static [u8; 44usize] = + b"http://lv2plug.in/ns/ext/parameters#release\0"; +pub const LV2_PARAMETERS__resonance: &'static [u8; 46usize] = + b"http://lv2plug.in/ns/ext/parameters#resonance\0"; +pub const LV2_PARAMETERS__sampleRate: &'static [u8; 47usize] = + b"http://lv2plug.in/ns/ext/parameters#sampleRate\0"; +pub const LV2_PARAMETERS__sustain: &'static [u8; 44usize] = + b"http://lv2plug.in/ns/ext/parameters#sustain\0"; +pub const LV2_PARAMETERS__threshold: &'static [u8; 46usize] = + b"http://lv2plug.in/ns/ext/parameters#threshold\0"; +pub const LV2_PARAMETERS__waveform: &'static [u8; 45usize] = + b"http://lv2plug.in/ns/ext/parameters#waveform\0"; +pub const LV2_PARAMETERS__wetDryRatio: &'static [u8; 48usize] = + b"http://lv2plug.in/ns/ext/parameters#wetDryRatio\0"; +pub const LV2_PARAMETERS__wetLevel: &'static [u8; 45usize] = + b"http://lv2plug.in/ns/ext/parameters#wetLevel\0"; +pub const LV2_CORE_URI: &'static [u8; 29usize] = b"http://lv2plug.in/ns/lv2core\0"; +pub const LV2_CORE_PREFIX: &'static [u8; 30usize] = b"http://lv2plug.in/ns/lv2core#\0"; +pub const LV2_CORE__AllpassPlugin: &'static [u8; 43usize] = + b"http://lv2plug.in/ns/lv2core#AllpassPlugin\0"; +pub const LV2_CORE__AmplifierPlugin: &'static [u8; 45usize] = + b"http://lv2plug.in/ns/lv2core#AmplifierPlugin\0"; +pub const LV2_CORE__AnalyserPlugin: &'static [u8; 44usize] = + b"http://lv2plug.in/ns/lv2core#AnalyserPlugin\0"; +pub const LV2_CORE__AudioPort: &'static [u8; 39usize] = b"http://lv2plug.in/ns/lv2core#AudioPort\0"; +pub const LV2_CORE__BandpassPlugin: &'static [u8; 44usize] = + b"http://lv2plug.in/ns/lv2core#BandpassPlugin\0"; +pub const LV2_CORE__CVPort: &'static [u8; 36usize] = b"http://lv2plug.in/ns/lv2core#CVPort\0"; +pub const LV2_CORE__ChorusPlugin: &'static [u8; 42usize] = + b"http://lv2plug.in/ns/lv2core#ChorusPlugin\0"; +pub const LV2_CORE__CombPlugin: &'static [u8; 40usize] = + b"http://lv2plug.in/ns/lv2core#CombPlugin\0"; +pub const LV2_CORE__CompressorPlugin: &'static [u8; 46usize] = + b"http://lv2plug.in/ns/lv2core#CompressorPlugin\0"; +pub const LV2_CORE__ConstantPlugin: &'static [u8; 44usize] = + b"http://lv2plug.in/ns/lv2core#ConstantPlugin\0"; +pub const LV2_CORE__ControlPort: &'static [u8; 41usize] = + b"http://lv2plug.in/ns/lv2core#ControlPort\0"; +pub const LV2_CORE__ConverterPlugin: &'static [u8; 45usize] = + b"http://lv2plug.in/ns/lv2core#ConverterPlugin\0"; +pub const LV2_CORE__DelayPlugin: &'static [u8; 41usize] = + b"http://lv2plug.in/ns/lv2core#DelayPlugin\0"; +pub const LV2_CORE__DistortionPlugin: &'static [u8; 46usize] = + b"http://lv2plug.in/ns/lv2core#DistortionPlugin\0"; +pub const LV2_CORE__DynamicsPlugin: &'static [u8; 44usize] = + b"http://lv2plug.in/ns/lv2core#DynamicsPlugin\0"; +pub const LV2_CORE__EQPlugin: &'static [u8; 38usize] = b"http://lv2plug.in/ns/lv2core#EQPlugin\0"; +pub const LV2_CORE__EnvelopePlugin: &'static [u8; 44usize] = + b"http://lv2plug.in/ns/lv2core#EnvelopePlugin\0"; +pub const LV2_CORE__ExpanderPlugin: &'static [u8; 44usize] = + b"http://lv2plug.in/ns/lv2core#ExpanderPlugin\0"; +pub const LV2_CORE__ExtensionData: &'static [u8; 43usize] = + b"http://lv2plug.in/ns/lv2core#ExtensionData\0"; +pub const LV2_CORE__Feature: &'static [u8; 37usize] = b"http://lv2plug.in/ns/lv2core#Feature\0"; +pub const LV2_CORE__FilterPlugin: &'static [u8; 42usize] = + b"http://lv2plug.in/ns/lv2core#FilterPlugin\0"; +pub const LV2_CORE__FlangerPlugin: &'static [u8; 43usize] = + b"http://lv2plug.in/ns/lv2core#FlangerPlugin\0"; +pub const LV2_CORE__FunctionPlugin: &'static [u8; 44usize] = + b"http://lv2plug.in/ns/lv2core#FunctionPlugin\0"; +pub const LV2_CORE__GatePlugin: &'static [u8; 40usize] = + b"http://lv2plug.in/ns/lv2core#GatePlugin\0"; +pub const LV2_CORE__GeneratorPlugin: &'static [u8; 45usize] = + b"http://lv2plug.in/ns/lv2core#GeneratorPlugin\0"; +pub const LV2_CORE__HighpassPlugin: &'static [u8; 44usize] = + b"http://lv2plug.in/ns/lv2core#HighpassPlugin\0"; +pub const LV2_CORE__InputPort: &'static [u8; 39usize] = b"http://lv2plug.in/ns/lv2core#InputPort\0"; +pub const LV2_CORE__InstrumentPlugin: &'static [u8; 46usize] = + b"http://lv2plug.in/ns/lv2core#InstrumentPlugin\0"; +pub const LV2_CORE__LimiterPlugin: &'static [u8; 43usize] = + b"http://lv2plug.in/ns/lv2core#LimiterPlugin\0"; +pub const LV2_CORE__LowpassPlugin: &'static [u8; 43usize] = + b"http://lv2plug.in/ns/lv2core#LowpassPlugin\0"; +pub const LV2_CORE__MixerPlugin: &'static [u8; 41usize] = + b"http://lv2plug.in/ns/lv2core#MixerPlugin\0"; +pub const LV2_CORE__ModulatorPlugin: &'static [u8; 45usize] = + b"http://lv2plug.in/ns/lv2core#ModulatorPlugin\0"; +pub const LV2_CORE__MultiEQPlugin: &'static [u8; 43usize] = + b"http://lv2plug.in/ns/lv2core#MultiEQPlugin\0"; +pub const LV2_CORE__OscillatorPlugin: &'static [u8; 46usize] = + b"http://lv2plug.in/ns/lv2core#OscillatorPlugin\0"; +pub const LV2_CORE__OutputPort: &'static [u8; 40usize] = + b"http://lv2plug.in/ns/lv2core#OutputPort\0"; +pub const LV2_CORE__ParaEQPlugin: &'static [u8; 42usize] = + b"http://lv2plug.in/ns/lv2core#ParaEQPlugin\0"; +pub const LV2_CORE__PhaserPlugin: &'static [u8; 42usize] = + b"http://lv2plug.in/ns/lv2core#PhaserPlugin\0"; +pub const LV2_CORE__PitchPlugin: &'static [u8; 41usize] = + b"http://lv2plug.in/ns/lv2core#PitchPlugin\0"; +pub const LV2_CORE__Plugin: &'static [u8; 36usize] = b"http://lv2plug.in/ns/lv2core#Plugin\0"; +pub const LV2_CORE__PluginBase: &'static [u8; 40usize] = + b"http://lv2plug.in/ns/lv2core#PluginBase\0"; +pub const LV2_CORE__Point: &'static [u8; 35usize] = b"http://lv2plug.in/ns/lv2core#Point\0"; +pub const LV2_CORE__Port: &'static [u8; 34usize] = b"http://lv2plug.in/ns/lv2core#Port\0"; +pub const LV2_CORE__PortProperty: &'static [u8; 42usize] = + b"http://lv2plug.in/ns/lv2core#PortProperty\0"; +pub const LV2_CORE__Resource: &'static [u8; 38usize] = b"http://lv2plug.in/ns/lv2core#Resource\0"; +pub const LV2_CORE__ReverbPlugin: &'static [u8; 42usize] = + b"http://lv2plug.in/ns/lv2core#ReverbPlugin\0"; +pub const LV2_CORE__ScalePoint: &'static [u8; 40usize] = + b"http://lv2plug.in/ns/lv2core#ScalePoint\0"; +pub const LV2_CORE__SimulatorPlugin: &'static [u8; 45usize] = + b"http://lv2plug.in/ns/lv2core#SimulatorPlugin\0"; +pub const LV2_CORE__SpatialPlugin: &'static [u8; 43usize] = + b"http://lv2plug.in/ns/lv2core#SpatialPlugin\0"; +pub const LV2_CORE__Specification: &'static [u8; 43usize] = + b"http://lv2plug.in/ns/lv2core#Specification\0"; +pub const LV2_CORE__SpectralPlugin: &'static [u8; 44usize] = + b"http://lv2plug.in/ns/lv2core#SpectralPlugin\0"; +pub const LV2_CORE__UtilityPlugin: &'static [u8; 43usize] = + b"http://lv2plug.in/ns/lv2core#UtilityPlugin\0"; +pub const LV2_CORE__WaveshaperPlugin: &'static [u8; 46usize] = + b"http://lv2plug.in/ns/lv2core#WaveshaperPlugin\0"; +pub const LV2_CORE__appliesTo: &'static [u8; 39usize] = b"http://lv2plug.in/ns/lv2core#appliesTo\0"; +pub const LV2_CORE__binary: &'static [u8; 36usize] = b"http://lv2plug.in/ns/lv2core#binary\0"; +pub const LV2_CORE__connectionOptional: &'static [u8; 48usize] = + b"http://lv2plug.in/ns/lv2core#connectionOptional\0"; +pub const LV2_CORE__control: &'static [u8; 37usize] = b"http://lv2plug.in/ns/lv2core#control\0"; +pub const LV2_CORE__default: &'static [u8; 37usize] = b"http://lv2plug.in/ns/lv2core#default\0"; +pub const LV2_CORE__designation: &'static [u8; 41usize] = + b"http://lv2plug.in/ns/lv2core#designation\0"; +pub const LV2_CORE__documentation: &'static [u8; 43usize] = + b"http://lv2plug.in/ns/lv2core#documentation\0"; +pub const LV2_CORE__enumeration: &'static [u8; 41usize] = + b"http://lv2plug.in/ns/lv2core#enumeration\0"; +pub const LV2_CORE__extensionData: &'static [u8; 43usize] = + b"http://lv2plug.in/ns/lv2core#extensionData\0"; +pub const LV2_CORE__freeWheeling: &'static [u8; 42usize] = + b"http://lv2plug.in/ns/lv2core#freeWheeling\0"; +pub const LV2_CORE__hardRTCapable: &'static [u8; 43usize] = + b"http://lv2plug.in/ns/lv2core#hardRTCapable\0"; +pub const LV2_CORE__inPlaceBroken: &'static [u8; 43usize] = + b"http://lv2plug.in/ns/lv2core#inPlaceBroken\0"; +pub const LV2_CORE__index: &'static [u8; 35usize] = b"http://lv2plug.in/ns/lv2core#index\0"; +pub const LV2_CORE__integer: &'static [u8; 37usize] = b"http://lv2plug.in/ns/lv2core#integer\0"; +pub const LV2_CORE__isLive: &'static [u8; 36usize] = b"http://lv2plug.in/ns/lv2core#isLive\0"; +pub const LV2_CORE__latency: &'static [u8; 37usize] = b"http://lv2plug.in/ns/lv2core#latency\0"; +pub const LV2_CORE__maximum: &'static [u8; 37usize] = b"http://lv2plug.in/ns/lv2core#maximum\0"; +pub const LV2_CORE__microVersion: &'static [u8; 42usize] = + b"http://lv2plug.in/ns/lv2core#microVersion\0"; +pub const LV2_CORE__minimum: &'static [u8; 37usize] = b"http://lv2plug.in/ns/lv2core#minimum\0"; +pub const LV2_CORE__minorVersion: &'static [u8; 42usize] = + b"http://lv2plug.in/ns/lv2core#minorVersion\0"; +pub const LV2_CORE__name: &'static [u8; 34usize] = b"http://lv2plug.in/ns/lv2core#name\0"; +pub const LV2_CORE__optionalFeature: &'static [u8; 45usize] = + b"http://lv2plug.in/ns/lv2core#optionalFeature\0"; +pub const LV2_CORE__port: &'static [u8; 34usize] = b"http://lv2plug.in/ns/lv2core#port\0"; +pub const LV2_CORE__portProperty: &'static [u8; 42usize] = + b"http://lv2plug.in/ns/lv2core#portProperty\0"; +pub const LV2_CORE__project: &'static [u8; 37usize] = b"http://lv2plug.in/ns/lv2core#project\0"; +pub const LV2_CORE__prototype: &'static [u8; 39usize] = b"http://lv2plug.in/ns/lv2core#prototype\0"; +pub const LV2_CORE__reportsLatency: &'static [u8; 44usize] = + b"http://lv2plug.in/ns/lv2core#reportsLatency\0"; +pub const LV2_CORE__requiredFeature: &'static [u8; 45usize] = + b"http://lv2plug.in/ns/lv2core#requiredFeature\0"; +pub const LV2_CORE__sampleRate: &'static [u8; 40usize] = + b"http://lv2plug.in/ns/lv2core#sampleRate\0"; +pub const LV2_CORE__scalePoint: &'static [u8; 40usize] = + b"http://lv2plug.in/ns/lv2core#scalePoint\0"; +pub const LV2_CORE__symbol: &'static [u8; 36usize] = b"http://lv2plug.in/ns/lv2core#symbol\0"; +pub const LV2_CORE__toggled: &'static [u8; 37usize] = b"http://lv2plug.in/ns/lv2core#toggled\0"; +pub const LV2_WORKER_URI: &'static [u8; 32usize] = b"http://lv2plug.in/ns/ext/worker\0"; +pub const LV2_WORKER_PREFIX: &'static [u8; 33usize] = b"http://lv2plug.in/ns/ext/worker#\0"; +pub const LV2_WORKER__interface: &'static [u8; 42usize] = + b"http://lv2plug.in/ns/ext/worker#interface\0"; +pub const LV2_WORKER__schedule: &'static [u8; 41usize] = + b"http://lv2plug.in/ns/ext/worker#schedule\0"; +pub const LV2_DATA_ACCESS_URI: &'static [u8; 37usize] = b"http://lv2plug.in/ns/ext/data-access\0"; +pub const LV2_DATA_ACCESS_PREFIX: &'static [u8; 38usize] = + b"http://lv2plug.in/ns/ext/data-access#\0"; +pub const LV2_URID_URI: &'static [u8; 30usize] = b"http://lv2plug.in/ns/ext/urid\0"; +pub const LV2_URID_PREFIX: &'static [u8; 31usize] = b"http://lv2plug.in/ns/ext/urid#\0"; +pub const LV2_URID__map: &'static [u8; 34usize] = b"http://lv2plug.in/ns/ext/urid#map\0"; +pub const LV2_URID__unmap: &'static [u8; 36usize] = b"http://lv2plug.in/ns/ext/urid#unmap\0"; +pub const LV2_URID_MAP_URI: &'static [u8; 34usize] = b"http://lv2plug.in/ns/ext/urid#map\0"; +pub const LV2_URID_UNMAP_URI: &'static [u8; 36usize] = b"http://lv2plug.in/ns/ext/urid#unmap\0"; +pub const LV2_TIME_URI: &'static [u8; 30usize] = b"http://lv2plug.in/ns/ext/time\0"; +pub const LV2_TIME_PREFIX: &'static [u8; 31usize] = b"http://lv2plug.in/ns/ext/time#\0"; +pub const LV2_TIME__Time: &'static [u8; 35usize] = b"http://lv2plug.in/ns/ext/time#Time\0"; +pub const LV2_TIME__Position: &'static [u8; 39usize] = b"http://lv2plug.in/ns/ext/time#Position\0"; +pub const LV2_TIME__Rate: &'static [u8; 35usize] = b"http://lv2plug.in/ns/ext/time#Rate\0"; +pub const LV2_TIME__position: &'static [u8; 39usize] = b"http://lv2plug.in/ns/ext/time#position\0"; +pub const LV2_TIME__barBeat: &'static [u8; 38usize] = b"http://lv2plug.in/ns/ext/time#barBeat\0"; +pub const LV2_TIME__bar: &'static [u8; 34usize] = b"http://lv2plug.in/ns/ext/time#bar\0"; +pub const LV2_TIME__beat: &'static [u8; 35usize] = b"http://lv2plug.in/ns/ext/time#beat\0"; +pub const LV2_TIME__beatUnit: &'static [u8; 39usize] = b"http://lv2plug.in/ns/ext/time#beatUnit\0"; +pub const LV2_TIME__beatsPerBar: &'static [u8; 42usize] = + b"http://lv2plug.in/ns/ext/time#beatsPerBar\0"; +pub const LV2_TIME__beatsPerMinute: &'static [u8; 45usize] = + b"http://lv2plug.in/ns/ext/time#beatsPerMinute\0"; +pub const LV2_TIME__frame: &'static [u8; 36usize] = b"http://lv2plug.in/ns/ext/time#frame\0"; +pub const LV2_TIME__framesPerSecond: &'static [u8; 46usize] = + b"http://lv2plug.in/ns/ext/time#framesPerSecond\0"; +pub const LV2_TIME__speed: &'static [u8; 36usize] = b"http://lv2plug.in/ns/ext/time#speed\0"; +pub const LV2_DYN_MANIFEST_URI: &'static [u8; 37usize] = b"http://lv2plug.in/ns/ext/dynmanifest\0"; +pub const LV2_DYN_MANIFEST_PREFIX: &'static [u8; 38usize] = + b"http://lv2plug.in/ns/ext/dynmanifest#\0"; +pub const LV2_OPTIONS_URI: &'static [u8; 33usize] = b"http://lv2plug.in/ns/ext/options\0"; +pub const LV2_OPTIONS_PREFIX: &'static [u8; 34usize] = b"http://lv2plug.in/ns/ext/options#\0"; +pub const LV2_OPTIONS__Option: &'static [u8; 40usize] = + b"http://lv2plug.in/ns/ext/options#Option\0"; +pub const LV2_OPTIONS__interface: &'static [u8; 43usize] = + b"http://lv2plug.in/ns/ext/options#interface\0"; +pub const LV2_OPTIONS__options: &'static [u8; 41usize] = + b"http://lv2plug.in/ns/ext/options#options\0"; +pub const LV2_OPTIONS__requiredOption: &'static [u8; 48usize] = + b"http://lv2plug.in/ns/ext/options#requiredOption\0"; +pub const LV2_OPTIONS__supportedOption: &'static [u8; 49usize] = + b"http://lv2plug.in/ns/ext/options#supportedOption\0"; +pub const LV2_EVENT_URI: &'static [u8; 31usize] = b"http://lv2plug.in/ns/ext/event\0"; +pub const LV2_EVENT_PREFIX: &'static [u8; 32usize] = b"http://lv2plug.in/ns/ext/event#\0"; +pub const LV2_EVENT__Event: &'static [u8; 37usize] = b"http://lv2plug.in/ns/ext/event#Event\0"; +pub const LV2_EVENT__EventPort: &'static [u8; 41usize] = + b"http://lv2plug.in/ns/ext/event#EventPort\0"; +pub const LV2_EVENT__FrameStamp: &'static [u8; 42usize] = + b"http://lv2plug.in/ns/ext/event#FrameStamp\0"; +pub const LV2_EVENT__TimeStamp: &'static [u8; 41usize] = + b"http://lv2plug.in/ns/ext/event#TimeStamp\0"; +pub const LV2_EVENT__generatesTimeStamp: &'static [u8; 50usize] = + b"http://lv2plug.in/ns/ext/event#generatesTimeStamp\0"; +pub const LV2_EVENT__generic: &'static [u8; 39usize] = b"http://lv2plug.in/ns/ext/event#generic\0"; +pub const LV2_EVENT__inheritsEvent: &'static [u8; 45usize] = + b"http://lv2plug.in/ns/ext/event#inheritsEvent\0"; +pub const LV2_EVENT__inheritsTimeStamp: &'static [u8; 49usize] = + b"http://lv2plug.in/ns/ext/event#inheritsTimeStamp\0"; +pub const LV2_EVENT__supportsEvent: &'static [u8; 45usize] = + b"http://lv2plug.in/ns/ext/event#supportsEvent\0"; +pub const LV2_EVENT__supportsTimeStamp: &'static [u8; 49usize] = + b"http://lv2plug.in/ns/ext/event#supportsTimeStamp\0"; +pub const LV2_EVENT_AUDIO_STAMP: u32 = 0; +pub const LV2_LOG_URI: &'static [u8; 29usize] = b"http://lv2plug.in/ns/ext/log\0"; +pub const LV2_LOG_PREFIX: &'static [u8; 30usize] = b"http://lv2plug.in/ns/ext/log#\0"; +pub const LV2_LOG__Entry: &'static [u8; 35usize] = b"http://lv2plug.in/ns/ext/log#Entry\0"; +pub const LV2_LOG__Error: &'static [u8; 35usize] = b"http://lv2plug.in/ns/ext/log#Error\0"; +pub const LV2_LOG__Note: &'static [u8; 34usize] = b"http://lv2plug.in/ns/ext/log#Note\0"; +pub const LV2_LOG__Trace: &'static [u8; 35usize] = b"http://lv2plug.in/ns/ext/log#Trace\0"; +pub const LV2_LOG__Warning: &'static [u8; 37usize] = b"http://lv2plug.in/ns/ext/log#Warning\0"; +pub const LV2_LOG__log: &'static [u8; 33usize] = b"http://lv2plug.in/ns/ext/log#log\0"; +pub const LV2_UNITS_URI: &'static [u8; 38usize] = b"http://lv2plug.in/ns/extensions/units\0"; +pub const LV2_UNITS_PREFIX: &'static [u8; 39usize] = b"http://lv2plug.in/ns/extensions/units#\0"; +pub const LV2_UNITS__Conversion: &'static [u8; 49usize] = + b"http://lv2plug.in/ns/extensions/units#Conversion\0"; +pub const LV2_UNITS__Unit: &'static [u8; 43usize] = b"http://lv2plug.in/ns/extensions/units#Unit\0"; +pub const LV2_UNITS__bar: &'static [u8; 42usize] = b"http://lv2plug.in/ns/extensions/units#bar\0"; +pub const LV2_UNITS__beat: &'static [u8; 43usize] = b"http://lv2plug.in/ns/extensions/units#beat\0"; +pub const LV2_UNITS__bpm: &'static [u8; 42usize] = b"http://lv2plug.in/ns/extensions/units#bpm\0"; +pub const LV2_UNITS__cent: &'static [u8; 43usize] = b"http://lv2plug.in/ns/extensions/units#cent\0"; +pub const LV2_UNITS__cm: &'static [u8; 41usize] = b"http://lv2plug.in/ns/extensions/units#cm\0"; +pub const LV2_UNITS__coef: &'static [u8; 43usize] = b"http://lv2plug.in/ns/extensions/units#coef\0"; +pub const LV2_UNITS__conversion: &'static [u8; 49usize] = + b"http://lv2plug.in/ns/extensions/units#conversion\0"; +pub const LV2_UNITS__db: &'static [u8; 41usize] = b"http://lv2plug.in/ns/extensions/units#db\0"; +pub const LV2_UNITS__degree: &'static [u8; 45usize] = + b"http://lv2plug.in/ns/extensions/units#degree\0"; +pub const LV2_UNITS__frame: &'static [u8; 44usize] = + b"http://lv2plug.in/ns/extensions/units#frame\0"; +pub const LV2_UNITS__hz: &'static [u8; 41usize] = b"http://lv2plug.in/ns/extensions/units#hz\0"; +pub const LV2_UNITS__inch: &'static [u8; 43usize] = b"http://lv2plug.in/ns/extensions/units#inch\0"; +pub const LV2_UNITS__khz: &'static [u8; 42usize] = b"http://lv2plug.in/ns/extensions/units#khz\0"; +pub const LV2_UNITS__km: &'static [u8; 41usize] = b"http://lv2plug.in/ns/extensions/units#km\0"; +pub const LV2_UNITS__m: &'static [u8; 40usize] = b"http://lv2plug.in/ns/extensions/units#m\0"; +pub const LV2_UNITS__mhz: &'static [u8; 42usize] = b"http://lv2plug.in/ns/extensions/units#mhz\0"; +pub const LV2_UNITS__midiNote: &'static [u8; 47usize] = + b"http://lv2plug.in/ns/extensions/units#midiNote\0"; +pub const LV2_UNITS__mile: &'static [u8; 43usize] = b"http://lv2plug.in/ns/extensions/units#mile\0"; +pub const LV2_UNITS__min: &'static [u8; 42usize] = b"http://lv2plug.in/ns/extensions/units#min\0"; +pub const LV2_UNITS__mm: &'static [u8; 41usize] = b"http://lv2plug.in/ns/extensions/units#mm\0"; +pub const LV2_UNITS__ms: &'static [u8; 41usize] = b"http://lv2plug.in/ns/extensions/units#ms\0"; +pub const LV2_UNITS__name: &'static [u8; 43usize] = b"http://lv2plug.in/ns/extensions/units#name\0"; +pub const LV2_UNITS__oct: &'static [u8; 42usize] = b"http://lv2plug.in/ns/extensions/units#oct\0"; +pub const LV2_UNITS__pc: &'static [u8; 41usize] = b"http://lv2plug.in/ns/extensions/units#pc\0"; +pub const LV2_UNITS__prefixConversion: &'static [u8; 55usize] = + b"http://lv2plug.in/ns/extensions/units#prefixConversion\0"; +pub const LV2_UNITS__render: &'static [u8; 45usize] = + b"http://lv2plug.in/ns/extensions/units#render\0"; +pub const LV2_UNITS__s: &'static [u8; 40usize] = b"http://lv2plug.in/ns/extensions/units#s\0"; +pub const LV2_UNITS__semitone12TET: &'static [u8; 52usize] = + b"http://lv2plug.in/ns/extensions/units#semitone12TET\0"; +pub const LV2_UNITS__symbol: &'static [u8; 45usize] = + b"http://lv2plug.in/ns/extensions/units#symbol\0"; +pub const LV2_UNITS__unit: &'static [u8; 43usize] = b"http://lv2plug.in/ns/extensions/units#unit\0"; +pub const LV2_UI_URI: &'static [u8; 35usize] = b"http://lv2plug.in/ns/extensions/ui\0"; +pub const LV2_UI_PREFIX: &'static [u8; 36usize] = b"http://lv2plug.in/ns/extensions/ui#\0"; +pub const LV2_UI__CocoaUI: &'static [u8; 43usize] = b"http://lv2plug.in/ns/extensions/ui#CocoaUI\0"; +pub const LV2_UI__Gtk3UI: &'static [u8; 42usize] = b"http://lv2plug.in/ns/extensions/ui#Gtk3UI\0"; +pub const LV2_UI__GtkUI: &'static [u8; 41usize] = b"http://lv2plug.in/ns/extensions/ui#GtkUI\0"; +pub const LV2_UI__PortNotification: &'static [u8; 52usize] = + b"http://lv2plug.in/ns/extensions/ui#PortNotification\0"; +pub const LV2_UI__PortProtocol: &'static [u8; 48usize] = + b"http://lv2plug.in/ns/extensions/ui#PortProtocol\0"; +pub const LV2_UI__Qt4UI: &'static [u8; 41usize] = b"http://lv2plug.in/ns/extensions/ui#Qt4UI\0"; +pub const LV2_UI__Qt5UI: &'static [u8; 41usize] = b"http://lv2plug.in/ns/extensions/ui#Qt5UI\0"; +pub const LV2_UI__UI: &'static [u8; 38usize] = b"http://lv2plug.in/ns/extensions/ui#UI\0"; +pub const LV2_UI__WindowsUI: &'static [u8; 45usize] = + b"http://lv2plug.in/ns/extensions/ui#WindowsUI\0"; +pub const LV2_UI__X11UI: &'static [u8; 41usize] = b"http://lv2plug.in/ns/extensions/ui#X11UI\0"; +pub const LV2_UI__binary: &'static [u8; 42usize] = b"http://lv2plug.in/ns/extensions/ui#binary\0"; +pub const LV2_UI__fixedSize: &'static [u8; 45usize] = + b"http://lv2plug.in/ns/extensions/ui#fixedSize\0"; +pub const LV2_UI__idleInterface: &'static [u8; 49usize] = + b"http://lv2plug.in/ns/extensions/ui#idleInterface\0"; +pub const LV2_UI__noUserResize: &'static [u8; 48usize] = + b"http://lv2plug.in/ns/extensions/ui#noUserResize\0"; +pub const LV2_UI__notifyType: &'static [u8; 46usize] = + b"http://lv2plug.in/ns/extensions/ui#notifyType\0"; +pub const LV2_UI__parent: &'static [u8; 42usize] = b"http://lv2plug.in/ns/extensions/ui#parent\0"; +pub const LV2_UI__plugin: &'static [u8; 42usize] = b"http://lv2plug.in/ns/extensions/ui#plugin\0"; +pub const LV2_UI__portIndex: &'static [u8; 45usize] = + b"http://lv2plug.in/ns/extensions/ui#portIndex\0"; +pub const LV2_UI__portMap: &'static [u8; 43usize] = b"http://lv2plug.in/ns/extensions/ui#portMap\0"; +pub const LV2_UI__portNotification: &'static [u8; 52usize] = + b"http://lv2plug.in/ns/extensions/ui#portNotification\0"; +pub const LV2_UI__portSubscribe: &'static [u8; 49usize] = + b"http://lv2plug.in/ns/extensions/ui#portSubscribe\0"; +pub const LV2_UI__protocol: &'static [u8; 44usize] = + b"http://lv2plug.in/ns/extensions/ui#protocol\0"; +pub const LV2_UI__floatProtocol: &'static [u8; 49usize] = + b"http://lv2plug.in/ns/extensions/ui#floatProtocol\0"; +pub const LV2_UI__peakProtocol: &'static [u8; 48usize] = + b"http://lv2plug.in/ns/extensions/ui#peakProtocol\0"; +pub const LV2_UI__resize: &'static [u8; 42usize] = b"http://lv2plug.in/ns/extensions/ui#resize\0"; +pub const LV2_UI__showInterface: &'static [u8; 49usize] = + b"http://lv2plug.in/ns/extensions/ui#showInterface\0"; +pub const LV2_UI__touch: &'static [u8; 41usize] = b"http://lv2plug.in/ns/extensions/ui#touch\0"; +pub const LV2_UI__ui: &'static [u8; 38usize] = b"http://lv2plug.in/ns/extensions/ui#ui\0"; +pub const LV2_UI__updateRate: &'static [u8; 46usize] = + b"http://lv2plug.in/ns/extensions/ui#updateRate\0"; +pub const LV2_UI__windowTitle: &'static [u8; 47usize] = + b"http://lv2plug.in/ns/extensions/ui#windowTitle\0"; +pub const LV2_MORPH_URI: &'static [u8; 31usize] = b"http://lv2plug.in/ns/ext/morph\0"; +pub const LV2_MORPH_PREFIX: &'static [u8; 32usize] = b"http://lv2plug.in/ns/ext/morph#\0"; +pub const LV2_MORPH__AutoMorphPort: &'static [u8; 45usize] = + b"http://lv2plug.in/ns/ext/morph#AutoMorphPort\0"; +pub const LV2_MORPH__MorphPort: &'static [u8; 41usize] = + b"http://lv2plug.in/ns/ext/morph#MorphPort\0"; +pub const LV2_MORPH__interface: &'static [u8; 41usize] = + b"http://lv2plug.in/ns/ext/morph#interface\0"; +pub const LV2_MORPH__supportsType: &'static [u8; 44usize] = + b"http://lv2plug.in/ns/ext/morph#supportsType\0"; +pub const LV2_MORPH__currentType: &'static [u8; 43usize] = + b"http://lv2plug.in/ns/ext/morph#currentType\0"; +pub const LV2_BUF_SIZE_URI: &'static [u8; 34usize] = b"http://lv2plug.in/ns/ext/buf-size\0"; +pub const LV2_BUF_SIZE_PREFIX: &'static [u8; 35usize] = b"http://lv2plug.in/ns/ext/buf-size#\0"; +pub const LV2_BUF_SIZE__boundedBlockLength: &'static [u8; 53usize] = + b"http://lv2plug.in/ns/ext/buf-size#boundedBlockLength\0"; +pub const LV2_BUF_SIZE__fixedBlockLength: &'static [u8; 51usize] = + b"http://lv2plug.in/ns/ext/buf-size#fixedBlockLength\0"; +pub const LV2_BUF_SIZE__maxBlockLength: &'static [u8; 49usize] = + b"http://lv2plug.in/ns/ext/buf-size#maxBlockLength\0"; +pub const LV2_BUF_SIZE__minBlockLength: &'static [u8; 49usize] = + b"http://lv2plug.in/ns/ext/buf-size#minBlockLength\0"; +pub const LV2_BUF_SIZE__nominalBlockLength: &'static [u8; 53usize] = + b"http://lv2plug.in/ns/ext/buf-size#nominalBlockLength\0"; +pub const LV2_BUF_SIZE__powerOf2BlockLength: &'static [u8; 54usize] = + b"http://lv2plug.in/ns/ext/buf-size#powerOf2BlockLength\0"; +pub const LV2_BUF_SIZE__sequenceSize: &'static [u8; 47usize] = + b"http://lv2plug.in/ns/ext/buf-size#sequenceSize\0"; +pub const LV2_STATE_URI: &'static [u8; 31usize] = b"http://lv2plug.in/ns/ext/state\0"; +pub const LV2_STATE_PREFIX: &'static [u8; 32usize] = b"http://lv2plug.in/ns/ext/state#\0"; +pub const LV2_STATE__State: &'static [u8; 37usize] = b"http://lv2plug.in/ns/ext/state#State\0"; +pub const LV2_STATE__interface: &'static [u8; 41usize] = + b"http://lv2plug.in/ns/ext/state#interface\0"; +pub const LV2_STATE__loadDefaultState: &'static [u8; 48usize] = + b"http://lv2plug.in/ns/ext/state#loadDefaultState\0"; +pub const LV2_STATE__makePath: &'static [u8; 40usize] = + b"http://lv2plug.in/ns/ext/state#makePath\0"; +pub const LV2_STATE__mapPath: &'static [u8; 39usize] = b"http://lv2plug.in/ns/ext/state#mapPath\0"; +pub const LV2_STATE__state: &'static [u8; 37usize] = b"http://lv2plug.in/ns/ext/state#state\0"; +pub const LV2_STATE__threadSafeRestore: &'static [u8; 49usize] = + b"http://lv2plug.in/ns/ext/state#threadSafeRestore\0"; +pub const LV2_STATE__StateChanged: &'static [u8; 44usize] = + b"http://lv2plug.in/ns/ext/state#StateChanged\0"; +pub const LV2_PRESETS_URI: &'static [u8; 33usize] = b"http://lv2plug.in/ns/ext/presets\0"; +pub const LV2_PRESETS_PREFIX: &'static [u8; 34usize] = b"http://lv2plug.in/ns/ext/presets#\0"; +pub const LV2_PRESETS__Bank: &'static [u8; 38usize] = b"http://lv2plug.in/ns/ext/presets#Bank\0"; +pub const LV2_PRESETS__Preset: &'static [u8; 40usize] = + b"http://lv2plug.in/ns/ext/presets#Preset\0"; +pub const LV2_PRESETS__bank: &'static [u8; 38usize] = b"http://lv2plug.in/ns/ext/presets#bank\0"; +pub const LV2_PRESETS__preset: &'static [u8; 40usize] = + b"http://lv2plug.in/ns/ext/presets#preset\0"; +pub const LV2_PRESETS__value: &'static [u8; 39usize] = b"http://lv2plug.in/ns/ext/presets#value\0"; +pub const LV2_URI_MAP_URI: &'static [u8; 33usize] = b"http://lv2plug.in/ns/ext/uri-map\0"; +pub const LV2_URI_MAP_PREFIX: &'static [u8; 34usize] = b"http://lv2plug.in/ns/ext/uri-map#\0"; +pub const LV2_PORT_GROUPS_URI: &'static [u8; 37usize] = b"http://lv2plug.in/ns/ext/port-groups\0"; +pub const LV2_PORT_GROUPS_PREFIX: &'static [u8; 38usize] = + b"http://lv2plug.in/ns/ext/port-groups#\0"; +pub const LV2_PORT_GROUPS__DiscreteGroup: &'static [u8; 51usize] = + b"http://lv2plug.in/ns/ext/port-groups#DiscreteGroup\0"; +pub const LV2_PORT_GROUPS__Element: &'static [u8; 45usize] = + b"http://lv2plug.in/ns/ext/port-groups#Element\0"; +pub const LV2_PORT_GROUPS__FivePointOneGroup: &'static [u8; 55usize] = + b"http://lv2plug.in/ns/ext/port-groups#FivePointOneGroup\0"; +pub const LV2_PORT_GROUPS__FivePointZeroGroup: &'static [u8; 56usize] = + b"http://lv2plug.in/ns/ext/port-groups#FivePointZeroGroup\0"; +pub const LV2_PORT_GROUPS__FourPointZeroGroup: &'static [u8; 56usize] = + b"http://lv2plug.in/ns/ext/port-groups#FourPointZeroGroup\0"; +pub const LV2_PORT_GROUPS__Group: &'static [u8; 43usize] = + b"http://lv2plug.in/ns/ext/port-groups#Group\0"; +pub const LV2_PORT_GROUPS__InputGroup: &'static [u8; 48usize] = + b"http://lv2plug.in/ns/ext/port-groups#InputGroup\0"; +pub const LV2_PORT_GROUPS__MidSideGroup: &'static [u8; 50usize] = + b"http://lv2plug.in/ns/ext/port-groups#MidSideGroup\0"; +pub const LV2_PORT_GROUPS__MonoGroup: &'static [u8; 47usize] = + b"http://lv2plug.in/ns/ext/port-groups#MonoGroup\0"; +pub const LV2_PORT_GROUPS__OutputGroup: &'static [u8; 49usize] = + b"http://lv2plug.in/ns/ext/port-groups#OutputGroup\0"; +pub const LV2_PORT_GROUPS__SevenPointOneGroup: &'static [u8; 56usize] = + b"http://lv2plug.in/ns/ext/port-groups#SevenPointOneGroup\0"; +pub const LV2_PORT_GROUPS__SevenPointOneWideGroup: &'static [u8; 60usize] = + b"http://lv2plug.in/ns/ext/port-groups#SevenPointOneWideGroup\0"; +pub const LV2_PORT_GROUPS__SixPointOneGroup: &'static [u8; 54usize] = + b"http://lv2plug.in/ns/ext/port-groups#SixPointOneGroup\0"; +pub const LV2_PORT_GROUPS__StereoGroup: &'static [u8; 49usize] = + b"http://lv2plug.in/ns/ext/port-groups#StereoGroup\0"; +pub const LV2_PORT_GROUPS__ThreePointZeroGroup: &'static [u8; 57usize] = + b"http://lv2plug.in/ns/ext/port-groups#ThreePointZeroGroup\0"; +pub const LV2_PORT_GROUPS__center: &'static [u8; 44usize] = + b"http://lv2plug.in/ns/ext/port-groups#center\0"; +pub const LV2_PORT_GROUPS__centerLeft: &'static [u8; 48usize] = + b"http://lv2plug.in/ns/ext/port-groups#centerLeft\0"; +pub const LV2_PORT_GROUPS__centerRight: &'static [u8; 49usize] = + b"http://lv2plug.in/ns/ext/port-groups#centerRight\0"; +pub const LV2_PORT_GROUPS__element: &'static [u8; 45usize] = + b"http://lv2plug.in/ns/ext/port-groups#element\0"; +pub const LV2_PORT_GROUPS__group: &'static [u8; 43usize] = + b"http://lv2plug.in/ns/ext/port-groups#group\0"; +pub const LV2_PORT_GROUPS__left: &'static [u8; 42usize] = + b"http://lv2plug.in/ns/ext/port-groups#left\0"; +pub const LV2_PORT_GROUPS__lowFrequencyEffects: &'static [u8; 57usize] = + b"http://lv2plug.in/ns/ext/port-groups#lowFrequencyEffects\0"; +pub const LV2_PORT_GROUPS__mainInput: &'static [u8; 47usize] = + b"http://lv2plug.in/ns/ext/port-groups#mainInput\0"; +pub const LV2_PORT_GROUPS__mainOutput: &'static [u8; 48usize] = + b"http://lv2plug.in/ns/ext/port-groups#mainOutput\0"; +pub const LV2_PORT_GROUPS__rearCenter: &'static [u8; 48usize] = + b"http://lv2plug.in/ns/ext/port-groups#rearCenter\0"; +pub const LV2_PORT_GROUPS__rearLeft: &'static [u8; 46usize] = + b"http://lv2plug.in/ns/ext/port-groups#rearLeft\0"; +pub const LV2_PORT_GROUPS__rearRight: &'static [u8; 47usize] = + b"http://lv2plug.in/ns/ext/port-groups#rearRight\0"; +pub const LV2_PORT_GROUPS__right: &'static [u8; 43usize] = + b"http://lv2plug.in/ns/ext/port-groups#right\0"; +pub const LV2_PORT_GROUPS__side: &'static [u8; 42usize] = + b"http://lv2plug.in/ns/ext/port-groups#side\0"; +pub const LV2_PORT_GROUPS__sideChainOf: &'static [u8; 49usize] = + b"http://lv2plug.in/ns/ext/port-groups#sideChainOf\0"; +pub const LV2_PORT_GROUPS__sideLeft: &'static [u8; 46usize] = + b"http://lv2plug.in/ns/ext/port-groups#sideLeft\0"; +pub const LV2_PORT_GROUPS__sideRight: &'static [u8; 47usize] = + b"http://lv2plug.in/ns/ext/port-groups#sideRight\0"; +pub const LV2_PORT_GROUPS__source: &'static [u8; 44usize] = + b"http://lv2plug.in/ns/ext/port-groups#source\0"; +pub const LV2_PORT_GROUPS__subGroupOf: &'static [u8; 48usize] = + b"http://lv2plug.in/ns/ext/port-groups#subGroupOf\0"; +pub const LV2_PATCH_URI: &'static [u8; 31usize] = b"http://lv2plug.in/ns/ext/patch\0"; +pub const LV2_PATCH_PREFIX: &'static [u8; 32usize] = b"http://lv2plug.in/ns/ext/patch#\0"; +pub const LV2_PATCH__Ack: &'static [u8; 35usize] = b"http://lv2plug.in/ns/ext/patch#Ack\0"; +pub const LV2_PATCH__Delete: &'static [u8; 38usize] = b"http://lv2plug.in/ns/ext/patch#Delete\0"; +pub const LV2_PATCH__Copy: &'static [u8; 36usize] = b"http://lv2plug.in/ns/ext/patch#Copy\0"; +pub const LV2_PATCH__Error: &'static [u8; 37usize] = b"http://lv2plug.in/ns/ext/patch#Error\0"; +pub const LV2_PATCH__Get: &'static [u8; 35usize] = b"http://lv2plug.in/ns/ext/patch#Get\0"; +pub const LV2_PATCH__Message: &'static [u8; 39usize] = b"http://lv2plug.in/ns/ext/patch#Message\0"; +pub const LV2_PATCH__Move: &'static [u8; 36usize] = b"http://lv2plug.in/ns/ext/patch#Move\0"; +pub const LV2_PATCH__Patch: &'static [u8; 37usize] = b"http://lv2plug.in/ns/ext/patch#Patch\0"; +pub const LV2_PATCH__Post: &'static [u8; 36usize] = b"http://lv2plug.in/ns/ext/patch#Post\0"; +pub const LV2_PATCH__Put: &'static [u8; 35usize] = b"http://lv2plug.in/ns/ext/patch#Put\0"; +pub const LV2_PATCH__Request: &'static [u8; 39usize] = b"http://lv2plug.in/ns/ext/patch#Request\0"; +pub const LV2_PATCH__Response: &'static [u8; 40usize] = + b"http://lv2plug.in/ns/ext/patch#Response\0"; +pub const LV2_PATCH__Set: &'static [u8; 35usize] = b"http://lv2plug.in/ns/ext/patch#Set\0"; +pub const LV2_PATCH__accept: &'static [u8; 38usize] = b"http://lv2plug.in/ns/ext/patch#accept\0"; +pub const LV2_PATCH__add: &'static [u8; 35usize] = b"http://lv2plug.in/ns/ext/patch#add\0"; +pub const LV2_PATCH__body: &'static [u8; 36usize] = b"http://lv2plug.in/ns/ext/patch#body\0"; +pub const LV2_PATCH__context: &'static [u8; 39usize] = b"http://lv2plug.in/ns/ext/patch#context\0"; +pub const LV2_PATCH__destination: &'static [u8; 43usize] = + b"http://lv2plug.in/ns/ext/patch#destination\0"; +pub const LV2_PATCH__property: &'static [u8; 40usize] = + b"http://lv2plug.in/ns/ext/patch#property\0"; +pub const LV2_PATCH__readable: &'static [u8; 40usize] = + b"http://lv2plug.in/ns/ext/patch#readable\0"; +pub const LV2_PATCH__remove: &'static [u8; 38usize] = b"http://lv2plug.in/ns/ext/patch#remove\0"; +pub const LV2_PATCH__request: &'static [u8; 39usize] = b"http://lv2plug.in/ns/ext/patch#request\0"; +pub const LV2_PATCH__subject: &'static [u8; 39usize] = b"http://lv2plug.in/ns/ext/patch#subject\0"; +pub const LV2_PATCH__sequenceNumber: &'static [u8; 46usize] = + b"http://lv2plug.in/ns/ext/patch#sequenceNumber\0"; +pub const LV2_PATCH__value: &'static [u8; 37usize] = b"http://lv2plug.in/ns/ext/patch#value\0"; +pub const LV2_PATCH__wildcard: &'static [u8; 40usize] = + b"http://lv2plug.in/ns/ext/patch#wildcard\0"; +pub const LV2_PATCH__writable: &'static [u8; 40usize] = + b"http://lv2plug.in/ns/ext/patch#writable\0"; +pub const LV2_RESIZE_PORT_URI: &'static [u8; 37usize] = b"http://lv2plug.in/ns/ext/resize-port\0"; +pub const LV2_RESIZE_PORT_PREFIX: &'static [u8; 38usize] = + b"http://lv2plug.in/ns/ext/resize-port#\0"; +pub const LV2_RESIZE_PORT__asLargeAs: &'static [u8; 47usize] = + b"http://lv2plug.in/ns/ext/resize-port#asLargeAs\0"; +pub const LV2_RESIZE_PORT__minimumSize: &'static [u8; 49usize] = + b"http://lv2plug.in/ns/ext/resize-port#minimumSize\0"; +pub const LV2_RESIZE_PORT__resize: &'static [u8; 44usize] = + b"http://lv2plug.in/ns/ext/resize-port#resize\0"; +pub const LV2_MIDI_URI: &'static [u8; 30usize] = b"http://lv2plug.in/ns/ext/midi\0"; +pub const LV2_MIDI_PREFIX: &'static [u8; 31usize] = b"http://lv2plug.in/ns/ext/midi#\0"; +pub const LV2_MIDI__ActiveSense: &'static [u8; 42usize] = + b"http://lv2plug.in/ns/ext/midi#ActiveSense\0"; +pub const LV2_MIDI__Aftertouch: &'static [u8; 41usize] = + b"http://lv2plug.in/ns/ext/midi#Aftertouch\0"; +pub const LV2_MIDI__Bender: &'static [u8; 37usize] = b"http://lv2plug.in/ns/ext/midi#Bender\0"; +pub const LV2_MIDI__ChannelPressure: &'static [u8; 46usize] = + b"http://lv2plug.in/ns/ext/midi#ChannelPressure\0"; +pub const LV2_MIDI__Chunk: &'static [u8; 36usize] = b"http://lv2plug.in/ns/ext/midi#Chunk\0"; +pub const LV2_MIDI__Clock: &'static [u8; 36usize] = b"http://lv2plug.in/ns/ext/midi#Clock\0"; +pub const LV2_MIDI__Continue: &'static [u8; 39usize] = b"http://lv2plug.in/ns/ext/midi#Continue\0"; +pub const LV2_MIDI__Controller: &'static [u8; 41usize] = + b"http://lv2plug.in/ns/ext/midi#Controller\0"; +pub const LV2_MIDI__MidiEvent: &'static [u8; 40usize] = + b"http://lv2plug.in/ns/ext/midi#MidiEvent\0"; +pub const LV2_MIDI__NoteOff: &'static [u8; 38usize] = b"http://lv2plug.in/ns/ext/midi#NoteOff\0"; +pub const LV2_MIDI__NoteOn: &'static [u8; 37usize] = b"http://lv2plug.in/ns/ext/midi#NoteOn\0"; +pub const LV2_MIDI__ProgramChange: &'static [u8; 44usize] = + b"http://lv2plug.in/ns/ext/midi#ProgramChange\0"; +pub const LV2_MIDI__QuarterFrame: &'static [u8; 43usize] = + b"http://lv2plug.in/ns/ext/midi#QuarterFrame\0"; +pub const LV2_MIDI__Reset: &'static [u8; 36usize] = b"http://lv2plug.in/ns/ext/midi#Reset\0"; +pub const LV2_MIDI__SongPosition: &'static [u8; 43usize] = + b"http://lv2plug.in/ns/ext/midi#SongPosition\0"; +pub const LV2_MIDI__SongSelect: &'static [u8; 41usize] = + b"http://lv2plug.in/ns/ext/midi#SongSelect\0"; +pub const LV2_MIDI__Start: &'static [u8; 36usize] = b"http://lv2plug.in/ns/ext/midi#Start\0"; +pub const LV2_MIDI__Stop: &'static [u8; 35usize] = b"http://lv2plug.in/ns/ext/midi#Stop\0"; +pub const LV2_MIDI__SystemCommon: &'static [u8; 43usize] = + b"http://lv2plug.in/ns/ext/midi#SystemCommon\0"; +pub const LV2_MIDI__SystemExclusive: &'static [u8; 46usize] = + b"http://lv2plug.in/ns/ext/midi#SystemExclusive\0"; +pub const LV2_MIDI__SystemMessage: &'static [u8; 44usize] = + b"http://lv2plug.in/ns/ext/midi#SystemMessage\0"; +pub const LV2_MIDI__SystemRealtime: &'static [u8; 45usize] = + b"http://lv2plug.in/ns/ext/midi#SystemRealtime\0"; +pub const LV2_MIDI__Tick: &'static [u8; 35usize] = b"http://lv2plug.in/ns/ext/midi#Tick\0"; +pub const LV2_MIDI__TuneRequest: &'static [u8; 42usize] = + b"http://lv2plug.in/ns/ext/midi#TuneRequest\0"; +pub const LV2_MIDI__VoiceMessage: &'static [u8; 43usize] = + b"http://lv2plug.in/ns/ext/midi#VoiceMessage\0"; +pub const LV2_MIDI__benderValue: &'static [u8; 42usize] = + b"http://lv2plug.in/ns/ext/midi#benderValue\0"; +pub const LV2_MIDI__binding: &'static [u8; 38usize] = b"http://lv2plug.in/ns/ext/midi#binding\0"; +pub const LV2_MIDI__byteNumber: &'static [u8; 41usize] = + b"http://lv2plug.in/ns/ext/midi#byteNumber\0"; +pub const LV2_MIDI__channel: &'static [u8; 38usize] = b"http://lv2plug.in/ns/ext/midi#channel\0"; +pub const LV2_MIDI__chunk: &'static [u8; 36usize] = b"http://lv2plug.in/ns/ext/midi#chunk\0"; +pub const LV2_MIDI__controllerNumber: &'static [u8; 47usize] = + b"http://lv2plug.in/ns/ext/midi#controllerNumber\0"; +pub const LV2_MIDI__controllerValue: &'static [u8; 46usize] = + b"http://lv2plug.in/ns/ext/midi#controllerValue\0"; +pub const LV2_MIDI__noteNumber: &'static [u8; 41usize] = + b"http://lv2plug.in/ns/ext/midi#noteNumber\0"; +pub const LV2_MIDI__pressure: &'static [u8; 39usize] = b"http://lv2plug.in/ns/ext/midi#pressure\0"; +pub const LV2_MIDI__programNumber: &'static [u8; 44usize] = + b"http://lv2plug.in/ns/ext/midi#programNumber\0"; +pub const LV2_MIDI__property: &'static [u8; 39usize] = b"http://lv2plug.in/ns/ext/midi#property\0"; +pub const LV2_MIDI__songNumber: &'static [u8; 41usize] = + b"http://lv2plug.in/ns/ext/midi#songNumber\0"; +pub const LV2_MIDI__songPosition: &'static [u8; 43usize] = + b"http://lv2plug.in/ns/ext/midi#songPosition\0"; +pub const LV2_MIDI__status: &'static [u8; 37usize] = b"http://lv2plug.in/ns/ext/midi#status\0"; +pub const LV2_MIDI__statusMask: &'static [u8; 41usize] = + b"http://lv2plug.in/ns/ext/midi#statusMask\0"; +pub const LV2_MIDI__velocity: &'static [u8; 39usize] = b"http://lv2plug.in/ns/ext/midi#velocity\0"; +pub const LV2_ATOM_URI: &'static [u8; 30usize] = b"http://lv2plug.in/ns/ext/atom\0"; +pub const LV2_ATOM_PREFIX: &'static [u8; 31usize] = b"http://lv2plug.in/ns/ext/atom#\0"; +pub const LV2_ATOM__Atom: &'static [u8; 35usize] = b"http://lv2plug.in/ns/ext/atom#Atom\0"; +pub const LV2_ATOM__AtomPort: &'static [u8; 39usize] = b"http://lv2plug.in/ns/ext/atom#AtomPort\0"; +pub const LV2_ATOM__Blank: &'static [u8; 36usize] = b"http://lv2plug.in/ns/ext/atom#Blank\0"; +pub const LV2_ATOM__Bool: &'static [u8; 35usize] = b"http://lv2plug.in/ns/ext/atom#Bool\0"; +pub const LV2_ATOM__Chunk: &'static [u8; 36usize] = b"http://lv2plug.in/ns/ext/atom#Chunk\0"; +pub const LV2_ATOM__Double: &'static [u8; 37usize] = b"http://lv2plug.in/ns/ext/atom#Double\0"; +pub const LV2_ATOM__Event: &'static [u8; 36usize] = b"http://lv2plug.in/ns/ext/atom#Event\0"; +pub const LV2_ATOM__Float: &'static [u8; 36usize] = b"http://lv2plug.in/ns/ext/atom#Float\0"; +pub const LV2_ATOM__Int: &'static [u8; 34usize] = b"http://lv2plug.in/ns/ext/atom#Int\0"; +pub const LV2_ATOM__Literal: &'static [u8; 38usize] = b"http://lv2plug.in/ns/ext/atom#Literal\0"; +pub const LV2_ATOM__Long: &'static [u8; 35usize] = b"http://lv2plug.in/ns/ext/atom#Long\0"; +pub const LV2_ATOM__Number: &'static [u8; 37usize] = b"http://lv2plug.in/ns/ext/atom#Number\0"; +pub const LV2_ATOM__Object: &'static [u8; 37usize] = b"http://lv2plug.in/ns/ext/atom#Object\0"; +pub const LV2_ATOM__Path: &'static [u8; 35usize] = b"http://lv2plug.in/ns/ext/atom#Path\0"; +pub const LV2_ATOM__Property: &'static [u8; 39usize] = b"http://lv2plug.in/ns/ext/atom#Property\0"; +pub const LV2_ATOM__Resource: &'static [u8; 39usize] = b"http://lv2plug.in/ns/ext/atom#Resource\0"; +pub const LV2_ATOM__Sequence: &'static [u8; 39usize] = b"http://lv2plug.in/ns/ext/atom#Sequence\0"; +pub const LV2_ATOM__Sound: &'static [u8; 36usize] = b"http://lv2plug.in/ns/ext/atom#Sound\0"; +pub const LV2_ATOM__String: &'static [u8; 37usize] = b"http://lv2plug.in/ns/ext/atom#String\0"; +pub const LV2_ATOM__Tuple: &'static [u8; 36usize] = b"http://lv2plug.in/ns/ext/atom#Tuple\0"; +pub const LV2_ATOM__URI: &'static [u8; 34usize] = b"http://lv2plug.in/ns/ext/atom#URI\0"; +pub const LV2_ATOM__URID: &'static [u8; 35usize] = b"http://lv2plug.in/ns/ext/atom#URID\0"; +pub const LV2_ATOM__Vector: &'static [u8; 37usize] = b"http://lv2plug.in/ns/ext/atom#Vector\0"; +pub const LV2_ATOM__atomTransfer: &'static [u8; 43usize] = + b"http://lv2plug.in/ns/ext/atom#atomTransfer\0"; +pub const LV2_ATOM__beatTime: &'static [u8; 39usize] = b"http://lv2plug.in/ns/ext/atom#beatTime\0"; +pub const LV2_ATOM__bufferType: &'static [u8; 41usize] = + b"http://lv2plug.in/ns/ext/atom#bufferType\0"; +pub const LV2_ATOM__childType: &'static [u8; 40usize] = + b"http://lv2plug.in/ns/ext/atom#childType\0"; +pub const LV2_ATOM__eventTransfer: &'static [u8; 44usize] = + b"http://lv2plug.in/ns/ext/atom#eventTransfer\0"; +pub const LV2_ATOM__frameTime: &'static [u8; 40usize] = + b"http://lv2plug.in/ns/ext/atom#frameTime\0"; +pub const LV2_ATOM__supports: &'static [u8; 39usize] = b"http://lv2plug.in/ns/ext/atom#supports\0"; +pub const LV2_ATOM__timeUnit: &'static [u8; 39usize] = b"http://lv2plug.in/ns/ext/atom#timeUnit\0"; +pub const LV2_ATOM_REFERENCE_TYPE: u32 = 0; +#[doc = "Plugin Instance Handle."] +#[doc = ""] +#[doc = "This is a handle for one particular instance of a plugin. It is valid to"] +#[doc = "compare to NULL (or 0 for C++) but otherwise the host MUST NOT attempt to"] +#[doc = "interpret it."] +pub type LV2_Handle = *mut ::std::os::raw::c_void; +#[doc = "Feature."] +#[doc = ""] +#[doc = "Features allow hosts to make additional functionality available to plugins"] +#[doc = "without requiring modification to the LV2 API. Extensions may define new"] +#[doc = "features and specify the `URI` and `data` to be used if necessary."] +#[doc = "Some features, such as lv2:isLive, do not require the host to pass data."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _LV2_Feature { + #[doc = "A globally unique, case-sensitive identifier (URI) for this feature."] + #[doc = ""] + #[doc = "This MUST be a valid URI string as defined by RFC 3986."] + pub URI: *const ::std::os::raw::c_char, + #[doc = "Pointer to arbitrary data."] + #[doc = ""] + #[doc = "The format of this data is defined by the extension which describes the"] + #[doc = "feature with the given `URI`."] + pub data: *mut ::std::os::raw::c_void, +} +pub type LV2_Feature = _LV2_Feature; +#[doc = "Plugin Descriptor."] +#[doc = ""] +#[doc = "This structure provides the core functions necessary to instantiate and use"] +#[doc = "a plugin."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _LV2_Descriptor { + #[doc = "A globally unique, case-sensitive identifier for this plugin."] + #[doc = ""] + #[doc = "This MUST be a valid URI string as defined by RFC 3986. All plugins with"] + #[doc = "the same URI MUST be compatible to some degree, see"] + #[doc = "http://lv2plug.in/ns/lv2core for details."] + pub URI: *const ::std::os::raw::c_char, + #[doc = "Instantiate the plugin."] + #[doc = ""] + #[doc = "Note that instance initialisation should generally occur in activate()"] + #[doc = "rather than here. If a host calls instantiate(), it MUST call cleanup()"] + #[doc = "at some point in the future."] + #[doc = ""] + #[doc = "@param descriptor Descriptor of the plugin to instantiate."] + #[doc = ""] + #[doc = "@param sample_rate Sample rate, in Hz, for the new plugin instance."] + #[doc = ""] + #[doc = "@param bundle_path Path to the LV2 bundle which contains this plugin"] + #[doc = "binary. It MUST include the trailing directory separator (e.g. '/') so"] + #[doc = "that simply appending a filename will yield the path to that file in the"] + #[doc = "bundle."] + #[doc = ""] + #[doc = "@param features A NULL terminated array of LV2_Feature structs which"] + #[doc = "represent the features the host supports. Plugins may refuse to"] + #[doc = "instantiate if required features are not found here. However, hosts MUST"] + #[doc = "NOT use this as a discovery mechanism: instead, use the RDF data to"] + #[doc = "determine which features are required and do not attempt to instantiate"] + #[doc = "unsupported plugins at all. This parameter MUST NOT be NULL, i.e. a host"] + #[doc = "that supports no features MUST pass a single element array containing"] + #[doc = "NULL."] + #[doc = ""] + #[doc = "@return A handle for the new plugin instance, or NULL if instantiation"] + #[doc = "has failed."] + pub instantiate: ::std::option::Option< + unsafe extern "C" fn( + descriptor: *const _LV2_Descriptor, + sample_rate: f64, + bundle_path: *const ::std::os::raw::c_char, + features: *const *const LV2_Feature, + ) -> LV2_Handle, + >, + #[doc = "Connect a port on a plugin instance to a memory location."] + #[doc = ""] + #[doc = "Plugin writers should be aware that the host may elect to use the same"] + #[doc = "buffer for more than one port and even use the same buffer for both"] + #[doc = "input and output (see lv2:inPlaceBroken in lv2.ttl)."] + #[doc = ""] + #[doc = "If the plugin has the feature lv2:hardRTCapable then there are various"] + #[doc = "things that the plugin MUST NOT do within the connect_port() function;"] + #[doc = "see lv2core.ttl for details."] + #[doc = ""] + #[doc = "connect_port() MUST be called at least once for each port before run()"] + #[doc = "is called, unless that port is lv2:connectionOptional. The plugin must"] + #[doc = "pay careful attention to the block size passed to run() since the block"] + #[doc = "allocated may only just be large enough to contain the data, and is not"] + #[doc = "guaranteed to remain constant between run() calls."] + #[doc = ""] + #[doc = "connect_port() may be called more than once for a plugin instance to"] + #[doc = "allow the host to change the buffers that the plugin is reading or"] + #[doc = "writing. These calls may be made before or after activate() or"] + #[doc = "deactivate() calls."] + #[doc = ""] + #[doc = "@param instance Plugin instance containing the port."] + #[doc = ""] + #[doc = "@param port Index of the port to connect. The host MUST NOT try to"] + #[doc = "connect a port index that is not defined in the plugin's RDF data. If"] + #[doc = "it does, the plugin's behaviour is undefined (a crash is likely)."] + #[doc = ""] + #[doc = "@param data_location Pointer to data of the type defined by the port"] + #[doc = "type in the plugin's RDF data (e.g. an array of float for an"] + #[doc = "lv2:AudioPort). This pointer must be stored by the plugin instance and"] + #[doc = "used to read/write data when run() is called. Data present at the time"] + #[doc = "of the connect_port() call MUST NOT be considered meaningful."] + pub connect_port: ::std::option::Option< + unsafe extern "C" fn( + instance: LV2_Handle, + port: u32, + data_location: *mut ::std::os::raw::c_void, + ), + >, + #[doc = "Initialise a plugin instance and activate it for use."] + #[doc = ""] + #[doc = "This is separated from instantiate() to aid real-time support and so"] + #[doc = "that hosts can reinitialise a plugin instance by calling deactivate()"] + #[doc = "and then activate(). In this case the plugin instance MUST reset all"] + #[doc = "state information dependent on the history of the plugin instance except"] + #[doc = "for any data locations provided by connect_port(). If there is nothing"] + #[doc = "for activate() to do then this field may be NULL."] + #[doc = ""] + #[doc = "When present, hosts MUST call this function once before run() is called"] + #[doc = "for the first time. This call SHOULD be made as close to the run() call"] + #[doc = "as possible and indicates to real-time plugins that they are now live,"] + #[doc = "however plugins MUST NOT rely on a prompt call to run() after"] + #[doc = "activate()."] + #[doc = ""] + #[doc = "The host MUST NOT call activate() again until deactivate() has been"] + #[doc = "called first. If a host calls activate(), it MUST call deactivate() at"] + #[doc = "some point in the future. Note that connect_port() may be called before"] + #[doc = "or after activate()."] + pub activate: ::std::option::Option, + #[doc = "Run a plugin instance for a block."] + #[doc = ""] + #[doc = "Note that if an activate() function exists then it must be called before"] + #[doc = "run(). If deactivate() is called for a plugin instance then run() may"] + #[doc = "not be called until activate() has been called again."] + #[doc = ""] + #[doc = "If the plugin has the feature lv2:hardRTCapable then there are various"] + #[doc = "things that the plugin MUST NOT do within the run() function (see"] + #[doc = "lv2core.ttl for details)."] + #[doc = ""] + #[doc = "As a special case, when `sample_count` is 0, the plugin should update"] + #[doc = "any output ports that represent a single instant in time (e.g. control"] + #[doc = "ports, but not audio ports). This is particularly useful for latent"] + #[doc = "plugins, which should update their latency output port so hosts can"] + #[doc = "pre-roll plugins to compute latency. Plugins MUST NOT crash when"] + #[doc = "`sample_count` is 0."] + #[doc = ""] + #[doc = "@param instance Instance to be run."] + #[doc = ""] + #[doc = "@param sample_count The block size (in samples) for which the plugin"] + #[doc = "instance must run."] + pub run: ::std::option::Option, + #[doc = "Deactivate a plugin instance (counterpart to activate())."] + #[doc = ""] + #[doc = "Hosts MUST deactivate all activated instances after they have been run()"] + #[doc = "for the last time. This call SHOULD be made as close to the last run()"] + #[doc = "call as possible and indicates to real-time plugins that they are no"] + #[doc = "longer live, however plugins MUST NOT rely on prompt deactivation. If"] + #[doc = "there is nothing for deactivate() to do then this field may be NULL"] + #[doc = ""] + #[doc = "Deactivation is not similar to pausing since the plugin instance will be"] + #[doc = "reinitialised by activate(). However, deactivate() itself MUST NOT fully"] + #[doc = "reset plugin state. For example, the host may deactivate a plugin, then"] + #[doc = "store its state (using some extension to do so)."] + #[doc = ""] + #[doc = "Hosts MUST NOT call deactivate() unless activate() was previously"] + #[doc = "called. Note that connect_port() may be called before or after"] + #[doc = "deactivate()."] + pub deactivate: ::std::option::Option, + #[doc = "Clean up a plugin instance (counterpart to instantiate())."] + #[doc = ""] + #[doc = "Once an instance of a plugin has been finished with it must be deleted"] + #[doc = "using this function. The instance handle passed ceases to be valid after"] + #[doc = "this call."] + #[doc = ""] + #[doc = "If activate() was called for a plugin instance then a corresponding call"] + #[doc = "to deactivate() MUST be made before cleanup() is called. Hosts MUST NOT"] + #[doc = "call cleanup() unless instantiate() was previously called."] + pub cleanup: ::std::option::Option, + #[doc = "Return additional plugin data defined by some extenion."] + #[doc = ""] + #[doc = "A typical use of this facility is to return a struct containing function"] + #[doc = "pointers to extend the LV2_Descriptor API."] + #[doc = ""] + #[doc = "The actual type and meaning of the returned object MUST be specified"] + #[doc = "precisely by the extension. This function MUST return NULL for any"] + #[doc = "unsupported URI. If a plugin does not support any extension data, this"] + #[doc = "field may be NULL."] + #[doc = ""] + #[doc = "The host is never responsible for freeing the returned value."] + pub extension_data: ::std::option::Option< + unsafe extern "C" fn(uri: *const ::std::os::raw::c_char) -> *const ::std::os::raw::c_void, + >, +} +pub type LV2_Descriptor = _LV2_Descriptor; +#[doc = "Type of the lv2_descriptor() function in a library (old discovery API)."] +pub type LV2_Descriptor_Function = + ::std::option::Option *const LV2_Descriptor>; +#[doc = "Handle for a library descriptor."] +pub type LV2_Lib_Handle = *mut ::std::os::raw::c_void; +#[doc = "Descriptor for a plugin library."] +#[doc = ""] +#[doc = "To access a plugin library, the host creates an LV2_Lib_Descriptor via the"] +#[doc = "lv2_lib_descriptor() function in the shared object."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct LV2_Lib_Descriptor { + #[doc = "Opaque library data which must be passed as the first parameter to all"] + #[doc = "the methods of this struct."] + pub handle: LV2_Lib_Handle, + #[doc = "The total size of this struct. This allows for this struct to be"] + #[doc = "expanded in the future if necessary. This MUST be set by the library to"] + #[doc = "sizeof(LV2_Lib_Descriptor). The host MUST NOT access any fields of this"] + #[doc = "struct beyond get_plugin() unless this field indicates they are present."] + pub size: u32, + #[doc = "Destroy this library descriptor and free all related resources."] + pub cleanup: ::std::option::Option, + #[doc = "Plugin accessor."] + #[doc = ""] + #[doc = "Plugins are accessed by index using values from 0 upwards. Out of range"] + #[doc = "indices MUST result in this function returning NULL, so the host can"] + #[doc = "enumerate plugins by increasing `index` until NULL is returned."] + pub get_plugin: ::std::option::Option< + unsafe extern "C" fn(handle: LV2_Lib_Handle, index: u32) -> *const LV2_Descriptor, + >, +} +#[doc = "Type of the lv2_lib_descriptor() function in an LV2 library."] +pub type LV2_Lib_Descriptor_Function = ::std::option::Option< + unsafe extern "C" fn( + bundle_path: *const ::std::os::raw::c_char, + features: *const *const LV2_Feature, + ) -> *const LV2_Lib_Descriptor, +>; +#[doc = "< Completed successfully."] +pub const LV2_Worker_Status_LV2_WORKER_SUCCESS: LV2_Worker_Status = 0; +#[doc = "< Unknown error."] +pub const LV2_Worker_Status_LV2_WORKER_ERR_UNKNOWN: LV2_Worker_Status = 1; +#[doc = "< Failed due to lack of space."] +pub const LV2_Worker_Status_LV2_WORKER_ERR_NO_SPACE: LV2_Worker_Status = 2; +#[doc = "Status code for worker functions."] +pub type LV2_Worker_Status = u32; +#[doc = " Opaque handle for LV2_Worker_Interface::work()."] +pub type LV2_Worker_Respond_Handle = *mut ::std::os::raw::c_void; +#[doc = "A function to respond to run() from the worker method."] +#[doc = ""] +#[doc = "The `data` MUST be safe for the host to copy and later pass to"] +#[doc = "work_response(), and the host MUST guarantee that it will be eventually"] +#[doc = "passed to work_response() if this function returns LV2_WORKER_SUCCESS."] +pub type LV2_Worker_Respond_Function = ::std::option::Option< + unsafe extern "C" fn( + handle: LV2_Worker_Respond_Handle, + size: u32, + data: *const ::std::os::raw::c_void, + ) -> LV2_Worker_Status, +>; +#[doc = "Plugin Worker Interface."] +#[doc = ""] +#[doc = "This is the interface provided by the plugin to implement a worker method."] +#[doc = "The plugin's extension_data() method should return an LV2_Worker_Interface"] +#[doc = "when called with LV2_WORKER__interface as its argument."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _LV2_Worker_Interface { + #[doc = "The worker method. This is called by the host in a non-realtime context"] + #[doc = "as requested, possibly with an arbitrary message to handle."] + #[doc = ""] + #[doc = "A response can be sent to run() using `respond`. The plugin MUST NOT"] + #[doc = "make any assumptions about which thread calls this method, except that"] + #[doc = "there are no real-time requirements and only one call may be executed at"] + #[doc = "a time. That is, the host MAY call this method from any non-real-time"] + #[doc = "thread, but MUST NOT make concurrent calls to this method from several"] + #[doc = "threads."] + #[doc = ""] + #[doc = "@param instance The LV2 instance this is a method on."] + #[doc = "@param respond A function for sending a response to run()."] + #[doc = "@param handle Must be passed to `respond` if it is called."] + #[doc = "@param size The size of `data`."] + #[doc = "@param data Data from run(), or NULL."] + pub work: ::std::option::Option< + unsafe extern "C" fn( + instance: LV2_Handle, + respond: LV2_Worker_Respond_Function, + handle: LV2_Worker_Respond_Handle, + size: u32, + data: *const ::std::os::raw::c_void, + ) -> LV2_Worker_Status, + >, + #[doc = "Handle a response from the worker. This is called by the host in the"] + #[doc = "run() context when a response from the worker is ready."] + #[doc = ""] + #[doc = "@param instance The LV2 instance this is a method on."] + #[doc = "@param size The size of `body`."] + #[doc = "@param body Message body, or NULL."] + pub work_response: ::std::option::Option< + unsafe extern "C" fn( + instance: LV2_Handle, + size: u32, + body: *const ::std::os::raw::c_void, + ) -> LV2_Worker_Status, + >, + #[doc = "Called when all responses for this cycle have been delivered."] + #[doc = ""] + #[doc = "Since work_response() may be called after run() finished, this provides"] + #[doc = "a hook for code that must run after the cycle is completed."] + #[doc = ""] + #[doc = "This field may be NULL if the plugin has no use for it. Otherwise, the"] + #[doc = "host MUST call it after every run(), regardless of whether or not any"] + #[doc = "responses were sent that cycle."] + pub end_run: + ::std::option::Option LV2_Worker_Status>, +} +pub type LV2_Worker_Interface = _LV2_Worker_Interface; +#[doc = " Opaque handle for LV2_Worker_Schedule."] +pub type LV2_Worker_Schedule_Handle = *mut ::std::os::raw::c_void; +#[doc = "Schedule Worker Host Feature."] +#[doc = ""] +#[doc = "The host passes this feature to provide a schedule_work() function, which"] +#[doc = "the plugin can use to schedule a worker call from run()."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _LV2_Worker_Schedule { + #[doc = "Opaque host data."] + pub handle: LV2_Worker_Schedule_Handle, + #[doc = "Request from run() that the host call the worker."] + #[doc = ""] + #[doc = "This function is in the audio threading class. It should be called from"] + #[doc = "run() to request that the host call the work() method in a non-realtime"] + #[doc = "context with the given arguments."] + #[doc = ""] + #[doc = "This function is always safe to call from run(), but it is not"] + #[doc = "guaranteed that the worker is actually called from a different thread."] + #[doc = "In particular, when free-wheeling (e.g. for offline rendering), the"] + #[doc = "worker may be executed immediately. This allows single-threaded"] + #[doc = "processing with sample accuracy and avoids timing problems when run() is"] + #[doc = "executing much faster or slower than real-time."] + #[doc = ""] + #[doc = "Plugins SHOULD be written in such a way that if the worker runs"] + #[doc = "immediately, and responses from the worker are delivered immediately,"] + #[doc = "the effect of the work takes place immediately with sample accuracy."] + #[doc = ""] + #[doc = "The `data` MUST be safe for the host to copy and later pass to work(),"] + #[doc = "and the host MUST guarantee that it will be eventually passed to work()"] + #[doc = "if this function returns LV2_WORKER_SUCCESS."] + #[doc = ""] + #[doc = "@param handle The handle field of this struct."] + #[doc = "@param size The size of `data`."] + #[doc = "@param data Message to pass to work(), or NULL."] + pub schedule_work: ::std::option::Option< + unsafe extern "C" fn( + handle: LV2_Worker_Schedule_Handle, + size: u32, + data: *const ::std::os::raw::c_void, + ) -> LV2_Worker_Status, + >, +} +pub type LV2_Worker_Schedule = _LV2_Worker_Schedule; +#[doc = "The data field of the LV2_Feature for this extension."] +#[doc = ""] +#[doc = "To support this feature the host must pass an LV2_Feature struct to the"] +#[doc = "instantiate method with URI \"http://lv2plug.in/ns/ext/data-access\""] +#[doc = "and data pointed to an instance of this struct."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct LV2_Extension_Data_Feature { + #[doc = "A pointer to a method the UI can call to get data (of a type specified"] + #[doc = "by some other extension) from the plugin."] + #[doc = ""] + #[doc = "This call never is never guaranteed to return anything, UIs should"] + #[doc = "degrade gracefully if direct access to the plugin data is not possible"] + #[doc = "(in which case this function will return NULL)."] + #[doc = ""] + #[doc = "This is for access to large data that can only possibly work if the UI"] + #[doc = "and plugin are running in the same process. For all other things, use"] + #[doc = "the normal LV2 UI communication system."] + pub data_access: ::std::option::Option< + unsafe extern "C" fn(uri: *const ::std::os::raw::c_char) -> *const ::std::os::raw::c_void, + >, +} +#[doc = "Opaque pointer to host data for LV2_URID_Map."] +pub type LV2_URID_Map_Handle = *mut ::std::os::raw::c_void; +#[doc = "Opaque pointer to host data for LV2_URID_Unmap."] +pub type LV2_URID_Unmap_Handle = *mut ::std::os::raw::c_void; +#[doc = "URI mapped to an integer."] +pub type LV2_URID = u32; +#[doc = "URID Map Feature (LV2_URID__map)"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _LV2_URID_Map { + #[doc = "Opaque pointer to host data."] + #[doc = ""] + #[doc = "This MUST be passed to map_uri() whenever it is called."] + #[doc = "Otherwise, it must not be interpreted in any way."] + pub handle: LV2_URID_Map_Handle, + #[doc = "Get the numeric ID of a URI."] + #[doc = ""] + #[doc = "If the ID does not already exist, it will be created."] + #[doc = ""] + #[doc = "This function is referentially transparent; any number of calls with the"] + #[doc = "same arguments is guaranteed to return the same value over the life of a"] + #[doc = "plugin instance. Note, however, that several URIs MAY resolve to the"] + #[doc = "same ID if the host considers those URIs equivalent."] + #[doc = ""] + #[doc = "This function is not necessarily very fast or RT-safe: plugins SHOULD"] + #[doc = "cache any IDs they might need in performance critical situations."] + #[doc = ""] + #[doc = "The return value 0 is reserved and indicates that an ID for that URI"] + #[doc = "could not be created for whatever reason. However, hosts SHOULD NOT"] + #[doc = "return 0 from this function in non-exceptional circumstances (i.e. the"] + #[doc = "URI map SHOULD be dynamic)."] + #[doc = ""] + #[doc = "@param handle Must be the callback_data member of this struct."] + #[doc = "@param uri The URI to be mapped to an integer ID."] + pub map: ::std::option::Option< + unsafe extern "C" fn( + handle: LV2_URID_Map_Handle, + uri: *const ::std::os::raw::c_char, + ) -> LV2_URID, + >, +} +pub type LV2_URID_Map = _LV2_URID_Map; +#[doc = "URI Unmap Feature (LV2_URID__unmap)"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _LV2_URID_Unmap { + #[doc = "Opaque pointer to host data."] + #[doc = ""] + #[doc = "This MUST be passed to unmap() whenever it is called."] + #[doc = "Otherwise, it must not be interpreted in any way."] + pub handle: LV2_URID_Unmap_Handle, + #[doc = "Get the URI for a previously mapped numeric ID."] + #[doc = ""] + #[doc = "Returns NULL if `urid` is not yet mapped. Otherwise, the corresponding"] + #[doc = "URI is returned in a canonical form. This MAY not be the exact same"] + #[doc = "string that was originally passed to LV2_URID_Map::map(), but it MUST be"] + #[doc = "an identical URI according to the URI syntax specification (RFC3986). A"] + #[doc = "non-NULL return for a given `urid` will always be the same for the life"] + #[doc = "of the plugin. Plugins that intend to perform string comparison on"] + #[doc = "unmapped URIs SHOULD first canonicalise URI strings with a call to"] + #[doc = "map_uri() followed by a call to unmap_uri()."] + #[doc = ""] + #[doc = "@param handle Must be the callback_data member of this struct."] + #[doc = "@param urid The ID to be mapped back to the URI string."] + pub unmap: ::std::option::Option< + unsafe extern "C" fn( + handle: LV2_URID_Unmap_Handle, + urid: LV2_URID, + ) -> *const ::std::os::raw::c_char, + >, +} +pub type LV2_URID_Unmap = _LV2_URID_Unmap; +pub type va_list = __builtin_va_list; +#[doc = "Dynamic manifest generator handle."] +#[doc = ""] +#[doc = "This handle indicates a particular status of a dynamic manifest generator."] +#[doc = "The host MUST NOT attempt to interpret it and, unlikely LV2_Handle, it is"] +#[doc = "NOT even valid to compare this to NULL. The dynamic manifest generator MAY"] +#[doc = "use it to reference internal data."] +pub type LV2_Dyn_Manifest_Handle = *mut ::std::os::raw::c_void; +#[doc = "This option applies to the instance itself. The subject must be"] +#[doc = "ignored."] +pub const LV2_Options_Context_LV2_OPTIONS_INSTANCE: LV2_Options_Context = 0; +#[doc = "This option applies to some named resource. The subject is a URI mapped"] +#[doc = "to an integer (a LV2_URID, like the key)"] +pub const LV2_Options_Context_LV2_OPTIONS_RESOURCE: LV2_Options_Context = 1; +#[doc = "This option applies to some blank node. The subject is a blank node"] +#[doc = "identifier, which is valid only within the current local scope."] +pub const LV2_Options_Context_LV2_OPTIONS_BLANK: LV2_Options_Context = 2; +#[doc = "This option applies to a port on the instance. The subject is the"] +#[doc = "port's index."] +pub const LV2_Options_Context_LV2_OPTIONS_PORT: LV2_Options_Context = 3; +#[doc = "The context of an Option, which defines the subject it applies to."] +pub type LV2_Options_Context = u32; +#[doc = "An option."] +#[doc = ""] +#[doc = "This is a property with a subject, also known as a triple or statement."] +#[doc = ""] +#[doc = "This struct is useful anywhere a statement needs to be passed where no"] +#[doc = "memory ownership issues are present (since the value is a const pointer)."] +#[doc = ""] +#[doc = "Options can be passed to an instance via the feature LV2_OPTIONS__options"] +#[doc = "with data pointed to an array of options terminated by a zeroed option, or"] +#[doc = "accessed/manipulated using LV2_Options_Interface."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _LV2_Options_Option { + #[doc = "< Context (type of subject)."] + pub context: LV2_Options_Context, + #[doc = "< Subject."] + pub subject: u32, + #[doc = "< Key (property)."] + pub key: LV2_URID, + #[doc = "< Size of value in bytes."] + pub size: u32, + #[doc = "< Type of value (datatype)."] + pub type_: LV2_URID, + #[doc = "< Pointer to value (object)."] + pub value: *const ::std::os::raw::c_void, +} +pub type LV2_Options_Option = _LV2_Options_Option; +#[doc = "< Completed successfully."] +pub const LV2_Options_Status_LV2_OPTIONS_SUCCESS: LV2_Options_Status = 0; +#[doc = "< Unknown error."] +pub const LV2_Options_Status_LV2_OPTIONS_ERR_UNKNOWN: LV2_Options_Status = 1; +#[doc = "< Invalid/unsupported subject."] +pub const LV2_Options_Status_LV2_OPTIONS_ERR_BAD_SUBJECT: LV2_Options_Status = 2; +#[doc = "< Invalid/unsupported key."] +pub const LV2_Options_Status_LV2_OPTIONS_ERR_BAD_KEY: LV2_Options_Status = 4; +#[doc = "< Invalid/unsupported value."] +pub const LV2_Options_Status_LV2_OPTIONS_ERR_BAD_VALUE: LV2_Options_Status = 8; +#[doc = " A status code for option functions."] +pub type LV2_Options_Status = u32; +#[doc = "Interface for dynamically setting options (LV2_OPTIONS__interface)."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _LV2_Options_Interface { + #[doc = "Get the given options."] + #[doc = ""] + #[doc = "Each element of the passed options array MUST have type, subject, and"] + #[doc = "key set. All other fields (size, type, value) MUST be initialised to"] + #[doc = "zero, and are set to the option value if such an option is found."] + #[doc = ""] + #[doc = "This function is in the \"instantiation\" LV2 threading class, so no other"] + #[doc = "instance functions may be called concurrently."] + #[doc = ""] + #[doc = "@return Bitwise OR of LV2_Options_Status values."] + pub get: ::std::option::Option< + unsafe extern "C" fn(instance: LV2_Handle, options: *mut LV2_Options_Option) -> u32, + >, + #[doc = "Set the given options."] + #[doc = ""] + #[doc = "This function is in the \"instantiation\" LV2 threading class, so no other"] + #[doc = "instance functions may be called concurrently."] + #[doc = ""] + #[doc = "@return Bitwise OR of LV2_Options_Status values."] + pub set: ::std::option::Option< + unsafe extern "C" fn(instance: LV2_Handle, options: *const LV2_Options_Option) -> u32, + >, +} +pub type LV2_Options_Interface = _LV2_Options_Interface; +pub const LV2_EVENT_PPQN: u32 = 3136573440; +#[doc = "An LV2 event (header only)."] +#[doc = ""] +#[doc = "LV2 events are generic time-stamped containers for any type of event."] +#[doc = "The type field defines the format of a given event's contents."] +#[doc = ""] +#[doc = "This struct defines the header of an LV2 event. An LV2 event is a single"] +#[doc = "chunk of POD (plain old data), usually contained in a flat buffer (see"] +#[doc = "LV2_EventBuffer below). Unless a required feature says otherwise, hosts may"] +#[doc = "assume a deep copy of an LV2 event can be created safely using a simple:"] +#[doc = ""] +#[doc = "memcpy(ev_copy, ev, sizeof(LV2_Event) + ev->size); (or equivalent)"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct LV2_Event { + #[doc = "The frames portion of timestamp. The units used here can optionally be"] + #[doc = "set for a port (with the lv2ev:timeUnits property), otherwise this is"] + #[doc = "audio frames, corresponding to the sample_count parameter of the LV2 run"] + #[doc = "method (e.g. frame 0 is the first frame for that call to run)."] + pub frames: u32, + #[doc = "The sub-frames portion of timestamp. The units used here can optionally"] + #[doc = "be set for a port (with the lv2ev:timeUnits property), otherwise this is"] + #[doc = "1/(2^32) of an audio frame."] + pub subframes: u32, + #[doc = "The type of this event, as a number which represents some URI"] + #[doc = "defining an event type. This value MUST be some value previously"] + #[doc = "returned from a call to the uri_to_id function defined in the LV2"] + #[doc = "URI map extension (see lv2_uri_map.h)."] + #[doc = "There are special rules which must be followed depending on the type"] + #[doc = "of an event. If the plugin recognizes an event type, the definition"] + #[doc = "of that event type will describe how to interpret the event, and"] + #[doc = "any required behaviour. Otherwise, if the type is 0, this event is a"] + #[doc = "non-POD event and lv2_event_unref MUST be called if the event is"] + #[doc = "'dropped' (see above). Even if the plugin does not understand an event,"] + #[doc = "it may pass the event through to an output by simply copying (and NOT"] + #[doc = "calling lv2_event_unref). These rules are designed to allow for generic"] + #[doc = "event handling plugins and large non-POD events, but with minimal hassle"] + #[doc = "on simple plugins that \"don't care\" about these more advanced features."] + pub type_: u16, + #[doc = "The size of the data portion of this event in bytes, which immediately"] + #[doc = "follows. The header size (12 bytes) is not included in this value."] + pub size: u16, +} +#[doc = "A buffer of LV2 events (header only)."] +#[doc = ""] +#[doc = "Like events (which this contains) an event buffer is a single chunk of POD:"] +#[doc = "the entire buffer (including contents) can be copied with a single memcpy."] +#[doc = "The first contained event begins sizeof(LV2_EventBuffer) bytes after the"] +#[doc = "start of this struct."] +#[doc = ""] +#[doc = "After this header, the buffer contains an event header (defined by struct"] +#[doc = "LV2_Event), followed by that event's contents (padded to 64 bits), followed"] +#[doc = "by another header, etc:"] +#[doc = ""] +#[doc = "| | | | | | |"] +#[doc = "| | | | | | | | | | | | | | | | | | | | | | | | |"] +#[doc = "|FRAMES |SUBFRMS|TYP|LEN|DATA..DATA..PAD|FRAMES | ..."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct LV2_Event_Buffer { + #[doc = "The contents of the event buffer. This may or may not reside in the"] + #[doc = "same block of memory as this header, plugins must not assume either."] + #[doc = "The host guarantees this points to at least capacity bytes of allocated"] + #[doc = "memory (though only size bytes of that are valid events)."] + pub data: *mut u8, + #[doc = "The size of this event header in bytes (including everything)."] + #[doc = ""] + #[doc = "This is to allow for extending this header in the future without"] + #[doc = "breaking binary compatibility. Whenever this header is copied,"] + #[doc = "it MUST be done using this field (and NOT the sizeof this struct)."] + pub header_size: u16, + #[doc = "The type of the time stamps for events in this buffer."] + #[doc = "As a special exception, '0' always means audio frames and subframes"] + #[doc = "(1/UINT32_MAX'th of a frame) in the sample rate passed to instantiate."] + #[doc = ""] + #[doc = "INPUTS: The host must set this field to the numeric ID of some URI"] + #[doc = "defining the meaning of the frames/subframes fields of contained events"] + #[doc = "(obtained by the LV2 URI Map uri_to_id function with the URI of this"] + #[doc = "extension as the 'map' argument, see lv2_uri_map.h). The host must"] + #[doc = "never pass a plugin a buffer which uses a stamp type the plugin does not"] + #[doc = "'understand'. The value of this field must never change, except when"] + #[doc = "connect_port is called on the input port, at which time the host MUST"] + #[doc = "have set the stamp_type field to the value that will be used for all"] + #[doc = "subsequent run calls."] + #[doc = ""] + #[doc = "OUTPUTS: The plugin may set this to any value that has been returned"] + #[doc = "from uri_to_id with the URI of this extension for a 'map' argument."] + #[doc = "When connected to a buffer with connect_port, output ports MUST set this"] + #[doc = "field to the type of time stamp they will be writing. On any call to"] + #[doc = "connect_port on an event input port, the plugin may change this field on"] + #[doc = "any output port, it is the responsibility of the host to check if any of"] + #[doc = "these values have changed and act accordingly."] + pub stamp_type: u16, + #[doc = "The number of events in this buffer."] + #[doc = ""] + #[doc = "INPUTS: The host must set this field to the number of events contained"] + #[doc = "in the data buffer before calling run(). The plugin must not change"] + #[doc = "this field."] + #[doc = ""] + #[doc = "OUTPUTS: The plugin must set this field to the number of events it has"] + #[doc = "written to the buffer before returning from run(). Any initial value"] + #[doc = "should be ignored by the plugin."] + pub event_count: u32, + #[doc = "The size of the data buffer in bytes."] + #[doc = "This is set by the host and must not be changed by the plugin."] + #[doc = "The host is allowed to change this between run() calls."] + pub capacity: u32, + #[doc = "The size of the initial portion of the data buffer containing data."] + #[doc = ""] + #[doc = "INPUTS: The host must set this field to the number of bytes used"] + #[doc = "by all events it has written to the buffer (including headers)"] + #[doc = "before calling the plugin's run()."] + #[doc = "The plugin must not change this field."] + #[doc = ""] + #[doc = "OUTPUTS: The plugin must set this field to the number of bytes"] + #[doc = "used by all events it has written to the buffer (including headers)"] + #[doc = "before returning from run()."] + #[doc = "Any initial value should be ignored by the plugin."] + pub size: u32, +} +#[doc = "Opaque pointer to host data."] +pub type LV2_Event_Callback_Data = *mut ::std::os::raw::c_void; +#[doc = "Non-POD events feature."] +#[doc = ""] +#[doc = "To support this feature the host must pass an LV2_Feature struct to the"] +#[doc = "plugin's instantiate method with URI \"http://lv2plug.in/ns/ext/event\""] +#[doc = "and data pointed to an instance of this struct. Note this feature"] +#[doc = "is not mandatory to support the event extension."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct LV2_Event_Feature { + #[doc = "Opaque pointer to host data."] + #[doc = ""] + #[doc = "The plugin MUST pass this to any call to functions in this struct."] + #[doc = "Otherwise, it must not be interpreted in any way."] + pub callback_data: LV2_Event_Callback_Data, + #[doc = "Take a reference to a non-POD event."] + #[doc = ""] + #[doc = "If a plugin receives an event with type 0, it means the event is a"] + #[doc = "pointer to some object in memory and not a flat sequence of bytes"] + #[doc = "in the buffer. When receiving a non-POD event, the plugin already"] + #[doc = "has an implicit reference to the event. If the event is stored AND"] + #[doc = "passed to an output, lv2_event_ref MUST be called on that event."] + #[doc = "If the event is only stored OR passed through, this is not necessary"] + #[doc = "(as the plugin already has 1 implicit reference)."] + #[doc = ""] + #[doc = "@param event An event received at an input that will not be copied to"] + #[doc = "an output or stored in any way."] + #[doc = ""] + #[doc = "@param context The calling context. Like event types, this is a mapped"] + #[doc = "URI, see lv2_context.h. Simple plugin with just a run() method should"] + #[doc = "pass 0 here (the ID of the 'standard' LV2 run context). The host"] + #[doc = "guarantees that this function is realtime safe iff the context is"] + #[doc = "realtime safe."] + #[doc = ""] + #[doc = "PLUGINS THAT VIOLATE THESE RULES MAY CAUSE CRASHES AND MEMORY LEAKS."] + pub lv2_event_ref: ::std::option::Option< + unsafe extern "C" fn(callback_data: LV2_Event_Callback_Data, event: *mut LV2_Event) -> u32, + >, + #[doc = "Drop a reference to a non-POD event."] + #[doc = ""] + #[doc = "If a plugin receives an event with type 0, it means the event is a"] + #[doc = "pointer to some object in memory and not a flat sequence of bytes"] + #[doc = "in the buffer. If the plugin does not pass the event through to"] + #[doc = "an output or store it internally somehow, it MUST call this function"] + #[doc = "on the event (more information on using non-POD events below)."] + #[doc = ""] + #[doc = "@param event An event received at an input that will not be copied to an"] + #[doc = "output or stored in any way."] + #[doc = ""] + #[doc = "@param context The calling context. Like event types, this is a mapped"] + #[doc = "URI, see lv2_context.h. Simple plugin with just a run() method should"] + #[doc = "pass 0 here (the ID of the 'standard' LV2 run context). The host"] + #[doc = "guarantees that this function is realtime safe iff the context is"] + #[doc = "realtime safe."] + #[doc = ""] + #[doc = "PLUGINS THAT VIOLATE THESE RULES MAY CAUSE CRASHES AND MEMORY LEAKS."] + pub lv2_event_unref: ::std::option::Option< + unsafe extern "C" fn(callback_data: LV2_Event_Callback_Data, event: *mut LV2_Event) -> u32, + >, +} +#[doc = " An iterator over an LV2_Event_Buffer."] +#[doc = ""] +#[doc = " Multiple simultaneous read iterators over a single buffer is fine,"] +#[doc = " but changing the buffer invalidates all iterators (e.g. RW Lock)."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct LV2_Event_Iterator { + pub buf: *mut LV2_Event_Buffer, + pub offset: u32, +} +#[doc = "Opaque data to host data for LV2_Log_Log."] +pub type LV2_Log_Handle = *mut ::std::os::raw::c_void; +#[doc = "Log feature (LV2_LOG__log)"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _LV2_Log { + #[doc = "Opaque pointer to host data."] + #[doc = ""] + #[doc = "This MUST be passed to methods in this struct whenever they are called."] + #[doc = "Otherwise, it must not be interpreted in any way."] + pub handle: LV2_Log_Handle, + #[doc = "Log a message, passing format parameters directly."] + #[doc = ""] + #[doc = "The API of this function matches that of the standard C printf function,"] + #[doc = "except for the addition of the first two parameters. This function may"] + #[doc = "be called from any non-realtime context, or from any context if `type`"] + #[doc = "is @ref LV2_LOG__Trace."] + pub printf: ::std::option::Option< + unsafe extern "C" fn( + handle: LV2_Log_Handle, + type_: LV2_URID, + fmt: *const ::std::os::raw::c_char, + ... + ) -> ::std::os::raw::c_int, + >, + #[doc = "Log a message, passing format parameters in a va_list."] + #[doc = ""] + #[doc = "The API of this function matches that of the standard C vprintf"] + #[doc = "function, except for the addition of the first two parameters. This"] + #[doc = "function may be called from any non-realtime context, or from any"] + #[doc = "context if `type` is @ref LV2_LOG__Trace."] + pub vprintf: ::std::option::Option< + unsafe extern "C" fn( + handle: LV2_Log_Handle, + type_: LV2_URID, + fmt: *const ::std::os::raw::c_char, + ap: *mut __va_list_tag, + ) -> ::std::os::raw::c_int, + >, +} +pub type LV2_Log_Log = _LV2_Log; +#[doc = "Logger convenience API state."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct LV2_Log_Logger { + pub log: *mut LV2_Log_Log, + pub Error: LV2_URID, + pub Note: LV2_URID, + pub Trace: LV2_URID, + pub Warning: LV2_URID, +} +#[doc = "A pointer to some widget or other type of UI handle."] +#[doc = ""] +#[doc = "The actual type is defined by the type of the UI."] +pub type LV2UI_Widget = *mut ::std::os::raw::c_void; +#[doc = "A pointer to UI instance internals."] +#[doc = ""] +#[doc = "The host may compare this to NULL, but otherwise MUST NOT interpret it."] +pub type LV2UI_Handle = *mut ::std::os::raw::c_void; +#[doc = "A pointer to a controller provided by the host."] +#[doc = ""] +#[doc = "The UI may compare this to NULL, but otherwise MUST NOT interpret it."] +pub type LV2UI_Controller = *mut ::std::os::raw::c_void; +#[doc = "A pointer to opaque data for a feature."] +pub type LV2UI_Feature_Handle = *mut ::std::os::raw::c_void; +#[doc = "A host-provided function that sends data to a plugin's input ports."] +#[doc = ""] +#[doc = "@param controller The opaque controller pointer passed to"] +#[doc = "LV2UI_Descriptor::instantiate()."] +#[doc = ""] +#[doc = "@param port_index Index of the port to update."] +#[doc = ""] +#[doc = "@param buffer Buffer containing `buffer_size` bytes of data."] +#[doc = ""] +#[doc = "@param buffer_size Size of `buffer` in bytes."] +#[doc = ""] +#[doc = "@param port_protocol Either 0 or the URID for a ui:PortProtocol. If 0, the"] +#[doc = "protocol is implicitly ui:floatProtocol, the port MUST be an lv2:ControlPort"] +#[doc = "input, `buffer` MUST point to a single float value, and `buffer_size` MUST"] +#[doc = "be sizeof(float). The UI SHOULD NOT use a protocol not supported by the"] +#[doc = "host, but the host MUST gracefully ignore any protocol it does not"] +#[doc = "understand."] +pub type LV2UI_Write_Function = ::std::option::Option< + unsafe extern "C" fn( + controller: LV2UI_Controller, + port_index: u32, + buffer_size: u32, + port_protocol: u32, + buffer: *const ::std::os::raw::c_void, + ), +>; +#[doc = "A plugin UI."] +#[doc = ""] +#[doc = "A pointer to an object of this type is returned by the lv2ui_descriptor()"] +#[doc = "function."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _LV2UI_Descriptor { + #[doc = "The URI for this UI (not for the plugin it controls)."] + pub URI: *const ::std::os::raw::c_char, + #[doc = "Create a new UI and return a handle to it. This function works"] + #[doc = "similarly to LV2_Descriptor::instantiate()."] + #[doc = ""] + #[doc = "@param descriptor The descriptor for the UI to instantiate."] + #[doc = ""] + #[doc = "@param plugin_uri The URI of the plugin that this UI will control."] + #[doc = ""] + #[doc = "@param bundle_path The path to the bundle containing this UI, including"] + #[doc = "the trailing directory separator."] + #[doc = ""] + #[doc = "@param write_function A function that the UI can use to send data to the"] + #[doc = "plugin's input ports."] + #[doc = ""] + #[doc = "@param controller A handle for the UI instance to be passed as the"] + #[doc = "first parameter of UI methods."] + #[doc = ""] + #[doc = "@param widget (output) widget pointer. The UI points this at its main"] + #[doc = "widget, which has the type defined by the UI type in the data file."] + #[doc = ""] + #[doc = "@param features An array of LV2_Feature pointers. The host must pass"] + #[doc = "all feature URIs that it and the UI supports and any additional data, as"] + #[doc = "in LV2_Descriptor::instantiate(). Note that UI features and plugin"] + #[doc = "features are not necessarily the same."] + #[doc = ""] + pub instantiate: ::std::option::Option< + unsafe extern "C" fn( + descriptor: *const _LV2UI_Descriptor, + plugin_uri: *const ::std::os::raw::c_char, + bundle_path: *const ::std::os::raw::c_char, + write_function: LV2UI_Write_Function, + controller: LV2UI_Controller, + widget: *mut LV2UI_Widget, + features: *const *const LV2_Feature, + ) -> LV2UI_Handle, + >, + #[doc = "Destroy the UI. The host must not try to access the widget after"] + #[doc = "calling this function."] + pub cleanup: ::std::option::Option, + #[doc = "Tell the UI that something interesting has happened at a plugin port."] + #[doc = ""] + #[doc = "What is \"interesting\" and how it is written to `buffer` is defined by"] + #[doc = "`format`, which has the same meaning as in LV2UI_Write_Function()."] + #[doc = "Format 0 is a special case for lv2:ControlPort, where this function"] + #[doc = "should be called when the port value changes (but not necessarily for"] + #[doc = "every change), `buffer_size` must be sizeof(float), and `buffer`"] + #[doc = "points to a single IEEE-754 float."] + #[doc = ""] + #[doc = "By default, the host should only call this function for lv2:ControlPort"] + #[doc = "inputs. However, the UI can request updates for other ports statically"] + #[doc = "with ui:portNotification or dynamicaly with ui:portSubscribe."] + #[doc = ""] + #[doc = "The UI MUST NOT retain any reference to `buffer` after this function"] + #[doc = "returns, it is only valid for the duration of the call."] + #[doc = ""] + #[doc = "This member may be NULL if the UI is not interested in any port events."] + pub port_event: ::std::option::Option< + unsafe extern "C" fn( + ui: LV2UI_Handle, + port_index: u32, + buffer_size: u32, + format: u32, + buffer: *const ::std::os::raw::c_void, + ), + >, + #[doc = "Return a data structure associated with an extension URI, typically an"] + #[doc = "interface struct with additional function pointers"] + #[doc = ""] + #[doc = "This member may be set to NULL if the UI is not interested in supporting"] + #[doc = "any extensions. This is similar to LV2_Descriptor::extension_data()."] + #[doc = ""] + pub extension_data: ::std::option::Option< + unsafe extern "C" fn(uri: *const ::std::os::raw::c_char) -> *const ::std::os::raw::c_void, + >, +} +pub type LV2UI_Descriptor = _LV2UI_Descriptor; +#[doc = "Feature/interface for resizable UIs (LV2_UI__resize)."] +#[doc = ""] +#[doc = "This structure is used in two ways: as a feature passed by the host via"] +#[doc = "LV2UI_Descriptor::instantiate(), or as an interface provided by a UI via"] +#[doc = "LV2UI_Descriptor::extension_data())."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _LV2UI_Resize { + #[doc = "Pointer to opaque data which must be passed to ui_resize()."] + pub handle: LV2UI_Feature_Handle, + #[doc = "Request/advertise a size change."] + #[doc = ""] + #[doc = "When provided by the host, the UI may call this function to inform the"] + #[doc = "host about the size of the UI."] + #[doc = ""] + #[doc = "When provided by the UI, the host may call this function to notify the"] + #[doc = "UI that it should change its size accordingly. In this case, the host"] + #[doc = "must pass the LV2UI_Handle to provide access to the UI instance."] + #[doc = ""] + #[doc = "@return 0 on success."] + pub ui_resize: ::std::option::Option< + unsafe extern "C" fn( + handle: LV2UI_Feature_Handle, + width: ::std::os::raw::c_int, + height: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int, + >, +} +pub type LV2UI_Resize = _LV2UI_Resize; +#[doc = "Feature to map port symbols to UIs."] +#[doc = ""] +#[doc = "This can be used by the UI to get the index for a port with the given"] +#[doc = "symbol. This makes it possible to implement and distribute a UI separately"] +#[doc = "from the plugin (since symbol, unlike index, is a stable port identifier)."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _LV2UI_Port_Map { + #[doc = "Pointer to opaque data which must be passed to port_index()."] + pub handle: LV2UI_Feature_Handle, + #[doc = "Get the index for the port with the given `symbol`."] + #[doc = ""] + #[doc = "@return The index of the port, or LV2UI_INVALID_PORT_INDEX if no such"] + #[doc = "port is found."] + pub port_index: ::std::option::Option< + unsafe extern "C" fn( + handle: LV2UI_Feature_Handle, + symbol: *const ::std::os::raw::c_char, + ) -> u32, + >, +} +pub type LV2UI_Port_Map = _LV2UI_Port_Map; +#[doc = "Feature to subscribe to port updates (LV2_UI__portSubscribe)."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _LV2UI_Port_Subscribe { + #[doc = "Pointer to opaque data which must be passed to subscribe() and"] + #[doc = "unsubscribe()."] + pub handle: LV2UI_Feature_Handle, + #[doc = "Subscribe to updates for a port."] + #[doc = ""] + #[doc = "This means that the host will call the UI's port_event() function when"] + #[doc = "the port value changes (as defined by protocol)."] + #[doc = ""] + #[doc = "Calling this function with the same `port_index` and `port_protocol`"] + #[doc = "as an already active subscription has no effect."] + #[doc = ""] + #[doc = "@param handle The handle field of this struct."] + #[doc = "@param port_index The index of the port."] + #[doc = "@param port_protocol The URID of the ui:PortProtocol."] + #[doc = "@param features Features for this subscription."] + #[doc = "@return 0 on success."] + pub subscribe: ::std::option::Option< + unsafe extern "C" fn( + handle: LV2UI_Feature_Handle, + port_index: u32, + port_protocol: u32, + features: *const *const LV2_Feature, + ) -> u32, + >, + #[doc = "Unsubscribe from updates for a port."] + #[doc = ""] + #[doc = "This means that the host will cease calling calling port_event() when"] + #[doc = "the port value changes."] + #[doc = ""] + #[doc = "Calling this function with a `port_index` and `port_protocol` that"] + #[doc = "does not refer to an active port subscription has no effect."] + #[doc = ""] + #[doc = "@param handle The handle field of this struct."] + #[doc = "@param port_index The index of the port."] + #[doc = "@param port_protocol The URID of the ui:PortProtocol."] + #[doc = "@param features Features for this subscription."] + #[doc = "@return 0 on success."] + pub unsubscribe: ::std::option::Option< + unsafe extern "C" fn( + handle: LV2UI_Feature_Handle, + port_index: u32, + port_protocol: u32, + features: *const *const LV2_Feature, + ) -> u32, + >, +} +pub type LV2UI_Port_Subscribe = _LV2UI_Port_Subscribe; +#[doc = "A feature to notify the host that the user has grabbed a UI control."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _LV2UI_Touch { + #[doc = "Pointer to opaque data which must be passed to ui_resize()."] + pub handle: LV2UI_Feature_Handle, + #[doc = "Notify the host that a control has been grabbed or released."] + #[doc = ""] + #[doc = "The host should cease automating the port or otherwise manipulating the"] + #[doc = "port value until the control has been ungrabbed."] + #[doc = ""] + #[doc = "@param handle The handle field of this struct."] + #[doc = "@param port_index The index of the port associated with the control."] + #[doc = "@param grabbed If true, the control has been grabbed, otherwise the"] + #[doc = "control has been released."] + pub touch: ::std::option::Option< + unsafe extern "C" fn(handle: LV2UI_Feature_Handle, port_index: u32, grabbed: bool), + >, +} +pub type LV2UI_Touch = _LV2UI_Touch; +#[doc = "UI Idle Interface (LV2_UI__idleInterface)"] +#[doc = ""] +#[doc = "UIs can provide this interface to have an idle() callback called by the host"] +#[doc = "rapidly to update the UI."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _LV2UI_Idle_Interface { + #[doc = "Run a single iteration of the UI's idle loop."] + #[doc = ""] + #[doc = "This will be called rapidly in the UI thread at a rate appropriate"] + #[doc = "for a toolkit main loop. There are no precise timing guarantees, but"] + #[doc = "the host should attempt to call idle() at a high enough rate for smooth"] + #[doc = "animation, at least 30Hz."] + #[doc = ""] + #[doc = "@return non-zero if the UI has been closed, in which case the host"] + #[doc = "should stop calling idle(), and can either completely destroy the UI, or"] + #[doc = "re-show it and resume calling idle()."] + pub idle: + ::std::option::Option ::std::os::raw::c_int>, +} +pub type LV2UI_Idle_Interface = _LV2UI_Idle_Interface; +#[doc = "UI Show Interface (LV2_UI__showInterface)"] +#[doc = ""] +#[doc = "UIs can provide this interface to show and hide a window, which allows them"] +#[doc = "to function in hosts unable to embed their widget. This allows any UI to"] +#[doc = "provide a fallback for embedding that works in any host."] +#[doc = ""] +#[doc = "If used:"] +#[doc = "- The host MUST use LV2UI_Idle_Interface to drive the UI."] +#[doc = "- The UI MUST return non-zero from LV2UI_Idle_Interface::idle() when it has been closed."] +#[doc = "- If idle() returns non-zero, the host MUST call hide() and stop calling"] +#[doc = "idle(). It MAY later call show() then resume calling idle()."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _LV2UI_Show_Interface { + #[doc = "Show a window for this UI."] + #[doc = ""] + #[doc = "The window title MAY have been passed by the host to"] + #[doc = "LV2UI_Descriptor::instantiate() as an LV2_Options_Option with key"] + #[doc = "LV2_UI__windowTitle."] + #[doc = ""] + #[doc = "@return 0 on success, or anything else to stop being called."] + pub show: + ::std::option::Option ::std::os::raw::c_int>, + #[doc = "Hide the window for this UI."] + #[doc = ""] + #[doc = "@return 0 on success, or anything else to stop being called."] + pub hide: + ::std::option::Option ::std::os::raw::c_int>, +} +pub type LV2UI_Show_Interface = _LV2UI_Show_Interface; +#[doc = "Peak data for a slice of time, the update format for ui:peakProtocol."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _LV2UI_Peak_Data { + #[doc = "The start of the measurement period. This is just a running counter"] + #[doc = "that is only meaningful in comparison to previous values and must not be"] + #[doc = "interpreted as an absolute time."] + pub period_start: u32, + #[doc = "The size of the measurement period, in the same units as period_start."] + pub period_size: u32, + #[doc = "The peak value for the measurement period. This should be the maximal"] + #[doc = "value for abs(sample) over all the samples in the period."] + pub peak: f32, +} +pub type LV2UI_Peak_Data = _LV2UI_Peak_Data; +#[doc = "The type of the lv2ui_descriptor() function."] +pub type LV2UI_DescriptorFunction = + ::std::option::Option *const LV2UI_Descriptor>; +pub type LV2_State_Handle = *mut ::std::os::raw::c_void; +pub type LV2_State_Map_Path_Handle = *mut ::std::os::raw::c_void; +pub type LV2_State_Make_Path_Handle = *mut ::std::os::raw::c_void; +impl LV2_State_Flags { + #[doc = "Plain Old Data."] + #[doc = ""] + #[doc = "Values with this flag contain no pointers or references to other areas"] + #[doc = "of memory. It is safe to copy POD values with a simple memcpy and store"] + #[doc = "them for the duration of the process. A POD value is not necessarily"] + #[doc = "safe to trasmit between processes or machines (e.g. filenames are POD),"] + #[doc = "see LV2_STATE_IS_PORTABLE for details."] + #[doc = ""] + #[doc = "Implementations MUST NOT attempt to copy or serialise a non-POD value if"] + #[doc = "they do not understand its type (and thus know how to correctly do so)."] + pub const LV2_STATE_IS_POD: LV2_State_Flags = LV2_State_Flags(1); +} +impl LV2_State_Flags { + #[doc = "Portable (architecture independent) data."] + #[doc = ""] + #[doc = "Values with this flag are in a format that is usable on any"] + #[doc = "architecture. A portable value saved on one machine can be restored on"] + #[doc = "another machine regardless of architecture. The format of portable"] + #[doc = "values MUST NOT depend on architecture-specific properties like"] + #[doc = "endianness or alignment. Portable values MUST NOT contain filenames."] + pub const LV2_STATE_IS_PORTABLE: LV2_State_Flags = LV2_State_Flags(2); +} +impl LV2_State_Flags { + #[doc = "Native data."] + #[doc = ""] + #[doc = "This flag is used by the host to indicate that the saved data is only"] + #[doc = "going to be used locally in the currently running process (e.g. for"] + #[doc = "instance duplication or snapshots), so the plugin should use the most"] + #[doc = "efficient representation possible and not worry about serialisation"] + #[doc = "and portability."] + pub const LV2_STATE_IS_NATIVE: LV2_State_Flags = LV2_State_Flags(4); +} +impl ::std::ops::BitOr for LV2_State_Flags { + type Output = Self; + #[inline] + fn bitor(self, other: Self) -> Self { + LV2_State_Flags(self.0 | other.0) + } +} +impl ::std::ops::BitOrAssign for LV2_State_Flags { + #[inline] + fn bitor_assign(&mut self, rhs: LV2_State_Flags) { + self.0 |= rhs.0; + } +} +impl ::std::ops::BitAnd for LV2_State_Flags { + type Output = Self; + #[inline] + fn bitand(self, other: Self) -> Self { + LV2_State_Flags(self.0 & other.0) + } +} +impl ::std::ops::BitAndAssign for LV2_State_Flags { + #[inline] + fn bitand_assign(&mut self, rhs: LV2_State_Flags) { + self.0 &= rhs.0; + } +} +#[repr(transparent)] +#[doc = "Flags describing value characteristics."] +#[doc = ""] +#[doc = "These flags are used along with the value's type URI to determine how to"] +#[doc = "(de-)serialise the value data, or whether it is even possible to do so."] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub struct LV2_State_Flags(pub u32); +#[doc = "< Completed successfully."] +pub const LV2_State_Status_LV2_STATE_SUCCESS: LV2_State_Status = 0; +#[doc = "< Unknown error."] +pub const LV2_State_Status_LV2_STATE_ERR_UNKNOWN: LV2_State_Status = 1; +#[doc = "< Failed due to unsupported type."] +pub const LV2_State_Status_LV2_STATE_ERR_BAD_TYPE: LV2_State_Status = 2; +#[doc = "< Failed due to unsupported flags."] +pub const LV2_State_Status_LV2_STATE_ERR_BAD_FLAGS: LV2_State_Status = 3; +#[doc = "< Failed due to missing features."] +pub const LV2_State_Status_LV2_STATE_ERR_NO_FEATURE: LV2_State_Status = 4; +#[doc = "< Failed due to missing property."] +pub const LV2_State_Status_LV2_STATE_ERR_NO_PROPERTY: LV2_State_Status = 5; +#[doc = "< Failed due to insufficient space."] +pub const LV2_State_Status_LV2_STATE_ERR_NO_SPACE: LV2_State_Status = 6; +#[doc = " A status code for state functions."] +pub type LV2_State_Status = u32; +#[doc = "A host-provided function to store a property."] +#[doc = "@param handle Must be the handle passed to LV2_State_Interface.save()."] +#[doc = "@param key The key to store `value` under (URID)."] +#[doc = "@param value Pointer to the value to be stored."] +#[doc = "@param size The size of `value` in bytes."] +#[doc = "@param type The type of `value` (URID)."] +#[doc = "@param flags LV2_State_Flags for `value`."] +#[doc = "@return 0 on success, otherwise a non-zero error code."] +#[doc = ""] +#[doc = "The host passes a callback of this type to LV2_State_Interface.save(). This"] +#[doc = "callback is called repeatedly by the plugin to store all the properties that"] +#[doc = "describe its current state."] +#[doc = ""] +#[doc = "DO NOT INVENT NONSENSE URI SCHEMES FOR THE KEY. Best is to use keys from"] +#[doc = "existing vocabularies. If nothing appropriate is available, use http URIs"] +#[doc = "that point to somewhere you can host documents so documentation can be made"] +#[doc = "resolvable (e.g. a child of the plugin or project URI). If this is not"] +#[doc = "possible, invent a URN scheme, e.g. urn:myproj:whatever. The plugin MUST"] +#[doc = "NOT pass an invalid URI key."] +#[doc = ""] +#[doc = "The host MAY fail to store a property for whatever reason, but SHOULD"] +#[doc = "store any property that is LV2_STATE_IS_POD and LV2_STATE_IS_PORTABLE."] +#[doc = "Implementations SHOULD use the types from the LV2 Atom extension"] +#[doc = "(http://lv2plug.in/ns/ext/atom) wherever possible. The plugin SHOULD"] +#[doc = "attempt to fall-back and avoid the error if possible."] +#[doc = ""] +#[doc = "Note that `size` MUST be > 0, and `value` MUST point to a valid region of"] +#[doc = "memory `size` bytes long (this is required to make restore unambiguous)."] +#[doc = ""] +#[doc = "The plugin MUST NOT attempt to use this function outside of the"] +#[doc = "LV2_State_Interface.restore() context."] +pub type LV2_State_Store_Function = ::std::option::Option< + unsafe extern "C" fn( + handle: LV2_State_Handle, + key: u32, + value: *const ::std::os::raw::c_void, + size: usize, + type_: u32, + flags: u32, + ) -> LV2_State_Status, +>; +#[doc = "A host-provided function to retrieve a property."] +#[doc = "@param handle Must be the handle passed to LV2_State_Interface.restore()."] +#[doc = "@param key The key of the property to retrieve (URID)."] +#[doc = "@param size (Output) If non-NULL, set to the size of the restored value."] +#[doc = "@param type (Output) If non-NULL, set to the type of the restored value."] +#[doc = "@param flags (Output) If non-NULL, set to the flags for the restored value."] +#[doc = "@return A pointer to the restored value (object), or NULL if no value"] +#[doc = "has been stored under `key`."] +#[doc = ""] +#[doc = "A callback of this type is passed by the host to"] +#[doc = "LV2_State_Interface.restore(). This callback is called repeatedly by the"] +#[doc = "plugin to retrieve any properties it requires to restore its state."] +#[doc = ""] +#[doc = "The returned value MUST remain valid until LV2_State_Interface.restore()"] +#[doc = "returns. The plugin MUST NOT attempt to use this function, or any value"] +#[doc = "returned from it, outside of the LV2_State_Interface.restore() context."] +pub type LV2_State_Retrieve_Function = ::std::option::Option< + unsafe extern "C" fn( + handle: LV2_State_Handle, + key: u32, + size: *mut usize, + type_: *mut u32, + flags: *mut u32, + ) -> *const ::std::os::raw::c_void, +>; +#[doc = "LV2 Plugin State Interface."] +#[doc = ""] +#[doc = "When the plugin's extension_data is called with argument"] +#[doc = "LV2_STATE__interface, the plugin MUST return an LV2_State_Interface"] +#[doc = "structure, which remains valid for the lifetime of the plugin."] +#[doc = ""] +#[doc = "The host can use the contained function pointers to save and restore the"] +#[doc = "state of a plugin instance at any time, provided the threading restrictions"] +#[doc = "of the functions are met."] +#[doc = ""] +#[doc = "Stored data is only guaranteed to be compatible between instances of plugins"] +#[doc = "with the same URI (i.e. if a change to a plugin would cause a fatal error"] +#[doc = "when restoring state saved by a previous version of that plugin, the plugin"] +#[doc = "URI MUST change just as it must when ports change incompatibly). Plugin"] +#[doc = "authors should consider this possibility, and always store sensible data"] +#[doc = "with meaningful types to avoid such problems in the future."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _LV2_State_Interface { + #[doc = "Save plugin state using a host-provided `store` callback."] + #[doc = ""] + #[doc = "@param instance The instance handle of the plugin."] + #[doc = "@param store The host-provided store callback."] + #[doc = "@param handle An opaque pointer to host data which MUST be passed as the"] + #[doc = "handle parameter to `store` if it is called."] + #[doc = "@param flags Flags describing desired properties of this save. These"] + #[doc = "flags may be used to determine the most appropriate values to store."] + #[doc = "@param features Extensible parameter for passing any additional"] + #[doc = "features to be used for this save."] + #[doc = ""] + #[doc = "The plugin is expected to store everything necessary to completely"] + #[doc = "restore its state later. Plugins SHOULD store simple POD data whenever"] + #[doc = "possible, and consider the possibility of state being restored much"] + #[doc = "later on a different machine."] + #[doc = ""] + #[doc = "The `handle` pointer and `store` function MUST NOT be used"] + #[doc = "beyond the scope of save()."] + #[doc = ""] + #[doc = "This function has its own special threading class: it may not be called"] + #[doc = "concurrently with any \"Instantiation\" function, but it may be called"] + #[doc = "concurrently with functions in any other class, unless the definition of"] + #[doc = "that class prohibits it (e.g. it may not be called concurrently with a"] + #[doc = "\"Discovery\" function, but it may be called concurrently with an \"Audio\""] + #[doc = "function. The plugin is responsible for any locking or lock-free"] + #[doc = "techniques necessary to make this possible."] + #[doc = ""] + #[doc = "Note that in the simple case where state is only modified by restore(),"] + #[doc = "there are no synchronization issues since save() is never called"] + #[doc = "concurrently with restore() (though run() may read it during a save)."] + #[doc = ""] + #[doc = "Plugins that dynamically modify state while running, however, must take"] + #[doc = "care to do so in such a way that a concurrent call to save() will save a"] + #[doc = "consistent representation of plugin state for a single instant in time."] + pub save: ::std::option::Option< + unsafe extern "C" fn( + instance: LV2_Handle, + store: LV2_State_Store_Function, + handle: LV2_State_Handle, + flags: u32, + features: *const *const LV2_Feature, + ) -> LV2_State_Status, + >, + #[doc = "Restore plugin state using a host-provided `retrieve` callback."] + #[doc = ""] + #[doc = "@param instance The instance handle of the plugin."] + #[doc = "@param retrieve The host-provided retrieve callback."] + #[doc = "@param handle An opaque pointer to host data which MUST be passed as the"] + #[doc = "handle parameter to `retrieve` if it is called."] + #[doc = "@param flags Currently unused."] + #[doc = "@param features Extensible parameter for passing any additional"] + #[doc = "features to be used for this restore."] + #[doc = ""] + #[doc = "The plugin MAY assume a restored value was set by a previous call to"] + #[doc = "LV2_State_Interface.save() by a plugin with the same URI."] + #[doc = ""] + #[doc = "The plugin MUST gracefully fall back to a default value when a value can"] + #[doc = "not be retrieved. This allows the host to reset the plugin state with"] + #[doc = "an empty map."] + #[doc = ""] + #[doc = "The `handle` pointer and `store` function MUST NOT be used"] + #[doc = "beyond the scope of restore()."] + #[doc = ""] + #[doc = "This function is in the \"Instantiation\" threading class as defined by"] + #[doc = "LV2. This means it MUST NOT be called concurrently with any other"] + #[doc = "function on the same plugin instance."] + pub restore: ::std::option::Option< + unsafe extern "C" fn( + instance: LV2_Handle, + retrieve: LV2_State_Retrieve_Function, + handle: LV2_State_Handle, + flags: u32, + features: *const *const LV2_Feature, + ) -> LV2_State_Status, + >, +} +pub type LV2_State_Interface = _LV2_State_Interface; +#[doc = "Feature data for state:mapPath (@ref LV2_STATE__mapPath)."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct LV2_State_Map_Path { + #[doc = "Opaque host data."] + pub handle: LV2_State_Map_Path_Handle, + #[doc = "Map an absolute path to an abstract path for use in plugin state."] + #[doc = "@param handle MUST be the `handle` member of this struct."] + #[doc = "@param absolute_path The absolute path of a file."] + #[doc = "@return An abstract path suitable for use in plugin state."] + #[doc = ""] + #[doc = "The plugin MUST use this function to map any paths that will be stored"] + #[doc = "in plugin state. The returned value is an abstract path which MAY not"] + #[doc = "be an actual file system path; absolute_path() MUST be used to map"] + #[doc = "it to an actual path in order to use the file."] + #[doc = ""] + #[doc = "Plugins MUST NOT make any assumptions about abstract paths except that"] + #[doc = "they can be mapped back to the absolute path of the \"same\" file (though"] + #[doc = "not necessarily the same original path) using absolute_path()."] + #[doc = ""] + #[doc = "This function may only be called within the context of"] + #[doc = "LV2_State_Interface methods. The caller is responsible for freeing the"] + #[doc = "returned value with free()."] + pub abstract_path: ::std::option::Option< + unsafe extern "C" fn( + handle: LV2_State_Map_Path_Handle, + absolute_path: *const ::std::os::raw::c_char, + ) -> *mut ::std::os::raw::c_char, + >, + #[doc = "Map an abstract path from plugin state to an absolute path."] + #[doc = "@param handle MUST be the `handle` member of this struct."] + #[doc = "@param abstract_path An abstract path (e.g. a path from plugin state)."] + #[doc = "@return An absolute file system path."] + #[doc = ""] + #[doc = "The plugin MUST use this function in order to actually open or otherwise"] + #[doc = "use any paths loaded from plugin state."] + #[doc = ""] + #[doc = "This function may only be called within the context of"] + #[doc = "LV2_State_Interface methods. The caller is responsible for freeing the"] + #[doc = "returned value with free()."] + pub absolute_path: ::std::option::Option< + unsafe extern "C" fn( + handle: LV2_State_Map_Path_Handle, + abstract_path: *const ::std::os::raw::c_char, + ) -> *mut ::std::os::raw::c_char, + >, +} +#[doc = "Feature data for state:makePath (@ref LV2_STATE__makePath)."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct LV2_State_Make_Path { + #[doc = "Opaque host data."] + pub handle: LV2_State_Make_Path_Handle, + #[doc = "Return a path the plugin may use to create a new file."] + #[doc = "@param handle MUST be the `handle` member of this struct."] + #[doc = "@param path The path of the new file within a namespace unique to this"] + #[doc = "plugin instance."] + #[doc = "@return The absolute path to use for the new file."] + #[doc = ""] + #[doc = "This function can be used by plugins to create files and directories,"] + #[doc = "either at state saving time (if this feature is passed to"] + #[doc = "LV2_State_Interface.save()) or any time (if this feature is passed to"] + #[doc = "LV2_Descriptor.instantiate())."] + #[doc = ""] + #[doc = "The host MUST do whatever is necessary for the plugin to be able to"] + #[doc = "create a file at the returned path (e.g. using fopen), including"] + #[doc = "creating any leading directories."] + #[doc = ""] + #[doc = "If this function is passed to LV2_Descriptor.instantiate(), it may be"] + #[doc = "called from any non-realtime context. If it is passed to"] + #[doc = "LV2_State_Interface.save(), it may only be called within the dynamic"] + #[doc = "scope of that function call."] + #[doc = ""] + #[doc = "The caller is responsible for freeing the returned value with free()."] + pub path: ::std::option::Option< + unsafe extern "C" fn( + handle: LV2_State_Make_Path_Handle, + path: *const ::std::os::raw::c_char, + ) -> *mut ::std::os::raw::c_char, + >, +} +#[doc = "Opaque pointer to host data."] +pub type LV2_URI_Map_Callback_Data = *mut ::std::os::raw::c_void; +#[doc = "URI Map Feature."] +#[doc = ""] +#[doc = "To support this feature the host must pass an LV2_Feature struct to the"] +#[doc = "plugin's instantiate method with URI \"http://lv2plug.in/ns/ext/uri-map\""] +#[doc = "and data pointed to an instance of this struct."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct LV2_URI_Map_Feature { + #[doc = "Opaque pointer to host data."] + #[doc = ""] + #[doc = "The plugin MUST pass this to any call to functions in this struct."] + #[doc = "Otherwise, it must not be interpreted in any way."] + pub callback_data: LV2_URI_Map_Callback_Data, + #[doc = "Get the numeric ID of a URI from the host."] + #[doc = ""] + #[doc = "@param callback_data Must be the callback_data member of this struct."] + #[doc = "@param map The 'context' of this URI. Certain extensions may define a"] + #[doc = "URI that must be passed here with certain restrictions on the return"] + #[doc = "value (e.g. limited range). This value may be NULL if the plugin needs"] + #[doc = "an ID for a URI in general. Extensions SHOULD NOT define a context"] + #[doc = "unless there is a specific need to do so, e.g. to restrict the range of"] + #[doc = "the returned value."] + #[doc = "@param uri The URI to be mapped to an integer ID."] + #[doc = ""] + #[doc = "This function is referentially transparent; any number of calls with the"] + #[doc = "same arguments is guaranteed to return the same value over the life of a"] + #[doc = "plugin instance (though the same URI may return different values with a"] + #[doc = "different map parameter). However, this function is not necessarily very"] + #[doc = "fast: plugins SHOULD cache any IDs they might need in performance"] + #[doc = "critical situations."] + #[doc = ""] + #[doc = "The return value 0 is reserved and indicates that an ID for that URI"] + #[doc = "could not be created for whatever reason. Extensions MAY define more"] + #[doc = "precisely what this means in a certain context, but in general plugins"] + #[doc = "SHOULD handle this situation as gracefully as possible. However, hosts"] + #[doc = "SHOULD NOT return 0 from this function in non-exceptional circumstances"] + #[doc = "(e.g. the URI map SHOULD be dynamic). Hosts that statically support only"] + #[doc = "a fixed set of URIs should not expect plugins to function correctly."] + pub uri_to_id: ::std::option::Option< + unsafe extern "C" fn( + callback_data: LV2_URI_Map_Callback_Data, + map: *const ::std::os::raw::c_char, + uri: *const ::std::os::raw::c_char, + ) -> u32, + >, +} +#[doc = "< Completed successfully."] +pub const LV2_Resize_Port_Status_LV2_RESIZE_PORT_SUCCESS: LV2_Resize_Port_Status = 0; +#[doc = "< Unknown error."] +pub const LV2_Resize_Port_Status_LV2_RESIZE_PORT_ERR_UNKNOWN: LV2_Resize_Port_Status = 1; +#[doc = "< Insufficient space."] +pub const LV2_Resize_Port_Status_LV2_RESIZE_PORT_ERR_NO_SPACE: LV2_Resize_Port_Status = 2; +#[doc = " A status code for state functions."] +pub type LV2_Resize_Port_Status = u32; +#[doc = " Opaque data for resize method."] +pub type LV2_Resize_Port_Feature_Data = *mut ::std::os::raw::c_void; +#[doc = " Host feature to allow plugins to resize their port buffers."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct LV2_Resize_Port_Resize { + #[doc = " Opaque data for resize method."] + pub data: LV2_Resize_Port_Feature_Data, + #[doc = "Resize a port buffer to at least `size` bytes."] + #[doc = ""] + #[doc = "This function MAY return an error, in which case the port buffer was not"] + #[doc = "resized and the port is still connected to the same location. Plugins"] + #[doc = "MUST gracefully handle this situation."] + #[doc = ""] + #[doc = "This function is in the audio threading class."] + #[doc = ""] + #[doc = "The host MUST preserve the contents of the port buffer when resizing."] + #[doc = ""] + #[doc = "Plugins MAY resize a port many times in a single run callback. Hosts"] + #[doc = "SHOULD make this as inexpensive as possible."] + pub resize: ::std::option::Option< + unsafe extern "C" fn( + data: LV2_Resize_Port_Feature_Data, + index: u32, + size: usize, + ) -> LV2_Resize_Port_Status, + >, +} +#[doc = "< Invalid Message"] +pub const LV2_Midi_Message_Type_LV2_MIDI_MSG_INVALID: LV2_Midi_Message_Type = 0; +#[doc = "< Note Off"] +pub const LV2_Midi_Message_Type_LV2_MIDI_MSG_NOTE_OFF: LV2_Midi_Message_Type = 128; +#[doc = "< Note On"] +pub const LV2_Midi_Message_Type_LV2_MIDI_MSG_NOTE_ON: LV2_Midi_Message_Type = 144; +#[doc = "< Note Pressure"] +pub const LV2_Midi_Message_Type_LV2_MIDI_MSG_NOTE_PRESSURE: LV2_Midi_Message_Type = 160; +#[doc = "< Controller"] +pub const LV2_Midi_Message_Type_LV2_MIDI_MSG_CONTROLLER: LV2_Midi_Message_Type = 176; +#[doc = "< Program Change"] +pub const LV2_Midi_Message_Type_LV2_MIDI_MSG_PGM_CHANGE: LV2_Midi_Message_Type = 192; +#[doc = "< Channel Pressure"] +pub const LV2_Midi_Message_Type_LV2_MIDI_MSG_CHANNEL_PRESSURE: LV2_Midi_Message_Type = 208; +#[doc = "< Pitch Bender"] +pub const LV2_Midi_Message_Type_LV2_MIDI_MSG_BENDER: LV2_Midi_Message_Type = 224; +#[doc = "< System Exclusive Begin"] +pub const LV2_Midi_Message_Type_LV2_MIDI_MSG_SYSTEM_EXCLUSIVE: LV2_Midi_Message_Type = 240; +#[doc = "< MTC Quarter Frame"] +pub const LV2_Midi_Message_Type_LV2_MIDI_MSG_MTC_QUARTER: LV2_Midi_Message_Type = 241; +#[doc = "< Song Position"] +pub const LV2_Midi_Message_Type_LV2_MIDI_MSG_SONG_POS: LV2_Midi_Message_Type = 242; +#[doc = "< Song Select"] +pub const LV2_Midi_Message_Type_LV2_MIDI_MSG_SONG_SELECT: LV2_Midi_Message_Type = 243; +#[doc = "< Tune Request"] +pub const LV2_Midi_Message_Type_LV2_MIDI_MSG_TUNE_REQUEST: LV2_Midi_Message_Type = 246; +#[doc = "< Clock"] +pub const LV2_Midi_Message_Type_LV2_MIDI_MSG_CLOCK: LV2_Midi_Message_Type = 248; +#[doc = "< Start"] +pub const LV2_Midi_Message_Type_LV2_MIDI_MSG_START: LV2_Midi_Message_Type = 250; +#[doc = "< Continue"] +pub const LV2_Midi_Message_Type_LV2_MIDI_MSG_CONTINUE: LV2_Midi_Message_Type = 251; +#[doc = "< Stop"] +pub const LV2_Midi_Message_Type_LV2_MIDI_MSG_STOP: LV2_Midi_Message_Type = 252; +#[doc = "< Active Sensing"] +pub const LV2_Midi_Message_Type_LV2_MIDI_MSG_ACTIVE_SENSE: LV2_Midi_Message_Type = 254; +#[doc = "< Reset"] +pub const LV2_Midi_Message_Type_LV2_MIDI_MSG_RESET: LV2_Midi_Message_Type = 255; +#[doc = "MIDI Message Type."] +#[doc = ""] +#[doc = "This includes both voice messages (which have a channel) and system messages"] +#[doc = "(which do not), as well as a sentinel value for invalid messages. To get"] +#[doc = "the type of a message suitable for use in a switch statement, use"] +#[doc = "lv2_midi_get_type() on the status byte."] +pub type LV2_Midi_Message_Type = u32; +#[doc = "< Bank Selection"] +pub const LV2_Midi_Controller_LV2_MIDI_CTL_MSB_BANK: LV2_Midi_Controller = 0; +#[doc = "< Modulation"] +pub const LV2_Midi_Controller_LV2_MIDI_CTL_MSB_MODWHEEL: LV2_Midi_Controller = 1; +#[doc = "< Breath"] +pub const LV2_Midi_Controller_LV2_MIDI_CTL_MSB_BREATH: LV2_Midi_Controller = 2; +#[doc = "< Foot"] +pub const LV2_Midi_Controller_LV2_MIDI_CTL_MSB_FOOT: LV2_Midi_Controller = 4; +#[doc = "< Portamento Time"] +pub const LV2_Midi_Controller_LV2_MIDI_CTL_MSB_PORTAMENTO_TIME: LV2_Midi_Controller = 5; +#[doc = "< Data Entry"] +pub const LV2_Midi_Controller_LV2_MIDI_CTL_MSB_DATA_ENTRY: LV2_Midi_Controller = 6; +#[doc = "< Main Volume"] +pub const LV2_Midi_Controller_LV2_MIDI_CTL_MSB_MAIN_VOLUME: LV2_Midi_Controller = 7; +#[doc = "< Balance"] +pub const LV2_Midi_Controller_LV2_MIDI_CTL_MSB_BALANCE: LV2_Midi_Controller = 8; +#[doc = "< Panpot"] +pub const LV2_Midi_Controller_LV2_MIDI_CTL_MSB_PAN: LV2_Midi_Controller = 10; +#[doc = "< Expression"] +pub const LV2_Midi_Controller_LV2_MIDI_CTL_MSB_EXPRESSION: LV2_Midi_Controller = 11; +#[doc = "< Effect1"] +pub const LV2_Midi_Controller_LV2_MIDI_CTL_MSB_EFFECT1: LV2_Midi_Controller = 12; +#[doc = "< Effect2"] +pub const LV2_Midi_Controller_LV2_MIDI_CTL_MSB_EFFECT2: LV2_Midi_Controller = 13; +#[doc = "< General Purpose 1"] +pub const LV2_Midi_Controller_LV2_MIDI_CTL_MSB_GENERAL_PURPOSE1: LV2_Midi_Controller = 16; +#[doc = "< General Purpose 2"] +pub const LV2_Midi_Controller_LV2_MIDI_CTL_MSB_GENERAL_PURPOSE2: LV2_Midi_Controller = 17; +#[doc = "< General Purpose 3"] +pub const LV2_Midi_Controller_LV2_MIDI_CTL_MSB_GENERAL_PURPOSE3: LV2_Midi_Controller = 18; +#[doc = "< General Purpose 4"] +pub const LV2_Midi_Controller_LV2_MIDI_CTL_MSB_GENERAL_PURPOSE4: LV2_Midi_Controller = 19; +#[doc = "< Bank Selection"] +pub const LV2_Midi_Controller_LV2_MIDI_CTL_LSB_BANK: LV2_Midi_Controller = 32; +#[doc = "< Modulation"] +pub const LV2_Midi_Controller_LV2_MIDI_CTL_LSB_MODWHEEL: LV2_Midi_Controller = 33; +#[doc = "< Breath"] +pub const LV2_Midi_Controller_LV2_MIDI_CTL_LSB_BREATH: LV2_Midi_Controller = 34; +#[doc = "< Foot"] +pub const LV2_Midi_Controller_LV2_MIDI_CTL_LSB_FOOT: LV2_Midi_Controller = 36; +#[doc = "< Portamento Time"] +pub const LV2_Midi_Controller_LV2_MIDI_CTL_LSB_PORTAMENTO_TIME: LV2_Midi_Controller = 37; +#[doc = "< Data Entry"] +pub const LV2_Midi_Controller_LV2_MIDI_CTL_LSB_DATA_ENTRY: LV2_Midi_Controller = 38; +#[doc = "< Main Volume"] +pub const LV2_Midi_Controller_LV2_MIDI_CTL_LSB_MAIN_VOLUME: LV2_Midi_Controller = 39; +#[doc = "< Balance"] +pub const LV2_Midi_Controller_LV2_MIDI_CTL_LSB_BALANCE: LV2_Midi_Controller = 40; +#[doc = "< Panpot"] +pub const LV2_Midi_Controller_LV2_MIDI_CTL_LSB_PAN: LV2_Midi_Controller = 42; +#[doc = "< Expression"] +pub const LV2_Midi_Controller_LV2_MIDI_CTL_LSB_EXPRESSION: LV2_Midi_Controller = 43; +#[doc = "< Effect1"] +pub const LV2_Midi_Controller_LV2_MIDI_CTL_LSB_EFFECT1: LV2_Midi_Controller = 44; +#[doc = "< Effect2"] +pub const LV2_Midi_Controller_LV2_MIDI_CTL_LSB_EFFECT2: LV2_Midi_Controller = 45; +#[doc = "< General Purpose 1"] +pub const LV2_Midi_Controller_LV2_MIDI_CTL_LSB_GENERAL_PURPOSE1: LV2_Midi_Controller = 48; +#[doc = "< General Purpose 2"] +pub const LV2_Midi_Controller_LV2_MIDI_CTL_LSB_GENERAL_PURPOSE2: LV2_Midi_Controller = 49; +#[doc = "< General Purpose 3"] +pub const LV2_Midi_Controller_LV2_MIDI_CTL_LSB_GENERAL_PURPOSE3: LV2_Midi_Controller = 50; +#[doc = "< General Purpose 4"] +pub const LV2_Midi_Controller_LV2_MIDI_CTL_LSB_GENERAL_PURPOSE4: LV2_Midi_Controller = 51; +#[doc = "< Sustain Pedal"] +pub const LV2_Midi_Controller_LV2_MIDI_CTL_SUSTAIN: LV2_Midi_Controller = 64; +#[doc = "< Portamento"] +pub const LV2_Midi_Controller_LV2_MIDI_CTL_PORTAMENTO: LV2_Midi_Controller = 65; +#[doc = "< Sostenuto"] +pub const LV2_Midi_Controller_LV2_MIDI_CTL_SOSTENUTO: LV2_Midi_Controller = 66; +#[doc = "< Soft Pedal"] +pub const LV2_Midi_Controller_LV2_MIDI_CTL_SOFT_PEDAL: LV2_Midi_Controller = 67; +#[doc = "< Legato Foot Switch"] +pub const LV2_Midi_Controller_LV2_MIDI_CTL_LEGATO_FOOTSWITCH: LV2_Midi_Controller = 68; +#[doc = "< Hold2"] +pub const LV2_Midi_Controller_LV2_MIDI_CTL_HOLD2: LV2_Midi_Controller = 69; +#[doc = "< SC1 Sound Variation"] +pub const LV2_Midi_Controller_LV2_MIDI_CTL_SC1_SOUND_VARIATION: LV2_Midi_Controller = 70; +#[doc = "< SC2 Timbre"] +pub const LV2_Midi_Controller_LV2_MIDI_CTL_SC2_TIMBRE: LV2_Midi_Controller = 71; +#[doc = "< SC3 Release Time"] +pub const LV2_Midi_Controller_LV2_MIDI_CTL_SC3_RELEASE_TIME: LV2_Midi_Controller = 72; +#[doc = "< SC4 Attack Time"] +pub const LV2_Midi_Controller_LV2_MIDI_CTL_SC4_ATTACK_TIME: LV2_Midi_Controller = 73; +#[doc = "< SC5 Brightness"] +pub const LV2_Midi_Controller_LV2_MIDI_CTL_SC5_BRIGHTNESS: LV2_Midi_Controller = 74; +#[doc = "< SC6"] +pub const LV2_Midi_Controller_LV2_MIDI_CTL_SC6: LV2_Midi_Controller = 75; +#[doc = "< SC7"] +pub const LV2_Midi_Controller_LV2_MIDI_CTL_SC7: LV2_Midi_Controller = 76; +#[doc = "< SC8"] +pub const LV2_Midi_Controller_LV2_MIDI_CTL_SC8: LV2_Midi_Controller = 77; +#[doc = "< SC9"] +pub const LV2_Midi_Controller_LV2_MIDI_CTL_SC9: LV2_Midi_Controller = 78; +#[doc = "< SC10"] +pub const LV2_Midi_Controller_LV2_MIDI_CTL_SC10: LV2_Midi_Controller = 79; +#[doc = "< General Purpose 5"] +pub const LV2_Midi_Controller_LV2_MIDI_CTL_GENERAL_PURPOSE5: LV2_Midi_Controller = 80; +#[doc = "< General Purpose 6"] +pub const LV2_Midi_Controller_LV2_MIDI_CTL_GENERAL_PURPOSE6: LV2_Midi_Controller = 81; +#[doc = "< General Purpose 7"] +pub const LV2_Midi_Controller_LV2_MIDI_CTL_GENERAL_PURPOSE7: LV2_Midi_Controller = 82; +#[doc = "< General Purpose 8"] +pub const LV2_Midi_Controller_LV2_MIDI_CTL_GENERAL_PURPOSE8: LV2_Midi_Controller = 83; +#[doc = "< Portamento Control"] +pub const LV2_Midi_Controller_LV2_MIDI_CTL_PORTAMENTO_CONTROL: LV2_Midi_Controller = 84; +#[doc = "< E1 Reverb Depth"] +pub const LV2_Midi_Controller_LV2_MIDI_CTL_E1_REVERB_DEPTH: LV2_Midi_Controller = 91; +#[doc = "< E2 Tremolo Depth"] +pub const LV2_Midi_Controller_LV2_MIDI_CTL_E2_TREMOLO_DEPTH: LV2_Midi_Controller = 92; +#[doc = "< E3 Chorus Depth"] +pub const LV2_Midi_Controller_LV2_MIDI_CTL_E3_CHORUS_DEPTH: LV2_Midi_Controller = 93; +#[doc = "< E4 Detune Depth"] +pub const LV2_Midi_Controller_LV2_MIDI_CTL_E4_DETUNE_DEPTH: LV2_Midi_Controller = 94; +#[doc = "< E5 Phaser Depth"] +pub const LV2_Midi_Controller_LV2_MIDI_CTL_E5_PHASER_DEPTH: LV2_Midi_Controller = 95; +#[doc = "< Data Increment"] +pub const LV2_Midi_Controller_LV2_MIDI_CTL_DATA_INCREMENT: LV2_Midi_Controller = 96; +#[doc = "< Data Decrement"] +pub const LV2_Midi_Controller_LV2_MIDI_CTL_DATA_DECREMENT: LV2_Midi_Controller = 97; +#[doc = "< Non-registered Parameter Number"] +pub const LV2_Midi_Controller_LV2_MIDI_CTL_NRPN_LSB: LV2_Midi_Controller = 98; +#[doc = "< Non-registered Parameter Number"] +pub const LV2_Midi_Controller_LV2_MIDI_CTL_NRPN_MSB: LV2_Midi_Controller = 99; +#[doc = "< Registered Parameter Number"] +pub const LV2_Midi_Controller_LV2_MIDI_CTL_RPN_LSB: LV2_Midi_Controller = 100; +#[doc = "< Registered Parameter Number"] +pub const LV2_Midi_Controller_LV2_MIDI_CTL_RPN_MSB: LV2_Midi_Controller = 101; +#[doc = "< All Sounds Off"] +pub const LV2_Midi_Controller_LV2_MIDI_CTL_ALL_SOUNDS_OFF: LV2_Midi_Controller = 120; +#[doc = "< Reset Controllers"] +pub const LV2_Midi_Controller_LV2_MIDI_CTL_RESET_CONTROLLERS: LV2_Midi_Controller = 121; +#[doc = "< Local Control Switch"] +pub const LV2_Midi_Controller_LV2_MIDI_CTL_LOCAL_CONTROL_SWITCH: LV2_Midi_Controller = 122; +#[doc = "< All Notes Off"] +pub const LV2_Midi_Controller_LV2_MIDI_CTL_ALL_NOTES_OFF: LV2_Midi_Controller = 123; +#[doc = "< Omni Off"] +pub const LV2_Midi_Controller_LV2_MIDI_CTL_OMNI_OFF: LV2_Midi_Controller = 124; +#[doc = "< Omni On"] +pub const LV2_Midi_Controller_LV2_MIDI_CTL_OMNI_ON: LV2_Midi_Controller = 125; +#[doc = "< Mono1"] +pub const LV2_Midi_Controller_LV2_MIDI_CTL_MONO1: LV2_Midi_Controller = 126; +#[doc = "< Mono2"] +pub const LV2_Midi_Controller_LV2_MIDI_CTL_MONO2: LV2_Midi_Controller = 127; +#[doc = "Standard MIDI Controller Numbers."] +pub type LV2_Midi_Controller = u32; +#[doc = " The header of an atom:Atom."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct LV2_Atom { + #[doc = "< Size in bytes, not including type and size."] + pub size: u32, + #[doc = "< Type of this atom (mapped URI)."] + pub type_: u32, +} +#[doc = " An atom:Int or atom:Bool. May be cast to LV2_Atom."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct LV2_Atom_Int { + #[doc = "< Atom header."] + pub atom: LV2_Atom, + #[doc = "< Integer value."] + pub body: i32, +} +#[doc = " An atom:Long. May be cast to LV2_Atom."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct LV2_Atom_Long { + #[doc = "< Atom header."] + pub atom: LV2_Atom, + #[doc = "< Integer value."] + pub body: i64, +} +#[doc = " An atom:Float. May be cast to LV2_Atom."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct LV2_Atom_Float { + #[doc = "< Atom header."] + pub atom: LV2_Atom, + #[doc = "< Floating point value."] + pub body: f32, +} +#[doc = " An atom:Double. May be cast to LV2_Atom."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct LV2_Atom_Double { + #[doc = "< Atom header."] + pub atom: LV2_Atom, + #[doc = "< Floating point value."] + pub body: f64, +} +#[doc = " An atom:Bool. May be cast to LV2_Atom."] +pub type LV2_Atom_Bool = LV2_Atom_Int; +#[doc = " An atom:URID. May be cast to LV2_Atom."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct LV2_Atom_URID { + #[doc = "< Atom header."] + pub atom: LV2_Atom, + #[doc = "< URID."] + pub body: u32, +} +#[doc = " An atom:String. May be cast to LV2_Atom."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct LV2_Atom_String { + #[doc = "< Atom header."] + pub atom: LV2_Atom, +} +#[doc = " The body of an atom:Literal."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct LV2_Atom_Literal_Body { + #[doc = "< Datatype URID."] + pub datatype: u32, + #[doc = "< Language URID."] + pub lang: u32, +} +#[doc = " An atom:Literal. May be cast to LV2_Atom."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct LV2_Atom_Literal { + #[doc = "< Atom header."] + pub atom: LV2_Atom, + #[doc = "< Body."] + pub body: LV2_Atom_Literal_Body, +} +#[doc = " An atom:Tuple. May be cast to LV2_Atom."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct LV2_Atom_Tuple { + #[doc = "< Atom header."] + pub atom: LV2_Atom, +} +#[doc = " The body of an atom:Vector."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct LV2_Atom_Vector_Body { + #[doc = "< The size of each element in the vector."] + pub child_size: u32, + #[doc = "< The type of each element in the vector."] + pub child_type: u32, +} +#[doc = " An atom:Vector. May be cast to LV2_Atom."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct LV2_Atom_Vector { + #[doc = "< Atom header."] + pub atom: LV2_Atom, + #[doc = "< Body."] + pub body: LV2_Atom_Vector_Body, +} +#[doc = " The body of an atom:Property (e.g. in an atom:Object)."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct LV2_Atom_Property_Body { + #[doc = "< Key (predicate) (mapped URI)."] + pub key: u32, + #[doc = "< Context URID (may be, and generally is, 0)."] + pub context: u32, + #[doc = "< Value atom header."] + pub value: LV2_Atom, +} +#[doc = " An atom:Property. May be cast to LV2_Atom."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct LV2_Atom_Property { + #[doc = "< Atom header."] + pub atom: LV2_Atom, + #[doc = "< Body."] + pub body: LV2_Atom_Property_Body, +} +#[doc = " The body of an atom:Object. May be cast to LV2_Atom."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct LV2_Atom_Object_Body { + #[doc = "< URID, or 0 for blank."] + pub id: u32, + #[doc = "< Type URID (same as rdf:type, for fast dispatch)."] + pub otype: u32, +} +#[doc = " An atom:Object. May be cast to LV2_Atom."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct LV2_Atom_Object { + #[doc = "< Atom header."] + pub atom: LV2_Atom, + #[doc = "< Body."] + pub body: LV2_Atom_Object_Body, +} +#[doc = " The header of an atom:Event. Note this type is NOT an LV2_Atom."] +#[repr(C)] +#[derive(Copy, Clone)] +pub struct LV2_Atom_Event { + pub time: LV2_Atom_Event__bindgen_ty_1, + #[doc = "< Event body atom header."] + pub body: LV2_Atom, +} +#[doc = " Time stamp. Which type is valid is determined by context."] +#[repr(C)] +#[derive(Copy, Clone)] +pub union LV2_Atom_Event__bindgen_ty_1 { + #[doc = "< Time in audio frames."] + pub frames: i64, + #[doc = "< Time in beats."] + pub beats: f64, + _bindgen_union_align: u64, +} +#[doc = "The body of an atom:Sequence (a sequence of events)."] +#[doc = ""] +#[doc = "The unit field is either a URID that described an appropriate time stamp"] +#[doc = "type, or may be 0 where a default stamp type is known. For"] +#[doc = "LV2_Descriptor::run(), the default stamp type is audio frames."] +#[doc = ""] +#[doc = "The contents of a sequence is a series of LV2_Atom_Event, each aligned"] +#[doc = "to 64-bits, e.g.:"] +#[doc = "

"]
+#[doc = "| Event 1 (size 6)                              | Event 2"]
+#[doc = "|       |       |       |       |       |       |       |       |"]
+#[doc = "| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |"]
+#[doc = "|FRAMES |SUBFRMS|TYPE   |SIZE   |DATADATADATAPAD|FRAMES |SUBFRMS|..."]
+#[doc = "
"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct LV2_Atom_Sequence_Body { + #[doc = "< URID of unit of event time stamps."] + pub unit: u32, + #[doc = "< Currently unused."] + pub pad: u32, +} +#[doc = " An atom:Sequence."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct LV2_Atom_Sequence { + #[doc = "< Atom header."] + pub atom: LV2_Atom, + #[doc = "< Body."] + pub body: LV2_Atom_Sequence_Body, +} +#[doc = " A single entry in an Object query."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct LV2_Atom_Object_Query { + #[doc = "< Key to query (input set by user)"] + pub key: u32, + #[doc = "< Found value (output set by query function)"] + pub value: *mut *const LV2_Atom, +} +extern "C" { + pub static LV2_ATOM_OBJECT_QUERY_END: LV2_Atom_Object_Query; +} +#[doc = " Handle for LV2_Atom_Forge_Sink."] +pub type LV2_Atom_Forge_Sink_Handle = *mut ::std::os::raw::c_void; +#[doc = " A reference to a chunk of written output."] +pub type LV2_Atom_Forge_Ref = isize; +#[doc = " Sink function for writing output. See lv2_atom_forge_set_sink()."] +pub type LV2_Atom_Forge_Sink = ::std::option::Option< + unsafe extern "C" fn( + handle: LV2_Atom_Forge_Sink_Handle, + buf: *const ::std::os::raw::c_void, + size: u32, + ) -> LV2_Atom_Forge_Ref, +>; +#[doc = " Function for resolving a reference. See lv2_atom_forge_set_sink()."] +pub type LV2_Atom_Forge_Deref_Func = ::std::option::Option< + unsafe extern "C" fn( + handle: LV2_Atom_Forge_Sink_Handle, + ref_: LV2_Atom_Forge_Ref, + ) -> *mut LV2_Atom, +>; +#[doc = " A stack frame used for keeping track of nested Atom containers."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _LV2_Atom_Forge_Frame { + pub parent: *mut _LV2_Atom_Forge_Frame, + pub ref_: LV2_Atom_Forge_Ref, +} +pub type LV2_Atom_Forge_Frame = _LV2_Atom_Forge_Frame; +#[doc = " A \"forge\" for creating atoms by appending to a buffer."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct LV2_Atom_Forge { + pub buf: *mut u8, + pub offset: u32, + pub size: u32, + pub sink: LV2_Atom_Forge_Sink, + pub deref: LV2_Atom_Forge_Deref_Func, + pub handle: LV2_Atom_Forge_Sink_Handle, + pub stack: *mut LV2_Atom_Forge_Frame, + pub Blank: LV2_URID, + pub Bool: LV2_URID, + pub Chunk: LV2_URID, + pub Double: LV2_URID, + pub Float: LV2_URID, + pub Int: LV2_URID, + pub Long: LV2_URID, + pub Literal: LV2_URID, + pub Object: LV2_URID, + pub Path: LV2_URID, + pub Property: LV2_URID, + pub Resource: LV2_URID, + pub Sequence: LV2_URID, + pub String: LV2_URID, + pub Tuple: LV2_URID, + pub URI: LV2_URID, + pub URID: LV2_URID, + pub Vector: LV2_URID, +} +pub type __builtin_va_list = [__va_list_tag; 1usize]; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __va_list_tag { + pub gp_offset: ::std::os::raw::c_uint, + pub fp_offset: ::std::os::raw::c_uint, + pub overflow_arg_area: *mut ::std::os::raw::c_void, + pub reg_save_area: *mut ::std::os::raw::c_void, +} From 14dc5d8d629208fdc2d61314093d4c16be205fbe Mon Sep 17 00:00:00 2001 From: Yruama_Lairba Date: Thu, 9 Apr 2020 02:15:19 +0200 Subject: [PATCH 012/151] add lv2-sys-bindgen script that pre generate binding --- .cargo/config | 2 ++ Cargo.toml | 3 ++- sys/bindgen/Cargo.toml | 11 ++++++++ sys/bindgen/src/main.rs | 58 +++++++++++++++++++++++++++++++++++++++++ 4 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 .cargo/config create mode 100644 sys/bindgen/Cargo.toml create mode 100644 sys/bindgen/src/main.rs diff --git a/.cargo/config b/.cargo/config new file mode 100644 index 00000000..3f016e4c --- /dev/null +++ b/.cargo/config @@ -0,0 +1,2 @@ +[alias] +lv2-sys-bindgen = "run -p lv2-sys-bindgen --" diff --git a/Cargo.toml b/Cargo.toml index 44349a2f..83d02764 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -86,6 +86,7 @@ members = [ "midi", "state", "sys", + "sys/bindgen", "time", "units", "urid", @@ -106,4 +107,4 @@ lv2-units = { path = "units" } urid = { path = "urid" } urid-derive = { path = "urid/derive" } lv2-urid = { path = "urid/lv2-urid" } -lv2-worker = { path = "worker" } \ No newline at end of file +lv2-worker = { path = "worker" } diff --git a/sys/bindgen/Cargo.toml b/sys/bindgen/Cargo.toml new file mode 100644 index 00000000..ae9e303b --- /dev/null +++ b/sys/bindgen/Cargo.toml @@ -0,0 +1,11 @@ +[package] +name = "lv2-sys-bindgen" +version = "0.1.0" +authors = ["Yruama_Lairba "] +edition = "2018" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +bindgen = "0.53.1" + diff --git a/sys/bindgen/src/main.rs b/sys/bindgen/src/main.rs new file mode 100644 index 00000000..6c982676 --- /dev/null +++ b/sys/bindgen/src/main.rs @@ -0,0 +1,58 @@ +fn main() { + extern crate bindgen; + use std::env; + use std::fs; + use std::path::PathBuf; + + let mut bindings = bindgen::Builder::default().size_t_is_usize(true); + + let mut work_dir = PathBuf::new(); + work_dir.push(env::var("CARGO_MANIFEST_DIR").unwrap()); + work_dir.pop(); + + let source_dir= work_dir.join("lv2"); + let out_path = work_dir.join("build_data"); + + // Adding the crate to the include path of clang. + // Otherwise, included headers can not be found. + bindings = bindings.clang_arg(format!("-I{}", work_dir.to_str().unwrap())); + + + for entry in fs::read_dir(source_dir).unwrap() { + let spec_dir = if let Ok(spec_dir) = entry { + spec_dir.path() + } else { + continue; + }; + + for entry in fs::read_dir(spec_dir).unwrap() { + let entry = match entry { + Ok(entry) => entry.path(), + _ => continue, + }; + + let extension = match entry.extension() { + Some(extension) => extension, + None => continue, + }; + + if extension == "h" { + bindings = bindings.header(entry.to_str().unwrap()); + } + } + } + bindings = bindings + .whitelist_type("LV2.*") + .whitelist_function("LV2.*") + .whitelist_var("LV2.*") + .layout_tests(false) + .bitfield_enum("LV2_State_Flags"); + + // Generating the bindings. + let bindings = bindings.generate().expect("Unable to generate bindings"); + + // Writing the bindings to a file. + bindings + .write_to_file(out_path.join("bindings.rs")) + .expect("Couldn't write bindings!"); +} From 6e6fd62f6c13a0b63786e18d296670b06924c116 Mon Sep 17 00:00:00 2001 From: Yruama_Lairba Date: Thu, 9 Apr 2020 17:44:59 +0200 Subject: [PATCH 013/151] wip, determine bindings compat from rustc target --- sys/bindgen/enum_test.h | 1 + sys/bindgen/src/main.rs | 63 +++++++++++++++++++++++++++++++++++++---- 2 files changed, 58 insertions(+), 6 deletions(-) create mode 100644 sys/bindgen/enum_test.h diff --git a/sys/bindgen/enum_test.h b/sys/bindgen/enum_test.h new file mode 100644 index 00000000..2c3934e9 --- /dev/null +++ b/sys/bindgen/enum_test.h @@ -0,0 +1 @@ +enum test {TEST}; diff --git a/sys/bindgen/src/main.rs b/sys/bindgen/src/main.rs index 6c982676..fdaebfb8 100644 --- a/sys/bindgen/src/main.rs +++ b/sys/bindgen/src/main.rs @@ -1,23 +1,28 @@ +extern crate bindgen; +use std::env; +use std::fs; +use std::path::PathBuf; +use std::process::Command; + fn main() { - extern crate bindgen; - use std::env; - use std::fs; - use std::path::PathBuf; + generate_bindings(); + test_compatible_target(); +} +fn generate_bindings() { let mut bindings = bindgen::Builder::default().size_t_is_usize(true); let mut work_dir = PathBuf::new(); work_dir.push(env::var("CARGO_MANIFEST_DIR").unwrap()); work_dir.pop(); - let source_dir= work_dir.join("lv2"); + let source_dir = work_dir.join("lv2"); let out_path = work_dir.join("build_data"); // Adding the crate to the include path of clang. // Otherwise, included headers can not be found. bindings = bindings.clang_arg(format!("-I{}", work_dir.to_str().unwrap())); - for entry in fs::read_dir(source_dir).unwrap() { let spec_dir = if let Ok(spec_dir) = entry { spec_dir.path() @@ -56,3 +61,49 @@ fn main() { .write_to_file(out_path.join("bindings.rs")) .expect("Couldn't write bindings!"); } + +use std::thread; + +fn test_compatible_target() { + let mut test_h = PathBuf::new(); + test_h.push(env::var("CARGO_MANIFEST_DIR").unwrap()); + test_h.push("enum_test.h"); + let test_h = test_h.to_str().unwrap(); + let output = Command::new("rustc") + .args(&["--print", "target-list"]) + .output() + .expect("failed to execute rustc --print target-list"); + + if !output.status.success() { + panic!("'rustc --print target-list' returned an error"); + } + let targets = std::str::from_utf8(&output.stdout).unwrap().split('\n'); + + for target in targets { + let target = String::from(target.trim()); + let test_h = String::from(test_h); + print!("{}: ", target); + //the thread spawning avoid to exit when bindgen panics + let handle = thread::spawn(move || { + let builder = bindgen::Builder::default() + .size_t_is_usize(true) + .clang_arg(format!("--target={}", target)) + .header(test_h); + let bindings = builder + .generate() + .expect("failed to generate a test binding"); + bindings.to_string() + }); + let res = handle.join(); + let is_ok = if let Ok(res) = res { + let pat = "pub type test = "; + if let Some(i) = res.find(pat) { + print!("{}, ", &res[i+pat.len()..i+pat.len() + 3]); + } + res.contains("pub type test = u32") || res.contains("pub type test = i32") + } else { + false + }; + println!("{}", is_ok); + } +} From b048438abf8230b11d62694f7a1e388cff28089f Mon Sep 17 00:00:00 2001 From: Yruama_Lairba Date: Thu, 9 Apr 2020 18:20:31 +0200 Subject: [PATCH 014/151] use panic hook to silent bindgen panics --- sys/bindgen/src/main.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/bindgen/src/main.rs b/sys/bindgen/src/main.rs index fdaebfb8..f0b02894 100644 --- a/sys/bindgen/src/main.rs +++ b/sys/bindgen/src/main.rs @@ -89,9 +89,13 @@ fn test_compatible_target() { .size_t_is_usize(true) .clang_arg(format!("--target={}", target)) .header(test_h); + // make silent panic + std::panic::set_hook(Box::new(|_|())); let bindings = builder .generate() .expect("failed to generate a test binding"); + //restore default panic hook because it's not thread local + let _ = std::panic::take_hook(); bindings.to_string() }); let res = handle.join(); From 33d99b42dddcfe15d88a2982e2b53592d83d86b0 Mon Sep 17 00:00:00 2001 From: Yruama_Lairba Date: Thu, 9 Apr 2020 19:01:51 +0200 Subject: [PATCH 015/151] use split_whitespace instead of split --- sys/bindgen/src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/bindgen/src/main.rs b/sys/bindgen/src/main.rs index f0b02894..c9e4d2f9 100644 --- a/sys/bindgen/src/main.rs +++ b/sys/bindgen/src/main.rs @@ -77,10 +77,10 @@ fn test_compatible_target() { if !output.status.success() { panic!("'rustc --print target-list' returned an error"); } - let targets = std::str::from_utf8(&output.stdout).unwrap().split('\n'); + let targets = std::str::from_utf8(&output.stdout).unwrap().split_whitespace(); for target in targets { - let target = String::from(target.trim()); + let target = String::from(target); let test_h = String::from(test_h); print!("{}: ", target); //the thread spawning avoid to exit when bindgen panics From 9f8f1c9480a7b66edc20b52eb559e6ed719b68c3 Mon Sep 17 00:00:00 2001 From: Yruama_Lairba Date: Thu, 9 Apr 2020 22:40:56 +0200 Subject: [PATCH 016/151] save valid targets list in a file --- sys/bindgen/src/main.rs | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/sys/bindgen/src/main.rs b/sys/bindgen/src/main.rs index c9e4d2f9..8b07f155 100644 --- a/sys/bindgen/src/main.rs +++ b/sys/bindgen/src/main.rs @@ -62,6 +62,7 @@ fn generate_bindings() { .expect("Couldn't write bindings!"); } +use std::io::Write; use std::thread; fn test_compatible_target() { @@ -77,20 +78,22 @@ fn test_compatible_target() { if !output.status.success() { panic!("'rustc --print target-list' returned an error"); } - let targets = std::str::from_utf8(&output.stdout).unwrap().split_whitespace(); - + let targets = std::str::from_utf8(&output.stdout) + .unwrap() + .split_whitespace(); + let mut valid_targets = Vec::new(); for target in targets { - let target = String::from(target); + let target2 = String::from(target); let test_h = String::from(test_h); print!("{}: ", target); //the thread spawning avoid to exit when bindgen panics let handle = thread::spawn(move || { let builder = bindgen::Builder::default() .size_t_is_usize(true) - .clang_arg(format!("--target={}", target)) + .clang_arg(format!("--target={}", target2)) .header(test_h); // make silent panic - std::panic::set_hook(Box::new(|_|())); + std::panic::set_hook(Box::new(|_| ())); let bindings = builder .generate() .expect("failed to generate a test binding"); @@ -102,12 +105,25 @@ fn test_compatible_target() { let is_ok = if let Ok(res) = res { let pat = "pub type test = "; if let Some(i) = res.find(pat) { - print!("{}, ", &res[i+pat.len()..i+pat.len() + 3]); + print!("{}, ", &res[i + pat.len()..i + pat.len() + 3]); } res.contains("pub type test = u32") || res.contains("pub type test = i32") } else { false }; + if is_ok { + valid_targets.push(target); + } println!("{}", is_ok); } + //write valid target to a file + let mut out_path = PathBuf::new(); + out_path.push(env::var("CARGO_MANIFEST_DIR").unwrap()); + out_path.pop(); + out_path.push("build_data"); + out_path.push("valid_targets.txt"); + let mut f = fs::File::create(out_path).unwrap(); + for target in valid_targets { + writeln!(f, "{}", target).unwrap(); + } } From d4888a00987ea6fc1cce2e711d938a8f30c36b12 Mon Sep 17 00:00:00 2001 From: Yruama_Lairba Date: Fri, 10 Apr 2020 01:38:54 +0200 Subject: [PATCH 017/151] break prebuild step if bindings not compatible with target An error message instruct to use bindgen feature --- sys/build.rs | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/sys/build.rs b/sys/build.rs index 64f3998a..ebdb1063 100644 --- a/sys/build.rs +++ b/sys/build.rs @@ -1,15 +1,29 @@ #[cfg(not(feature = "bindgen"))] -fn main() { +use std::error::Error; + +fn main() -> Result<(), Box> { use std::env; use std::fs; use std::path::PathBuf; - let mut source_path = PathBuf::from(env::var("CARGO_MANIFEST_DIR").unwrap()); - source_path.push("build_data"); - source_path.push("bindings.rs"); + let mut data_path = PathBuf::from(env::var("CARGO_MANIFEST_DIR").unwrap()); + data_path.push("build_data"); + + let target = env::var("TARGET").unwrap(); + let valid_targets = fs::read_to_string(data_path.join("valid_targets.txt")) + .expect("can't find \"valid_targets.txt\""); + if !valid_targets.contains(&target) { + let s = format!("No valid prebinding for {}. ", target) + + "Add \"lv2_sys\" with \"bindgen\" feature in your dependencies."; + eprintln!("{}", s); + std::process::exit(-1); + //return Err("No prebinding for the target".into()) ; + } + let mut out_path = PathBuf::from(env::var("OUT_DIR").unwrap()); out_path.push("bindings.rs"); - fs::copy(source_path, out_path).unwrap(); + fs::copy(data_path.join("bindings.rs"), out_path).unwrap(); + Ok(()) } #[cfg(feature = "bindgen")] From ecdb5c0ef2030a0d9f21333166f7459808405c7a Mon Sep 17 00:00:00 2001 From: Yruama_Lairba Date: Fri, 10 Apr 2020 01:50:54 +0200 Subject: [PATCH 018/151] add list of usable target with static bindings --- sys/build_data/valid_targets.txt | 128 +++++++++++++++++++++++++++++++ 1 file changed, 128 insertions(+) create mode 100644 sys/build_data/valid_targets.txt diff --git a/sys/build_data/valid_targets.txt b/sys/build_data/valid_targets.txt new file mode 100644 index 00000000..7f317e46 --- /dev/null +++ b/sys/build_data/valid_targets.txt @@ -0,0 +1,128 @@ +aarch64-fuchsia +aarch64-linux-android +aarch64-pc-windows-msvc +aarch64-unknown-cloudabi +aarch64-unknown-freebsd +aarch64-unknown-hermit +aarch64-unknown-linux-gnu +aarch64-unknown-linux-musl +aarch64-unknown-netbsd +aarch64-unknown-none +aarch64-unknown-none-softfloat +aarch64-unknown-openbsd +aarch64-unknown-redox +aarch64-uwp-windows-msvc +aarch64-wrs-vxworks +arm-linux-androideabi +arm-unknown-linux-gnueabi +arm-unknown-linux-gnueabihf +arm-unknown-linux-musleabi +arm-unknown-linux-musleabihf +armebv7r-none-eabi +armebv7r-none-eabihf +armv4t-unknown-linux-gnueabi +armv5te-unknown-linux-gnueabi +armv5te-unknown-linux-musleabi +armv6-unknown-freebsd +armv6-unknown-netbsd-eabihf +armv7-linux-androideabi +armv7-unknown-cloudabi-eabihf +armv7-unknown-freebsd +armv7-unknown-linux-gnueabi +armv7-unknown-linux-gnueabihf +armv7-unknown-linux-musleabi +armv7-unknown-linux-musleabihf +armv7-unknown-netbsd-eabihf +armv7-wrs-vxworks-eabihf +armv7a-none-eabi +armv7a-none-eabihf +armv7r-none-eabi +armv7r-none-eabihf +i586-pc-windows-msvc +i586-unknown-linux-gnu +i586-unknown-linux-musl +i686-apple-darwin +i686-linux-android +i686-pc-windows-gnu +i686-pc-windows-msvc +i686-unknown-cloudabi +i686-unknown-freebsd +i686-unknown-haiku +i686-unknown-linux-gnu +i686-unknown-linux-musl +i686-unknown-netbsd +i686-unknown-openbsd +i686-unknown-uefi +i686-uwp-windows-gnu +i686-uwp-windows-msvc +i686-wrs-vxworks +mips-unknown-linux-gnu +mips-unknown-linux-musl +mips-unknown-linux-uclibc +mips64-unknown-linux-gnuabi64 +mips64-unknown-linux-muslabi64 +mips64el-unknown-linux-gnuabi64 +mips64el-unknown-linux-muslabi64 +mipsel-unknown-linux-gnu +mipsel-unknown-linux-musl +mipsel-unknown-linux-uclibc +nvptx64-nvidia-cuda +powerpc-unknown-linux-gnu +powerpc-unknown-linux-gnuspe +powerpc-unknown-linux-musl +powerpc-unknown-netbsd +powerpc-wrs-vxworks +powerpc-wrs-vxworks-spe +powerpc64-unknown-freebsd +powerpc64-unknown-linux-gnu +powerpc64-unknown-linux-musl +powerpc64-wrs-vxworks +powerpc64le-unknown-linux-gnu +powerpc64le-unknown-linux-musl +s390x-unknown-linux-gnu +sparc-unknown-linux-gnu +sparc64-unknown-linux-gnu +sparc64-unknown-netbsd +sparc64-unknown-openbsd +sparcv9-sun-solaris +thumbv6m-none-eabi +thumbv7a-pc-windows-msvc +thumbv7em-none-eabi +thumbv7em-none-eabihf +thumbv7m-none-eabi +thumbv7neon-linux-androideabi +thumbv7neon-unknown-linux-gnueabihf +thumbv7neon-unknown-linux-musleabihf +thumbv8m.base-none-eabi +thumbv8m.main-none-eabi +thumbv8m.main-none-eabihf +wasm32-unknown-emscripten +wasm32-unknown-unknown +wasm32-wasi +x86_64-apple-darwin +x86_64-fortanix-unknown-sgx +x86_64-fuchsia +x86_64-linux-android +x86_64-linux-kernel +x86_64-pc-solaris +x86_64-pc-windows-gnu +x86_64-pc-windows-msvc +x86_64-rumprun-netbsd +x86_64-sun-solaris +x86_64-unknown-cloudabi +x86_64-unknown-dragonfly +x86_64-unknown-freebsd +x86_64-unknown-haiku +x86_64-unknown-hermit +x86_64-unknown-hermit-kernel +x86_64-unknown-l4re-uclibc +x86_64-unknown-linux-gnu +x86_64-unknown-linux-gnux32 +x86_64-unknown-linux-musl +x86_64-unknown-netbsd +x86_64-unknown-openbsd +x86_64-unknown-redox +x86_64-unknown-uefi +x86_64-uwp-windows-gnu +x86_64-uwp-windows-msvc +x86_64-wrs-vxworks From eb1969c9cb17b176178f26644d20a00bd0bb6bea Mon Sep 17 00:00:00 2001 From: Yruama_Lairba Date: Fri, 10 Apr 2020 19:54:49 +0200 Subject: [PATCH 019/151] fix compiling issue when using bindgen, try_main pattern --- sys/build.rs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/sys/build.rs b/sys/build.rs index ebdb1063..79c2d2e1 100644 --- a/sys/build.rs +++ b/sys/build.rs @@ -1,7 +1,16 @@ #[cfg(not(feature = "bindgen"))] use std::error::Error; -fn main() -> Result<(), Box> { +#[cfg(not(feature = "bindgen"))] +fn main() { + if let Err(e) = try_main() { + eprintln!("{}", e); + std::process::exit(-1); + } +} + +#[cfg(not(feature = "bindgen"))] +fn try_main() -> Result<(), Box> { use std::env; use std::fs; use std::path::PathBuf; @@ -15,9 +24,7 @@ fn main() -> Result<(), Box> { if !valid_targets.contains(&target) { let s = format!("No valid prebinding for {}. ", target) + "Add \"lv2_sys\" with \"bindgen\" feature in your dependencies."; - eprintln!("{}", s); - std::process::exit(-1); - //return Err("No prebinding for the target".into()) ; + return Err(s.into()) ; } let mut out_path = PathBuf::from(env::var("OUT_DIR").unwrap()); @@ -26,6 +33,7 @@ fn main() -> Result<(), Box> { Ok(()) } + #[cfg(feature = "bindgen")] fn main() { extern crate bindgen; From f7e0499a47497570b1323c055e4b1d11ae17f9b0 Mon Sep 17 00:00:00 2001 From: Yruama_Lairba Date: Fri, 10 Apr 2020 21:15:34 +0200 Subject: [PATCH 020/151] make nicer printing --- sys/bindgen/src/main.rs | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/sys/bindgen/src/main.rs b/sys/bindgen/src/main.rs index 8b07f155..9399073e 100644 --- a/sys/bindgen/src/main.rs +++ b/sys/bindgen/src/main.rs @@ -6,7 +6,7 @@ use std::process::Command; fn main() { generate_bindings(); - test_compatible_target(); + generate_valid_target(); } fn generate_bindings() { @@ -65,7 +65,7 @@ fn generate_bindings() { use std::io::Write; use std::thread; -fn test_compatible_target() { +fn generate_valid_target() { let mut test_h = PathBuf::new(); test_h.push(env::var("CARGO_MANIFEST_DIR").unwrap()); test_h.push("enum_test.h"); @@ -102,19 +102,24 @@ fn test_compatible_target() { bindings.to_string() }); let res = handle.join(); - let is_ok = if let Ok(res) = res { - let pat = "pub type test = "; - if let Some(i) = res.find(pat) { - print!("{}, ", &res[i + pat.len()..i + pat.len() + 3]); + match res { + Ok(res) => { + let pat = "pub type test = "; + let i1 = res.find(pat).unwrap() + pat.len(); + let i2 = i1 + res.get(i1..).unwrap().find(';').unwrap(); + let repr = res.get(i1..i2).unwrap(); + print!("enum is {}, ", repr); + if repr.contains("u32") || repr.contains("i32") { + println!("valid."); + valid_targets.push(target); + } else { + println!("not valid."); + } + } + Err(_) => { + println!("bindgen error"); } - res.contains("pub type test = u32") || res.contains("pub type test = i32") - } else { - false }; - if is_ok { - valid_targets.push(target); - } - println!("{}", is_ok); } //write valid target to a file let mut out_path = PathBuf::new(); From cd99ffd719e8d25aa96456bc653b70e36e7e4ea6 Mon Sep 17 00:00:00 2001 From: Yruama_Lairba Date: Fri, 10 Apr 2020 23:39:18 +0200 Subject: [PATCH 021/151] move generate binding into a lib.rs for future reuse --- sys/bindgen/src/lib.rs | 56 +++++++++++++++++++++++++++++++++++++++++ sys/bindgen/src/main.rs | 55 +--------------------------------------- 2 files changed, 57 insertions(+), 54 deletions(-) create mode 100644 sys/bindgen/src/lib.rs diff --git a/sys/bindgen/src/lib.rs b/sys/bindgen/src/lib.rs new file mode 100644 index 00000000..888e73f5 --- /dev/null +++ b/sys/bindgen/src/lib.rs @@ -0,0 +1,56 @@ +use std::env; +use std::fs; +use std::path::PathBuf; + +pub fn generate_bindings() { + let mut bindings = bindgen::Builder::default().size_t_is_usize(true); + + let mut work_dir = PathBuf::new(); + work_dir.push(env::var("CARGO_MANIFEST_DIR").unwrap()); + work_dir.pop(); + + let source_dir = work_dir.join("lv2"); + let out_path = work_dir.join("build_data"); + + // Adding the crate to the include path of clang. + // Otherwise, included headers can not be found. + bindings = bindings.clang_arg(format!("-I{}", work_dir.to_str().unwrap())); + + for entry in fs::read_dir(source_dir).unwrap() { + let spec_dir = if let Ok(spec_dir) = entry { + spec_dir.path() + } else { + continue; + }; + + for entry in fs::read_dir(spec_dir).unwrap() { + let entry = match entry { + Ok(entry) => entry.path(), + _ => continue, + }; + + let extension = match entry.extension() { + Some(extension) => extension, + None => continue, + }; + + if extension == "h" { + bindings = bindings.header(entry.to_str().unwrap()); + } + } + } + bindings = bindings + .whitelist_type("LV2.*") + .whitelist_function("LV2.*") + .whitelist_var("LV2.*") + .layout_tests(false) + .bitfield_enum("LV2_State_Flags"); + + // Generating the bindings. + let bindings = bindings.generate().expect("Unable to generate bindings"); + + // Writing the bindings to a file. + bindings + .write_to_file(out_path.join("bindings.rs")) + .expect("Couldn't write bindings!"); +} diff --git a/sys/bindgen/src/main.rs b/sys/bindgen/src/main.rs index 9399073e..f7446eb3 100644 --- a/sys/bindgen/src/main.rs +++ b/sys/bindgen/src/main.rs @@ -1,6 +1,7 @@ extern crate bindgen; use std::env; use std::fs; +use std::io::Write; use std::path::PathBuf; use std::process::Command; @@ -9,60 +10,6 @@ fn main() { generate_valid_target(); } -fn generate_bindings() { - let mut bindings = bindgen::Builder::default().size_t_is_usize(true); - - let mut work_dir = PathBuf::new(); - work_dir.push(env::var("CARGO_MANIFEST_DIR").unwrap()); - work_dir.pop(); - - let source_dir = work_dir.join("lv2"); - let out_path = work_dir.join("build_data"); - - // Adding the crate to the include path of clang. - // Otherwise, included headers can not be found. - bindings = bindings.clang_arg(format!("-I{}", work_dir.to_str().unwrap())); - - for entry in fs::read_dir(source_dir).unwrap() { - let spec_dir = if let Ok(spec_dir) = entry { - spec_dir.path() - } else { - continue; - }; - - for entry in fs::read_dir(spec_dir).unwrap() { - let entry = match entry { - Ok(entry) => entry.path(), - _ => continue, - }; - - let extension = match entry.extension() { - Some(extension) => extension, - None => continue, - }; - - if extension == "h" { - bindings = bindings.header(entry.to_str().unwrap()); - } - } - } - bindings = bindings - .whitelist_type("LV2.*") - .whitelist_function("LV2.*") - .whitelist_var("LV2.*") - .layout_tests(false) - .bitfield_enum("LV2_State_Flags"); - - // Generating the bindings. - let bindings = bindings.generate().expect("Unable to generate bindings"); - - // Writing the bindings to a file. - bindings - .write_to_file(out_path.join("bindings.rs")) - .expect("Couldn't write bindings!"); -} - -use std::io::Write; use std::thread; fn generate_valid_target() { From 594f00d1db2ea833afac66d120cc1d17f1be78e5 Mon Sep 17 00:00:00 2001 From: Yruama_Lairba Date: Sat, 11 Apr 2020 01:41:46 +0200 Subject: [PATCH 022/151] function that get the 'layout' type used for a C enum --- sys/bindgen/src/main.rs | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/sys/bindgen/src/main.rs b/sys/bindgen/src/main.rs index f7446eb3..211d6d15 100644 --- a/sys/bindgen/src/main.rs +++ b/sys/bindgen/src/main.rs @@ -1,10 +1,13 @@ extern crate bindgen; use std::env; +use std::error::Error; use std::fs; use std::io::Write; use std::path::PathBuf; use std::process::Command; +type DynError = Box; + fn main() { generate_bindings(); generate_valid_target(); @@ -79,3 +82,37 @@ fn generate_valid_target() { writeln!(f, "{}", target).unwrap(); } } + +/// Return the target enum representation or error if bindgen panics +fn get_target_enum(target: &str) -> Result { + let mut test_h = PathBuf::new(); + test_h.push(env::var("CARGO_MANIFEST_DIR")?); + test_h.push("enum_test.h"); + let test_h = test_h.to_str().unwrap(); + let test_h = String::from(test_h); + let target = String::from(target); + //the thread spawning avoid to exit when bindgen panics + let handle = thread::spawn(move || { + let builder = bindgen::Builder::default() + .size_t_is_usize(true) + .clang_arg(format!("--target={}", target)) + .header(test_h); + // make silent panic + std::panic::set_hook(Box::new(|_| ())); + let bindings = builder.generate().unwrap(); + //restore default panic hook because it's not thread local + let _ = std::panic::take_hook(); + bindings.to_string() + }); + let res = handle.join(); + match res { + Ok(res) => { + let pat = "pub type test = "; + let i1 = res.find(pat).unwrap() + pat.len(); + let i2 = i1 + res.get(i1..).unwrap().find(';').unwrap(); + let repr = res.get(i1..i2).unwrap(); + Ok(String::from(repr)) + } + Err(_) => Err("bindgen panicked".into()), + } +} From 12eaaaaa941d9d54c061973a5431130937765beb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Oliver=20=27Janonard=27=20Opdenh=C3=B6vel?= Date: Sat, 11 Apr 2020 11:34:17 +0200 Subject: [PATCH 023/151] Small tweaks to the atom crate --- atom/src/lib.rs | 8 ++++++++ atom/src/object.rs | 1 - 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/atom/src/lib.rs b/atom/src/lib.rs index e851dc42..01000c10 100644 --- a/atom/src/lib.rs +++ b/atom/src/lib.rs @@ -103,6 +103,7 @@ use urid::*; #[derive(Clone, URIDCollection)] /// Collection with the URIDs of all `UriBound`s in this crate. pub struct AtomURIDCollection { + pub blank: URID, pub double: URID, pub float: URID, pub int: URID, @@ -204,4 +205,11 @@ impl<'a> UnidentifiedAtom<'a> { .map(|(body, _)| body) .and_then(|body| A::read(body, parameter)) } + + /// Retrieve the type URID of the atom. + /// + /// This can be used to identify atoms without actually reading them. + pub fn type_urid(self) -> Option { + self.space.split_type::().and_then(|(header, _)| URID::new(header.type_)) + } } diff --git a/atom/src/object.rs b/atom/src/object.rs index 08ecc160..418e7059 100644 --- a/atom/src/object.rs +++ b/atom/src/object.rs @@ -135,7 +135,6 @@ where /// Deprecated alias of `Object` /// /// A blank object is an object that isn't an instance of a class. The [specification recommends](https://lv2plug.in/ns/ext/atom/atom.html#Blank) to use an [`Object`](struct.Object.html) with an id of `None`, but some hosts still use it and therefore, it's included in this library. -#[deprecated] pub struct Blank; #[allow(deprecated)] From 34585a0dc7ff750c28b8ff37e96f78263130c2a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Oliver=20=27Janonard=27=20Opdenh=C3=B6vel?= Date: Sat, 11 Apr 2020 17:08:10 +0200 Subject: [PATCH 024/151] Updating the documentation of Object, increasing the version number --- atom/Cargo.toml | 2 +- atom/src/object.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/atom/Cargo.toml b/atom/Cargo.toml index e9b2bae8..eaa9134a 100644 --- a/atom/Cargo.toml +++ b/atom/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "lv2-atom" -version = "1.1.0" +version = "1.1.1" authors = ["Jan-Oliver 'Janonard' Opdenhövel "] edition = "2018" license = "MIT OR Apache-2.0" diff --git a/atom/src/object.rs b/atom/src/object.rs index 418e7059..bff4e539 100644 --- a/atom/src/object.rs +++ b/atom/src/object.rs @@ -132,7 +132,7 @@ where } } -/// Deprecated alias of `Object` +/// Alias of `Object`, used by older hosts. /// /// A blank object is an object that isn't an instance of a class. The [specification recommends](https://lv2plug.in/ns/ext/atom/atom.html#Blank) to use an [`Object`](struct.Object.html) with an id of `None`, but some hosts still use it and therefore, it's included in this library. pub struct Blank; From ca6458c6d7f667a4ad3a16751a2eaaccb3f1190d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Oliver=20=27Janonard=27=20Opdenh=C3=B6vel?= Date: Sat, 11 Apr 2020 17:09:28 +0200 Subject: [PATCH 025/151] Decreasing the version number again --- atom/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/atom/Cargo.toml b/atom/Cargo.toml index eaa9134a..e9b2bae8 100644 --- a/atom/Cargo.toml +++ b/atom/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "lv2-atom" -version = "1.1.1" +version = "1.1.0" authors = ["Jan-Oliver 'Janonard' Opdenhövel "] edition = "2018" license = "MIT OR Apache-2.0" From 4de1315d30cc32c267ecd13e63de5f50933e24dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Oliver=20=27Janonard=27=20Opdenh=C3=B6vel?= Date: Sat, 11 Apr 2020 17:16:15 +0200 Subject: [PATCH 026/151] Adding a note about Blank's deprecation status --- atom/src/object.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/atom/src/object.rs b/atom/src/object.rs index bff4e539..1a18d419 100644 --- a/atom/src/object.rs +++ b/atom/src/object.rs @@ -135,14 +135,14 @@ where /// Alias of `Object`, used by older hosts. /// /// A blank object is an object that isn't an instance of a class. The [specification recommends](https://lv2plug.in/ns/ext/atom/atom.html#Blank) to use an [`Object`](struct.Object.html) with an id of `None`, but some hosts still use it and therefore, it's included in this library. +/// +/// If you want to read an object, you should also support `Blank`s, but if you want to write an object, you should always use `Object`. pub struct Blank; -#[allow(deprecated)] unsafe impl UriBound for Blank { const URI: &'static [u8] = sys::LV2_ATOM__Blank; } -#[allow(deprecated)] impl<'a, 'b> Atom<'a, 'b> for Blank where 'a: 'b, From 4050af9796e0427ed8cefe8d0f1cb54c1e2f8188 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Oliver=20=27Janonard=27=20Opdenh=C3=B6vel?= Date: Sat, 11 Apr 2020 18:00:15 +0200 Subject: [PATCH 027/151] Formatting --- atom/src/lib.rs | 6 ++++-- atom/src/object.rs | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/atom/src/lib.rs b/atom/src/lib.rs index 01000c10..235eda50 100644 --- a/atom/src/lib.rs +++ b/atom/src/lib.rs @@ -207,9 +207,11 @@ impl<'a> UnidentifiedAtom<'a> { } /// Retrieve the type URID of the atom. - /// + /// /// This can be used to identify atoms without actually reading them. pub fn type_urid(self) -> Option { - self.space.split_type::().and_then(|(header, _)| URID::new(header.type_)) + self.space + .split_type::() + .and_then(|(header, _)| URID::new(header.type_)) } } diff --git a/atom/src/object.rs b/atom/src/object.rs index 1a18d419..f1fe8969 100644 --- a/atom/src/object.rs +++ b/atom/src/object.rs @@ -135,7 +135,7 @@ where /// Alias of `Object`, used by older hosts. /// /// A blank object is an object that isn't an instance of a class. The [specification recommends](https://lv2plug.in/ns/ext/atom/atom.html#Blank) to use an [`Object`](struct.Object.html) with an id of `None`, but some hosts still use it and therefore, it's included in this library. -/// +/// /// If you want to read an object, you should also support `Blank`s, but if you want to write an object, you should always use `Object`. pub struct Blank; From 982de4bba98a5d36d7dfd2fbf65b390d87ff92e7 Mon Sep 17 00:00:00 2001 From: Yruama_Lairba Date: Sun, 12 Apr 2020 12:07:30 +0200 Subject: [PATCH 028/151] some refactoring, fix a missing import --- sys/bindgen/src/main.rs | 41 +++++++++-------------------------------- 1 file changed, 9 insertions(+), 32 deletions(-) diff --git a/sys/bindgen/src/main.rs b/sys/bindgen/src/main.rs index 211d6d15..e520ebfd 100644 --- a/sys/bindgen/src/main.rs +++ b/sys/bindgen/src/main.rs @@ -1,7 +1,9 @@ extern crate bindgen; +use lv2_sys_bindgen::*; use std::env; use std::error::Error; use std::fs; +use std::io; use std::io::Write; use std::path::PathBuf; use std::process::Command; @@ -16,10 +18,6 @@ fn main() { use std::thread; fn generate_valid_target() { - let mut test_h = PathBuf::new(); - test_h.push(env::var("CARGO_MANIFEST_DIR").unwrap()); - test_h.push("enum_test.h"); - let test_h = test_h.to_str().unwrap(); let output = Command::new("rustc") .args(&["--print", "target-list"]) .output() @@ -33,41 +31,20 @@ fn generate_valid_target() { .split_whitespace(); let mut valid_targets = Vec::new(); for target in targets { - let target2 = String::from(target); - let test_h = String::from(test_h); print!("{}: ", target); - //the thread spawning avoid to exit when bindgen panics - let handle = thread::spawn(move || { - let builder = bindgen::Builder::default() - .size_t_is_usize(true) - .clang_arg(format!("--target={}", target2)) - .header(test_h); - // make silent panic - std::panic::set_hook(Box::new(|_| ())); - let bindings = builder - .generate() - .expect("failed to generate a test binding"); - //restore default panic hook because it's not thread local - let _ = std::panic::take_hook(); - bindings.to_string() - }); - let res = handle.join(); - match res { + io::stdout().flush().unwrap(); + match get_target_enum(target) { Ok(res) => { - let pat = "pub type test = "; - let i1 = res.find(pat).unwrap() + pat.len(); - let i2 = i1 + res.get(i1..).unwrap().find(';').unwrap(); - let repr = res.get(i1..i2).unwrap(); - print!("enum is {}, ", repr); - if repr.contains("u32") || repr.contains("i32") { + print!("enum is {}, ", res); + if res.contains("32") { println!("valid."); valid_targets.push(target); } else { println!("not valid."); } } - Err(_) => { - println!("bindgen error"); + Err(e) => { + println!("{}",e); } }; } @@ -100,7 +77,7 @@ fn get_target_enum(target: &str) -> Result { // make silent panic std::panic::set_hook(Box::new(|_| ())); let bindings = builder.generate().unwrap(); - //restore default panic hook because it's not thread local + //restore default panic hook let _ = std::panic::take_hook(); bindings.to_string() }); From e3cf980e99e416b9caebdb6e558a27a4b5eddf44 Mon Sep 17 00:00:00 2001 From: Yruama_Lairba Date: Sun, 12 Apr 2020 15:08:10 +0200 Subject: [PATCH 029/151] better printing --- sys/bindgen/src/main.rs | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/sys/bindgen/src/main.rs b/sys/bindgen/src/main.rs index e520ebfd..196cfccc 100644 --- a/sys/bindgen/src/main.rs +++ b/sys/bindgen/src/main.rs @@ -11,7 +11,10 @@ use std::process::Command; type DynError = Box; fn main() { + print!("Generating bindings..."); + io::stdout().flush().unwrap(); generate_bindings(); + println!(" Done"); generate_valid_target(); } @@ -30,21 +33,23 @@ fn generate_valid_target() { .unwrap() .split_whitespace(); let mut valid_targets = Vec::new(); + println!("Target compatibility:"); + println!("{:-^40}|{:-^12}|{:-^8}|","target triple", "enum repr.", "status"); for target in targets { - print!("{}: ", target); + print!("{:<40}|", target); io::stdout().flush().unwrap(); match get_target_enum(target) { Ok(res) => { - print!("enum is {}, ", res); + print!("{:^12}|", res); if res.contains("32") { - println!("valid."); + println!("{:^8}|","Ok"); valid_targets.push(target); } else { - println!("not valid."); + println!("{:^8}|","Not Ok"); } } - Err(e) => { - println!("{}",e); + Err(_) => { + println!("{:^12}|{:^8}|","??","Error"); } }; } @@ -58,6 +63,7 @@ fn generate_valid_target() { for target in valid_targets { writeln!(f, "{}", target).unwrap(); } + println!("Valid targets saved!"); } /// Return the target enum representation or error if bindgen panics From ef0c8aa96a79f4388617d6ddb75afbfe4a6445ac Mon Sep 17 00:00:00 2001 From: Yruama_Lairba Date: Sun, 12 Apr 2020 15:31:17 +0200 Subject: [PATCH 030/151] check host enum before doing anything --- sys/bindgen/src/main.rs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/sys/bindgen/src/main.rs b/sys/bindgen/src/main.rs index 196cfccc..28bcfc2e 100644 --- a/sys/bindgen/src/main.rs +++ b/sys/bindgen/src/main.rs @@ -11,11 +11,16 @@ use std::process::Command; type DynError = Box; fn main() { - print!("Generating bindings..."); - io::stdout().flush().unwrap(); - generate_bindings(); - println!(" Done"); - generate_valid_target(); + if get_target_enum("").unwrap().contains("32") { + print!("Generating bindings..."); + io::stdout().flush().unwrap(); + generate_bindings(); + println!(" Done"); + generate_valid_target(); + } else { + eprintln!("host enum layout must be u32 or i32"); + std::process::exit(-1); + } } use std::thread; From aa617f89d994689181a1ab69d0a25ee23f8c31d4 Mon Sep 17 00:00:00 2001 From: Yruama_Lairba Date: Sun, 12 Apr 2020 15:46:33 +0200 Subject: [PATCH 031/151] rustformat and quick description for each function --- sys/bindgen/src/lib.rs | 1 + sys/bindgen/src/main.rs | 12 ++++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/sys/bindgen/src/lib.rs b/sys/bindgen/src/lib.rs index 888e73f5..49d6857c 100644 --- a/sys/bindgen/src/lib.rs +++ b/sys/bindgen/src/lib.rs @@ -2,6 +2,7 @@ use std::env; use std::fs; use std::path::PathBuf; +/// Generate lv2-sys bindings pub fn generate_bindings() { let mut bindings = bindgen::Builder::default().size_t_is_usize(true); diff --git a/sys/bindgen/src/main.rs b/sys/bindgen/src/main.rs index 28bcfc2e..bfab5cfc 100644 --- a/sys/bindgen/src/main.rs +++ b/sys/bindgen/src/main.rs @@ -25,6 +25,7 @@ fn main() { use std::thread; +/// Check and display target compatitibily and saves the good one into a file. fn generate_valid_target() { let output = Command::new("rustc") .args(&["--print", "target-list"]) @@ -39,7 +40,10 @@ fn generate_valid_target() { .split_whitespace(); let mut valid_targets = Vec::new(); println!("Target compatibility:"); - println!("{:-^40}|{:-^12}|{:-^8}|","target triple", "enum repr.", "status"); + println!( + "{:-^40}|{:-^12}|{:-^8}|", + "target triple", "enum repr.", "status" + ); for target in targets { print!("{:<40}|", target); io::stdout().flush().unwrap(); @@ -47,14 +51,14 @@ fn generate_valid_target() { Ok(res) => { print!("{:^12}|", res); if res.contains("32") { - println!("{:^8}|","Ok"); + println!("{:^8}|", "Ok"); valid_targets.push(target); } else { - println!("{:^8}|","Not Ok"); + println!("{:^8}|", "Not Ok"); } } Err(_) => { - println!("{:^12}|{:^8}|","??","Error"); + println!("{:^12}|{:^8}|", "??", "Error"); } }; } From 8c5801fde556bc395a9ef8c7e74cced0b15f0ad0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Oliver=20=27Janonard=27=20Opdenh=C3=B6vel?= Date: Sun, 12 Apr 2020 15:57:42 +0200 Subject: [PATCH 032/151] Importing the book --- Cargo.toml | 10 +- docs/.gitignore | 7 + docs/LICENSE.md | 15 + docs/Makefile | 22 ++ docs/README.md | 25 ++ docs/amp/Cargo.toml | 22 ++ docs/amp/eg-amp-rs.lv2/amp.ttl | 82 +++++ docs/amp/eg-amp-rs.lv2/manifest.ttl | 53 +++ docs/amp/src/lib.rs | 39 +++ docs/conf.py | 54 ++++ docs/fifths/Cargo.toml | 12 + docs/fifths/eg-fifths-rs.lv2/fifths.ttl | 30 ++ docs/fifths/eg-fifths-rs.lv2/manifest.ttl | 8 + docs/fifths/src/lib.rs | 100 ++++++ docs/index.rst | 17 + docs/introduction.md | 11 + docs/introductions/amp.md | 13 + docs/introductions/fifths.md | 3 + docs/introductions/metro.md | 1 + docs/introductions/midigate.md | 8 + docs/make_chapters.py | 183 +++++++++++ docs/metro/Cargo.toml | 13 + docs/metro/eg-metro-rs.lv2/manifest.ttl | 8 + docs/metro/eg-metro-rs.lv2/metro.ttl | 29 ++ docs/metro/src/lib.rs | 95 ++++++ docs/metro/src/pipes.rs | 305 ++++++++++++++++++ docs/midigate/Cargo.toml | 14 + docs/midigate/eg-midigate-rs.lv2/manifest.ttl | 9 + docs/midigate/eg-midigate-rs.lv2/midigate.ttl | 55 ++++ docs/midigate/src/lib.rs | 127 ++++++++ install_examples.sh | 20 ++ 31 files changed, 1389 insertions(+), 1 deletion(-) create mode 100644 docs/.gitignore create mode 100644 docs/LICENSE.md create mode 100644 docs/Makefile create mode 100644 docs/README.md create mode 100644 docs/amp/Cargo.toml create mode 100644 docs/amp/eg-amp-rs.lv2/amp.ttl create mode 100644 docs/amp/eg-amp-rs.lv2/manifest.ttl create mode 100644 docs/amp/src/lib.rs create mode 100644 docs/conf.py create mode 100644 docs/fifths/Cargo.toml create mode 100644 docs/fifths/eg-fifths-rs.lv2/fifths.ttl create mode 100644 docs/fifths/eg-fifths-rs.lv2/manifest.ttl create mode 100644 docs/fifths/src/lib.rs create mode 100644 docs/index.rst create mode 100644 docs/introduction.md create mode 100644 docs/introductions/amp.md create mode 100644 docs/introductions/fifths.md create mode 100644 docs/introductions/metro.md create mode 100644 docs/introductions/midigate.md create mode 100755 docs/make_chapters.py create mode 100644 docs/metro/Cargo.toml create mode 100644 docs/metro/eg-metro-rs.lv2/manifest.ttl create mode 100644 docs/metro/eg-metro-rs.lv2/metro.ttl create mode 100644 docs/metro/src/lib.rs create mode 100644 docs/metro/src/pipes.rs create mode 100644 docs/midigate/Cargo.toml create mode 100644 docs/midigate/eg-midigate-rs.lv2/manifest.ttl create mode 100644 docs/midigate/eg-midigate-rs.lv2/midigate.ttl create mode 100644 docs/midigate/src/lib.rs create mode 100755 install_examples.sh diff --git a/Cargo.toml b/Cargo.toml index 44349a2f..04907240 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -92,8 +92,15 @@ members = [ "urid/derive", "urid/lv2-urid", "worker", + "docs/amp", + "docs/fifths", + "docs/metro", + "docs/midigate", ] +[profile.release] +lto = true + [patch.crates-io] lv2-atom = { path = "atom" } lv2-core = { path = "core" } @@ -106,4 +113,5 @@ lv2-units = { path = "units" } urid = { path = "urid" } urid-derive = { path = "urid/derive" } lv2-urid = { path = "urid/lv2-urid" } -lv2-worker = { path = "worker" } \ No newline at end of file +lv2-worker = { path = "worker" } +iterpipes = { git = "https://github.com/Janonard/pipes" } \ No newline at end of file diff --git a/docs/.gitignore b/docs/.gitignore new file mode 100644 index 00000000..f27c9827 --- /dev/null +++ b/docs/.gitignore @@ -0,0 +1,7 @@ + +target +_build +export +Cargo.lock +__pycache__ +.vscode \ No newline at end of file diff --git a/docs/LICENSE.md b/docs/LICENSE.md new file mode 100644 index 00000000..b01e14b4 --- /dev/null +++ b/docs/LICENSE.md @@ -0,0 +1,15 @@ +Copyright 2019 Jan-Oliver "Janonard" Opdenhövel. + +Based on LV2, Copyright 2006-2012 Steve Harris, David Robillard. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. \ No newline at end of file diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 00000000..382e743b --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,22 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line, and also +# from the environment for the first two. +SPHINXOPTS ?= +SPHINXBUILD ?= sphinx-build +SOURCEDIR = . +BUILDDIR = _build + +# Put it first so that "make" without argument is like "make help". +help: + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +.PHONY: help Makefile + +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile + mkdir -p export + ./make_chapters.py + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 00000000..b5abdc97 --- /dev/null +++ b/docs/README.md @@ -0,0 +1,25 @@ +# Programming LV2 Plugins - Rust Edition + +[![Build Status](https://travis-ci.org/Janonard/rust-lv2-book.svg?branch=master)](https://travis-ci.org/Janonard/rust-lv2-book) + +This repository contains the sample plugins of the "Programming LV2 Plugins - Rust edition" book, as well as means to build both the plugins and the book. + +## Building the book + +The book is generated from the source files of the samples. In order to build the book, you need to have Python 3 installed. Simply type + +```bash +python3 make_book.py +``` + +and the book will be written to `export/README.md`. + +## Building and installing the sample plugins + +Every sample is a self-contained Rust crate; You can simply build it with cargo. If you want to install the samples on your machine, you can run `install.sh`. This will build the crates, bundle them and copy them to `~/.lv2`. + +The compiler might complain that "profiles for the non root package will be ignored", which you can safely ignore. Some examples have a profile section to show how to enable link-time optimizations, but these profile section don't have an effect. + +## Licensing + +Just like the original, the book and the code is published under the `ISC` license. See the [LICENSE file](LICENSE.md) for more info. \ No newline at end of file diff --git a/docs/amp/Cargo.toml b/docs/amp/Cargo.toml new file mode 100644 index 00000000..50784aa6 --- /dev/null +++ b/docs/amp/Cargo.toml @@ -0,0 +1,22 @@ +# The host does not really care in which language the code of the plugin is written, as long as the +# built library complies to the headers of the specifications. Therefore, every plugin is a standard +# Cargo crate. +[package] +name = "amp" +version = "0.2.0" +authors = ["Jan-Oliver 'Janonard' Opdenhövel "] +license = "ISC" +edition = "2018" + +# Plugins are dynamic libraries. This setting tells cargo to export it this way. +[lib] +crate-type = ["dylib"] + +# Rust-lv2 is a network of individual sub-crates with different version numbers and histories. +# However, most plugins don't need to deal with them directly. Instead, they use the re-export crate +# simply called `lv2`. It has an optional dependency to every sub-crate, which can be enabled via crate features. +# +# The default feature set includes everything to create a simple plugin for audio and MIDI processing. +# Therefore, we don't need to enable extra features here. +[dependencies] +lv2 = "0.5.0" \ No newline at end of file diff --git a/docs/amp/eg-amp-rs.lv2/amp.ttl b/docs/amp/eg-amp-rs.lv2/amp.ttl new file mode 100644 index 00000000..7f5d19ea --- /dev/null +++ b/docs/amp/eg-amp-rs.lv2/amp.ttl @@ -0,0 +1,82 @@ +# The full description of the plugin is in this file, which is linked to from +# `manifest.ttl`. This is done so the host only needs to scan the relatively +# small `manifest.ttl` files to quickly discover all plugins. +@prefix doap: . +@prefix lv2: . +@prefix rdf: . +@prefix rdfs: . +@prefix units: . +# First the type of the plugin is described. All plugins must explicitly list +# `lv2:Plugin` as a type. A more specific type should also be given, where +# applicable, so hosts can present a nicer UI for loading plugins. Note that +# this URI is the identifier of the plugin, so if it does not match the one in +# `manifest.ttl`, the host will not discover the plugin data at all. + + a lv2:Plugin , + lv2:AmplifierPlugin ; +# Plugins are associated with a project, where common information like +# developers, home page, and so on are described. This plugin is part of the +# rust-lv2-book project, which has URI , and is described +# elsewhere. Typical plugin collections will describe the project in +# manifest.ttl + lv2:project ; +# Every plugin must have a name, described with the doap:name property. +# Translations to various languages can be added by putting a language tag +# after strings as shown later. + doap:name "Simple Amplifier (Rust Version)" ; + doap:license ; +# This tells the host that this plugin can not work "in-place"; The input and output buffers may not be the same. In this case, this isn't technically true, but it would mean that the plugin would receive a mutable and an immutable reference to the same place in memory, which obviously isn't allowed in Rust. + lv2:requiredFeature lv2:inPlaceBroken ; + lv2:optionalFeature lv2:hardRTCapable ; + lv2:port [ +# Every port must have at least two types, one that specifies direction +# (lv2:InputPort or lv2:OutputPort), and another to describe the data type. +# This port is a lv2:ControlPort, which means it contains a single float. + a lv2:InputPort , + lv2:ControlPort ; + lv2:index 0 ; + lv2:symbol "gain" ; + lv2:name "Gain" , + "收益"@ch , + "Gewinn"@de , + "Gain"@en-gb , + "Aumento"@es , + "Gain"@fr , + "Guadagno"@it , + "利益"@jp , + "Увеличение"@ru ; +# An lv2:ControlPort should always describe its default value, and usually a +# minimum and maximum value. Defining a range is not strictly required, but +# should be done wherever possible to aid host support, particularly for UIs. + lv2:default 0.0 ; + lv2:minimum -90.0 ; + lv2:maximum 24.0 ; +# Ports can describe units and control detents to allow better UI generation +# and host automation. + units:unit units:db ; + lv2:scalePoint [ + rdfs:label "+5" ; + rdf:value 5.0 + ] , [ + rdfs:label "0" ; + rdf:value 0.0 + ] , [ + rdfs:label "-5" ; + rdf:value -5.0 + ] , [ + rdfs:label "-10" ; + rdf:value -10.0 + ] + ] , [ + a lv2:AudioPort , + lv2:InputPort ; + lv2:index 1 ; + lv2:symbol "in" ; + lv2:name "In" + ] , [ + a lv2:AudioPort , + lv2:OutputPort ; + lv2:index 2 ; + lv2:symbol "out" ; + lv2:name "Out" + ] . diff --git a/docs/amp/eg-amp-rs.lv2/manifest.ttl b/docs/amp/eg-amp-rs.lv2/manifest.ttl new file mode 100644 index 00000000..ae927635 --- /dev/null +++ b/docs/amp/eg-amp-rs.lv2/manifest.ttl @@ -0,0 +1,53 @@ +# LV2 plugins are installed in a `bundle`, a directory with a standard structure. Each bundle has a +# Turtle file named `manifest.ttl` which lists the contents of the bundle. +# +# Hosts typically read the manifest of every installed bundle to discover plugins on start-up, so it +# should be as small as possible for performance reasons. Details that are only useful if the host +# chooses to load the plugin are stored in other files and linked to from `manifest.ttl`. +# +# In a crate, this should be a special folder that contains the Turtle files. After the crate was +# build, the resulting shared object should also be copied into this folder. +# +# #### URIs +# +# LV2 makes use of URIs as globally-unique identifiers for resources. For example, the ID of the +# plugin described here is ``. Note that URIs are only used as identifiers +# and don't necessarily imply that something can be accessed at that address on the web (though that +# may be the case). +# +# #### Namespace Prefixes +# +# Turtle files contain many URIs, but prefixes can be defined to improve readability. For example, +# with the `lv2:` prefix below, `lv2:Plugin` can be written instead of +# ``. + +@prefix lv2: . +@prefix rdfs: . + +# #### Describing a Plugin +# +# Turtle files contain a set of statements which describe resources. This file contains 3 statements: +# +# | Subject | Predicate | Object | +# |---------------------------------|----------------|--------------| +# | `` | `a ` | `lv2:Plugin` | +# | `` | `lv2:binary` | `` | +# | `` | `rdfs:seeAlso` | ` ` | +# +# Firstly, `` is an LV2 plugin: + + a lv2:Plugin . + +# The predicate `a` is a Turtle shorthand for `rdf:type`. +# +# The binary of that plugin can be found at ``: + + lv2:binary . + +# This line is platform-dependent since it assumes that shared objects have the `.so` ending. On Windows, it should be ending with `.dll`. +# Relative URIs in manifests are relative to the bundle directory, so this refers to a binary with +# the given name in the same directory as this manifest. +# +# Finally, more information about this plugin can be found in ``: + + rdfs:seeAlso . diff --git a/docs/amp/src/lib.rs b/docs/amp/src/lib.rs new file mode 100644 index 00000000..77dc9758 --- /dev/null +++ b/docs/amp/src/lib.rs @@ -0,0 +1,39 @@ +// Include the prelude of `lv2`. This includes the preludes of every sub-crate and you are strongly encouraged to use it, since many macros depend on it. +use lv2::prelude::*; +// Most useful plugins will have ports for input and output data. In code, these ports are represented by a struct implementing the `PortCollection` trait. Internally, ports are referred to by index. These indices are assigned in ascending order, starting with 0 for the first port. The indices in `amp.ttl` have to match them. +#[derive(PortCollection)] +struct Ports { + gain: InputPort, + input: InputPort