private void AddDSP() { if (this.FChannel != null) { double dpriority; this.FPinInPriority.GetValue(0, out dpriority); double denabled; this.FPinInEnabled.GetValue(0, out denabled); if (this.FChannel.BassHandle.HasValue && denabled >= 0.5) { this.FDSPHandle = BassWaDsp.BASS_WADSP_Load(this.FFilename, 5, 5, 100, 100, null); string dspDesc = BassWaDsp.BASS_WADSP_GetName(this.FDSPHandle); string moduleName = BassWaDsp.BASS_WADSP_GetModuleName(this.FDSPHandle, 0); BassWaDsp.BASS_WADSP_Start(this.FDSPHandle, 0, this.FChannel.BassHandle.Value); BassWaDsp.BASS_WADSP_ChannelSetDSP(this.FDSPHandle, this.FChannel.BassHandle.Value, Convert.ToInt32(dpriority)); this.FPinOutFxHandle.SliceCount = 1; this.FPinOutFxHandle.SetValue(0, this.FDSPHandle); } } }
/// <summary> /// Loads a WinAmp DSP plug-in and applies it to the mixer /// </summary> /// <param name="location">The file location of the WinAmp DSP DLL</param> public WaPlugin LoadWaPlugin(string location) { if (location == "") { return(null); } if (WaPlugin != null && WaPlugin.Location == location) { return(WaPlugin); } if (!File.Exists(location)) { return(null); } BassMix.BASS_Mixer_ChannelPause(ChannelId); if (!_waDspLoaded) { StartWaDspEngine(); } // DebugHelper.WriteLine("Load WAPlugin " + location); var id = BassWaDsp.BASS_WADSP_Load(location, 10, 10, 300, 300, null); Thread.Sleep(20); var plugin = new WaPlugin { Id = id, Module = 0 }; plugin.Name = BassWaDsp.BASS_WADSP_GetName(plugin.Id); Thread.Sleep(20); plugin.Location = location; BassWaDsp.BASS_WADSP_Start(plugin.Id, plugin.Module, ChannelId); Thread.Sleep(20); BassWaDsp.BASS_WADSP_ChannelSetDSP(plugin.Id, ChannelId, 1); Thread.Sleep(20); WaPlugin = plugin; BassMix.BASS_Mixer_ChannelPlay(ChannelId); Thread.Sleep(20); return(plugin); }