Beispiel #1
0
        public void UpdateChorus()
        {
            BassEngine engine = BassEngine.Instance;

            if (chorusITM.switchx)
            {
                if (chorusITM.fxState == false)
                {
                    Bass.BASS_FXSetParameters(_fxChorusHandle, _chorusfx);
                }
                if (chorusITM.fxState == false)
                {
                    _fxChorusHandle = Bass.BASS_ChannelSetFX(engine.ActiveStreamHandle, BASSFXType.BASS_FX_DX8_CHORUS, 0);
                }

                switch (chorusITM.SelUTx)
                {
                case "Default Preset":
                    _chorusfx.Preset_Default();
                    break;

                case "Preset: A":
                    _chorusfx.Preset_A();
                    break;

                case "Preset: B":
                    _chorusfx.Preset_B();
                    break;
                }
            }
            else
            {
                Bass.BASS_ChannelRemoveFX(engine.ActiveStreamHandle, _fxChorusHandle);
            }
        }
Beispiel #2
0
        public void UpdateApf()
        {
            BassEngine engine = BassEngine.Instance;

            if (APFITM.switchx)
            {
                if (APFITM.fxState == false)
                {
                    Bass.BASS_FXSetParameters(_fxApfHandle, _apFfx);
                }
                if (APFITM.fxState == false)
                {
                    _fxApfHandle = Bass.BASS_ChannelSetFX(engine.ActiveStreamHandle, BASSFXType.BASS_FX_BFX_APF, 0);
                }
                _apFfx.Preset_RobotVoice();

                switch (APFITM.SelUTx)
                {
                case "Default Preset":
                    _apFfx.Preset_RobotVoice();
                    break;
                }
            }
            else
            {
                Bass.BASS_ChannelRemoveFX(engine.ActiveStreamHandle, _fxApfHandle);
            }
        }
Beispiel #3
0
        private void checkBoxFlanger_CheckedChanged(object sender, System.EventArgs e)
        {
            if (_StreamFX == 0)
            {
                return;
            }

            if (this.checkBoxFlanger.Checked)
            {
                // and add a DSP here as well...
                _flangerFX = Bass.BASS_ChannelSetFX(_StreamFX, BASSFXType.BASS_FX_BFX_FLANGER, -4);
                BASS_BFX_FLANGER flanger = new BASS_BFX_FLANGER();
                flanger.Preset_Default();
                Bass.BASS_FXSetParameters(_flangerFX, flanger);

                // just to demo how to get
                BASS_BFX_FLANGER f = new BASS_BFX_FLANGER();
                Bass.BASS_FXGetParameters(_flangerFX, f);
            }
            else
            {
                // remove the DSP
                Bass.BASS_ChannelRemoveFX(_StreamFX, _flangerFX);
                _flangerFX = 0;
            }
        }
Beispiel #4
0
        public void UpdateDistortion()
        {
            BassEngine engine = BassEngine.Instance;

            if (DistortionITM.switchx)
            {
                if (DistortionITM.fxState == false)
                {
                    Bass.BASS_FXSetParameters(_fxDistortionHandle, _distortionfx);
                }
                if (DistortionITM.fxState == false)
                {
                    _fxDistortionHandle = Bass.BASS_ChannelSetFX(engine.ActiveStreamHandle,
                                                                 BASSFXType.BASS_FX_DX8_DISTORTION, 0);
                }
                _distortionfx.Preset_Default();

                switch (DistortionITM.SelUTx)
                {
                case "Default Preset":
                    _distortionfx.Preset_Default();
                    break;
                }
            }
            else
            {
                Bass.BASS_ChannelRemoveFX(engine.ActiveStreamHandle, _fxDistortionHandle);
            }
        }
Beispiel #5
0
        public void UpdateGargle()
        {
            BassEngine engine = BassEngine.Instance;

            if (GargleITM.switchx)
            {
                if (GargleITM.fxState == false)
                {
                    Bass.BASS_FXSetParameters(_fxGargleHandle, _garglefx);
                }
                if (GargleITM.fxState == false)
                {
                    _fxGargleHandle = Bass.BASS_ChannelSetFX(engine.ActiveStreamHandle, BASSFXType.BASS_FX_DX8_GARGLE, 0);
                }

                switch (GargleITM.SelUTx)
                {
                case "Default Preset":
                    _garglefx.Preset_Default();
                    break;
                }
            }
            else
            {
                Bass.BASS_ChannelRemoveFX(engine.ActiveStreamHandle, _fxGargleHandle);
            }
        }
Beispiel #6
0
        public void UpdateFlanger()
        {
            BassEngine engine = BassEngine.Instance;

            if (FlangerITM.switchx)
            {
                if (FlangerITM.fxState == false)
                {
                    Bass.BASS_FXSetParameters(_fxFlangerHandle, _flangerfx);
                }
                if (FlangerITM.fxState == false)
                {
                    _fxFlangerHandle = Bass.BASS_ChannelSetFX(engine.ActiveStreamHandle, BASSFXType.BASS_FX_DX8_FLANGER,
                                                              0);
                }
                switch (FlangerITM.SelUTx)
                {
                case "Default Preset":
                    _flangerfx.Preset_Default();
                    break;

                case "Preset: A":
                    _flangerfx.Preset_A();
                    break;

                case "Preset: B":
                    _flangerfx.Preset_B();
                    break;
                }
            }
            else
            {
                Bass.BASS_ChannelRemoveFX(engine.ActiveStreamHandle, _fxFlangerHandle);
            }
        }
Beispiel #7
0
        public void UpdateI3Dl2Reverb()
        {
            BassEngine engine = BassEngine.Instance;

            if (I3DL2ReverbITM.switchx)
            {
                if (I3DL2ReverbITM.fxState == false)
                {
                    Bass.BASS_FXSetParameters(_fxI3Dl2ReverbHandle, _i3Dl2Reverbfx);
                }
                if (I3DL2ReverbITM.fxState == false)
                {
                    _fxI3Dl2ReverbHandle = Bass.BASS_ChannelSetFX(engine.ActiveStreamHandle,
                                                                  BASSFXType.BASS_FX_DX8_I3DL2REVERB, 0);
                }
                switch (I3DL2ReverbITM.SelUTx)
                {
                case "Default Preset":
                    _i3Dl2Reverbfx.Preset_Default();
                    break;
                }
            }
            else
            {
                Bass.BASS_ChannelRemoveFX(engine.ActiveStreamHandle, _fxI3Dl2ReverbHandle);
            }
        }
Beispiel #8
0
        public void UpdateEcho()
        {
            BassEngine engine = BassEngine.Instance;

            if (EchoITM.switchx)
            {
                if (EchoITM.fxState == false)
                {
                    Bass.BASS_FXSetParameters(_fxEchoHandle, _echofx);
                }
                if (EchoITM.fxState == false)
                {
                    _fxEchoHandle = Bass.BASS_ChannelSetFX(engine.ActiveStreamHandle, BASSFXType.BASS_FX_DX8_ECHO, 0);
                }
                switch (EchoITM.SelUTx)
                {
                case "Default Preset":
                    _echofx.Preset_Default();
                    break;

                case "Preset: Short":
                    _echofx.Preset_Long();
                    break;

                case "Preset: Long":
                    _echofx.Preset_Small();
                    break;
                }
            }
            else
            {
                Bass.BASS_ChannelRemoveFX(engine.ActiveStreamHandle, _fxEchoHandle);
            }
        }
Beispiel #9
0
        /// <summary>
        /// Sets the equalizer value according to frequency.
        /// </summary>
        /// <param name="frequency"></param>
        /// <param name="value"></param>
        public void SetEqualizerFrequency(Int32 frequency, Double value)
        {
            EqualizerValue   equalizerValue = new EqualizerValue(frequency, value);
            BASS_DX8_PARAMEQ parameqDX8     = new BASS_DX8_PARAMEQ();

            if (values.ContainsKey(frequency))
            {
                Handle eqValueHandle = values[frequency]?.Handle;

                if (eqValueHandle != null)
                {
                    Bass.BASS_ChannelRemoveFX(handle, eqValueHandle);
                }
            }

            Int32 fxHandle = Bass.BASS_ChannelSetFX(handle, BASSFXType.BASS_FX_DX8_PARAMEQ, frequency);

            equalizerValue.Handle = new Handle(fxHandle);

            parameqDX8.fCenter    = frequency;
            parameqDX8.fGain      = (Single)value;
            parameqDX8.fBandwidth = 8f;

            Bass.BASS_FXSetParameters(equalizerValue.Handle, parameqDX8);

            values[frequency] = equalizerValue;
        }
Beispiel #10
0
        public void UpdatePhaser()
        {
            BassEngine engine = BassEngine.Instance;

            if (PhaserITM.switchx)
            {
                if (PhaserITM.fxState == false)
                {
                    Bass.BASS_FXSetParameters(_fxPhaserHandle, _phaserfx);
                }
                if (PhaserITM.fxState == false)
                {
                    _fxPhaserHandle = Bass.BASS_ChannelSetFX(engine.ActiveStreamHandle, BASSFXType.BASS_FX_BFX_PHASER, 0);
                }
                _phaserfx.Preset_PhaseShift();
                switch (PhaserITM.SelUTx)
                {
                case "Default Preset":
                    break;
                }
            }
            else
            {
                Bass.BASS_ChannelRemoveFX(engine.ActiveStreamHandle, _fxPhaserHandle);
            }
        }
Beispiel #11
0
        public void UpdateAutoWah()
        {
            BassEngine engine = BassEngine.Instance;

            if (AutoWahITM.switchx)
            {
                if (AutoWahITM.fxState == false)
                {
                    Bass.BASS_FXSetParameters(_fxAutoWahHandle, _autoWahfx);
                }
                if (AutoWahITM.fxState == false)
                {
                    _fxAutoWahHandle = Bass.BASS_ChannelSetFX(engine.ActiveStreamHandle, BASSFXType.BASS_FX_BFX_AUTOWAH,
                                                              0);
                }
                _autoWahfx.Preset_SlowAutoWah();
                switch (AutoWahITM.SelUTx)
                {
                case "Default Preset":
                    _autoWahfx.Preset_HiFastAutoWah();
                    break;
                }
            }
            else
            {
                Bass.BASS_ChannelRemoveFX(engine.ActiveStreamHandle, _fxAutoWahHandle);
            }
        }
Beispiel #12
0
 public override void RemoveFromSoundFile()
 {
     if (sf != null)
     {
         Bass.BASS_ChannelRemoveFX(sf.AudioStream.StreamHandle, ID);
         sf.AudioStreamChanged -= handler;
         sf = null;
     }
 }
Beispiel #13
0
        /// <summary>
        /// Usunięcie efektu Gargle z kanału.
        /// </summary>
        /// <param name="which">Numer efektu do usunięcia.</param>
        public override void Delete(int which)
        {
            for (int i = 0; i < keys.Length; ++i)
            {
                Bass.BASS_ChannelRemoveFX(keys[i].KeySound.Stream, handles[i + which * 12]);
            }

            gargle.RemoveAt(which);
            handles.RemoveRange(which * 12, 12);
        }
Beispiel #14
0
        public void UpdateCompressor()
        {
            BassEngine engine = BassEngine.Instance;

            if (CompressorITM.switchx)
            {
                if (CompressorITM.fxState == false)
                {
                    Bass.BASS_FXSetParameters(_fxCompressorHandle, _compressorfx);
                }
                if (CompressorITM.fxState == false)
                {
                    _fxCompressorHandle = Bass.BASS_ChannelSetFX(engine.ActiveStreamHandle,
                                                                 BASSFXType.BASS_FX_DX8_COMPRESSOR, 0);
                }


                switch (FlangerITM.SelUTx)
                {
                case "Default Preset":
                    _compressorfx.Preset_Default();
                    break;

                case "Preset: Soft":
                    _compressorfx.Preset_Soft();
                    break;

                case "Preset: Soft 2":
                    _compressorfx.Preset_Soft2();
                    break;

                case "Preset: Medium":
                    _compressorfx.Preset_Medium();
                    break;

                case "Preset: Hard":
                    _compressorfx.Preset_Hard();
                    break;

                case "Preset: Hard 2":
                    _compressorfx.Preset_Hard2();
                    break;

                case "Preset: Hard Commercial":
                    _compressorfx.Preset_HardCommercial();
                    break;
                }
            }
            else
            {
                Bass.BASS_ChannelRemoveFX(engine.ActiveStreamHandle, _fxCompressorHandle);
            }
        }
Beispiel #15
0
        public Implementation.Equalizer EnableEQ(bool enable = false)
        {
            m_isEnabled = enable;

            if (enable)
            {
                Init(m_handle);
            }
            else
            {
                if (m_handle != -1)
                {
                    Bass.BASS_ChannelRemoveFX(m_handle, m_bandValue.Handle);
                    // m_dsp_gain.Gain_dBV = 0.0;
                    m_dsp_gain.Dispose();
                }
            }

            return(m_equalizer);
        }
Beispiel #16
0
        private void checkBoxSwap_CheckedChanged(object sender, System.EventArgs e)
        {
            if (_StreamFX == 0)
            {
                return;
            }

            if (this.checkBoxSwap.Checked)
            {
                // and add a DSP here as well...
                _rotateFX = Bass.BASS_ChannelSetFX(_StreamFX, BASSFXType.BASS_FX_BFX_ROTATE, -5);
                // the rotate effect has no parameters, so nothing to set
            }
            else
            {
                // remove the DSP
                Bass.BASS_ChannelRemoveFX(_StreamFX, _rotateFX);
                _rotateFX = 0;
            }
        }
Beispiel #17
0
 /// <summary>
 /// Enables EQ based on data in _fx array
 /// </summary>
 /// <param name="enabled"></param>
 /// <returns></returns>
 public bool EqEnable(bool enabled)
 {
     _eqEnabled = enabled;
     if (_eqEnabled)
     {
         for (int i = 0; i < _fx.Length; i++)
         {
             _fx[i] = Bass.BASS_ChannelSetFX(this.Stream, BASSFXType.BASS_FX_DX8_PARAMEQ, 0);
         }
         return(true);
     }
     else
     {
         for (int i = 0; i < _fx.Length; i++)
         {
             Bass.BASS_ChannelRemoveFX(this.Stream, _fx[i]);
         }
         return(false);
     }
 }
Beispiel #18
0
        private void checkBoxEcho_CheckedChanged(object sender, System.EventArgs e)
        {
            if (_StreamFX == 0)
            {
                return;
            }

            if (this.checkBoxEcho.Checked)
            {
                // and add a DSP here as well...
                _echoFX = Bass.BASS_ChannelSetFX(_StreamFX, BASSFXType.BASS_FX_BFX_ECHO3, -3);
                BASS_BFX_ECHO3 echo = new BASS_BFX_ECHO3();
                echo.Preset_LongEcho();
                Bass.BASS_FXSetParameters(_echoFX, echo);
            }
            else
            {
                // remove the DSP
                Bass.BASS_ChannelRemoveFX(_StreamFX, _echoFX);
                _echoFX = 0;
            }
        }
Beispiel #19
0
        public void KillallFxStates()
        {
            BassEngine engine = BassEngine.Instance;

            chorusITM.fxState = false;
            Bass.BASS_ChannelRemoveFX(engine.ActiveStreamHandle, _fxChorusHandle);

            ReverbITM.fxState = false;
            Bass.BASS_ChannelRemoveFX(engine.ActiveStreamHandle, _fxReverbHandle);

            EchoITM.fxState = false;
            Bass.BASS_ChannelRemoveFX(engine.ActiveStreamHandle, _fxEchoHandle);

            I3DL2ReverbITM.fxState = false;
            Bass.BASS_ChannelRemoveFX(engine.ActiveStreamHandle, _fxI3Dl2ReverbHandle);

            GargleITM.fxState = false;
            Bass.BASS_ChannelRemoveFX(engine.ActiveStreamHandle, _fxGargleHandle);

            FlangerITM.fxState = false;
            Bass.BASS_ChannelRemoveFX(engine.ActiveStreamHandle, _fxFlangerHandle);

            CompressorITM.fxState = false;
            Bass.BASS_ChannelRemoveFX(engine.ActiveStreamHandle, _fxCompressorHandle);

            DistortionITM.fxState = false;
            Bass.BASS_ChannelRemoveFX(engine.ActiveStreamHandle, _fxDistortionHandle);

            AutoWahITM.fxState = false;
            Bass.BASS_ChannelRemoveFX(engine.ActiveStreamHandle, _fxAutoWahHandle);

            APFITM.fxState = false;
            Bass.BASS_ChannelRemoveFX(engine.ActiveStreamHandle, _fxApfHandle);

            PhaserITM.fxState = false;
            Bass.BASS_ChannelRemoveFX(engine.ActiveStreamHandle, _fxPhaserHandle);
        }