private void hostCommandStub_PluginCalled(object sender, PluginCalledEventArgs e) { HostCommandStub hostCmdStub = (HostCommandStub)sender; if (hostCmdStub.PluginContext.PluginInfo != null) { if (logtombCB.Checked) { MessageBox.Show(this, "Plugin " + hostCmdStub.PluginContext.PluginInfo.PluginID + " called: " + e.Message, "Plugin message", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { Debug.WriteLine("Plugin " + hostCmdStub.PluginContext.PluginInfo.PluginID + " called: " + e.Message); } } else { if (logtombCB.Checked) { MessageBox.Show(this, "The loading Plugin called: " + e.Message, "Plugin message", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { Debug.WriteLine("The loading Plugin called: " + e.Message); } } }
private VstPluginContext LoadPlugin(string pluginPath) { try { HostCommandStub hostCommandStub = new HostCommandStub(); hostCommandStub.PluginCalled += new EventHandler <PluginCalledEventArgs>(hostCommandStub_PluginCalled); VstPluginContext ctx = VstPluginContext.Create(pluginPath, hostCommandStub); ctx.Set("PluginPath", pluginPath); ctx.Set("HostCmdStub", hostCommandStub); ctx.PluginCommandStub.Commands.Open(); selectVSTButton.Enabled = false; loadVSTButton.Enabled = false; return(ctx); } catch (Exception e) { MessageBox.Show(this, e.ToString(), Text, MessageBoxButtons.OK, MessageBoxIcon.Error); } return(null); }
public HostCommands(HostCommandStub cmdStub) { _cmdStub = cmdStub; }