createMode static method

Equalizer createMode(
  1. EqualizerMode mode
)

Creates an Equalizer instance with any preset from EqualizerMode.

Implementation

static Equalizer createMode(EqualizerMode mode) {
  Equalizer equalizer = new _Equalizer();
  final _equalizer = EqualizerFFI.createMode(equalizer, mode.index);
  equalizer.id = _equalizer.ref.id;
  equalizer.preAmp = equalizer.preAmp;
  equalizer.mode = mode;
  equalizer.bandAmps = {};
  for (int i = 0; i < _equalizer.ref.size; i++) {
    equalizer.bandAmps[_equalizer.ref.bands[i]] = _equalizer.ref.amps[i];
  }
  return equalizer;
}