private void Init(FMOD.System system, bool setToDefaultValues = false) { system.lockDSP().ERRCHECK(); this.Bands.Clear(); var gainValues = !setToDefaultValues && this.playerSettings.PlayerEngine.EqualizerSettings != null ? this.playerSettings.PlayerEngine.EqualizerSettings.GainValues : null; foreach (var value in EqDefaultValues) { var band = EqualizerBand.GetEqualizerBand(system, this.IsEnabled, value[0], value[1], value[2]); if (band != null) { float savedValue; if (gainValues != null && gainValues.TryGetValue(band.BandCaption, out savedValue)) { band.Gain = savedValue; } this.Bands.Add(band); } } system.unlockDSP().ERRCHECK(); system.update().ERRCHECK(); }
private void DeInit(FMOD.System system) { system.lockDSP().ERRCHECK(); foreach (var band in this.Bands) { band.Release(); } system.unlockDSP().ERRCHECK(); system.update().ERRCHECK(); }