private void LoadData() { int i = 0; bool isSet = false; foreach (var device in Devices) { if ((_lastSavedDeviceName == null && i == 0) || (_lastSavedDeviceName != null && _lastSavedDeviceName == device.Name)) { _lastSavedDeviceName = device.Name; SetDeviceId(device); isSet = true; } ++i; } if (!isSet) { i = 0; foreach (var device in Devices) { if (i == 0) { _lastSavedDeviceName = device.Name; SetDeviceId(device); isSet = true; } else { break; } ++i; } } SetHzOffset(HzOffset); SetRequiredFrames(RequiredFrames); SetPeaksPriority(PeaksPriority.GetHashCode()); SetHeldReset(HeldReset); SetSingleTapReset(SingleTapReset); SetLevelDynamicRange(_levelDynamicRange); SetLevelGain(_levelGain); SetSpectrumDynamicRange(_spectrumDynamicRange); SetSpectrumGain(_spectrumGain); SetSpectrumThreshold(SpectrumThreshold * 100); }
public static void SetPeaksPriority(PeaksPriority peaksPriority) { PlayerPrefs.SetInt(Constants.PpPeaksPriority, peaksPriority.GetHashCode()); }