Implement IProcessContextRequirements
This is needed for VST 3.7. We claim to be a VST 3.6.14 plugin, but implementing this anyways seems like the safe bet. I doubt many hosts would, but under VST 3.7 hosts are allowed to not send any transport information unless this interface is implemented.
This commit is contained in:
parent
f05e31d9e3
commit
ffe4642aa5
2 changed files with 18 additions and 4 deletions
|
@ -13,7 +13,8 @@ use super::wrapper::Wrapper;
|
|||
use crate::plugin::Vst3Plugin;
|
||||
use crate::wrapper::util::strlcpy;
|
||||
|
||||
/// The VST3 SDK version this is roughtly based on.
|
||||
/// The VST3 SDK version this is roughtly based on. The bindings include some VST 3.7 things but not
|
||||
/// everything, so we'll play it safe.
|
||||
const VST3_SDK_VERSION: &str = "VST 3.6.14";
|
||||
|
||||
#[doc(hidden)]
|
||||
|
|
|
@ -4,15 +4,16 @@ use std::mem::{self, MaybeUninit};
|
|||
use std::ptr;
|
||||
use std::sync::atomic::Ordering;
|
||||
use std::sync::Arc;
|
||||
use vst3_com::vst::IProcessContextRequirementsFlags;
|
||||
use vst3_sys::base::{kInvalidArgument, kNoInterface, kResultFalse, kResultOk, tresult, TBool};
|
||||
use vst3_sys::base::{IBStream, IPluginBase};
|
||||
use vst3_sys::utils::SharedVstPtr;
|
||||
use vst3_sys::vst::{
|
||||
kNoParamId, kNoParentUnitId, kNoProgramListId, kRootUnitId, Event, EventTypes, IAudioProcessor,
|
||||
IComponent, IEditController, IEventList, IMidiMapping, INoteExpressionController,
|
||||
IParamValueQueue, IParameterChanges, IUnitInfo, LegacyMidiCCOutEvent, NoteExpressionTypeInfo,
|
||||
NoteExpressionValueDescription, NoteOffEvent, NoteOnEvent, ParameterFlags, PolyPressureEvent,
|
||||
ProgramListInfo, TChar, UnitInfo,
|
||||
IParamValueQueue, IParameterChanges, IProcessContextRequirements, IUnitInfo,
|
||||
LegacyMidiCCOutEvent, NoteExpressionTypeInfo, NoteExpressionValueDescription, NoteOffEvent,
|
||||
NoteOnEvent, ParameterFlags, PolyPressureEvent, ProgramListInfo, TChar, UnitInfo,
|
||||
};
|
||||
use vst3_sys::VST3;
|
||||
use widestring::U16CStr;
|
||||
|
@ -42,6 +43,7 @@ use vst3_sys as vst3_com;
|
|||
IAudioProcessor,
|
||||
IMidiMapping,
|
||||
INoteExpressionController,
|
||||
IProcessContextRequirements,
|
||||
IUnitInfo
|
||||
))]
|
||||
pub(crate) struct Wrapper<P: Vst3Plugin> {
|
||||
|
@ -1406,6 +1408,17 @@ impl<P: Vst3Plugin> INoteExpressionController for Wrapper<P> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<P: Vst3Plugin> IProcessContextRequirements for Wrapper<P> {
|
||||
unsafe fn get_process_context_requirements(&self) -> u32 {
|
||||
IProcessContextRequirementsFlags::kNeedProjectTimeMusic
|
||||
| IProcessContextRequirementsFlags::kNeedBarPositionMusic
|
||||
| IProcessContextRequirementsFlags::kNeedCycleMusic
|
||||
| IProcessContextRequirementsFlags::kNeedTimeSignature
|
||||
| IProcessContextRequirementsFlags::kNeedTempo
|
||||
| IProcessContextRequirementsFlags::kNeedTransportState
|
||||
}
|
||||
}
|
||||
|
||||
impl<P: Vst3Plugin> IUnitInfo for Wrapper<P> {
|
||||
unsafe fn get_unit_count(&self) -> i32 {
|
||||
self.inner.param_units.len() as i32
|
||||
|
|
Loading…
Add table
Reference in a new issue