public new void Dispose() { UtilityAudio.DisposeVST(); vst = null; base.Dispose(); Singleton = null; }
void LoadToolStripMenuItemClick(object sender, EventArgs e) { if (vstForm != null) { vstForm.Dispose(); vstForm = null; showToolStripMenuItem.Enabled = false; editParametersToolStripMenuItem.Enabled = false; loadToolStripMenuItem.Text = "Load..."; } else { var ofd = new OpenFileDialog(); ofd.Title = "Select VST:"; ofd.Filter = "VST Files (*.dll)|*.dll"; if (LastDirectoryUsed.ContainsKey("VSTDir")) { ofd.InitialDirectory = LastDirectoryUsed["VSTDir"]; } else { ofd.InitialDirectory = UtilityAudio.GetVSTDirectory(); } DialogResult res = ofd.ShowDialog(); if (res != DialogResult.OK || !File.Exists(ofd.FileName)) { return; } try { if (LastDirectoryUsed.ContainsKey("VSTDir")) { LastDirectoryUsed["VSTDir"] = Directory.GetParent(ofd.FileName).FullName; } else { LastDirectoryUsed.Add("VSTDir", Directory.GetParent(ofd.FileName).FullName); } vstForm = new VSTForm(ofd.FileName, comboBoxAudioOutDevices.Text); vstForm.Show(); showToolStripMenuItem.Enabled = true; editParametersToolStripMenuItem.Enabled = true; loadToolStripMenuItem.Text = "Unload..."; } catch (Exception ex) { MessageBox.Show(ex.Message); } } }
public VSTForm(string VSTPath) { Singleton = this; UtilityAudio.OpenAudio(AudioLibrary.NAudio); InitializeComponent(); vst = UtilityAudio.LoadVST(VSTPath, this.Handle); this.Text = vst.pluginContext.PluginCommandStub.GetProgramName(); Rectangle rect = new Rectangle(); vst.pluginContext.PluginCommandStub.EditorGetRect(out rect); this.SetClientSizeCore(rect.Width, rect.Height + 125); vst.StreamCall += new EventHandler<VSTStreamEventArgs>(vst_StreamCall); UtilityAudio.StartAudio(); }
void LoadToolStripMenuItemClick(object sender, EventArgs e) { if (vstForm != null) { vstForm.Dispose(); vstForm = null; showToolStripMenuItem.Enabled = false; editParametersToolStripMenuItem.Enabled = false; loadToolStripMenuItem.Text = "Load..."; } else { var ofd = new OpenFileDialog(); ofd.Title = "Select VST:"; ofd.Filter = "VST Files (*.dll)|*.dll"; if (LastDirectoryUsed.ContainsKey("VSTDir")) { ofd.InitialDirectory = LastDirectoryUsed["VSTDir"]; } else { ofd.InitialDirectory = UtilityAudio.GetVSTDirectory(); } DialogResult res = ofd.ShowDialog(); if (res != DialogResult.OK || !File.Exists(ofd.FileName)) return; try { if (LastDirectoryUsed.ContainsKey("VSTDir")) { LastDirectoryUsed["VSTDir"] = Directory.GetParent(ofd.FileName).FullName; } else { LastDirectoryUsed.Add("VSTDir", Directory.GetParent(ofd.FileName).FullName); } vstForm = new VSTForm(ofd.FileName); vstForm.Show(); showToolStripMenuItem.Enabled = true; editParametersToolStripMenuItem.Enabled = true; loadToolStripMenuItem.Text = "Unload..."; } catch (Exception ex) { MessageBox.Show(ex.Message); } } }
public VSTForm(string VSTPath) { Singleton = this; UtilityAudio.OpenAudio(AudioLibrary.NAudio); InitializeComponent(); vst = UtilityAudio.LoadVST(VSTPath, this.Handle); this.Text = vst.pluginContext.PluginCommandStub.GetProgramName(); var rect = new Rectangle(); vst.pluginContext.PluginCommandStub.EditorGetRect(out rect); this.SetClientSizeCore(rect.Width, rect.Height + 125); vst.StreamCall += vst_StreamCall; UtilityAudio.StartAudio(); }
void MainFormFormClosing(object sender, FormClosingEventArgs e) { if (midiIn != null) { midiIn.Dispose(); midiIn = null; } if (midiOut != null) { midiOut.Dispose(); midiOut = null; } if (vstForm != null) { vstForm.Dispose(); vstForm = null; } UtilityAudio.Dispose(); }
private void VSTForm_FormClosed(object sender, FormClosedEventArgs e) { Singleton = null; }