public void ClearWaPlugin() { if (WaPlugin == null) { return; } // DebugHelper.WriteLine("Unload plug-in" + WaPlugin.Name); try { BassWaDsp.BASS_WADSP_Stop(WaPlugin.Id); Thread.Sleep(20); BassWaDsp.BASS_WADSP_ChannelRemoveDSP(WaPlugin.Id); Thread.Sleep(20); BassWaDsp.BASS_WADSP_FreeDSP(WaPlugin.Id); Thread.Sleep(20); } catch { // ignored } WaPlugin = null; }
/// <summary> /// 释放DSP插件 /// </summary> public void FreeDSP() { StopDSP(); if (BassWaDsp.BASS_WADSP_FreeDSP(dspHandle)) { isLoaded = false; } }
private void ClearUp() { try { if (this.FChannel.BassHandle.HasValue && this.FDSPHandle != 0) { BassWaDsp.BASS_WADSP_Stop(this.FDSPHandle); Bass.BASS_ChannelRemoveDSP(this.FChannel.BassHandle.Value, this.FDSPHandle); BassWaDsp.BASS_WADSP_FreeDSP(this.FDSPHandle); } } catch { } this.FDSPHandle = 0; }
/// <summary> /// Don't use the selected VST Plugin anymore /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void buttonPluginRemove_Click(object sender, EventArgs e) { DSPPluginInfo pluginInfo = (DSPPluginInfo)listBoxSelectedPlugins.SelectedItem; if (pluginInfo == null) { return; } if (pluginInfo.DSPPluginType == DSPPluginInfo.PluginType.VST) { // Remove VST Handle BassVst.BASS_VST_ChannelRemoveDSP(0, _vstHandles[pluginInfo.Name]); _vstHandles.Remove(pluginInfo.Name); } else { // Remove Winamp Handle BassWaDsp.BASS_WADSP_FreeDSP(_waDspPlugins[pluginInfo.FilePath]); _waDspPlugins.Remove(pluginInfo.Name); } listBoxFoundPlugins.Items.Add(listBoxSelectedPlugins.SelectedItem); listBoxSelectedPlugins.Items.RemoveAt(listBoxSelectedPlugins.SelectedIndex); }