예제 #1
0
        public new void Dispose()
        {
            UtilityAudio.DisposeVST();
            vst = null;
            base.Dispose();

            Singleton = null;
        }
예제 #2
0
        public new void Dispose()
        {
            UtilityAudio.DisposeVST();
            vst = null;
            base.Dispose();

            Singleton = null;
        }
예제 #3
0
        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);
                }
            }
        }
예제 #4
0
        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();
        }
예제 #5
0
		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);
				}
			}
			
		}
예제 #6
0
        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();
        }
예제 #7
0
 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();
 }
예제 #8
0
 private void VSTForm_FormClosed(object sender, FormClosedEventArgs e)
 {
     Singleton = null;
 }
예제 #9
0
		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();
		}
예제 #10
0
 private void VSTForm_FormClosed(object sender, FormClosedEventArgs e)
 {
     Singleton = null;
 }