public static T GetInstance(Plugin creator) { if (creator == firstCreator) { return(firstInstance); } else if (firstCreator == null && Monitor.TryEnter(@lock)) { try { firstCreator = creator; firstInstance = @base.Invoke(creator) as T; creator.onDispose += onDispose; return(firstInstance); } finally { Monitor.Exit(@lock); } } else { T currentInstance = creator.vstInstancesByInterface[typeof(T)] as T; if (currentInstance == null) { creator.vstInstancesByInterface[typeof(T)] = currentInstance = @base.Invoke(creator) as T; } return(currentInstance); } }
public AudioProcessor(ApplicationBase creator) { this.creator = creator; tailSize = DefaultTailSize; blockSize = DefaultBlockSize; sampleRate = DefaultSampleRate; // the VST host sets the sample rate later on inputChannelCount = DefaultChannelCount; outputChannelCount = DefaultChannelCount; }
public PresetsManager(ApplicationBase creator) { this.creator = creator; thresholdParameterInfo = new VstParameterInfo { CanBeAutomated = true, CanRamp = true, DefaultValue = 0.125f, Label = "Threshold" }; var thresholdParamMgr = new VstParameterManager(thresholdParameterInfo); thresholdParamMgr.PropertyChanged += onThresholdChanged; }
private static void onDispose() { (firstInstance as IDisposable)?.Dispose(); firstInstance = null; firstCreator = null; }
internal MainView(ApplicationBase creator) { this.creator = creator; InitializeComponent(); }