Skip to content

Commit

Permalink
update for CLAP 1.1.9
Browse files Browse the repository at this point in the history
  • Loading branch information
glowcoil committed Nov 5, 2023
1 parent e70db09 commit ac9eb30
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 22 deletions.
36 changes: 23 additions & 13 deletions src/ext/draft/ambisonic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,45 @@ use crate::{cstr, host::*, plugin::*};

use std::ffi::CStr;

pub const CLAP_EXT_AMBISONIC: &CStr = cstr!("clap.ambisonic.draft/2");
pub const CLAP_EXT_AMBISONIC: &CStr = cstr!("clap.ambisonic.draft/3");

pub const CLAP_PORT_AMBISONIC: &CStr = cstr!("ambisonic");

pub const CLAP_AMBISONIC_FUMA: u32 = 0;
pub const CLAP_AMBISONIC_ACN: u32 = 1;
pub const CLAP_AMBISONIC_ORDERING_FUMA: clap_ambisonic_ordering = 0;
pub const CLAP_AMBISONIC_ORDERING_ACN: clap_ambisonic_ordering = 1;

pub const CLAP_AMBISONIC_NORMALIZATION_MAXN: u32 = 0;
pub const CLAP_AMBISONIC_NORMALIZATION_SN3D: u32 = 1;
pub const CLAP_AMBISONIC_NORMALIZATION_N3D: u32 = 2;
pub const CLAP_AMBISONIC_NORMALIZATION_SN2D: u32 = 3;
pub const CLAP_AMBISONIC_NORMALIZATION_N2D: u32 = 4;
pub type clap_ambisonic_ordering = u32;

pub const CLAP_AMBISONIC_NORMALIZATION_MAXN: clap_ambisonic_normalization = 0;
pub const CLAP_AMBISONIC_NORMALIZATION_SN3D: clap_ambisonic_normalization = 1;
pub const CLAP_AMBISONIC_NORMALIZATION_N3D: clap_ambisonic_normalization = 2;
pub const CLAP_AMBISONIC_NORMALIZATION_SN2D: clap_ambisonic_normalization = 3;
pub const CLAP_AMBISONIC_NORMALIZATION_N2D: clap_ambisonic_normalization = 4;

pub type clap_ambisonic_normalization = u32;

#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct clap_ambisonic_info {
pub ordering: u32,
pub normalization: u32,
pub struct clap_ambisonic_config {
pub ordering: clap_ambisonic_ordering,
pub normalization: clap_ambisonic_normalization,
}

#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct clap_plugin_ambisonic {
pub get_info: Option<
pub is_config_supported: Option<
unsafe extern "C" fn(
plugin: *const clap_plugin,
config: *const clap_ambisonic_config,
) -> bool,
>,
pub get_config: Option<
unsafe extern "C" fn(
plugin: *const clap_plugin,
is_input: bool,
port_index: u32,
info: *mut clap_ambisonic_info,
info: *mut clap_ambisonic_config,
) -> bool,
>,
}
Expand Down
3 changes: 2 additions & 1 deletion src/ext/draft/audio_ports_activation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::{cstr, plugin::*};

use std::ffi::CStr;

pub const CLAP_EXT_AUDIO_PORTS_ACTIVATION: &CStr = cstr!("clap.audio-ports-activation/draft-1");
pub const CLAP_EXT_AUDIO_PORTS_ACTIVATION: &CStr = cstr!("clap.audio-ports-activation/draft-2");

#[repr(C)]
#[derive(Debug, Copy, Clone)]
Expand All @@ -15,6 +15,7 @@ pub struct clap_plugin_audio_ports_activation {
is_input: bool,
port_index: u32,
is_active: bool,
sample_size: u32,
) -> bool,
>,
}
13 changes: 8 additions & 5 deletions src/ext/draft/configurable_audio_ports.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@ use crate::{cstr, plugin::*};

use std::ffi::{c_char, c_void, CStr};

pub const CLAP_EXT_CONFIGURABLE_AUDIO_PORTS: &CStr = cstr!("clap.configurable-audio-ports.draft0");
pub const CLAP_EXT_CONFIGURABLE_AUDIO_PORTS: &CStr = cstr!("clap.configurable-audio-ports.draft1");

#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct clap_audio_port_configuration_request {
pub is_best_effort: bool,
pub is_input: bool,
pub port_index: u32,
pub channel_count: u32,
Expand All @@ -21,10 +20,14 @@ unsafe impl Sync for clap_audio_port_configuration_request {}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct clap_plugin_configurable_audio_ports {
pub is_port_configurable: Option<
unsafe extern "C" fn(plugin: *const clap_plugin, is_input: bool, port_index: u32) -> bool,
pub can_apply_configuration: Option<
unsafe extern "C" fn(
plugin: *const clap_plugin,
requests: *const clap_audio_port_configuration_request,
request_count: u32,
) -> bool,
>,
pub request_configuration: Option<
pub apply_configuration: Option<
unsafe extern "C" fn(
plugin: *const clap_plugin,
requests: *const clap_audio_port_configuration_request,
Expand Down
5 changes: 3 additions & 2 deletions src/ext/draft/surround.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::{cstr, host::*, plugin::*};

use std::ffi::CStr;

pub const CLAP_EXT_SURROUND: &CStr = cstr!("clap.surround.draft/3");
pub const CLAP_EXT_SURROUND: &CStr = cstr!("clap.surround.draft/4");

pub const CLAP_PORT_SURROUND: &CStr = cstr!("surround");

Expand All @@ -28,6 +28,8 @@ pub const CLAP_SURROUND_TBR: u32 = 17;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct clap_plugin_surround {
pub is_channel_mask_supported:
Option<unsafe extern "C" fn(plugin: *const clap_plugin, channel_mask: u64) -> bool>,
pub get_channel_map: Option<
unsafe extern "C" fn(
plugin: *const clap_plugin,
Expand All @@ -37,7 +39,6 @@ pub struct clap_plugin_surround {
channel_map_capacity: u32,
) -> u32,
>,
pub changed: Option<unsafe extern "C" fn(plugin: *const clap_plugin)>,
}

#[repr(C)]
Expand Down
2 changes: 1 addition & 1 deletion src/version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pub struct clap_version {

pub const CLAP_VERSION_MAJOR: u32 = 1;
pub const CLAP_VERSION_MINOR: u32 = 1;
pub const CLAP_VERSION_REVISION: u32 = 8;
pub const CLAP_VERSION_REVISION: u32 = 9;

pub const CLAP_VERSION: clap_version = clap_version {
major: CLAP_VERSION_MAJOR,
Expand Down

0 comments on commit ac9eb30

Please sign in to comment.