public DynamicAmplificationService()
 {
     _effect = new BASS_BFX_DAMP();
     Band Target = new Band(0, +1.0f, 0.0f, 0.02f, "Target");
     Band Quiet = new Band(0, +1.0f, 0.0f, 0.02f, "Quiet");
     Band Rate = new Band(0, +1.0f, 0.0f, 0.02f, "Rate");
     Band Gain = new Band(0, +2.0f, 0.0f, 0.04f, "Gain");
     Band Delay = new Band(0, +10.0f, 0.0f, 0.2f, "Delay");
     Bands = new List<Band>() { Target, Quiet, Rate, Gain, Delay };
     Settings = new SettingsService<Band>("DynamicAmplificationEffect");
     CurrentSettings = Settings.GetCurrentSettings();
     CurrentSettings.SetPreset(Bands, "CurrentPreset");
     IsActive = CurrentSettings.IsActive;
     BandChanged += ((object sender, ChangedEventArgs e) => { SetEffectToBand(e.Value, e.BandIndex); });
     PresetNames = new List<string>(CurrentSettings.Presets.Keys);
     EffectName = "DynamicAmplification";
     PresetName = "CurrentPreset";
 }
Example #2
0
    private void SetDAmpPreset(int preset)
    {
      if (_damp == null)
      {
        _damp = new BASS_BFX_DAMP();
      }

      switch (preset)
      {
        case 0:
          _damp.Preset_Soft();
          break;
        case 1:
          _damp.Preset_Medium();
          break;
        case 2:
          _damp.Preset_Hard();
          break;
      }
    }
Example #3
0
    /// <summary>
    /// Sets the parameter for a given Bass effect
    /// </summary>
    /// <param name="id"></param>
    /// <param name="name"></param>
    /// <param name="value"></param>
    /// <param name="format"></param>
    private void setBassDSP(string id, string name, string value)
    {
      switch (id)
      {
        case "Gain":
          if (name == "Gain_dbV")
          {
            double gainDB = double.Parse(value);
            if (_gain == null)
            {
              _gain = new DSP_Gain();
            }

            if (gainDB == 0.0)
            {
              _gain.SetBypass(true);
            }
            else
            {
              _gain.SetBypass(false);
              _gain.Gain_dBV = gainDB;
            }
          }
          break;

        case "DynAmp":
          if (name == "Preset")
          {
            if (_damp == null)
            {
              _damp = new BASS_BFX_DAMP();
            }

            switch (Convert.ToInt32(value))
            {
              case 0:
                _damp.Preset_Soft();
                break;
              case 1:
                _damp.Preset_Medium();
                break;
              case 2:
                _damp.Preset_Hard();
                break;
            }
          }
          break;

        case "Compressor":
          if (name == "Threshold")
          {
            if (_comp == null)
            {
              _comp = new BASS_BFX_COMPRESSOR();
            }

            _comp.Preset_Medium();
            _comp.fThreshold = (float)Un4seen.Bass.Utils.DBToLevel(Convert.ToInt32(value) / 10d, 1.0);
          }
          break;
      }
    }