protected void Load(string filename) { if (File.Exists(filename)) { PluginContext = OpenPlugin(filename); if (PluginContext == null) { return; } SetOutputCount(PluginContext.PluginInfo.AudioOutputCount); PluginContext.PluginCommandStub.MainsChanged(true); PluginContext.PluginCommandStub.SetSampleRate(WaveFormat.SampleRate); PluginContext.PluginCommandStub.SetBlockSize(AudioService.Engine.Settings.BufferSize); FIsSynth = PluginContext.PluginInfo.Flags.HasFlag(VstPluginFlags.IsSynth); PluginContext.PluginCommandStub.StartProcess(); FInputCount = PluginContext.PluginInfo.AudioInputCount; FOutputCount = PluginContext.PluginInfo.AudioOutputCount; FInputMgr = new VstAudioBufferManager(FInputCount, AudioService.Engine.Settings.BufferSize); FOutputMgr = new VstAudioBufferManager(FOutputCount, AudioService.Engine.Settings.BufferSize); FInputBuffers = FInputMgr.ToArray(); FOutputBuffers = FOutputMgr.ToArray(); // plugin does not support processing audio if ((PluginContext.PluginInfo.Flags & VstPluginFlags.CanReplacing) == 0) { MessageBox.Show("This plugin does not process any audio."); return; } FCanEvents = PluginContext.PluginCommandStub.CanDo("receiveVstMidiEvent") == VstCanDoResult.Yes; InfoForm = new PluginInfoForm(); InfoForm.PluginContext = PluginContext; InfoForm.DataToForm(); InfoForm.Dock = DockStyle.Fill; InfoForm.ParameterCheck += InfoForm_ParameterCheck; GetPluginInfo(); GetProgramNames(); if (PluginChanged != null) { PluginChanged(); } FDoProcess = true; } }
protected void Load(string filename) { if (File.Exists(filename)) { PluginContext = OpenPlugin(filename); if(PluginContext == null) return; SetOutputCount(PluginContext.PluginInfo.AudioOutputCount); PluginContext.PluginCommandStub.MainsChanged(true); PluginContext.PluginCommandStub.SetSampleRate(WaveFormat.SampleRate); PluginContext.PluginCommandStub.SetBlockSize(AudioService.Engine.Settings.BufferSize); FIsSynth = PluginContext.PluginInfo.Flags.HasFlag(VstPluginFlags.IsSynth); PluginContext.PluginCommandStub.StartProcess(); FInputCount = PluginContext.PluginInfo.AudioInputCount; FOutputCount = PluginContext.PluginInfo.AudioOutputCount; FInputMgr = new VstAudioBufferManager(FInputCount, AudioService.Engine.Settings.BufferSize); FOutputMgr = new VstAudioBufferManager(FOutputCount, AudioService.Engine.Settings.BufferSize); FInputBuffers = FInputMgr.ToArray(); FOutputBuffers = FOutputMgr.ToArray(); // plugin does not support processing audio if ((PluginContext.PluginInfo.Flags & VstPluginFlags.CanReplacing) == 0) { MessageBox.Show("This plugin does not process any audio."); return; } FCanEvents = PluginContext.PluginCommandStub.CanDo("receiveVstMidiEvent") == VstCanDoResult.Yes; InfoForm = new PluginInfoForm(); InfoForm.PluginContext = PluginContext; InfoForm.DataToForm(); InfoForm.Dock = DockStyle.Fill; GetPluginInfo(); GetProgramNames(); if (PluginChanged != null) PluginChanged(); FDoProcess = true; } }